summaryrefslogtreecommitdiff
path: root/java/client/src/test
diff options
context:
space:
mode:
authorKim van der Riet <kpvdr@apache.org>2012-05-04 15:39:19 +0000
committerKim van der Riet <kpvdr@apache.org>2012-05-04 15:39:19 +0000
commit633c33f224f3196f3f9bd80bd2e418d8143fea06 (patch)
tree1391da89470593209466df68c0b40b89c14963b1 /java/client/src/test
parentc73f9286ebff93a6c8dbc29cf05e258c4b55c976 (diff)
downloadqpid-python-633c33f224f3196f3f9bd80bd2e418d8143fea06.tar.gz
QPID-3858: Updated branch - merged from trunk r.1333987
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1334037 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/client/src/test')
-rw-r--r--java/client/src/test/java/org/apache/qpid/jndi/JNDITest.properties (renamed from java/client/src/test/java/org/apache/qpid/test/unit/jndi/JNDITest.properties)0
-rw-r--r--java/client/src/test/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactoryTest.java (renamed from java/client/src/test/java/org/apache/qpid/test/unit/jndi/JNDIPropertyFileTest.java)45
-rw-r--r--java/client/src/test/java/org/apache/qpid/jndi/hello.properties27
-rw-r--r--java/client/src/test/java/org/apache/qpid/test/unit/message/TestAMQSession.java2
4 files changed, 54 insertions, 20 deletions
diff --git a/java/client/src/test/java/org/apache/qpid/test/unit/jndi/JNDITest.properties b/java/client/src/test/java/org/apache/qpid/jndi/JNDITest.properties
index 07017a05a6..07017a05a6 100644
--- a/java/client/src/test/java/org/apache/qpid/test/unit/jndi/JNDITest.properties
+++ b/java/client/src/test/java/org/apache/qpid/jndi/JNDITest.properties
diff --git a/java/client/src/test/java/org/apache/qpid/test/unit/jndi/JNDIPropertyFileTest.java b/java/client/src/test/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactoryTest.java
index 576ab4fa05..2989970dcd 100644
--- a/java/client/src/test/java/org/apache/qpid/test/unit/jndi/JNDIPropertyFileTest.java
+++ b/java/client/src/test/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactoryTest.java
@@ -14,29 +14,35 @@
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
- * under the License.
+ * under the License.
+ *
*
- *
*/
-package org.apache.qpid.test.unit.jndi;
+package org.apache.qpid.jndi;
-import junit.framework.TestCase;
-import org.apache.qpid.client.AMQDestination;
-import org.apache.qpid.framing.AMQShortString;
+import java.util.Properties;
+import javax.jms.Destination;
import javax.jms.Queue;
import javax.jms.Topic;
import javax.naming.ConfigurationException;
import javax.naming.Context;
import javax.naming.InitialContext;
-import java.util.Properties;
-public class JNDIPropertyFileTest extends TestCase
+import junit.framework.TestCase;
+
+import org.apache.qpid.client.AMQDestination;
+import org.apache.qpid.framing.AMQShortString;
+
+public class PropertiesFileInitialContextFactoryTest extends TestCase
{
+ private static final String FILE_URL_PATH = System.getProperty("user.dir") + "/client/src/test/java/org/apache/qpid/jndi/";
+ private static final String FILE_NAME = "hello.properties";
+
private Context ctx;
-
- public JNDIPropertyFileTest() throws Exception
+
+ protected void setUp() throws Exception
{
Properties properties = new Properties();
properties.load(this.getClass().getResourceAsStream("JNDITest.properties"));
@@ -44,19 +50,20 @@ public class JNDIPropertyFileTest extends TestCase
//Create the initial context
ctx = new InitialContext(properties);
}
-
+
+
public void testQueueNamesWithTrailingSpaces() throws Exception
{
Queue queue = (Queue)ctx.lookup("QueueNameWithSpace");
- assertEquals("QueueNameWithSpace",queue.getQueueName());
+ assertEquals("QueueNameWithSpace",queue.getQueueName());
}
-
+
public void testTopicNamesWithTrailingSpaces() throws Exception
{
Topic topic = (Topic)ctx.lookup("TopicNameWithSpace");
- assertEquals("TopicNameWithSpace",topic.getTopicName());
+ assertEquals("TopicNameWithSpace",topic.getTopicName());
}
-
+
public void testMultipleTopicNamesWithTrailingSpaces() throws Exception
{
Topic topic = (Topic)ctx.lookup("MultipleTopicNamesWithSpace");
@@ -64,16 +71,16 @@ public class JNDIPropertyFileTest extends TestCase
for (AMQShortString bindingKey: ((AMQDestination)topic).getBindingKeys())
{
i++;
- assertEquals("Topic" + i + "WithSpace",bindingKey.asString());
+ 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);
@@ -83,6 +90,6 @@ public class JNDIPropertyFileTest extends TestCase
{
assertTrue("Incorrect exception", e.getMessage().contains("Failed to parse entry: amq.topic/test;create:always}"));
}
-
+
}
}
diff --git a/java/client/src/test/java/org/apache/qpid/jndi/hello.properties b/java/client/src/test/java/org/apache/qpid/jndi/hello.properties
new file mode 100644
index 0000000000..d017d137fe
--- /dev/null
+++ b/java/client/src/test/java/org/apache/qpid/jndi/hello.properties
@@ -0,0 +1,27 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+java.naming.factory.initial = org.apache.qpid.jndi.PropertiesFileInitialContextFactory
+
+# register some connection factories
+# connectionfactory.[jndiname] = [ConnectionURL]
+connectionfactory.qpidConnectionfactory = amqp://guest:guest@clientid/test?brokerlist='tcp://10.0.1.46:5672'
+
+# Register an AMQP destination in JNDI
+# destination.[jniName] = [Address Format]
+destination.topicExchange = amq.topic
diff --git a/java/client/src/test/java/org/apache/qpid/test/unit/message/TestAMQSession.java b/java/client/src/test/java/org/apache/qpid/test/unit/message/TestAMQSession.java
index 84d91ee57e..f199961b6f 100644
--- a/java/client/src/test/java/org/apache/qpid/test/unit/message/TestAMQSession.java
+++ b/java/client/src/test/java/org/apache/qpid/test/unit/message/TestAMQSession.java
@@ -145,7 +145,7 @@ public class TestAMQSession extends AMQSession_0_8
}
public void sendQueueDeclare(AMQDestination amqd, AMQProtocolHandler protocolHandler,
- boolean nowait) throws AMQException, FailoverException
+ boolean nowait, boolean passive) throws AMQException, FailoverException
{
}