1 15 package hivemind.test; 16 17 import org.apache.hivemind.Registry; 18 19 24 public class TestContains extends FrameworkTestCase 25 { 26 private Registry registry; 27 28 protected void setUp() throws Exception 29 { 30 super.setUp(); 31 32 registry = buildFrameworkRegistry("contains.xml"); 33 } 34 35 protected void tearDown() throws Exception 36 { 37 super.tearDown(); 38 39 registry.shutdown(); 40 } 41 42 public void testConfiguration() 43 { 44 assertTrue(registry.containsConfiguration("hivemind.tests.contains.Simple")); 45 } 46 47 public void testConfigurationFailure() 48 { 49 assertTrue(!registry.containsConfiguration("xhivemind.tests.contains.Simple")); 50 } 51 52 public void testService() 53 { 54 assertTrue(registry.containsService("hivemind.tests.contains.multipleServiceOne", IMultipleService.class)); 55 } 56 57 public void testServiceFailure() 58 { 59 assertTrue(!registry.containsService("hivemind.tests.contains.multipleServiceOne", IUniqueService.class)); 60 assertTrue(!registry.containsService("xhivemind.tests.contains.multipleServiceOne", IMultipleService.class)); 61 } 62 63 public void testUniqueService() 64 { 65 assertTrue(registry.containsService(IUniqueService.class)); 66 } 67 68 public void testUniqueServiceFailure() 69 { 70 assertTrue(!registry.containsService(IMultipleService.class)); 71 } 72 73 } 74 | Popular Tags |