fixed RouterFactoryBean

This commit is contained in:
Mark Fisher
2011-12-20 17:05:25 -05:00
parent 03754b917a
commit 5fae7d2a1f
4 changed files with 65 additions and 6 deletions

View File

@@ -0,0 +1,34 @@
/*
* Copyright 2002-2011 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.router.config;
import java.util.Collection;
import org.springframework.integration.Message;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.router.AbstractMessageRouter;
/**
* @author Oleg Zhurakousky
*/
public class RfbFixRouter extends AbstractMessageRouter {
@Override
protected Collection<MessageChannel> determineTargetChannels(Message<?> message) {
return null;
}
}

View File

@@ -178,6 +178,11 @@ public class RouterParserTests {
verify(handler, times(1)).handleMessage(Mockito.any(Message.class));
}
@Test // should not fail
public void routerFactoryBeanTest(){
new ClassPathXmlApplicationContext("rfb-fix-config.xml", this.getClass());
}
public static class NonExistingChannelRouter{
public String route(String payload){
return "foo";

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int="http://www.springframework.org/schema/integration"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<int:router input-channel="input-channel" default-output-channel="discard-channel" ref="errorRouter"/>
<int:channel id="discard-channel"/>
<bean id="errorRouter" class="org.springframework.integration.router.config.RfbFixRouter"/>
</beans>