1 2 import junit.framework.Test; 3 import junit.framework.TestCase; 4 import junit.framework.TestSuite; 5 6 7 14 public class HelloWorldUTest extends TestCase 15 { 16 private static final Class THIS_CLASS = HelloWorldUTest.class; 17 18 public HelloWorldUTest( String name ) 19 { 20 super( name ); 21 } 22 23 24 27 public void testGetText() 28 { 29 HelloWorld hw = new HelloWorld(); 30 String t = hw.getText(); 31 assertEquals( "did not return correct text.", 32 "Hello, world!", 33 t ); 34 } 35 36 37 public void testExecute() 38 { 39 HelloWorld hw = new HelloWorld(); 40 hw.execute(); 41 } 42 43 44 47 48 public static Test suite() 49 { 50 TestSuite suite = new TestSuite( THIS_CLASS ); 51 52 return suite; 53 } 54 } 55 56 | Popular Tags |