INT-3984: Fix the BFPPs order

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

The `PropertySourcesPlaceholderConfigurer implements BeanFactoryPostProcessor, PriorityOrdered`
meaning that it is run before any other regular `BeanFactoryPostProcessor`,
like the `IntegrationConfigurationBeanFactoryPostProcessor` has been before.
With such an order any `BeanDefinition` declaration from the `IntegrationConfigurationBeanFactoryPostProcessor` process
ended up without `PP` resolutions.

* Rework `IntegrationConfigurationBeanFactoryPostProcessor` to the `BeanDefinitionRegistryPostProcessor`,
which makes it be loaded as early as possible. See `PostProcessorRegistrationDelegate`:
````java
// Now, invoke the postProcessBeanFactory callback of all processors handled so far.
invokeBeanFactoryPostProcessors(registryPostProcessors, beanFactory);
invokeBeanFactoryPostProcessors(regularPostProcessors, beanFactory);
````

* Modify `EnableIntegrationTests` and `ChannelSecurityInterceptorSecuredChannelAnnotationTests` to ensure that the change
meets the `PP` and `SpEL` resolutions during bean definition phase.
* Fix the timing issue in the `JdbcMessageStoreChannelIntegrationTests`
This commit is contained in:
Artem Bilan
2016-04-10 12:35:36 -04:00
committed by Gary Russell
parent 1df7815148
commit b469e62c8a
5 changed files with 29 additions and 22 deletions

View File

@@ -94,7 +94,7 @@ public class JdbcMessageStoreChannelIntegrationTests {
@Test
public void testSendAndActivate() throws Exception {
input.send(new GenericMessage<String>("foo"));
Service.await(1000);
Service.await(10000);
assertEquals(1, Service.messages.size());
}
@@ -102,7 +102,7 @@ public class JdbcMessageStoreChannelIntegrationTests {
public void testSendAndActivateWithRollback() throws Exception {
Service.fail = true;
input.send(new GenericMessage<String>("foo"));
Service.await(1000);
Service.await(10000);
assertThat(Service.messages.size(), Matchers.greaterThanOrEqualTo(1));
// After a rollback in the poller the message is still waiting to be delivered
// but unless we use a transaction here there is a chance that the queue will
@@ -252,6 +252,7 @@ public class JdbcMessageStoreChannelIntegrationTests {
}
public static class Service {
private static boolean fail = false;
private static List<String> messages = new CopyOnWriteArrayList<String>();
@@ -278,6 +279,7 @@ public class JdbcMessageStoreChannelIntegrationTests {
}
return input;
}
}
}