File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package sample .java .project ;
22
3- import junit .framework .TestCase ;
3+ import static org .junit .Assert .assertEquals ;
4+ import org .junit .Before ;
5+ import org .junit .Test ;
46
57/**
68 * A sample JUnit test.
79 *
810 * This test exists as a placeholder for the test unit framework.
911 */
10- public class SampleJavaProjectTest extends TestCase {
12+ public class SampleJavaProjectTest {
1113
1214 /**
1315 * Holds an instance of the class we are testing.
@@ -17,13 +19,15 @@ public class SampleJavaProjectTest extends TestCase {
1719 /**
1820 * JUnit set up method.
1921 */
22+ @ Before
2023 public final void setUp () {
2124 sjp = new SampleJavaProject ();
2225 }
2326
2427 /**
2528 * Tests the add() method in the main class.
2629 */
30+ @ Test
2731 public final void testAdd () {
2832 assertEquals (sjp .add (3 , 4 ), 7 );
2933 assertEquals (sjp .add (5 , -5 ), 0 );
You can’t perform that action at this time.
0 commit comments