INT-3589: Upgrade Dependencies

JIRA: https://jira.spring.io/browse/INT-3589, https://jira.spring.io/browse/INT-3624

* SF - 4.2. Fix Breaking changes for the `ApplicationEventPublisher`
* AMQP 1.5. Without issues
* Reactor - 2.0. Fix for the new `Stream` foundation
* jsonPath - 1.2.0. Fix for new `Predicate` abstraction. Add 'fail-fast error' to the `IntegrationRegistrar`
* Sshd - 0.13.0. Fix for new `VirtualFileSystemFactory` usage
* Spring Data - Fowler
* And others without issues
* Get rid of `reactor.util.StringUtils` usage

INT-3589: Address PR comments

Polishing
This commit is contained in:
Artem Bilan
2015-02-17 13:34:59 +02:00
committed by Gary Russell
parent b07686cdc0
commit f248394682
37 changed files with 312 additions and 245 deletions

View File

@@ -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.
@@ -225,7 +225,8 @@ public class ApplicationEventListeningMessageProducerTests {
ConfigurableListableBeanFactory beanFactory = ctx.getBeanFactory();
QueueChannel channel = new QueueChannel();
ApplicationEventListeningMessageProducer listenerMessageProducer = new ApplicationEventListeningMessageProducer();
ApplicationEventListeningMessageProducer listenerMessageProducer =
new ApplicationEventListeningMessageProducer();
listenerMessageProducer.setOutputChannel(channel);
listenerMessageProducer.setEventTypes(TestApplicationEvent2.class);
beanFactory.registerSingleton("testListenerMessageProducer", listenerMessageProducer);
@@ -236,7 +237,8 @@ public class ApplicationEventListeningMessageProducerTests {
ctx.refresh();
ApplicationEventMulticaster multicaster =
ctx.getBean(AbstractApplicationContext.APPLICATION_EVENT_MULTICASTER_BEAN_NAME, ApplicationEventMulticaster.class);
ctx.getBean(AbstractApplicationContext.APPLICATION_EVENT_MULTICASTER_BEAN_NAME,
ApplicationEventMulticaster.class);
Map<?, ?> retrieverCache = TestUtils.getPropertyValue(multicaster, "retrieverCache", Map.class);
ctx.publishEvent(new TestApplicationEvent1());
@@ -246,10 +248,11 @@ public class ApplicationEventListeningMessageProducerTests {
* event if not supported.
*/
assertEquals(2, retrieverCache.size());
for (Object key : retrieverCache.keySet()) {
Class<? extends ApplicationEvent> event = TestUtils.getPropertyValue(key, "eventType", Class.class);
for (Map.Entry<?, ?> entry : retrieverCache.entrySet()) {
Class<? extends ApplicationEvent> event = TestUtils.getPropertyValue(entry.getKey(), "eventType.resolved",
Class.class);
assertThat(event, Matchers.is(Matchers.isOneOf(ContextRefreshedEvent.class, TestApplicationEvent1.class)));
Set<?> listeners = TestUtils.getPropertyValue(retrieverCache.get(key), "applicationListenerBeans", Set.class);
Set<?> listeners = TestUtils.getPropertyValue(entry.getValue(), "applicationListenerBeans", Set.class);
assertEquals(1, listeners.size());
assertEquals("testListener", listeners.iterator().next());
}
@@ -257,19 +260,21 @@ public class ApplicationEventListeningMessageProducerTests {
TestApplicationEvent2 event2 = new TestApplicationEvent2();
ctx.publishEvent(event2);
assertEquals(3, retrieverCache.size());
for (Object key : retrieverCache.keySet()) {
Class<?> event = TestUtils.getPropertyValue(key, "eventType", Class.class);
for (Map.Entry<?, ?> entry : retrieverCache.entrySet()) {
Class<?> event = TestUtils.getPropertyValue(entry.getKey(), "eventType.resolved", Class.class);
if (TestApplicationEvent2.class.isAssignableFrom(event)) {
Set<?> listeners = TestUtils.getPropertyValue(retrieverCache.get(key), "applicationListenerBeans", Set.class);
Set<?> listeners = TestUtils.getPropertyValue(entry.getValue(), "applicationListenerBeans", Set.class);
assertEquals(2, listeners.size());
for (Object listener : listeners) {
assertThat((String) listener, Matchers.is(Matchers.isOneOf("testListenerMessageProducer", "testListener")));
assertThat((String) listener,
Matchers.is(Matchers.isOneOf("testListenerMessageProducer", "testListener")));
}
break;
}
}
ctx.publishEvent(new ApplicationEvent("Some event") {});
ctx.publishEvent(new ApplicationEvent("Some event") {
});
assertEquals(4, listenerCounter.get());
@@ -286,6 +291,7 @@ public class ApplicationEventListeningMessageProducerTests {
public TestApplicationEvent1() {
super("event1");
}
}
@SuppressWarnings("serial")
@@ -294,6 +300,7 @@ public class ApplicationEventListeningMessageProducerTests {
public TestApplicationEvent2() {
super("event2");
}
}
@SuppressWarnings("serial")
@@ -302,6 +309,7 @@ public class ApplicationEventListeningMessageProducerTests {
public TestMessagingEvent(Message<?> message) {
super(message);
}
}
private static class TestApplicationListener implements ApplicationListener<ApplicationEvent> {
@@ -315,6 +323,7 @@ public class ApplicationEventListeningMessageProducerTests {
public void onApplicationEvent(ApplicationEvent event) {
this.counter.incrementAndGet();
}
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 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.
@@ -23,9 +23,8 @@ import org.junit.Test;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.messaging.Message;
import org.springframework.integration.event.core.MessagingEvent;
import org.springframework.integration.event.outbound.ApplicationEventPublishingMessageHandler;
import org.springframework.messaging.Message;
import org.springframework.messaging.support.GenericMessage;
/**
@@ -56,7 +55,7 @@ public class ApplicationEventPublishingMessageHandlerTests {
handler.handleMessage(message);
ApplicationEvent event = publisher.getLastEvent();
assertEquals(TestEvent.class, event.getClass());
assertEquals("foo", ((TestEvent) event).getSource());
assertEquals("foo", ((TestEvent) event).getSource());
}
@@ -68,9 +67,16 @@ public class ApplicationEventPublishingMessageHandlerTests {
return this.lastEvent;
}
@Override
public void publishEvent(ApplicationEvent event) {
this.lastEvent = event;
}
@Override
public void publishEvent(Object event) {
}
}