1 26 27 package net.sourceforge.groboutils.codecoverage.v2.logger; 28 29 import java.io.IOException ; 30 31 import junit.framework.Test; 32 import junit.framework.TestCase; 33 import net.sourceforge.groboutils.autodoc.v1.AutoDoc; 34 import net.sourceforge.groboutils.codecoverage.v2.IChannelLogRecordUTestI; 35 import net.sourceforge.groboutils.junit.v1.iftc.CxFactory; 36 import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; 37 38 39 46 public class DefaultChannelLogRecordUTest extends TestCase 47 { 48 51 private static final Class THIS_CLASS = DefaultChannelLogRecordUTest.class; 52 private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); 53 54 public DefaultChannelLogRecordUTest( String name ) 55 { 56 super( name ); 57 } 58 59 60 63 64 public void testConstructor1() 65 { 66 try 67 { 68 new DefaultChannelLogRecord( null, (short)0, (short)1 ); 69 fail( "Did not throw IllegalArgumentException." ); 70 } 71 catch (IllegalArgumentException ex) 72 { 73 } 75 } 76 77 78 public void testConstructor2() 79 { 80 DefaultChannelLogRecord clr = new DefaultChannelLogRecord( 81 "A", (short)100, (short)-30 ); 82 assertEquals( 83 "Incorrect class signature.", 84 "A", 85 clr.getClassSignature() ); 86 assertEquals( 87 "Incorrect method index.", 88 (short)100, 89 clr.getMethodIndex() ); 90 assertEquals( 91 "Incorrect mark index.", 92 (short)-30, 93 clr.getMarkIndex() ); 94 } 95 96 97 100 101 102 105 106 public static Test suite() 107 { 108 InterfaceTestSuite suite = IChannelLogRecordUTestI.suite(); 109 suite.addTestSuite( THIS_CLASS ); 110 suite.addFactory( new CxFactory( "A" ) { 111 public Object createImplObject() throws IOException { 112 return new DefaultChannelLogRecord( "S", (short)0, (short)1 ); 113 } 114 } ); 115 116 return suite; 117 } 118 119 public static void main( String [] args ) 120 { 121 String [] name = { THIS_CLASS.getName() }; 122 123 126 junit.textui.TestRunner.main( name ); 127 } 128 129 130 134 protected void setUp() throws Exception 135 { 136 super.setUp(); 137 138 139 } 141 142 143 147 protected void tearDown() throws Exception 148 { 149 151 152 super.tearDown(); 153 } 154 } 155 156 | Popular Tags |