INT-3789: Upgrade to SF 4.2 and other fixes
JIRA: https://jira.spring.io/browse/INT-3789 * Hazelcast -> `3.5.1` * ActiveMq -> `5.11.1` * Boon -> `0.33` * Spring Security -> `4.0.2` * Kryo -> `3.0.3` * Fix missed polishing for the `Log4jLevelAdjuster` according required generics: https://build.spring.io/browse/INT-MJATS41-348 * Fix `ImapIdelIntegrationTests` sporadic failure * Fix `Kryo` Codec stuff according to the changes in the latest Kryo version
This commit is contained in:
12
build.gradle
12
build.gradle
@@ -82,10 +82,10 @@ subprojects { subproject ->
|
||||
|
||||
|
||||
ext {
|
||||
activeMqVersion = '5.11.0'
|
||||
activeMqVersion = '5.11.1'
|
||||
aspectjVersion = '1.8.4'
|
||||
apacheSshdVersion = '0.13.0'
|
||||
boonVersion = '0.31'
|
||||
boonVersion = '0.33'
|
||||
chronicleVersion = '3.4.3'
|
||||
commonsDbcpVersion = '1.4'
|
||||
commonsIoVersion = '2.4'
|
||||
@@ -97,7 +97,7 @@ subprojects { subproject ->
|
||||
groovyVersion = '2.4.4'
|
||||
guavaVersion = '18.0'
|
||||
hamcrestVersion = '1.3'
|
||||
hazelcastVersion = '3.4.2'
|
||||
hazelcastVersion = '3.5.1'
|
||||
hibernateVersion = '4.3.10.Final'
|
||||
hsqldbVersion = '2.3.2'
|
||||
h2Version = '1.4.180'
|
||||
@@ -113,7 +113,7 @@ subprojects { subproject ->
|
||||
jsonpathVersion = '2.0.0'
|
||||
junitVersion = '4.11'
|
||||
jythonVersion = '2.5.3'
|
||||
kryoShadedVersion = '3.0.0'
|
||||
kryoShadedVersion = '3.0.3'
|
||||
log4jVersion = '1.2.17'
|
||||
mockitoVersion = '1.9.5'
|
||||
mysqlVersion = '5.1.34'
|
||||
@@ -136,10 +136,10 @@ subprojects { subproject ->
|
||||
springDataMongoVersion = '1.7.2.RELEASE'
|
||||
springDataRedisVersion = '1.5.2.RELEASE'
|
||||
springGemfireVersion = '1.6.0.RELEASE'
|
||||
springSecurityVersion = project.hasProperty('springSecurityVersion') ? project.springSecurityVersion : '4.0.1.RELEASE'
|
||||
springSecurityVersion = project.hasProperty('springSecurityVersion') ? project.springSecurityVersion : '4.0.2.RELEASE'
|
||||
springSocialTwitterVersion = '1.1.0.RELEASE'
|
||||
springRetryVersion = '1.1.2.RELEASE'
|
||||
springVersion = project.hasProperty('springVersion') ? project.springVersion : '4.2.0.BUILD-SNAPSHOT'
|
||||
springVersion = project.hasProperty('springVersion') ? project.springVersion : '4.2.0.RELEASE'
|
||||
springWsVersion = '2.2.1.RELEASE'
|
||||
xmlUnitVersion = '1.5'
|
||||
xstreamVersion = '1.4.7'
|
||||
|
||||
@@ -19,6 +19,8 @@ package org.springframework.integration.codec.kryo;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.objenesis.strategy.StdInstantiatorStrategy;
|
||||
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import com.esotericsoftware.kryo.Kryo;
|
||||
@@ -31,6 +33,7 @@ import com.esotericsoftware.kryo.io.Output;
|
||||
* {@link KryoRegistrar}s.
|
||||
*
|
||||
* @author David Turanski
|
||||
* @author Artem Bilan
|
||||
* @since 4.2
|
||||
*/
|
||||
public class PojoCodec extends AbstractKryoCodec {
|
||||
@@ -96,6 +99,7 @@ public class PojoCodec extends AbstractKryoCodec {
|
||||
|
||||
@Override
|
||||
protected void configureKryoInstance(Kryo kryo) {
|
||||
kryo.setInstantiatorStrategy(new Kryo.DefaultInstantiatorStrategy(new StdInstantiatorStrategy()));
|
||||
if (this.kryoRegistrar != null) {
|
||||
this.kryoRegistrar.registerTypes(kryo);
|
||||
}
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
/*
|
||||
* Copyright 2015 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
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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.
|
||||
* 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.springframework.integration.codec;
|
||||
package org.springframework.integration.codec.kryo;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -25,7 +25,8 @@ import java.util.Map;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.integration.codec.kryo.PojoCodec;
|
||||
import org.springframework.integration.codec.Codec;
|
||||
import org.springframework.integration.codec.CompositeCodec;
|
||||
|
||||
/**
|
||||
* @author David Turanski
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -16,21 +16,23 @@
|
||||
package org.springframework.integration.mail.config;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Mockito.doAnswer;
|
||||
import static org.mockito.Mockito.doReturn;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.spy;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import javax.mail.Folder;
|
||||
import javax.mail.Message;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.mockito.Mockito;
|
||||
import org.mockito.invocation.InvocationOnMock;
|
||||
import org.mockito.stubbing.Answer;
|
||||
|
||||
@@ -39,13 +41,15 @@ import org.springframework.integration.mail.ImapIdleChannelAdapter;
|
||||
import org.springframework.integration.mail.ImapMailReceiver;
|
||||
import org.springframework.integration.test.util.TestUtils;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
|
||||
/**
|
||||
* @author Oleg Zhurakousky
|
||||
* @author Artem Bilan
|
||||
*/
|
||||
public class ImapIdelIntegrationTests {
|
||||
public class ImapIdleIntegrationTests {
|
||||
|
||||
@Test
|
||||
public void testWithTransactionSynchronization() throws Exception{
|
||||
public void testWithTransactionSynchronization() throws Exception {
|
||||
final AtomicBoolean block = new AtomicBoolean(false);
|
||||
ClassPathXmlApplicationContext context =
|
||||
new ClassPathXmlApplicationContext("imap-idle-mock-integration-config.xml", this.getClass());
|
||||
@@ -61,7 +65,7 @@ public class ImapIdelIntegrationTests {
|
||||
// to emulate the behavior of IDLE
|
||||
|
||||
public Object answer(InvocationOnMock invocation) throws Throwable {
|
||||
if (block.get()){
|
||||
if (block.get()) {
|
||||
Thread.sleep(5000);
|
||||
}
|
||||
block.set(true);
|
||||
@@ -83,17 +87,29 @@ public class ImapIdelIntegrationTests {
|
||||
mrField.set(adapter, receiver);
|
||||
// end mock setup
|
||||
|
||||
final CountDownLatch txProcessorLatch = new CountDownLatch(1);
|
||||
doAnswer(new Answer<Object>() {
|
||||
|
||||
@Override
|
||||
public Object answer(InvocationOnMock invocation) throws Throwable {
|
||||
txProcessorLatch.countDown();
|
||||
return null;
|
||||
}
|
||||
|
||||
}).when(processor).process(any(Message.class));
|
||||
|
||||
adapter.start();
|
||||
|
||||
Thread.sleep(1000);
|
||||
// validating that TXpost processor was invoked
|
||||
assertTrue(txProcessorLatch.await(10, TimeUnit.SECONDS));
|
||||
|
||||
adapter.stop();
|
||||
context.destroy();
|
||||
verify(processor, Mockito.times(1)).process(m1);
|
||||
|
||||
}
|
||||
|
||||
public static interface PostTransactionProcessor {
|
||||
public void process(Message mailMessage);
|
||||
public interface PostTransactionProcessor {
|
||||
|
||||
void process(Message mailMessage);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,8 @@
|
||||
</int:transaction-synchronization-factory>
|
||||
|
||||
<bean id="syncProcessor" class="org.mockito.Mockito" factory-method="mock">
|
||||
<constructor-arg value="org.springframework.integration.mail.config.ImapIdelIntegrationTests.PostTransactionProcessor"/>
|
||||
<constructor-arg
|
||||
value="org.springframework.integration.mail.config.ImapIdleIntegrationTests.PostTransactionProcessor"/>
|
||||
</bean>
|
||||
|
||||
<bean id="transactionManager" class="org.springframework.integration.transaction.PseudoTransactionManager"/>
|
||||
|
||||
@@ -56,7 +56,7 @@ public class Log4jLevelAdjuster implements MethodRule {
|
||||
|
||||
public Log4jLevelAdjuster(Level level, String... categories) {
|
||||
this.level = level;
|
||||
this.classes = new Class[0];
|
||||
this.classes = new Class<?>[0];
|
||||
this.categories = categories;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user