Upgrade to ActiveMQ-5.13.0
Since Spring IO 2.0.2 has been upgraded to Spring Boot 1.3.2 and that one has been upgraded to ActiveMQ-5.12.2, where this one has a Java Serialization Vulnerability fix (https://issues.apache.org/jira/browse/AMQ-6013), we are forced to back port such an upgrade fix from `master`.
This commit is contained in:
@@ -82,9 +82,9 @@ subprojects { subproject ->
|
||||
|
||||
|
||||
ext {
|
||||
activeMqVersion = '5.11.1'
|
||||
aspectjVersion = '1.8.4'
|
||||
apacheSshdVersion = '0.13.0'
|
||||
activeMqVersion = '5.13.0'
|
||||
aspectjVersion = '1.8.7'
|
||||
apacheSshdVersion = '0.14.0'
|
||||
boonVersion = '0.33'
|
||||
chronicleVersion = '3.4.3'
|
||||
commonsDbcpVersion = '1.4'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -31,7 +31,6 @@ import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import javax.jms.Destination;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Session;
|
||||
@@ -39,6 +38,7 @@ import javax.jms.TextMessage;
|
||||
|
||||
import org.apache.activemq.ActiveMQConnectionFactory;
|
||||
import org.apache.activemq.command.ActiveMQQueue;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
@@ -59,6 +59,7 @@ import org.springframework.messaging.support.GenericMessage;
|
||||
* @author Mark Fisher
|
||||
* @author Gary Russell
|
||||
* @author Gunnar Hillert
|
||||
* @author Artem Bilan
|
||||
*/
|
||||
public class PollableJmsChannelTests {
|
||||
|
||||
@@ -66,6 +67,11 @@ public class PollableJmsChannelTests {
|
||||
|
||||
private Destination queue;
|
||||
|
||||
@BeforeClass
|
||||
public static void setup() {
|
||||
System.setProperty("org.apache.activemq.SERIALIZABLE_PACKAGES", "*");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void queueReference() throws Exception {
|
||||
ActiveMqTestUtils.prepare();
|
||||
@@ -85,10 +91,10 @@ public class PollableJmsChannelTests {
|
||||
assertTrue(sent1);
|
||||
boolean sent2 = channel.send(new GenericMessage<String>("bar"));
|
||||
assertTrue(sent2);
|
||||
Message<?> result1 = channel.receive(1000);
|
||||
Message<?> result1 = channel.receive(10000);
|
||||
assertNotNull(result1);
|
||||
assertEquals("foo", result1.getPayload());
|
||||
Message<?> result2 = channel.receive(1000);
|
||||
Message<?> result2 = channel.receive(10000);
|
||||
assertNotNull(result2);
|
||||
assertEquals("bar", result2.getPayload());
|
||||
}
|
||||
@@ -115,7 +121,7 @@ public class PollableJmsChannelTests {
|
||||
Message<?> result1 = channel.receive(10000);
|
||||
assertNotNull(result1);
|
||||
assertEquals("foo", result1.getPayload());
|
||||
Message<?> result2 = channel.receive(1000);
|
||||
Message<?> result2 = channel.receive(10000);
|
||||
assertNotNull(result2);
|
||||
assertEquals("bar", result2.getPayload());
|
||||
}
|
||||
@@ -200,11 +206,14 @@ public class PollableJmsChannelTests {
|
||||
final AtomicReference<javax.jms.Message> message = new AtomicReference<javax.jms.Message>();
|
||||
final CountDownLatch latch1 = new CountDownLatch(1);
|
||||
Executors.newSingleThreadExecutor().execute(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
message.set(receiver.receive(queue));
|
||||
latch1.countDown();
|
||||
}});
|
||||
}
|
||||
|
||||
});
|
||||
assertTrue(latch1.await(10, TimeUnit.SECONDS));
|
||||
assertNotNull(message.get());
|
||||
assertEquals(5, message.get().getJMSPriority());
|
||||
@@ -215,11 +224,14 @@ public class PollableJmsChannelTests {
|
||||
boolean sent2 = channel.send(MessageBuilder.withPayload("foo").setPriority(6).build());
|
||||
assertTrue(sent2);
|
||||
Executors.newSingleThreadExecutor().execute(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
message.set(receiver.receive(queue));
|
||||
latch2.countDown();
|
||||
}});
|
||||
}
|
||||
|
||||
});
|
||||
assertTrue(latch2.await(10, TimeUnit.SECONDS));
|
||||
assertNotNull(message.get());
|
||||
assertEquals(6, message.get().getJMSPriority());
|
||||
@@ -260,9 +272,10 @@ public class PollableJmsChannelTests {
|
||||
message.setStringProperty("baz", "qux");
|
||||
return message;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Message<?> result2 = channel.receive(1000);
|
||||
Message<?> result2 = channel.receive(10000);
|
||||
assertNotNull(result2);
|
||||
assertEquals("bar", result2.getPayload());
|
||||
}
|
||||
@@ -296,4 +309,5 @@ public class PollableJmsChannelTests {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -44,6 +44,7 @@ import org.apache.activemq.command.ActiveMQTopic;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.mockito.invocation.InvocationOnMock;
|
||||
import org.mockito.stubbing.Answer;
|
||||
@@ -78,6 +79,11 @@ public class SubscribableJmsChannelTests {
|
||||
|
||||
private Destination queue;
|
||||
|
||||
@BeforeClass
|
||||
public static void beforeClass() {
|
||||
System.setProperty("org.apache.activemq.SERIALIZABLE_PACKAGES", "*");
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setup() throws Exception {
|
||||
ActiveMQConnectionFactory targetConnectionFactory = new ActiveMQConnectionFactory();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
*
|
||||
* Licensed 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
|
||||
@@ -23,6 +23,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import javax.jms.JMSException;
|
||||
|
||||
import org.apache.log4j.Level;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.TestName;
|
||||
@@ -76,6 +77,11 @@ public class ExtractRequestReplyPayloadTests {
|
||||
@Autowired
|
||||
ChannelPublishingJmsMessageListener inboundGateway;
|
||||
|
||||
@BeforeClass
|
||||
public static void setup() {
|
||||
System.setProperty("org.apache.activemq.SERIALIZABLE_PACKAGES", "*");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOutboundInboundDefault() {
|
||||
this.outboundGateway.setExtractRequestPayload(true);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -21,6 +21,7 @@ import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.mockito.Mockito;
|
||||
import org.mockito.invocation.InvocationOnMock;
|
||||
@@ -44,6 +45,11 @@ import org.springframework.jms.listener.AbstractMessageListenerContainer;
|
||||
*/
|
||||
public class JmsChannelHistoryTests {
|
||||
|
||||
@BeforeClass
|
||||
public static void setup() {
|
||||
System.setProperty("org.apache.activemq.SERIALIZABLE_PACKAGES", "*");
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Test
|
||||
public void testMessageHistory() throws Exception{
|
||||
|
||||
Reference in New Issue
Block a user