diff options
author | nickl- <github@jigsoft.co.za> | 2017-10-26 00:33:39 +0200 |
---|---|---|
committer | nickl- <github@jigsoft.co.za> | 2017-10-27 17:40:48 +0200 |
commit | ce84f84a174b279ee3e8a38446ea3a1f23bf8287 (patch) | |
tree | 84c9d3258afa98cafe34c57dccc9a7c946d0e92a | |
parent | 7ef0947b75ed935d45923cb00a93a52717c7c6ed (diff) | |
download | javassist-ce84f84a174b279ee3e8a38446ea3a1f23bf8287.tar.gz javassist-ce84f84a174b279ee3e8a38446ea3a1f23bf8287.zip |
Upgrade junit from ver 3 to 4.
There were minimal changes:
Some tests had their own runners these were discontinued as IDEs/maven run the tests anyway.
Removed the main methods for these.
2 tests were dependent on the running order so added the test sorter.
All tests succeed on junit 4 with legacy support.
-rw-r--r-- | pom.xml | 14 | ||||
-rw-r--r-- | src/test/javassist/Bench.java | 5 | ||||
-rw-r--r-- | src/test/javassist/JvstTest2.java | 5 | ||||
-rw-r--r-- | src/test/javassist/JvstTest4.java | 4 | ||||
-rw-r--r-- | src/test/javassist/bytecode/BytecodeTest.java | 6 | ||||
-rw-r--r-- | src/test/javassist/compiler/CompTest.java | 6 |
6 files changed, 19 insertions, 21 deletions
@@ -304,10 +304,16 @@ </profiles> <dependencies> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>3.8.1</version> - <scope>test</scope> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.12</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.hamcrest</groupId> + <artifactId>hamcrest-all</artifactId> + <version>1.3</version> + <scope>test</scope> </dependency> </dependencies> </project> diff --git a/src/test/javassist/Bench.java b/src/test/javassist/Bench.java index 723fa198..b7b8b27e 100644 --- a/src/test/javassist/Bench.java +++ b/src/test/javassist/Bench.java @@ -153,11 +153,6 @@ public class Bench extends JvstTestRoot { System.out.println("println: " + (t5 * 10) + " usec"); } - public static void main(String[] args) { - // junit.textui.TestRunner.run(suite()); - junit.swingui.TestRunner.main(new String[] { "javassist.Bench" }); - } - public static Test suite() { TestSuite suite = new TestSuite("Benchmark Tests"); suite.addTestSuite(Bench.class); diff --git a/src/test/javassist/JvstTest2.java b/src/test/javassist/JvstTest2.java index ec314e12..12bce5e4 100644 --- a/src/test/javassist/JvstTest2.java +++ b/src/test/javassist/JvstTest2.java @@ -2,10 +2,15 @@ package javassist; import java.io.*; import java.net.URL; + +import org.junit.FixMethodOrder; +import org.junit.runners.MethodSorters; + import java.lang.reflect.Method; import javassist.expr.*; +@FixMethodOrder(MethodSorters.NAME_ASCENDING) public class JvstTest2 extends JvstTestRoot { public JvstTest2(String name) { super(name); diff --git a/src/test/javassist/JvstTest4.java b/src/test/javassist/JvstTest4.java index a9607e8b..6e4de447 100644 --- a/src/test/javassist/JvstTest4.java +++ b/src/test/javassist/JvstTest4.java @@ -6,10 +6,14 @@ import java.io.FileInputStream; import java.io.FileOutputStream; import java.util.HashSet; +import org.junit.FixMethodOrder; +import org.junit.runners.MethodSorters; + import javassist.bytecode.*; import javassist.bytecode.annotation.Annotation; import javassist.expr.*; +@FixMethodOrder(MethodSorters.NAME_ASCENDING) public class JvstTest4 extends JvstTestRoot { public JvstTest4(String name) { super(name); diff --git a/src/test/javassist/bytecode/BytecodeTest.java b/src/test/javassist/bytecode/BytecodeTest.java index a859f248..a9b6e538 100644 --- a/src/test/javassist/bytecode/BytecodeTest.java +++ b/src/test/javassist/bytecode/BytecodeTest.java @@ -826,12 +826,6 @@ public class BytecodeTest extends TestCase { assertEquals("(I)V", cPool2.getUtf8Info(cPool2.getMethodTypeInfo(mtIndex))); } - public static void main(String[] args) { - // junit.textui.TestRunner.run(suite()); - junit.awtui.TestRunner.main(new String[] { - "javassist.bytecode.BytecodeTest" }); - } - public static Test suite() { TestSuite suite = new TestSuite("Bytecode Tests"); suite.addTestSuite(BytecodeTest.class); diff --git a/src/test/javassist/compiler/CompTest.java b/src/test/javassist/compiler/CompTest.java index 6a1d5424..158552e3 100644 --- a/src/test/javassist/compiler/CompTest.java +++ b/src/test/javassist/compiler/CompTest.java @@ -113,12 +113,6 @@ public class CompTest extends TestCase { assertEquals("(int,char[],String)", s); } - public static void main(String[] args) { - // junit.textui.TestRunner.run(suite()); - junit.awtui.TestRunner.main(new String[] { - "javassist.compiler.CompTest" }); - } - public static Test suite() { TestSuite suite = new TestSuite("Compiler Tests"); suite.addTestSuite(CompTest.class); |