Search in sources :

Example 1 with SimpleSequenceSizeReleaseStrategy

use of org.springframework.integration.aggregator.SimpleSequenceSizeReleaseStrategy in project spring-integration by spring-projects.

the class AggregatorAnnotationTests method testAnnotationWithCustomSettings.

@Test
public void testAnnotationWithCustomSettings() {
    ConfigurableApplicationContext context = new ClassPathXmlApplicationContext(new String[] { "classpath:/org/springframework/integration/config/annotation/testAnnotatedAggregator.xml" });
    final String endpointName = "endpointWithCustomizedAnnotation";
    MessageHandler aggregator = this.getAggregator(context, endpointName);
    assertTrue(getPropertyValue(aggregator, "releaseStrategy") instanceof SimpleSequenceSizeReleaseStrategy);
    assertEquals("outputChannel", getPropertyValue(aggregator, "outputChannelName"));
    assertEquals("discardChannel", getPropertyValue(aggregator, "discardChannelName"));
    assertEquals(98765432L, getPropertyValue(aggregator, "messagingTemplate.sendTimeout"));
    assertEquals(true, getPropertyValue(aggregator, "sendPartialResultOnExpiry"));
    context.close();
}
Also used : ConfigurableApplicationContext(org.springframework.context.ConfigurableApplicationContext) MessageHandler(org.springframework.messaging.MessageHandler) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) SimpleSequenceSizeReleaseStrategy(org.springframework.integration.aggregator.SimpleSequenceSizeReleaseStrategy) Test(org.junit.Test)

Example 2 with SimpleSequenceSizeReleaseStrategy

use of org.springframework.integration.aggregator.SimpleSequenceSizeReleaseStrategy in project spring-integration by spring-projects.

the class AggregatorAnnotationTests method testAnnotationWithDefaultSettings.

@Test
public void testAnnotationWithDefaultSettings() {
    ConfigurableApplicationContext context = new ClassPathXmlApplicationContext(new String[] { "classpath:/org/springframework/integration/config/annotation/testAnnotatedAggregator.xml" });
    final String endpointName = "endpointWithDefaultAnnotation";
    MessageHandler aggregator = this.getAggregator(context, endpointName);
    assertTrue(getPropertyValue(aggregator, "releaseStrategy") instanceof SimpleSequenceSizeReleaseStrategy);
    assertNull(getPropertyValue(aggregator, "outputChannel"));
    assertTrue(getPropertyValue(aggregator, "discardChannel") instanceof NullChannel);
    assertEquals(-1L, getPropertyValue(aggregator, "messagingTemplate.sendTimeout"));
    assertEquals(false, getPropertyValue(aggregator, "sendPartialResultOnExpiry"));
    context.close();
}
Also used : ConfigurableApplicationContext(org.springframework.context.ConfigurableApplicationContext) MessageHandler(org.springframework.messaging.MessageHandler) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) SimpleSequenceSizeReleaseStrategy(org.springframework.integration.aggregator.SimpleSequenceSizeReleaseStrategy) NullChannel(org.springframework.integration.channel.NullChannel) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 ConfigurableApplicationContext (org.springframework.context.ConfigurableApplicationContext)2 ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)2 SimpleSequenceSizeReleaseStrategy (org.springframework.integration.aggregator.SimpleSequenceSizeReleaseStrategy)2 MessageHandler (org.springframework.messaging.MessageHandler)2 NullChannel (org.springframework.integration.channel.NullChannel)1