1 15 16 package net.sourceforge.groboutils.junit.v1.iftc; 17 18 import junit.framework.Test; 19 import junit.framework.TestCase; 20 import junit.framework.TestSuite; 21 22 23 32 public class Sample3ImplIUTest extends TestCase { 33 private static final Class THIS_CLASS = Sample3ImplIUTest.class; 34 35 public Sample3ImplIUTest( String name ) { 36 super( name ); 37 } 38 39 42 public void testConstructor1() { 43 new Sample3Impl( (String [])null ); 44 } 45 46 47 public static class Sample2ImplFactory 48 implements Sample2IUTestI.Sample2Factory { 49 public Sample2 create( String [] s ) { 50 return new Sample3Impl( s ); 51 } 52 53 public Sample2 create( String s ) { 54 return new Sample3Impl( new String [] { s } ); 55 } 56 } 57 58 59 public static Test suite() { 60 TestSuite suite = new TestSuite( THIS_CLASS ); 61 62 InterfaceTestSuite its = Sample3IUTestI.suite(); 66 its.addInterfaceTestSuite( Sample4IUTestI.suite() ); 67 its.addFactory( new ImplFactory() { 68 public Object createImplObject() { 69 return new Sample3Impl(); 70 } 71 } ); 72 its.addFactory( new ImplFactory() { 73 public Object createImplObject() { 74 return new Sample3Impl( new String [] { "a", "b" } ); 75 } 76 } ); 77 suite.addTest( its ); 78 79 its = Sample2IUTestI.suite(); 82 its.addFactory( new ImplFactory() { 83 public Object createImplObject() { 84 return new Sample2ImplFactory(); 85 } 86 } ); 87 suite.addTest( its ); 88 89 return suite; 90 } 91 92 public static void main( String [] args ) { 93 String [] name = { THIS_CLASS.getName() }; 94 95 junit.textui.TestRunner.main( name ); 96 } 97 } 98 99 | Popular Tags |