Skip to content

Commit 504dbeb

Browse files
committed
Update to JUnit4 tests.
1 parent 1febd90 commit 504dbeb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/sample/java/project/SampleJavaProjectTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
package 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);

0 commit comments

Comments
 (0)