protected void setUp() throws Exception {
System.setProperty("java.naming.factory.initial", "com.sun.jndi.rmi.registry.RegistryContextFactory");
System.setProperty("java.naming.factory.url.pkgs", "org.apache.geronimo.naming");
System.setProperty("java.naming.provider.url", "rmi://localhost:1099");
initialContext = new InitialContext();
readOnlyContext = new ReadOnlyContext();
envBinding = new HashMap();
readOnlyContext.internalBind("env/hello", "Hello");
envBinding.put("hello", "Hello");
bind("env/world", "Hello World");
envBinding.put("world", "Hello World");
bind("env/here/there/anywhere", "long name");
envBinding.put("here", readOnlyContext.lookup("env/here"));
LinkRef link = new LinkRef("java:comp/env/hello");
bind("env/link", link);
envBinding.put("link", link);
RootContext.setComponentContext(readOnlyContext);
compContext = (Context) initialContext.lookup("java:comp");
envContext = (Context) initialContext.lookup("java:comp/env");
syntax = new Properties();
}
|