Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 365444

Summary: Allow to write tests with CLI syntax
Product: [Technology] JGit Reporter: Tomasz Zarna <tomasz.zarna>
Component: JGitAssignee: Tomasz Zarna <tomasz.zarna>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: caniszczyk, matthias.sohn
Version: 1.2Keywords: noteworthy, test
Target Milestone: 2.0-M2   
Hardware: PC   
OS: Windows XP   
URL: https://git.eclipse.org/r/#/c/5408/
Whiteboard:
Bug Depends on:    
Bug Blocks: 365535    
Attachments:
Description Flags
mylyn/context/zip none

Description Tomasz Zarna CLA 2011-12-02 10:00:00 EST
It would be cool if anyone knowing CGit had a way to put up a test case without knowing JGit API.

JGit already provides a CLI in org.eclipse.jgit.pgm, once it is completely backed with JGit API (bug 365439), being able to write tests like this, shouldn't be hard:

@Test
public void testList() throws Exception {
	String result = execute("git branch -v");
	assertEquals("* master 9c58deb Initial commit", result);
}

This would not only make writing tests easier but also increase test coverage on JGit API.
Comment 1 Tomasz Zarna CLA 2011-12-02 10:03:06 EST
A initial patch has been pushed as http://egit.eclipse.org/r/4720. Comments are welcome.
Comment 2 Tomasz Zarna CLA 2011-12-02 10:03:52 EST
Created attachment 207846 [details]
mylyn/context/zip
Comment 3 Tomasz Zarna CLA 2012-01-09 06:21:59 EST
Matthias, any chance someone will look at the fix in the nearest future? If there is anything you guys don't like about the patch please let me know and I'll amend it.

IMO this bug combined with bug 365439 could be a real booster for making the JGit API more robust.
Comment 4 Tomasz Zarna CLA 2012-03-22 09:04:28 EDT
Fixed with bf845c126d53f07de103e03b68ddb7f24014cee5
Comment 5 Chris Aniszczyk CLA 2012-03-22 19:35:30 EDT
For the purposes of documentation, I supervised and approved this change as a member of the Technology PMC.
Comment 6 Matthias Sohn CLA 2012-03-23 04:23:39 EDT
This change needs an approved CQ, hence I reverted this change as it was submitted by mistake and filed CQ 6358 and re-issued this contribution under https://git.eclipse.org/r/#/c/5408/
Comment 7 Tomasz Zarna CLA 2012-04-18 06:23:06 EDT
The CQ has been approved. Can we proceed with the contribution? The IP is clean now.
Comment 8 Tomasz Zarna CLA 2012-04-19 04:53:58 EDT
Merged as 9c5b31703f278c510bec64fa7a822713feaca6f2