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