*/
-import junit.framework.*;
-import junit.textui.*;
-
-public class All extends TestCase {
- /**
- * Runs all CACAO regression unit tests using
- * junit.textui.TestRunner
- */
- public static void main(String[] args) {
- Test s = suite();
- TestRunner.run(s);
- }
-
- /**
- * Collects all CACAO regression unit tests as one suite.
- */
- public static Test suite() {
- TestSuite suite = new TestSuite("CACAO Regression Unit Tests");
-
- // Add your test here.
-
- suite.addTest(new TestSuite(TestPatcher.class));
- suite.addTest(new TestSuite(TestExceptionInStaticClassInitializer.class));
-
- return suite;
- }
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+
+@Suite.SuiteClasses({
+TestExceptionInStaticClassInitializer.class,
+TestPatcher.class
+})
+
+public class All {
}
*/
-import junit.framework.*;
-import junit.textui.*;
-
-public class TestExceptionInStaticClassInitializer extends TestCase {
- public static void main(String[] args) {
- TestRunner.run(suite());
- }
-
- public static Test suite() {
- return new TestSuite(TestExceptionInStaticClassInitializer.class);
- }
+import org.junit.Test;
+import static org.junit.Assert.*;
+public class TestExceptionInStaticClassInitializer {
+ @Test
public void test() {
try {
TestExceptionInStaticClassInitializer_x.i = 1;
}
// This linenumber must be the one from...
- final static int LINE = 64;
+ final static int LINE = 57;
}
class TestExceptionInStaticClassInitializer_x {
*/
-import junit.framework.*;
-import junit.textui.*;
+import org.junit.Test;
+import static org.junit.Assert.*;
import java.io.*;
-public class TestPatcher extends TestCase {
- public static void main(String[] args) {
- TestRunner.run(suite());
- }
-
- public static Test suite() {
- return new TestSuite(TestPatcher.class);
- }
-
+public class TestPatcher {
static boolean doit = true;
final static int i = 123;
final static double d = 789.012;
final static Object o = new Object();
+ @Test
public void testNormal() {
invokestatic();
invokespecial();
*/
-import junit.framework.*;
-import junit.textui.*;
-
-public class All extends TestCase {
- /**
- * Runs all CACAO regression unit tests using
- * junit.textui.TestRunner
- */
- public static void main(String[] args) {
- Test s = suite();
- TestRunner.run(s);
- }
-
- /**
- * Collects all CACAO regression unit tests as one suite
- */
- public static Test suite() {
- TestSuite suite = new TestSuite("CACAO Regression Unit Tests");
-
- // Add your test here.
-
- suite.addTest(new TestSuite(PR52.class));
- suite.addTest(new TestSuite(PR57.class));
- suite.addTest(new TestSuite(PR58.class));
- suite.addTest(new TestSuite(PR65.class));
- suite.addTest(new TestSuite(PR80.class));
-
- return suite;
- }
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+
+@Suite.SuiteClasses({
+PR52.class,
+PR57.class,
+PR58.class,
+PR65.class,
+PR70.class,
+PR80.class,
+})
+
+public class All {
}
*/
-import junit.framework.*;
-import junit.textui.*;
+import org.junit.Test;
import java.security.*;
-public class PR52 extends TestCase {
- public static void main(String[] args) {
- TestRunner.run(suite());
- }
-
- public static Test suite() {
- return new TestSuite(PR52.class);
- }
-
+public class PR52 {
+ @Test
public void test() {
// This one only triggers with GNU Classpath.
AccessController.getContext();
*/
-import junit.framework.*;
-import junit.textui.*;
+import org.junit.Test;
-public class PR57 extends TestCase {
- public static void main(String[] args) {
- TestRunner.run(suite());
- }
-
- public static Test suite() {
- return new TestSuite(PR57.class);
- }
-
- public void test() {
- try {
- Class.forName("x");
- fail("Should throw ClassNotFoundException");
- }
- catch (ClassNotFoundException success) {
- }
+public class PR57 {
+ @Test ( expected = ClassNotFoundException.class )
+ public void test() throws ClassNotFoundException {
+ Class.forName("x");
}
}
*/
-import junit.framework.*;
-import junit.textui.*;
+import org.junit.Test;
+import static org.junit.Assert.*;
import java.io.*;
-public class PR58 extends TestCase {
- public static void main(String[] args) {
- TestRunner.run(suite());
- }
-
- public static Test suite() {
- return new TestSuite(PR58.class);
- }
-
+public class PR58 {
class x extends y {}
class y {}
+ @Test
public void testSuperClass() {
// Delete the class file which is extended.
new File("PR58$y.class").delete();
interface i {}
class j implements i {}
+ @Test
public void testSuperInterface() {
// Delete the interface file which is implemented.
new File("PR58$i.class").delete();
*/
-import junit.framework.*;
-import junit.textui.*;
-
-public class PR65 extends TestCase {
- public static void main(String[] args) {
- TestRunner.run(suite());
- }
-
- public static Test suite() {
- return new TestSuite(PR65.class);
- }
-
- public void test() {
- try {
- Object o = new int[2][1];
- Number[][] na = (Number[][]) o;
- na[0][0] = null;
- fail("Should throw ClassCastException");
- } catch (ClassCastException success) {
- }
+import org.junit.Test;
+
+public class PR65 {
+ @Test ( expected = ClassCastException.class )
+ public void test() throws ClassCastException {
+ Object o = new int[2][1];
+ Number[][] na = (Number[][]) o;
+ na[0][0] = null;
}
}
*/
-import junit.framework.*;
-import junit.textui.*;
-
-public class PR80 extends TestCase {
- public static void main(String[] args) {
- TestRunner.run(suite());
- }
-
- public static Test suite() {
- return new TestSuite(PR80.class);
- }
-
- public void test() {
- try {
- // Taken from Mauve gnu.testlet.java.lang.System.arraycopy
- int[] a = new int[5];
- int[] b = new int[5];
- System.arraycopy(a, 4, b, 4, Integer.MAX_VALUE);
- fail("Should throw ArrayIndexOutOfBoundsException");
- } catch (ArrayIndexOutOfBoundsException success) {
- }
+import org.junit.Test;
+
+public class PR80 {
+ @Test ( expected = ArrayIndexOutOfBoundsException.class )
+ public void test() throws ArrayIndexOutOfBoundsException {
+ // Taken from Mauve gnu.testlet.java.lang.System.arraycopy
+ int[] a = new int[5];
+ int[] b = new int[5];
+ System.arraycopy(a, 4, b, 4, Integer.MAX_VALUE);
}
}