1 17 18 package org.apache.geronimo.naming.geronimo; 19 20 import javax.naming.InitialContext ; 21 22 import junit.framework.TestCase; 23 24 30 public class GeronimoRootContextTest extends TestCase { 31 32 protected void setUp() throws Exception { 33 System.setProperty("java.naming.factory.initial", "com.sun.jndi.rmi.registry.RegistryContextFactory"); 34 System.setProperty("java.naming.factory.url.pkgs", "org.apache.geronimo.naming"); 35 System.setProperty("java.naming.provider.url", "rmi://localhost:1099"); 36 37 GeronimoContextManager.bind("one", "one"); 38 GeronimoContextManager.bind("this/is/a/compound/name", "two"); 39 GeronimoContextManager.bind("this/is/another/compound/name", "three"); 40 } 41 42 public void testLookup() throws Exception { 43 InitialContext context = new InitialContext (); 44 assertEquals(context.lookup("geronimo:one"), "one"); 45 assertEquals(context.lookup("geronimo:this/is/a/compound/name"), "two"); 46 assertEquals(context.lookup("geronimo:this/is/another/compound/name"), "three"); 47 48 } 49 } 50 | Popular Tags |