1 7 package com.inversoft.verge.repository.config.test; 8 9 10 import junit.framework.TestCase; 11 12 import com.inversoft.verge.repository.config.Config; 13 import com.inversoft.verge.repository.config.ItemConfig; 14 import com.inversoft.verge.repository.config.RepositoryConfigRegistry; 15 import com.inversoft.verge.util.ScopeConstants; 16 17 18 27 public class RepositoryConfigRegistryTest extends TestCase { 28 29 32 public RepositoryConfigRegistryTest(String name) { 33 super(name); 34 } 35 36 37 40 public void testAll() { 41 42 try { 43 RegistryHelper registry = new RegistryHelper(); 44 ItemConfig config1 = new ItemConfig("", ScopeConstants.PAGE_INT, 45 RepositoryConfigRegistryTest.class); 46 ItemConfig config2 = new ItemConfig("", ScopeConstants.PAGE_INT, 47 RepositoryConfigRegistryTest.class); 48 registry.register("test1", config1); 49 registry.register("test2", config2); 50 51 assertTrue("Should be 1", registry.lookup("test1") == config1); 52 assertTrue("Should be 2", registry.lookup("test2") == config2); 53 } catch (Exception e) { 54 fail(e.toString()); 55 } 56 } 57 58 61 public static class RegistryHelper extends RepositoryConfigRegistry { 62 protected void register(String id, Config config) { 63 super.register(id, config); 64 } 65 } 66 } 67 | Popular Tags |