1 package org.sapia.regis.local; 2 3 import java.util.Properties ; 4 5 import org.sapia.regis.RegisSession; 6 import org.sapia.regis.Registry; 7 8 import junit.framework.TestCase; 9 10 public class LocalRegistryFactoryTest extends TestCase { 11 12 public LocalRegistryFactoryTest(String arg0) { 13 super(arg0); 14 } 15 16 public void testConnect() throws Exception { 17 Properties props = new Properties (); 18 props.setProperty(LocalRegistryFactory.BOOTSTRAP, 19 "org/sapia/regis/local/configTest.xml"); 20 LocalRegistryFactory fac = new LocalRegistryFactory(); 21 Registry reg = fac.connect(props); 22 RegisSession s = reg.open(); 23 assertEquals("value", reg.getRoot().getChild("test").getProperty("prop").asString()); 24 s.close(); 25 26 } 27 28 public void testConnectWithVars() throws Exception { 29 Properties props = new Properties (); 30 props.setProperty(LocalRegistryFactory.BOOTSTRAP, "${user.dir}/etc/bootstrap1.xml"); 31 LocalRegistryFactory fac = new LocalRegistryFactory(); 32 fac.connect(props); 33 } 34 35 } 36 | Popular Tags |