File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
spring-integration-rmi/src/test/java/org/springframework/integration/rmi/config Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 1616
1717 <channel id =" testErrorChannel" />
1818
19- <rmi : inbound-gateway id =" gatewayWithDefaults" request-channel =" testChannel" auto-startup =" false" />
19+ <rmi : inbound-gateway id =" gatewayWithDefaults" request-channel =" testChannel" auto-startup =" false"
20+ registry-port =" #{T(org.springframework.integration.rmi.config.RmiInboundGatewayParserTests).PORT}" />
2021
2122 <rmi : inbound-gateway id =" gatewayWithCustomProperties" request-channel =" testChannel"
22- expect-reply =" false" request-timeout =" 123" reply-timeout =" 456" auto-startup =" false" />
23+ expect-reply =" false" request-timeout =" 123" reply-timeout =" 456" auto-startup =" false"
24+ registry-port =" #{T(org.springframework.integration.rmi.config.RmiInboundGatewayParserTests).PORT}" />
2325
2426 <rmi : inbound-gateway id =" gatewayWithHostAndErrorChannel" request-channel =" testChannel" registry-host =" localhost"
25- error-channel =" testErrorChannel" auto-startup =" false" />
27+ error-channel =" testErrorChannel" auto-startup =" false"
28+ registry-port =" #{T(org.springframework.integration.rmi.config.RmiInboundGatewayParserTests).PORT}" />
2629
27- <rmi : inbound-gateway id =" gatewayWithPort" request-channel =" testChannel" registry-port =" 1234" auto-startup =" false" />
30+ <rmi : inbound-gateway id =" gatewayWithPort" request-channel =" testChannel" auto-startup =" false"
31+ registry-port =" #{T(org.springframework.integration.rmi.config.RmiInboundGatewayParserTests).PORT}" />
2832
2933 <rmi : inbound-gateway id =" gatewayWithExecutorRef"
3034 request-channel =" testChannel"
3135 remote-invocation-executor =" invocationExecutor"
32- auto-startup =" false" />
36+ auto-startup =" false"
37+ registry-port =" #{T(org.springframework.integration.rmi.config.RmiInboundGatewayParserTests).PORT}" />
3338
3439 <beans : bean id =" invocationExecutor"
3540 class=" org.springframework.integration.rmi.config.StubRemoteInvocationExecutor" />
Original file line number Diff line number Diff line change 2929import org .springframework .messaging .MessageChannel ;
3030import org .springframework .test .annotation .DirtiesContext ;
3131import org .springframework .test .context .junit4 .SpringRunner ;
32+ import org .springframework .util .SocketUtils ;
3233
3334/**
3435 * @author Mark Fisher
3940@ DirtiesContext
4041public class RmiInboundGatewayParserTests {
4142
43+ public static final int PORT = SocketUtils .findAvailableTcpPort ();
44+
4245 @ Autowired
4346 @ Qualifier ("testChannel" )
4447 private MessageChannel channel ;
@@ -78,7 +81,7 @@ public void gatewayWithHost() {
7881 @ Test
7982 public void gatewayWithPort () {
8083 RmiInboundGateway gateway = (RmiInboundGateway ) context .getBean ("gatewayWithPort" );
81- assertThat (TestUtils .getPropertyValue (gateway , "registryPort" )).isEqualTo (1234 );
84+ assertThat (TestUtils .getPropertyValue (gateway , "registryPort" )).isEqualTo (PORT );
8285 }
8386
8487 @ Test
You can’t perform that action at this time.
0 commit comments