NO-JIRA Fixing Test

There's no semantic changes here, hence NO-JIRA
This commit is contained in:
Clebert Suconic 2020-05-01 12:29:19 -04:00
parent a38d58618b
commit 4ca6bac92d
1 changed files with 2 additions and 10 deletions

View File

@ -16,7 +16,6 @@
*/ */
package org.apache.activemq.artemis.tests.integration.crossprotocol; package org.apache.activemq.artemis.tests.integration.crossprotocol;
import javax.jms.BytesMessage;
import javax.jms.Connection; import javax.jms.Connection;
import javax.jms.Message; import javax.jms.Message;
import javax.jms.MessageConsumer; import javax.jms.MessageConsumer;
@ -24,8 +23,6 @@ import javax.jms.MessageProducer;
import javax.jms.ObjectMessage; import javax.jms.ObjectMessage;
import javax.jms.Queue; import javax.jms.Queue;
import javax.jms.Session; import javax.jms.Session;
import java.io.ByteArrayInputStream;
import java.io.ObjectInputStream;
import java.net.URI; import java.net.URI;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@ -105,16 +102,11 @@ public class AMQPToOpenwireTest extends ActiveMQTestBase {
queue = session.createQueue(queueName); queue = session.createQueue(queueName);
MessageConsumer consumer = session.createConsumer(queue); MessageConsumer consumer = session.createConsumer(queue);
connection.start(); connection.start();
BytesMessage receive = (BytesMessage) consumer.receive(5000); ObjectMessage receive = (ObjectMessage) consumer.receive(5000);
assertNotNull(receive); assertNotNull(receive);
byte[] bytes = new byte[(int) receive.getBodyLength()]; list = (ArrayList)receive.getObject();
receive.readBytes(bytes);
ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bytes));
list = (ArrayList) ois.readObject();
assertEquals(list.get(0), "aString"); assertEquals(list.get(0), "aString");
connection.close(); connection.close();
} catch (Exception e) {
e.printStackTrace();
} finally { } finally {
if (connection != null) { if (connection != null) {
connection.close(); connection.close();