git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[EGIT PATCH 04/10] Split a big test in ReadTreeTest into smaller tests

From
Robin Rosenberg <robin.rosenberg@dewire.com>
Date
Feb 23, 2008, 23:50 UTC
Message-ID
<1203810643-28819-5-git-send-email-robin.rosenberg@dewire.com>
In-Reply-To
<1203810643-28819-4-git-send-email-robin.rosenberg@dewire.com>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
 .../tst/org/spearce/jgit/lib/ReadTreeTest.java     |   84 +++++++++++++------
 1 files changed, 57 insertions(+), 27 deletions(-)
diff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/ReadTreeTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/ReadTreeTest.java
index 6faedc7..70c1396 100644
--- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/ReadTreeTest.java
+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/ReadTreeTest.java
@@ -273,50 +273,55 @@ public class ReadTreeTest extends RepositoryTestCase {
 	 *19   D	    0       F											  Update
 	 */
 	
-	public void testDirectoryFileConflicts() throws Exception {
+	public void testDirectoryFileConflicts_1() throws Exception {
 		// 1
 		doit(mk("DF/DF"), mk("DF"), mk("DF/DF"));
 		assertNoConflicts();
 		assertUpdated("DF");
 		assertRemoved("DF/DF");
-		
+	}
+
+	public void testDirectoryFileConflicts_2() throws Exception {
 		// 2
 		setupCase(mk("DF/DF"), mk("DF"), mk("DF/DF"));
 		writeTrashFile("DF/DF", "different");
 		go();
 		assertConflict("DF/DF");
 		
+	}
+
+	public void testDirectoryFileConflicts_3() throws Exception {
 		// 3 - the first to break!
-		tearDown();
-		setUp();
 		doit(mk("DF/DF"), mk("DF/DF"), mk("DF"));
 		assertUpdated("DF/DF");
 		assertRemoved("DF");
-		
+	}
+
+	public void testDirectoryFileConflicts_4() throws Exception {
 		// 4 (basically same as 3, just with H and M different)
-		tearDown();
-		setUp();
 		doit(mk("DF/DF"), mkmap("DF/DF", "foo"), mk("DF"));
 		assertUpdated("DF/DF");
 		assertRemoved("DF");
 		
+	}
+
+	public void testDirectoryFileConflicts_5() throws Exception {
 		// 5
-		tearDown();
-		setUp();
 		doit(mk("DF/DF"), mk("DF"), mk("DF"));
 		assertRemoved("DF/DF");
 		
+	}
+
+	public void testDirectoryFileConflicts_6() throws Exception {
 		// 6
-		tearDown();
-		setUp();
 		setupCase(mk("DF/DF"), mk("DF"), mk("DF"));
 		writeTrashFile("DF", "different");
 		go();
 		assertRemoved("DF/DF");
-		
+	}
+
+	public void testDirectoryFileConflicts_7() throws Exception {
 		// 7
-		tearDown();
-		setUp();
 		doit(mk("DF"), mk("DF"), mk("DF/DF"));
 		assertUpdated("DF");
 		assertRemoved("DF/DF");
@@ -334,29 +339,40 @@ public class ReadTreeTest extends RepositoryTestCase {
 		assertConflict("DF/DF/DF/DF/DF");
 		assertUpdated("DF/DF");
 
+	}
+
+	// 8 ?
+
+	public void testDirectoryFileConflicts_9() throws Exception {
 		// 9
-		tearDown();
-		setUp();
 		doit(mk("DF"), mkmap("DF", "QP"), mk("DF/DF"));
 		assertRemoved("DF/DF");
 		assertUpdated("DF");
-		
+	}
+
+	public void testDirectoryFileConflicts_10() throws Exception {
 		// 10
 		cleanUpDF();
 		doit(mk("DF"), mk("DF/DF"), mk("DF/DF"));
 		assertNoConflicts();
 		
+	}
+
+	public void testDirectoryFileConflicts_11() throws Exception {
 		// 11
-		cleanUpDF();
 		doit(mk("DF"), mk("DF/DF"), mkmap("DF/DF", "asdf"));
 		assertConflict("DF/DF");
-		
+	}
+
+	public void testDirectoryFileConflicts_12() throws Exception {
 		// 12
 		cleanUpDF();
 		doit(mk("DF"), mk("DF/DF"), mk("DF"));
 		assertRemoved("DF");
 		assertUpdated("DF/DF");
-		
+	}
+
+	public void testDirectoryFileConflicts_13() throws Exception {
 		// 13
 		cleanUpDF();
 		setupCase(mk("DF"), mk("DF/DF"), mk("DF"));
@@ -364,29 +380,39 @@ public class ReadTreeTest extends RepositoryTestCase {
 		go();
 		assertConflict("DF");
 		assertUpdated("DF/DF");
-		
+	}
+
+	public void testDirectoryFileConflicts_14() throws Exception {
 		// 14
 		cleanUpDF();
 		doit(mk("DF"), mk("DF/DF"), mkmap("DF", "Foo"));
 		assertConflict("DF");
 		assertUpdated("DF/DF");
-		
+	}
+
+	public void testDirectoryFileConflicts_15() throws Exception {
 		// 15
 		doit(mkmap(), mk("DF/DF"), mk("DF"));
 		assertRemoved("DF");
 		assertUpdated("DF/DF");
-		
+	}
+
+	public void testDirectoryFileConflicts_15b() throws Exception {
 		// 15, take 2, just to check multi-leveled
 		doit(mkmap(), mk("DF/DF/DF/DF"), mk("DF"));
 		assertRemoved("DF");
 		assertUpdated("DF/DF/DF/DF");
-		
+	}
+
+	public void testDirectoryFileConflicts_16() throws Exception {
 		// 16
 		cleanUpDF();
 		doit(mkmap(), mk("DF"), mk("DF/DF/DF"));
 		assertRemoved("DF/DF/DF");
 		assertUpdated("DF");
-		
+	}
+
+	public void testDirectoryFileConflicts_17() throws Exception {
 		// 17
 		cleanUpDF();
 		setupCase(mkmap(), mk("DF"), mk("DF/DF/DF"));
@@ -394,13 +420,17 @@ public class ReadTreeTest extends RepositoryTestCase {
 		go();
 		assertConflict("DF/DF/DF");
 		assertUpdated("DF");
-		
+	}
+
+	public void testDirectoryFileConflicts_18() throws Exception {
 		// 18
 		cleanUpDF();
 		doit(mk("DF/DF"), mk("DF/DF/DF/DF"), null);
 		assertRemoved("DF/DF");
 		assertUpdated("DF/DF/DF/DF");
-		
+	}
+
+	public void testDirectoryFileConflicts_19() throws Exception {
 		// 19
 		cleanUpDF();
 		doit(mk("DF/DF/DF/DF"), mk("DF/DF/DF"), null);
-- 
1.5.4.2
Previous: Robin RosenbergNext: Robin Rosenberg
Message 5 of 12 in “[EGIT] Sort order from hell fixes, take 2”
  1. Robin RosenbergFeb 23, 2008
  2. 01/10 Tighten IndexDiffTest to make it test better what it claims to testRobin Rosenberg, Feb 23, 2008
  3. 02/10 Extend IndexDiffTest with more testsRobin Rosenberg, Feb 23, 2008
  4. 03/10 WorkdirCheckout: more test for names that are closeRobin Rosenberg, Feb 23, 2008
  5. 04/10 Split a big test in ReadTreeTest into smaller testsRobin Rosenberg, Feb 23, 2008
  6. 05/10 Fix git sort order compare bugRobin Rosenberg, Feb 23, 2008
  7. 06/10 Use the proper comparison algorithmRobin Rosenberg, Feb 23, 2008
  8. 07/10 GitIndex: Get access to raw name and file modeRobin Rosenberg, Feb 23, 2008
  9. 08/10 TreeEntry: Accessors for full raw name and mode bitsRobin Rosenberg, Feb 23, 2008
  10. 09/10 Implement a Tree iteratorRobin Rosenberg, Feb 23, 2008
  11. 10/10 Rewritten IndexTreeWalkerRobin Rosenberg, Feb 23, 2008
  12. David WatsonMar 3, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.