INT-3631: Fix package tangle for ScatterGatherH

JIRA: https://jira.spring.io/browse/INT-3631

In addition add logging and SOUT hooks for `EnableIntegrationTests` to have more info for investigation of failures on CI like
https://build.spring.io/browse/INT-MJATS41-JOB1-233
This commit is contained in:
Artem Bilan
2015-02-11 15:56:14 +02:00
committed by Gary Russell
parent 195ee70568
commit bc509da062
8 changed files with 61 additions and 16 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014 the original author or authors.
* Copyright 2014-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.
@@ -27,7 +27,7 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.integration.handler.ScatterGatherHandler;
import org.springframework.integration.scattergather.ScatterGatherHandler;
import org.springframework.integration.router.RecipientListRouter;
import org.springframework.util.StringUtils;
import org.springframework.util.xml.DomUtils;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014 the original author or authors.
* Copyright 2014-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.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.integration.handler;
package org.springframework.integration.scattergather;
import org.springframework.aop.support.AopUtils;
import org.springframework.context.Lifecycle;
@@ -26,6 +26,7 @@ import org.springframework.integration.core.MessageProducer;
import org.springframework.integration.endpoint.AbstractEndpoint;
import org.springframework.integration.endpoint.EventDrivenConsumer;
import org.springframework.integration.endpoint.PollingConsumer;
import org.springframework.integration.handler.AbstractReplyProducingMessageHandler;
import org.springframework.integration.router.RecipientListRouter;
import org.springframework.integration.support.channel.HeaderChannelRegistry;
import org.springframework.messaging.Message;

View File

@@ -0,0 +1,4 @@
/**
* Provides classes supporting the Scatter-Gather pattern.
*/
package org.springframework.integration.scattergather;

View File

@@ -42,7 +42,13 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import org.aopalliance.intercept.MethodInterceptor;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.log4j.Level;
import org.apache.log4j.LogManager;
import org.hamcrest.Matchers;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -137,6 +143,8 @@ import reactor.spring.context.config.EnableReactor;
@DirtiesContext
public class EnableIntegrationTests {
private final Log logger = LogFactory.getLog(EnableIntegrationTests.class);
@Autowired
private ApplicationContext context;
@@ -255,6 +263,19 @@ public class EnableIntegrationTests {
@Autowired
private MessageChannel controlBusChannel;
private static Level existingLogLevel;
// The temporal hooks to investigate CI failures
@BeforeClass
public static void setup() {
existingLogLevel = LogManager.getLogger("org.springframework.integration").getLevel();
LogManager.getLogger("org.springframework.integration").setLevel(Level.DEBUG);
}
@AfterClass
public static void tearDown() {
LogManager.getLogger("org.springframework.integration").setLevel(existingLogLevel);
}
@Test
public void testAnnotatedServiceActivator() {
@@ -296,6 +317,9 @@ public class EnableIntegrationTests {
assertEquals(10L, TestUtils.getPropertyValue(trigger, "period"));
assertFalse(TestUtils.getPropertyValue(trigger, "fixedRate", Boolean.class));
// Markers to investigate the failures on CI
logger.debug("----SEND Message to 'input' channel----");
this.input.send(MessageBuilder.withPayload("Foo").build());
Message<?> interceptedMessage = this.wireTapChannel.receive(10000);
@@ -314,7 +338,10 @@ public class EnableIntegrationTests {
Matchers.containsString("annotationTestService.handle.serviceActivator.handler"));
assertThat(messageHistoryString, Matchers.not(Matchers.containsString("output")));
receive = this.publishedChannel.receive(1000);
receive = this.publishedChannel.receive(10000);
logger.debug("----RECEIVE Message from 'publishedChannel' channel----" + receive);
assertNotNull(receive);
assertEquals("foo", receive.getPayload());
@@ -694,7 +721,10 @@ public class EnableIntegrationTests {
@Override
public Message<?> preSend(Message<?> message, MessageChannel channel) {
fbInterceptorCounter().incrementAndGet();
return super.preSend(message, channel);
Message<?> message1 = super.preSend(message, channel);
logger.debug("!!!!'ciFactoryBean': the result of 'preSend' on '" + channel + "' '" +
message1 + "'");
return message1;
}
};
}
@@ -801,11 +831,15 @@ public class EnableIntegrationTests {
@GlobalChannelInterceptor
public static class TestChannelInterceptor extends ChannelInterceptorAdapter {
private final Log logger = LogFactory.getLog(TestChannelInterceptor.class);
private final AtomicInteger invoked = new AtomicInteger();
@Override
public Message<?> preSend(Message<?> message, MessageChannel channel) {
this.invoked.incrementAndGet();
logger.debug("!!!!'TestChannelInterceptor': the result of 'preSend' on '" + channel + "' '" +
message + "'");
return message;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014 the original author or authors.
* Copyright 2014-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.
@@ -33,7 +33,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.integration.aggregator.AggregatingMessageHandler;
import org.springframework.integration.channel.FixedSubscriberChannel;
import org.springframework.integration.endpoint.EventDrivenConsumer;
import org.springframework.integration.handler.ScatterGatherHandler;
import org.springframework.integration.scattergather.ScatterGatherHandler;
import org.springframework.integration.router.RecipientListRouter;
import org.springframework.integration.test.util.TestUtils;
import org.springframework.messaging.MessageHandler;

View File

@@ -2,6 +2,6 @@ log4j.rootCategory=WARN, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %c{1} [%t] : %m%n
log4j.appender.stdout.layout.ConversionPattern=%d %p %c{1} [%t] : %m%n
log4j.category.org.springframework.integration=WARN

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014 the original author or authors.
* Copyright 2014-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.
@@ -26,8 +26,6 @@ import java.util.Arrays;
import java.util.List;
import java.util.concurrent.Executors;
import javax.management.MBeanServer;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -48,7 +46,7 @@ import org.springframework.integration.channel.QueueChannel;
import org.springframework.integration.config.EnableIntegration;
import org.springframework.integration.handler.AbstractReplyProducingMessageHandler;
import org.springframework.integration.handler.BridgeHandler;
import org.springframework.integration.handler.ScatterGatherHandler;
import org.springframework.integration.scattergather.ScatterGatherHandler;
import org.springframework.integration.jmx.config.EnableIntegrationMBeanExport;
import org.springframework.integration.router.RecipientListRouter;
import org.springframework.integration.store.SimpleMessageStore;

View File

@@ -25,11 +25,19 @@
<section id="4.2-file-outbound-channel-adapter">
<title>File Outbound Channel Adapter</title>
<para>
The <code>&lt;int-file:outbound-channel-adapter&gt;</code> and
The <code>&lt;int-file:outbound-channel-adapter&gt;</code> and
<code>&lt;int-file:outbound-gateway&gt;</code> now support an <code>append-new-line</code> attribute.
If set to <code>true</code>, a new line is appended to the file after a message is written.
If set to <code>true</code>, a new line is appended to the file after a message is written.
The default attribute value is <code>false</code>.
</para>
</section>
</section>
<section>
<title>Class Package Change</title>
<para>
The <classname>ScatterGatherHandler</classname> class has been moved from the
<code>org.springframework.integration.handler</code> to the
<code>org.springframework.integration.scattergather</code>.
</para>
</section>
</section>
</chapter>