1 18 19 package cowsultants.itracker.ejb.test; 20 21 import java.rmi.*; 22 import java.sql.*; 23 import java.util.*; 24 import javax.rmi.*; 25 import javax.sql.*; 26 import javax.naming.*; 27 import javax.ejb.CreateException ; 28 29 import junit.framework.*; 30 31 import cowsultants.itracker.ejb.client.interfaces.*; 32 33 public class TestApplicationProperties extends TestCase { 34 35 public TestApplicationProperties(String name) { 36 super(name); 37 } 38 39 public void testGetProperties() { 40 try { 41 InitialContext ic = new InitialContext(); 42 Object scRef = ic.lookup(SystemConfiguration.JNDI_NAME); 43 SystemConfigurationHome scHome = (SystemConfigurationHome) PortableRemoteObject.narrow(scRef, SystemConfigurationHome.class); 44 SystemConfiguration sc = scHome.create(); 45 46 Properties props = sc.getProperties(); 47 assertTrue("default_ds != java:/ITrackerDS", props.getProperty("default_ds").equals("java:/ITrackerDS")); 48 49 } catch(CreateException ce) { 50 fail("CreateException caught during testIDCacheLoad: " + ce.getMessage()); 51 } catch(NamingException ne) { 52 fail("NamingException caught during testIDCacheLoad: " + ne.getMessage()); 53 } 54 } 55 56 public static Test suite() { 57 return new TestSuite(TestApplicationProperties.class); 58 } 59 } | Popular Tags |