Polishing
This commit is contained in:
parent
304c85ec70
commit
605e2477b9
|
@ -34,8 +34,8 @@ import org.springframework.util.StringValueResolver;
|
|||
*
|
||||
* <p>As of Spring 3.1, {@link org.springframework.context.support.PropertySourcesPlaceholderConfigurer
|
||||
* PropertySourcesPlaceholderConfigurer} should be used preferentially over this implementation; it is
|
||||
* more flexible through taking advantage of the {@link org.springframework.core.env.Environment Environment} and
|
||||
* {@link org.springframework.core.env.PropertySource PropertySource} mechanisms also made available in Spring 3.1.
|
||||
* more flexible through taking advantage of the {@link org.springframework.core.env.Environment} and
|
||||
* {@link org.springframework.core.env.PropertySource} mechanisms also made available in Spring 3.1.
|
||||
*
|
||||
* <p>{@link PropertyPlaceholderConfigurer} is still appropriate for use when:
|
||||
* <ul>
|
||||
|
@ -118,8 +118,8 @@ public class PropertyPlaceholderConfigurer extends PlaceholderConfigurerSupport
|
|||
* to pass external values in as JVM system properties: This can easily be
|
||||
* achieved in a startup script, even for existing environment variables.
|
||||
* @see #setSystemPropertiesMode
|
||||
* @see java.lang.System#getProperty(String)
|
||||
* @see java.lang.System#getenv(String)
|
||||
* @see System#getProperty(String)
|
||||
* @see System#getenv(String)
|
||||
*/
|
||||
public void setSearchSystemEnvironment(boolean searchSystemEnvironment) {
|
||||
this.searchSystemEnvironment = searchSystemEnvironment;
|
||||
|
|
|
@ -445,27 +445,23 @@ public class MessageBrokerBeanDefinitionParserTests {
|
|||
}
|
||||
|
||||
|
||||
private void testChannel(String channelName, List<Class<? extends MessageHandler>> subscriberTypes,
|
||||
int interceptorCount) {
|
||||
private void testChannel(
|
||||
String channelName, List<Class<? extends MessageHandler>> subscriberTypes, int interceptorCount) {
|
||||
|
||||
AbstractSubscribableChannel channel = this.appContext.getBean(channelName, AbstractSubscribableChannel.class);
|
||||
|
||||
for (Class<? extends MessageHandler> subscriberType : subscriberTypes) {
|
||||
MessageHandler subscriber = this.appContext.getBean(subscriberType);
|
||||
assertNotNull("No subscription for " + subscriberType, subscriber);
|
||||
assertTrue(channel.hasSubscription(subscriber));
|
||||
}
|
||||
|
||||
List<ChannelInterceptor> interceptors = channel.getInterceptors();
|
||||
assertEquals(interceptorCount, interceptors.size());
|
||||
assertEquals(ImmutableMessageChannelInterceptor.class, interceptors.get(interceptors.size()-1).getClass());
|
||||
}
|
||||
|
||||
private void testExecutor(String channelName, int corePoolSize, int maxPoolSize, int keepAliveSeconds) {
|
||||
|
||||
ThreadPoolTaskExecutor taskExecutor =
|
||||
this.appContext.getBean(channelName + "Executor", ThreadPoolTaskExecutor.class);
|
||||
|
||||
assertEquals(corePoolSize, taskExecutor.getCorePoolSize());
|
||||
assertEquals(maxPoolSize, taskExecutor.getMaxPoolSize());
|
||||
assertEquals(keepAliveSeconds, taskExecutor.getKeepAliveSeconds());
|
||||
|
@ -483,6 +479,7 @@ public class MessageBrokerBeanDefinitionParserTests {
|
|||
return (handler instanceof WebSocketHandlerDecorator) ?
|
||||
((WebSocketHandlerDecorator) handler).getLastHandler() : handler;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -509,7 +506,6 @@ class CustomReturnValueHandler implements HandlerMethodReturnValueHandler {
|
|||
|
||||
@Override
|
||||
public void handleReturnValue(Object returnValue, MethodParameter returnType, Message<?> message) throws Exception {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -540,12 +536,15 @@ class TestWebSocketHandlerDecorator extends WebSocketHandlerDecorator {
|
|||
class TestStompErrorHandler extends StompSubProtocolErrorHandler {
|
||||
}
|
||||
|
||||
|
||||
class TestValidator implements Validator {
|
||||
|
||||
@Override
|
||||
public boolean supports(Class<?> clazz) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(@Nullable Object target, Errors errors) { }
|
||||
public void validate(@Nullable Object target, Errors errors) {
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue