*/
package org.wamblee.support.jndi;
-import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.*;
import javax.naming.InitialContext;
+import javax.naming.NameNotFoundException;
import javax.naming.NamingException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.wamblee.support.jndi.StubInitialContextFactory;
public class StubInitiaContextFactoryTest {
assertEquals("hallo", obj);
}
+ @Test(expected = NameNotFoundException.class)
+ public void testLookupFails() throws Exception {
+ StubInitialContextFactory.register();
+
+ InitialContext ctx = new InitialContext();
+ Object obj = ctx.lookup("a/b");
+ }
}