Repository: qpid-jms Updated Branches: refs/heads/master 008943630 -> 7ca5622ce
add test where specified URL doesnt exist Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/7ca5622c Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/7ca5622c Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/7ca5622c Branch: refs/heads/master Commit: 7ca5622ce6858a7f921143152a5bf11d117ea7e3 Parents: 4a6c1b2 Author: Robert Gemmell <[email protected]> Authored: Mon Feb 2 16:50:16 2015 +0000 Committer: Robert Gemmell <[email protected]> Committed: Mon Feb 2 16:50:47 2015 +0000 ---------------------------------------------------------------------- .../qpid/jms/jndi/JmsInitialContextFactoryTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/7ca5622c/qpid-jms-client/src/test/java/org/apache/qpid/jms/jndi/JmsInitialContextFactoryTest.java ---------------------------------------------------------------------- diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/jndi/JmsInitialContextFactoryTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/jndi/JmsInitialContextFactoryTest.java index 488bc4e..5a2266a 100644 --- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/jndi/JmsInitialContextFactoryTest.java +++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/jndi/JmsInitialContextFactoryTest.java @@ -311,6 +311,20 @@ public class JmsInitialContextFactoryTest extends QpidJmsTestCase { } @Test + public void testContextFromProviderUrlNotFoundThrowsNamingException() throws Exception { + Hashtable<Object, Object> env = new Hashtable<Object, Object>(); + + env.put(Context.PROVIDER_URL, "/does/not/exist/1234"); + try { + createInitialContext(env); + fail("Should have thrown exception"); + } catch (NamingException ne) { + // Expected + assertTrue("Should have had a cause", ne.getCause() != null); + } + } + + @Test public void testContextFromProviderUrlInEnvironmentMap() throws Exception { doContextFromProviderUrlInEnvironmentMapTestImpl(false); } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
