X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=test%2Fenterprise%2Fsrc%2Ftest%2Fjava%2Forg%2Fwamblee%2Fsupport%2Fjndi%2FStubInitiaContextFactoryTest.java;h=f6a5781042fd68d2b32f9f086ce54d6d60ec10e4;hb=f832de172c381de15d4e95e4b4f77c834a2457df;hp=b4745bd1a22eac90a09d99978ab99de98613c547;hpb=1b9acefff0078d6d2a3f061948b36f6721743306;p=utils diff --git a/test/enterprise/src/test/java/org/wamblee/support/jndi/StubInitiaContextFactoryTest.java b/test/enterprise/src/test/java/org/wamblee/support/jndi/StubInitiaContextFactoryTest.java index b4745bd1..f6a57810 100644 --- a/test/enterprise/src/test/java/org/wamblee/support/jndi/StubInitiaContextFactoryTest.java +++ b/test/enterprise/src/test/java/org/wamblee/support/jndi/StubInitiaContextFactoryTest.java @@ -15,15 +15,15 @@ */ 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"); + } }