1 26 27 package net.sourceforge.groboutils.codecoverage.v2.datastore; 28 29 import java.io.File ; 30 import java.io.IOException ; 31 32 import junit.framework.Test; 33 import junit.framework.TestCase; 34 import net.sourceforge.groboutils.autodoc.v1.AutoDoc; 35 import net.sourceforge.groboutils.codecoverage.v2.CCCreatorUtil; 36 import net.sourceforge.groboutils.junit.v1.iftc.CxFactory; 37 import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; 38 39 40 47 public class DirMetaDataReaderUTest extends TestCase 48 { 49 52 private static final Class THIS_CLASS = DirMetaDataReaderUTest.class; 53 private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); 54 55 public DirMetaDataReaderUTest( String name ) 56 { 57 super( name ); 58 } 59 60 61 64 65 public void testConstructor1() throws Exception 66 { 67 try 68 { 69 new DirMetaDataReader( null ); 70 fail( "Doesn't throw IllegalArgumentException." ); 71 } 72 catch (IllegalArgumentException ex) 73 { 74 } 75 } 76 77 78 public void testGetClassReader1() throws Exception 79 { 80 File f = CCCreatorUtil.createNewDirectory(); 81 DirMetaDataReader dmdr = new DirMetaDataReader( f ); 82 try 83 { 84 dmdr.getClassReader( null ); 85 fail( "Did not throw IllegalArgumentException." ); 86 } 87 catch (IllegalArgumentException ex) 88 { 89 } 90 } 91 92 93 public void testGetAnalysisModuleSet1() throws Exception 94 { 95 File f = CCCreatorUtil.createNewDirectory(); 96 DirMetaDataReader dmdr = new DirMetaDataReader( f ); 97 AnalysisModuleSet ams = dmdr.getAnalysisModuleSet(); 98 assertEquals( 99 "Created modules out of nothing.", 100 0, 101 ams.getAnalysisModuleCount() ); 102 } 103 104 105 106 109 110 111 114 115 public static Test suite() 116 { 117 InterfaceTestSuite suite = IMetaDataReaderUTestI.suite(); 118 suite.addTestSuite( THIS_CLASS ); 119 suite.addFactory( new CxFactory( "A" ) { 120 public Object createImplObject() throws IOException { 121 return new DirMetaDataReader( new File ( "." ) ); 122 } 123 } ); 124 125 return suite; 126 } 127 128 public static void main( String [] args ) 129 { 130 String [] name = { THIS_CLASS.getName() }; 131 132 135 junit.textui.TestRunner.main( name ); 136 } 137 138 139 143 protected void setUp() throws Exception 144 { 145 super.setUp(); 146 147 148 } 150 151 152 156 protected void tearDown() throws Exception 157 { 158 160 161 super.tearDown(); 162 } 163 } 164 165 | Popular Tags |