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");
ReadOnlyContext readOnlyContext = new ReadOnlyContext();
readOnlyContext.internalBind("env/hello", "Hello");
readOnlyContext.internalBind("env/world", "Hello World");
readOnlyContext.internalBind("env/link", new LinkRef("java:comp/env/hello"));
RootContext.setComponentContext(readOnlyContext);
}
|