tabish121 commented on a change in pull request #2954: ARTEMIS-2608 Fix ClassCastException on binary properties conversion URL: https://github.com/apache/activemq-artemis/pull/2954#discussion_r397143943
########## File path: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/AMQPResenderToOpenwireTest.java ########## @@ -0,0 +1,158 @@ +/* + * 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.activemq.artemis.tests.integration.crossprotocol; + +import javax.jms.Connection; +import javax.jms.Message; +import javax.jms.MessageConsumer; +import javax.jms.MessageProducer; +import javax.jms.Queue; +import javax.jms.Session; + +import java.util.LinkedList; +import java.util.List; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; + +import org.apache.activemq.ActiveMQConnectionFactory; +import org.apache.activemq.artemis.api.core.RoutingType; +import org.apache.activemq.artemis.api.core.SimpleString; +import org.apache.activemq.artemis.core.config.Configuration; +import org.apache.activemq.artemis.core.server.ActiveMQServer; +import org.apache.activemq.artemis.core.settings.impl.AddressSettings; +import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; +import org.apache.qpid.jms.JmsConnectionFactory; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class AMQPResenderToOpenwireTest extends ActiveMQTestBase { + + private static final String OPENWIRE_URL = "tcp://localhost:61616"; + private static final String AMQP_URL = "amqp://localhost:61616"; + + private ActiveMQServer server; + private ActiveMQConnectionFactory factory; + private JmsConnectionFactory qpidFactory; + + private String queueZeroName = "queue.zero"; + private String queueOneName = "queue.one"; + + @Override + @Before + public void setUp() throws Exception { + super.setUp(); + server = createServer(true, true); + + factory = new ActiveMQConnectionFactory(OPENWIRE_URL); + qpidFactory = new JmsConnectionFactory(AMQP_URL); + + Configuration serverConfig = server.getConfiguration(); + serverConfig.getAddressesSettings().put("#", new AddressSettings().setAutoCreateQueues(true) + .setAutoCreateAddresses(true).setDeadLetterAddress(new SimpleString("ActiveMQ.DLQ"))); + serverConfig.setSecurityEnabled(false); + server.start(); + + SimpleString coreQueueZero = new SimpleString(queueZeroName); + server.createQueue(coreQueueZero, RoutingType.ANYCAST, coreQueueZero, null, false, false); + + SimpleString coreQueueOne = new SimpleString(queueOneName); + server.createQueue(coreQueueOne, RoutingType.ANYCAST, coreQueueOne, null, false, false); + } + + @Override + @After + public void tearDown() throws Exception { + if (server != null) { + server.stop(); + server = null; + } + } + + @Test(timeout = 60_000) + public void openwireInternalBinaryPropertiesShouldBeResentAsByteArrays() throws Exception { Review comment: @franz1981 is correct here, there is simply no need to make this a multi threaded test that requires more overhead and time vs just creating two methods that take a connection factory one the sends and one that receives and then test that messages sent from one protocol are received by another they contain the expected message body data types. There are plenty of existing test cases in the AMQP integrations tests that do this sort of thing already ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
