package testcode; import org.junit.Test; /** * Test that having a @Test annotation results in the translated class to extend * unittest.TestCase. We can not test this in java, therefore this class is not * runnable. */ public class SomeUnitTest { @Test public void test1() { System.out.println("java always succeeds this print"); } /** * This test does not have the name testXXX.java and therefore the * translator must introduce a new method that does start with "test" */ @Test public void someothertest() { System.out.println("also fine with java"); } /** * Translating this must result in testRaises() */ @Test(expected = NullPointerException.class) public void nullTest() { Integer x = null; x.toString();// throws NPE } }