Author: veithen
Date: Fri Nov 16 14:22:46 2012
New Revision: 1410352
URL: http://svn.apache.org/viewvc?rev=1410352&view=rev
Log:
Upgraded to qpid 0.18 so that we can get rid of the incubator repository.
Added:
axis/axis2/java/transports/trunk/modules/jms/src/test/conf/
axis/axis2/java/transports/trunk/modules/jms/src/test/conf/qpid/
axis/axis2/java/transports/trunk/modules/jms/src/test/conf/qpid/config.xml
(with props)
axis/axis2/java/transports/trunk/modules/jms/src/test/conf/qpid/log4j.xml
(with props)
axis/axis2/java/transports/trunk/modules/jms/src/test/conf/qpid/passwd
axis/axis2/java/transports/trunk/modules/jms/src/test/conf/qpid/virtualhosts.xml
(with props)
Modified:
axis/axis2/java/transports/trunk/modules/jms/pom.xml
axis/axis2/java/transports/trunk/modules/jms/src/test/java/org/apache/axis2/transport/jms/ActiveMQTestEnvironment.java
axis/axis2/java/transports/trunk/modules/jms/src/test/java/org/apache/axis2/transport/jms/JMSTestEnvironment.java
axis/axis2/java/transports/trunk/modules/jms/src/test/java/org/apache/axis2/transport/jms/QpidTestEnvironment.java
axis/axis2/java/transports/trunk/modules/jms/src/test/java/org/apache/axis2/transport/jms/QpidUtil.java
Modified: axis/axis2/java/transports/trunk/modules/jms/pom.xml
URL:
http://svn.apache.org/viewvc/axis/axis2/java/transports/trunk/modules/jms/pom.xml?rev=1410352&r1=1410351&r2=1410352&view=diff
==============================================================================
--- axis/axis2/java/transports/trunk/modules/jms/pom.xml (original)
+++ axis/axis2/java/transports/trunk/modules/jms/pom.xml Fri Nov 16 14:22:46
2012
@@ -126,13 +126,13 @@
<dependency>
<groupId>org.apache.qpid</groupId>
<artifactId>qpid-broker</artifactId>
- <version>1.0-incubating-M2.1</version>
+ <version>0.18</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.qpid</groupId>
<artifactId>qpid-client</artifactId>
- <version>1.0-incubating-M2.1</version>
+ <version>0.18</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -168,21 +168,6 @@
</dependency>
</dependencies>
- <repositories>
- <!-- this is for qpid -->
- <repository>
- <id>apache-incubating</id>
- <name>Apache Maven 2 Incubating Repository</name>
- <url>http://people.apache.org/repo/m2-incubating-repository/</url>
- <releases>
- <updatePolicy>never</updatePolicy>
- </releases>
- <snapshots>
- <updatePolicy>interval:60</updatePolicy>
- </snapshots>
- </repository>
- </repositories>
-
<properties>
<jms-1.1-spec.version>1.1</jms-1.1-spec.version>
<jta-spec.version>1.0</jta-spec.version>
Added:
axis/axis2/java/transports/trunk/modules/jms/src/test/conf/qpid/config.xml
URL:
http://svn.apache.org/viewvc/axis/axis2/java/transports/trunk/modules/jms/src/test/conf/qpid/config.xml?rev=1410352&view=auto
==============================================================================
--- axis/axis2/java/transports/trunk/modules/jms/src/test/conf/qpid/config.xml
(added)
+++ axis/axis2/java/transports/trunk/modules/jms/src/test/conf/qpid/config.xml
Fri Nov 16 14:22:46 2012
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+<broker>
+ <conf>src/test/conf/qpid</conf>
+ <security>
+ <pd-auth-manager>
+ <principal-database>
+
<class>org.apache.qpid.server.security.auth.database.PlainPasswordFilePrincipalDatabase</class>
+ <attributes>
+ <attribute>
+ <name>passwordFile</name>
+ <value>${conf}/passwd</value>
+ </attribute>
+ </attributes>
+ </principal-database>
+ </pd-auth-manager>
+ <msg-auth>false</msg-auth>
+ </security>
+ <virtualhosts>${conf}/virtualhosts.xml</virtualhosts>
+</broker>
\ No newline at end of file
Propchange:
axis/axis2/java/transports/trunk/modules/jms/src/test/conf/qpid/config.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: axis/axis2/java/transports/trunk/modules/jms/src/test/conf/qpid/log4j.xml
URL:
http://svn.apache.org/viewvc/axis/axis2/java/transports/trunk/modules/jms/src/test/conf/qpid/log4j.xml?rev=1410352&view=auto
==============================================================================
--- axis/axis2/java/transports/trunk/modules/jms/src/test/conf/qpid/log4j.xml
(added)
+++ axis/axis2/java/transports/trunk/modules/jms/src/test/conf/qpid/log4j.xml
Fri Nov 16 14:22:46 2012
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration>
+ <!-- This file is intentionally empty; we configure log4j elsewhere before
starting qpid. -->
+</log4j:configuration>
\ No newline at end of file
Propchange:
axis/axis2/java/transports/trunk/modules/jms/src/test/conf/qpid/log4j.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: axis/axis2/java/transports/trunk/modules/jms/src/test/conf/qpid/passwd
URL:
http://svn.apache.org/viewvc/axis/axis2/java/transports/trunk/modules/jms/src/test/conf/qpid/passwd?rev=1410352&view=auto
==============================================================================
--- axis/axis2/java/transports/trunk/modules/jms/src/test/conf/qpid/passwd
(added)
+++ axis/axis2/java/transports/trunk/modules/jms/src/test/conf/qpid/passwd Fri
Nov 16 14:22:46 2012
@@ -0,0 +1,19 @@
+#
+# 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.
+#
+guest:guest
Added:
axis/axis2/java/transports/trunk/modules/jms/src/test/conf/qpid/virtualhosts.xml
URL:
http://svn.apache.org/viewvc/axis/axis2/java/transports/trunk/modules/jms/src/test/conf/qpid/virtualhosts.xml?rev=1410352&view=auto
==============================================================================
---
axis/axis2/java/transports/trunk/modules/jms/src/test/conf/qpid/virtualhosts.xml
(added)
+++
axis/axis2/java/transports/trunk/modules/jms/src/test/conf/qpid/virtualhosts.xml
Fri Nov 16 14:22:46 2012
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+<virtualhosts>
+ <default>test</default>
+ <virtualhost>
+ <name>test</name>
+ <test>
+ <store>
+ <class>org.apache.qpid.server.store.MemoryMessageStore</class>
+ </store>
+ <queues>
+ <minimumAlertRepeatGap>30000</minimumAlertRepeatGap>
+ <maximumMessageCount>50</maximumMessageCount>
+ <queue>
+ <name>queue</name>
+ <queue>
+ <exchange>amq.direct</exchange>
+ <maximumQueueDepth>4235264</maximumQueueDepth>
+ <!-- 4Mb -->
+ <maximumMessageSize>2117632</maximumMessageSize>
+ <!-- 2Mb -->
+ <maximumMessageAge>600000</maximumMessageAge>
+ <!-- 10 mins -->
+ </queue>
+ </queue>
+ <queue>
+ <name>ping</name>
+ <ping>
+ <exchange>amq.direct</exchange>
+ <maximumQueueDepth>4235264</maximumQueueDepth>
+ <!-- 4Mb -->
+ <maximumMessageSize>2117632</maximumMessageSize>
+ <!-- 2Mb -->
+ <maximumMessageAge>600000</maximumMessageAge>
+ <!-- 10 mins -->
+ </ping>
+ </queue>
+ </queues>
+ </test>
+ </virtualhost>
+</virtualhosts>
Propchange:
axis/axis2/java/transports/trunk/modules/jms/src/test/conf/qpid/virtualhosts.xml
------------------------------------------------------------------------------
svn:eol-style = native
Modified:
axis/axis2/java/transports/trunk/modules/jms/src/test/java/org/apache/axis2/transport/jms/ActiveMQTestEnvironment.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/transports/trunk/modules/jms/src/test/java/org/apache/axis2/transport/jms/ActiveMQTestEnvironment.java?rev=1410352&r1=1410351&r2=1410352&view=diff
==============================================================================
---
axis/axis2/java/transports/trunk/modules/jms/src/test/java/org/apache/axis2/transport/jms/ActiveMQTestEnvironment.java
(original)
+++
axis/axis2/java/transports/trunk/modules/jms/src/test/java/org/apache/axis2/transport/jms/ActiveMQTestEnvironment.java
Fri Nov 16 14:22:46 2012
@@ -46,6 +46,7 @@ public class ActiveMQTestEnvironment ext
broker.setDataDirectory("target/activemq-data");
broker.setPersistenceAdapter(new MemoryPersistenceAdapter());
broker.start();
+ connectionFactory = new ActiveMQConnectionFactory("vm://" +
BROKER_NAME);
}
@TearDown @SuppressWarnings("unused")
@@ -54,12 +55,6 @@ public class ActiveMQTestEnvironment ext
}
@Override
- protected ActiveMQConnectionFactory createConnectionFactory() throws
Exception {
- return new ActiveMQConnectionFactory("vm://" + BROKER_NAME);
- }
-
-
- @Override
public Queue createQueue(String name) {
return new ActiveMQQueue(name);
}
Modified:
axis/axis2/java/transports/trunk/modules/jms/src/test/java/org/apache/axis2/transport/jms/JMSTestEnvironment.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/transports/trunk/modules/jms/src/test/java/org/apache/axis2/transport/jms/JMSTestEnvironment.java?rev=1410352&r1=1410351&r2=1410352&view=diff
==============================================================================
---
axis/axis2/java/transports/trunk/modules/jms/src/test/java/org/apache/axis2/transport/jms/JMSTestEnvironment.java
(original)
+++
axis/axis2/java/transports/trunk/modules/jms/src/test/java/org/apache/axis2/transport/jms/JMSTestEnvironment.java
Fri Nov 16 14:22:46 2012
@@ -25,19 +25,11 @@ import javax.jms.Queue;
import javax.jms.Topic;
import org.apache.axis2.transport.testkit.name.Key;
-import org.apache.axis2.transport.testkit.tests.Setup;
import org.apache.axis2.transport.testkit.tests.Transient;
@Key("broker")
public abstract class JMSTestEnvironment {
- private @Transient ConnectionFactory connectionFactory;
-
- @Setup @SuppressWarnings("unused")
- private void setUp() throws Exception {
- connectionFactory = createConnectionFactory();
- }
-
- protected abstract ConnectionFactory createConnectionFactory() throws
Exception;
+ protected @Transient ConnectionFactory connectionFactory;
public Destination createDestination(String destinationType, String name)
throws Exception {
if (destinationType.equals(JMSConstants.DESTINATION_TYPE_TOPIC)) {
Modified:
axis/axis2/java/transports/trunk/modules/jms/src/test/java/org/apache/axis2/transport/jms/QpidTestEnvironment.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/transports/trunk/modules/jms/src/test/java/org/apache/axis2/transport/jms/QpidTestEnvironment.java?rev=1410352&r1=1410351&r2=1410352&view=diff
==============================================================================
---
axis/axis2/java/transports/trunk/modules/jms/src/test/java/org/apache/axis2/transport/jms/QpidTestEnvironment.java
(original)
+++
axis/axis2/java/transports/trunk/modules/jms/src/test/java/org/apache/axis2/transport/jms/QpidTestEnvironment.java
Fri Nov 16 14:22:46 2012
@@ -26,36 +26,45 @@ import javax.jms.Topic;
import org.apache.axis2.transport.testkit.name.Name;
import org.apache.axis2.transport.testkit.tests.Setup;
import org.apache.axis2.transport.testkit.tests.TearDown;
+import org.apache.axis2.transport.testkit.tests.Transient;
+import org.apache.axis2.transport.testkit.util.PortAllocator;
import org.apache.qpid.AMQException;
import org.apache.qpid.client.AMQConnectionFactory;
import org.apache.qpid.client.AMQDestination;
import org.apache.qpid.client.AMQQueue;
import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.client.transport.TransportConnection;
import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
+import org.apache.qpid.server.Broker;
+import org.apache.qpid.server.BrokerOptions;
import org.apache.qpid.server.registry.ApplicationRegistry;
import org.apache.qpid.server.virtualhost.VirtualHost;
@Name("qpid")
public class QpidTestEnvironment extends JMSTestEnvironment {
- private VirtualHost virtualHost;
+ private @Transient PortAllocator portAllocator;
+ private @Transient Broker broker;
+ private @Transient VirtualHost virtualHost;
+ private int port;
@Setup @SuppressWarnings("unused")
- private void setUp() throws Exception {
- TransportConnection.createVMBroker(1);
+ private void setUp(PortAllocator portAllocator) throws Exception {
+ this.portAllocator = portAllocator;
+ port = portAllocator.allocatePort();
+ broker = new Broker();
+ BrokerOptions options = new BrokerOptions();
+ options.setConfigFile("src/test/conf/qpid/config.xml");
+ options.setLogConfigFile("src/test/conf/qpid/log4j.xml");
+ options.addPort(port);
+ broker.startup(options);
// null means the default virtual host
- virtualHost =
ApplicationRegistry.getInstance(1).getVirtualHostRegistry().getVirtualHost(null);
+ virtualHost =
ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost(null);
+ connectionFactory = new
AMQConnectionFactory("amqp://guest:guest@clientid/" + virtualHost.getName() +
"?brokerlist='tcp://localhost:" + port + "'");
}
@TearDown @SuppressWarnings("unused")
private void tearDown() throws Exception {
- TransportConnection.killVMBroker(1);
- }
-
- @Override
- protected AMQConnectionFactory createConnectionFactory() throws Exception {
- return new AMQConnectionFactory("vm://:1", "guest", "guest", "fred",
"test");
+ broker.shutdown();
+ portAllocator.releasePort(port);
}
@Override
@@ -72,6 +81,6 @@ public class QpidTestEnvironment extends
@Override
public void deleteDestination(Destination destination) throws Exception {
- QpidUtil.deleteQueue(virtualHost,
((AMQDestination)destination).getDestinationName().asString());
+ QpidUtil.deleteQueue(virtualHost,
((AMQDestination)destination).getRoutingKey().asString());
}
}
Modified:
axis/axis2/java/transports/trunk/modules/jms/src/test/java/org/apache/axis2/transport/jms/QpidUtil.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/transports/trunk/modules/jms/src/test/java/org/apache/axis2/transport/jms/QpidUtil.java?rev=1410352&r1=1410351&r2=1410352&view=diff
==============================================================================
---
axis/axis2/java/transports/trunk/modules/jms/src/test/java/org/apache/axis2/transport/jms/QpidUtil.java
(original)
+++
axis/axis2/java/transports/trunk/modules/jms/src/test/java/org/apache/axis2/transport/jms/QpidUtil.java
Fri Nov 16 14:22:46 2012
@@ -21,7 +21,9 @@ package org.apache.axis2.transport.jms;
import org.apache.qpid.AMQException;
import org.apache.qpid.framing.AMQShortString;
+import org.apache.qpid.server.model.UUIDGenerator;
import org.apache.qpid.server.queue.AMQQueue;
+import org.apache.qpid.server.queue.AMQQueueFactory;
import org.apache.qpid.server.queue.QueueRegistry;
import org.apache.qpid.server.virtualhost.VirtualHost;
@@ -29,14 +31,13 @@ public class QpidUtil {
private QpidUtil() {}
public static void createQueue(VirtualHost virtualHost, AMQShortString
exchangeName, String name) throws AMQException {
- AMQShortString _name = new AMQShortString(name);
QueueRegistry queueRegistry = virtualHost.getQueueRegistry();
- if (queueRegistry.getQueue(_name) != null) {
+ if (queueRegistry.getQueue(name) != null) {
throw new IllegalStateException("Queue " + name + " already
exists");
}
- AMQQueue queue = new AMQQueue(_name, false, null, false, virtualHost);
+ AMQQueue queue =
AMQQueueFactory.createAMQQueueImpl(UUIDGenerator.generateQueueUUID(name,
virtualHost.getName()), name, false, null, false, false, virtualHost, null);
queueRegistry.registerQueue(queue);
- queue.bind(_name, null,
virtualHost.getExchangeRegistry().getExchange(exchangeName));
+ virtualHost.getBindingFactory().addBinding(name, queue,
virtualHost.getExchangeRegistry().getExchange(exchangeName), null);
}
public static void deleteQueue(VirtualHost virtualHost, String name)
throws AMQException {