diff options
author | Robin Rosenberg <robin.rosenberg@dewire.com> | 2010-12-31 11:44:54 +0100 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2010-12-31 14:00:05 -0800 |
commit | d9e07a574a946693e491668e0d94619bc5d886a5 (patch) | |
tree | 5bce4e9d47090d6b427986de4db30be17cc99c6d /org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/LeafBucketTest.java | |
parent | 7cf8b8812f7baa1636c138113f4ed015eed8cc31 (diff) | |
download | jgit-d9e07a574a946693e491668e0d94619bc5d886a5.tar.gz jgit-d9e07a574a946693e491668e0d94619bc5d886a5.zip |
Convert all JGit unit tests to JUnit 4
Eclipse has some problem re-running single JUnit tests if
the tests are in Junit 3 format, but the JUnit 4 launcher
is used. This was quite unnecessary and the move was not
completed. We still have no JUnit4 test.
This completes the extermination of JUnit3. Most of the
work was global searce/replace using regular expression,
followed by numerous invocarions of quick-fix and organize
imports and verification that we had the same number of
tests before and after.
- Annotations were introduced.
- All references to JUnit3 classes removed
- Half-good replacement for getting the test name. This was
needed to make the TestRngs work. The initialization of
TestRngs was also made lazily since we can not longer find
out the test name in runtime in the @Before methods.
- Renamed test classes to end with Test, with the exception
of TestTranslateBundle, which fails from Maven
- Moved JGitTestUtil to the junit support bundle
Change-Id: Iddcd3da6ca927a7be773a9c63ebf8bb2147e2d13
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/LeafBucketTest.java')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/LeafBucketTest.java | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/LeafBucketTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/LeafBucketTest.java index 68b0e2b5ea..7c40695531 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/LeafBucketTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/LeafBucketTest.java @@ -43,14 +43,18 @@ package org.eclipse.jgit.notes; -import java.io.IOException; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; -import junit.framework.TestCase; +import java.io.IOException; import org.eclipse.jgit.lib.AnyObjectId; import org.eclipse.jgit.lib.MutableObjectId; +import org.junit.Test; -public class LeafBucketTest extends TestCase { +public class LeafBucketTest { + @Test public void testEmpty() { LeafBucket b = new LeafBucket(0); assertNull(b.get(id(0x00), null)); @@ -58,6 +62,7 @@ public class LeafBucketTest extends TestCase { assertNull(b.get(id(0xfe), null)); } + @Test public void testParseFive() { LeafBucket b = new LeafBucket(0); @@ -76,6 +81,7 @@ public class LeafBucketTest extends TestCase { assertNull(b.get(id(0x66), null)); } + @Test public void testSetFive_InOrder() throws IOException { LeafBucket b = new LeafBucket(0); @@ -94,6 +100,7 @@ public class LeafBucketTest extends TestCase { assertNull(b.get(id(0x66), null)); } + @Test public void testSetFive_ReverseOrder() throws IOException { LeafBucket b = new LeafBucket(0); @@ -112,6 +119,7 @@ public class LeafBucketTest extends TestCase { assertNull(b.get(id(0x66), null)); } + @Test public void testSetFive_MixedOrder() throws IOException { LeafBucket b = new LeafBucket(0); @@ -131,6 +139,7 @@ public class LeafBucketTest extends TestCase { assertNull(b.get(id(0x66), null)); } + @Test public void testSet_Replace() throws IOException { LeafBucket b = new LeafBucket(0); @@ -141,6 +150,7 @@ public class LeafBucketTest extends TestCase { assertEquals(id(0x01), b.get(id(0x11), null)); } + @Test public void testRemoveMissingNote() throws IOException { LeafBucket b = new LeafBucket(0); assertNull(b.get(id(0x11), null)); @@ -148,6 +158,7 @@ public class LeafBucketTest extends TestCase { assertNull(b.get(id(0x11), null)); } + @Test public void testRemoveFirst() throws IOException { LeafBucket b = new LeafBucket(0); @@ -168,6 +179,7 @@ public class LeafBucketTest extends TestCase { assertNull(b.get(id(0x66), null)); } + @Test public void testRemoveMiddle() throws IOException { LeafBucket b = new LeafBucket(0); @@ -188,6 +200,7 @@ public class LeafBucketTest extends TestCase { assertNull(b.get(id(0x66), null)); } + @Test public void testRemoveLast() throws IOException { LeafBucket b = new LeafBucket(0); @@ -208,6 +221,7 @@ public class LeafBucketTest extends TestCase { assertNull(b.get(id(0x66), null)); } + @Test public void testRemoveMakesEmpty() throws IOException { LeafBucket b = new LeafBucket(0); |