This is an automated email from the ASF dual-hosted git repository. robertlazarski pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/axis-axis2-java-core.git
The following commit(s) were added to refs/heads/master by this push: new 533edc1 AXIS2-6028 remove Qpid from JMS unit tests because the ancient version has a log4j 1.x dep and the new version is uphill due to a completely new API that makes unit testing difficult 533edc1 is described below commit 533edc173f217cb3529ed46ef557e582e6c987de Author: Robert Lazarski <robertlazar...@gmail.com> AuthorDate: Wed Mar 9 05:41:46 2022 -1000 AXIS2-6028 remove Qpid from JMS unit tests because the ancient version has a log4j 1.x dep and the new version is uphill due to a completely new API that makes unit testing difficult --- .../transport/jms/src/test/conf/qpid/config.xml | 37 ---------- modules/transport/jms/src/test/conf/qpid/passwd | 19 ----- .../jms/src/test/conf/qpid/virtualhosts.xml | 58 --------------- .../axis2/transport/jms/JMSTransportTest.java | 12 ++- .../axis2/transport/jms/QpidTestEnvironment.java | 85 ---------------------- .../org/apache/axis2/transport/jms/QpidUtil.java | 51 ------------- 6 files changed, 5 insertions(+), 257 deletions(-) diff --git a/modules/transport/jms/src/test/conf/qpid/config.xml b/modules/transport/jms/src/test/conf/qpid/config.xml deleted file mode 100644 index 2cf0ee2..0000000 --- a/modules/transport/jms/src/test/conf/qpid/config.xml +++ /dev/null @@ -1,37 +0,0 @@ -<?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 diff --git a/modules/transport/jms/src/test/conf/qpid/passwd b/modules/transport/jms/src/test/conf/qpid/passwd deleted file mode 100644 index 966a161..0000000 --- a/modules/transport/jms/src/test/conf/qpid/passwd +++ /dev/null @@ -1,19 +0,0 @@ -# -# 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 diff --git a/modules/transport/jms/src/test/conf/qpid/virtualhosts.xml b/modules/transport/jms/src/test/conf/qpid/virtualhosts.xml deleted file mode 100644 index 5d0d6bd..0000000 --- a/modules/transport/jms/src/test/conf/qpid/virtualhosts.xml +++ /dev/null @@ -1,58 +0,0 @@ -<?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> diff --git a/modules/transport/jms/src/test/java/org/apache/axis2/transport/jms/JMSTransportTest.java b/modules/transport/jms/src/test/java/org/apache/axis2/transport/jms/JMSTransportTest.java index e611813..3e0deb7 100644 --- a/modules/transport/jms/src/test/java/org/apache/axis2/transport/jms/JMSTransportTest.java +++ b/modules/transport/jms/src/test/java/org/apache/axis2/transport/jms/JMSTransportTest.java @@ -52,11 +52,9 @@ public class JMSTransportTest extends TestCase { // SYNAPSE-436: suite.addExclude("(&(test=EchoXML)(replyDestType=topic)(endpoint=axis))"); - // Although Qpid is compiled for Java 1.5, it uses classes only present in 1.6. - if (System.getProperty("java.version").startsWith("1.5.")) { - System.out.println("Excluding Qpid tests; please run the build with Java 1.6 to include them"); - suite.addExclude("(broker=qpid)"); - } + // Qpid has been removed because after major changes it is too hard + // to maintain + suite.addExclude("(broker=qpid)"); // Example to run a few use cases.. please leave these commented out - asankha //suite.addExclude("(|(test=AsyncXML)(test=MinConcurrency)(destType=topic)(broker=qpid)(destType=topic)(replyDestType=topic)(client=jms)(endpoint=mock)(cfOnSender=true))"); @@ -65,7 +63,7 @@ public class JMSTransportTest extends TestCase { TransportTestSuiteBuilder builder = new TransportTestSuiteBuilder(suite); - JMSTestEnvironment[] environments = new JMSTestEnvironment[] { new QpidTestEnvironment(), new ActiveMQTestEnvironment() }; + JMSTestEnvironment[] environments = new JMSTestEnvironment[] { new ActiveMQTestEnvironment() }; for (boolean singleCF : new boolean[] { false, true }) { for (boolean cfOnSender : new boolean[] { false, true }) { for (JMSTestEnvironment env : environments) { @@ -99,7 +97,7 @@ public class JMSTransportTest extends TestCase { builder.addEchoEndpoint(new MockEchoEndpoint()); builder.addEchoEndpoint(new AxisEchoEndpoint()); - for (JMSTestEnvironment env : new JMSTestEnvironment[] { new QpidTestEnvironment(), new ActiveMQTestEnvironment() }) { + for (JMSTestEnvironment env : new JMSTestEnvironment[] { new ActiveMQTestEnvironment() }) { suite.addTest(new MinConcurrencyTest(new AsyncChannel[] { new JMSAsyncChannel("endpoint1", JMSConstants.DESTINATION_TYPE_QUEUE, ContentTypeMode.TRANSPORT), new JMSAsyncChannel("endpoint2", JMSConstants.DESTINATION_TYPE_QUEUE, ContentTypeMode.TRANSPORT) }, diff --git a/modules/transport/jms/src/test/java/org/apache/axis2/transport/jms/QpidTestEnvironment.java b/modules/transport/jms/src/test/java/org/apache/axis2/transport/jms/QpidTestEnvironment.java deleted file mode 100644 index 39d877b..0000000 --- a/modules/transport/jms/src/test/java/org/apache/axis2/transport/jms/QpidTestEnvironment.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * 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. - */ - -package org.apache.axis2.transport.jms; - -import javax.jms.Destination; -import javax.jms.Queue; -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.exchange.ExchangeDefaults; -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 @Transient PortAllocator portAllocator; - private @Transient Broker broker; - private @Transient VirtualHost virtualHost; - private int port; - - @Setup @SuppressWarnings("unused") - 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.addPort(port); - broker.startup(options); - // null means the default virtual host - 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 { - broker.shutdown(); - portAllocator.releasePort(port); - } - - @Override - public Queue createQueue(String name) throws AMQException { - QpidUtil.createQueue(virtualHost, ExchangeDefaults.DIRECT_EXCHANGE_NAME, name); - return new AMQQueue(ExchangeDefaults.DIRECT_EXCHANGE_NAME, name); - } - - @Override - public Topic createTopic(String name) throws AMQException { - QpidUtil.createQueue(virtualHost, ExchangeDefaults.TOPIC_EXCHANGE_NAME, name); - return new AMQTopic(ExchangeDefaults.TOPIC_EXCHANGE_NAME, name); - } - - @Override - public void deleteDestination(Destination destination) throws Exception { - QpidUtil.deleteQueue(virtualHost, ((AMQDestination)destination).getRoutingKey().asString()); - } -} diff --git a/modules/transport/jms/src/test/java/org/apache/axis2/transport/jms/QpidUtil.java b/modules/transport/jms/src/test/java/org/apache/axis2/transport/jms/QpidUtil.java deleted file mode 100644 index 7255fd1..0000000 --- a/modules/transport/jms/src/test/java/org/apache/axis2/transport/jms/QpidUtil.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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. - */ - -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; - -public class QpidUtil { - private QpidUtil() {} - - public static void createQueue(VirtualHost virtualHost, AMQShortString exchangeName, String name) throws AMQException { - QueueRegistry queueRegistry = virtualHost.getQueueRegistry(); - if (queueRegistry.getQueue(name) != null) { - throw new IllegalStateException("Queue " + name + " already exists"); - } - AMQQueue queue = AMQQueueFactory.createAMQQueueImpl(UUIDGenerator.generateQueueUUID(name, virtualHost.getName()), name, false, null, false, false, virtualHost, null); - queueRegistry.registerQueue(queue); - virtualHost.getBindingFactory().addBinding(name, queue, virtualHost.getExchangeRegistry().getExchange(exchangeName), null); - } - - public static void deleteQueue(VirtualHost virtualHost, String name) throws AMQException { - AMQShortString _name = new AMQShortString(name); - AMQQueue queue = virtualHost.getQueueRegistry().getQueue(_name); - if (queue == null) { - throw new IllegalArgumentException("Queue " + name + " doesn't exist"); - } - queue.delete(); - } -}