diff --git a/build.gradle b/build.gradle index ecb5444eb2..ed38d9737f 100644 --- a/build.gradle +++ b/build.gradle @@ -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' diff --git a/spring-integration-jms/src/test/java/org/springframework/integration/jms/PollableJmsChannelTests.java b/spring-integration-jms/src/test/java/org/springframework/integration/jms/PollableJmsChannelTests.java index 969b829243..7859c0bc91 100644 --- a/spring-integration-jms/src/test/java/org/springframework/integration/jms/PollableJmsChannelTests.java +++ b/spring-integration-jms/src/test/java/org/springframework/integration/jms/PollableJmsChannelTests.java @@ -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("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 message = new AtomicReference(); 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 { } } + } diff --git a/spring-integration-jms/src/test/java/org/springframework/integration/jms/SubscribableJmsChannelTests.java b/spring-integration-jms/src/test/java/org/springframework/integration/jms/SubscribableJmsChannelTests.java index af8fa5d812..df2a2f53a8 100644 --- a/spring-integration-jms/src/test/java/org/springframework/integration/jms/SubscribableJmsChannelTests.java +++ b/spring-integration-jms/src/test/java/org/springframework/integration/jms/SubscribableJmsChannelTests.java @@ -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(); diff --git a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/ExtractRequestReplyPayloadTests.java b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/ExtractRequestReplyPayloadTests.java index a1b5ce236c..cd006bbcaf 100644 --- a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/ExtractRequestReplyPayloadTests.java +++ b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/ExtractRequestReplyPayloadTests.java @@ -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); diff --git a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsChannelHistoryTests.java b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsChannelHistoryTests.java index b5f0647c1b..474bf99697 100644 --- a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsChannelHistoryTests.java +++ b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsChannelHistoryTests.java @@ -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{