(no commit message)
[utils] / test / enterprise / src / test / java / org / wamblee / support / jndi / StubInitiaContextFactoryTest.java
index b4745bd1a22eac90a09d99978ab99de98613c547..f6a5781042fd68d2b32f9f086ce54d6d60ec10e4 100644 (file)
  */ 
 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 {
 
@@ -52,4 +52,11 @@ 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");
+    }
 }