File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1
1
package sample .java .project ;
2
2
3
- import junit .framework .TestCase ;
3
+ import static org .junit .Assert .assertEquals ;
4
+ import org .junit .Before ;
5
+ import org .junit .Test ;
4
6
5
7
/**
6
8
* A sample JUnit test.
7
9
*
8
10
* This test exists as a placeholder for the test unit framework.
9
11
*/
10
- public class SampleJavaProjectTest extends TestCase {
12
+ public class SampleJavaProjectTest {
11
13
12
14
/**
13
15
* Holds an instance of the class we are testing.
@@ -17,13 +19,15 @@ public class SampleJavaProjectTest extends TestCase {
17
19
/**
18
20
* JUnit set up method.
19
21
*/
22
+ @ Before
20
23
public final void setUp () {
21
24
sjp = new SampleJavaProject ();
22
25
}
23
26
24
27
/**
25
28
* Tests the add() method in the main class.
26
29
*/
30
+ @ Test
27
31
public final void testAdd () {
28
32
assertEquals (sjp .add (3 , 4 ), 7 );
29
33
assertEquals (sjp .add (5 , -5 ), 0 );
You can’t perform that action at this time.
0 commit comments