1 26 27 package net.sourceforge.groboutils.util.classes.v1; 28 29 import org.easymock.EasyMock; 30 import org.easymock.MockControl; 31 import junit.framework.Test; 32 import junit.framework.TestCase; 33 import junit.framework.TestSuite; 34 35 36 43 public class SPILoaderUTest extends TestCase 44 { 45 48 private static final Class THIS_CLASS = SPILoaderUTest.class; 49 50 public SPILoaderUTest( String name ) 51 { 52 super( name ); 53 } 54 55 56 59 63 protected void setUp() throws Exception 64 { 65 super.setUp(); 66 67 } 69 70 71 74 75 public void testConstructor1() 76 throws Exception 77 { 78 try 79 { 80 new SPILoader( null ); 81 fail("Did not throw IllegalArgumentException"); 82 } 83 catch (IllegalArgumentException iae) 84 { 85 } 87 } 88 89 90 public void testConstructor2() 91 throws Exception 92 { 93 try 94 { 95 new SPILoader( null, null ); 96 fail("Did not throw IllegalArgumentException"); 97 } 98 catch (IllegalArgumentException iae) 99 { 100 } 102 } 103 104 105 public void testConstructor3() 106 throws Exception 107 { 108 new SPILoader( THIS_CLASS ); 109 } 110 111 112 public void testConstructor4() 113 throws Exception 114 { 115 new SPILoader( THIS_CLASS, null ); 116 } 117 118 119 public void testHasNext1() 120 throws Exception 121 { 122 SPILoader spil = new SPILoader( THIS_CLASS ); 123 assertTrue( 124 "SPILoaderUTest should not have a prop def file, and so should "+ 125 "not have a 'next'.", 126 !spil.hasNext() ); 127 } 128 129 130 public void testHasNext2() 131 throws Exception 132 { 133 SPILoader spil = new SPILoader( Object .class ); 135 136 assertTrue( 137 "Object should have a prop def file in classpath with entries.", 138 spil.hasNext() ); 139 } 140 141 142 143 146 147 148 149 152 153 public static Test suite() 154 { 155 TestSuite suite = new TestSuite( THIS_CLASS ); 156 157 168 169 return suite; 170 } 171 172 public static void main( String [] args ) 173 { 174 String [] name = { THIS_CLASS.getName() }; 175 176 179 junit.textui.TestRunner.main( name ); 180 } 181 182 183 187 protected void tearDown() throws Exception 188 { 189 191 192 super.tearDown(); 193 } 194 } 195 196 | Popular Tags |