public class JUnitFourVersionTest {
@BeforeClass
public static void setUpBeforeClass() throws Exception {
System.out.println("setUpBeforeClass()");
}
@AfterClass
public static void tearDownAfterClass() throws Exception {
System.out.println("tearDownAfterClass()");
}
@Before
public void setUp() throws Exception {
System.out.println("setUp()");
}
@After
public void tearDown() throws Exception {
System.out.println("tearDown()");
}
@Test
public void helloOne() {
System.out.println("helloOne()");
Assert.assertEquals(2, 2);
}
@Test
public void helloTwo() {
System.out.println("helloTwo()");
}
public void helloThree() {
System.out.println("helloThree()");
}
@Test
@Ignore
public void helloFour() {
System.out.println("helloFour()");
}
@Test(timeout = 1000)
public void squareRoot() {
for (;;)
;
}
@Test(expected = IllegalArgumentException.class)
public void divideByZero() {
Calculation calculation = new Calculation();
calculation.div(5, 0);
}
}