summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRajith Muditha Attapattu <rajith@apache.org>2011-08-31 00:25:26 +0000
committerRajith Muditha Attapattu <rajith@apache.org>2011-08-31 00:25:26 +0000
commit470263db26077fab21685355316eb35e71b54b5e (patch)
tree81b28374132fc86be40784fb129009d9bf5dc75e
parent6e4b0d6c4e8eaefdd57bd330a6276894e1540a04 (diff)
downloadqpid-python-470263db26077fab21685355316eb35e71b54b5e.tar.gz
QPID-3395 Added a test case for this issue.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1163459 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/java/client/src/test/java/org/apache/qpid/test/unit/jndi/JNDIPropertyFileTest.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/qpid/java/client/src/test/java/org/apache/qpid/test/unit/jndi/JNDIPropertyFileTest.java b/qpid/java/client/src/test/java/org/apache/qpid/test/unit/jndi/JNDIPropertyFileTest.java
index a1b14d5723..2052312f54 100644
--- a/qpid/java/client/src/test/java/org/apache/qpid/test/unit/jndi/JNDIPropertyFileTest.java
+++ b/qpid/java/client/src/test/java/org/apache/qpid/test/unit/jndi/JNDIPropertyFileTest.java
@@ -24,6 +24,7 @@ import java.util.Properties;
import javax.jms.Queue;
import javax.jms.Topic;
+import javax.naming.ConfigurationException;
import javax.naming.Context;
import javax.naming.InitialContext;
@@ -67,4 +68,22 @@ public class JNDIPropertyFileTest extends TestCase
assertEquals("Topic" + i + "WithSpace",bindingKey.asString());
}
}
+
+ public void testConfigurationErrors() throws Exception
+ {
+ Properties properties = new Properties();
+ properties.put("java.naming.factory.initial", "org.apache.qpid.jndi.PropertiesFileInitialContextFactory");
+ properties.put("destination.my-queue","amq.topic/test;create:always}");
+
+ try
+ {
+ ctx = new InitialContext(properties);
+ fail("A configuration exception should be thrown with details about the address syntax error");
+ }
+ catch(ConfigurationException e)
+ {
+ assertTrue("Incorrect exception", e.getMessage().contains("Failed to parse entry: amq.topic/test;create:always}"));
+ }
+
+ }
}