1 26 27 package net.sourceforge.groboutils.pmti.v1.autodoc.v1.server; 28 29 import net.sourceforge.groboutils.pmti.v1.itf.*; 30 import net.sourceforge.groboutils.autodoc.v1.testserver.*; 31 32 import java.io.*; 33 34 import net.sourceforge.groboutils.autodoc.v1.AutoDoc; 35 import org.easymock.EasyMock; 36 import org.easymock.MockControl; 37 import net.sourceforge.groboutils.junit.v1.iftc.*; 38 import junit.framework.Test; 39 import junit.framework.TestCase; 40 import junit.framework.TestSuite; 41 42 43 50 public class AbstractNewFileServerUTestI extends InterfaceTestCase 51 { 52 55 private static final Class THIS_CLASS = AbstractNewFileServerUTestI.class; 56 private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); 57 58 public AbstractNewFileServerUTestI( String name, ImplFactory f ) 59 { 60 super( name, AbstractNewFileServer.class, f ); 61 } 62 63 64 public AbstractNewFileServer createAbstractNewFileServer() 65 { 66 return (AbstractNewFileServer)createImplObject(); 67 } 68 69 70 73 74 75 76 public void testOpenOutput() throws Exception 77 { 78 AbstractNewFileServer anfs = createAbstractNewFileServer(); 79 TestInfo ti = new DefaultTestInfo( "a", "b" ); 80 TestData td = new DefaultTestData( ti ); 81 Writer w = anfs.openOutput( td ); 82 try 83 { 84 assertNotNull( 85 "Must never return a null writer.", 86 w ); 87 } 88 finally 89 { 90 w.close(); 91 } 92 } 93 94 95 96 public void testCreateFileName() 97 { 98 AbstractNewFileServer anfs = createAbstractNewFileServer(); 99 TestInfo ti = new DefaultTestInfo( "a", "b" ); 100 TestData td = new DefaultTestData( ti ); 101 String name = anfs.createFileName( td ); 102 assertNotNull( 103 "Name is null.", 104 name ); 105 } 106 107 108 109 112 113 public static InterfaceTestSuite suite() 114 { 115 InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); 116 117 suite.addInterfaceTestSuite( AbstractWriterServerUTestI.suite() ); 118 119 return suite; 120 } 121 122 public static void main( String [] args ) 123 { 124 String [] name = { THIS_CLASS.getName() }; 125 126 129 junit.textui.TestRunner.main( name ); 130 } 131 132 133 137 protected void setUp() throws Exception 138 { 139 super.setUp(); 140 141 } 143 144 145 149 protected void tearDown() throws Exception 150 { 151 153 154 super.tearDown(); 155 } 156 } 157 158 | Popular Tags |