1 # Used in JAVA
2 public class Example {
3 @Test
4 public void method() {
5 org.junit.Assert.assertTrue( new ArrayList().isEmpty() );
6 }
7 }
8
1import junit.framework.*;
2
3public class JavaTest extends TestCase {
4 protected int value1, value2;
5
6 // assigning the values
7 protected void setUp(){
8 value1 = 3;
9 value2 = 3;
10 }
11
12 // test method to add two values
13 public void testAdd(){
14 double result = value1 + value2;
15 assertTrue(result == 6);
16 }
17}