File tree 2 files changed +14
-6
lines changed
spring-integration-rmi/src/test/java/org/springframework/integration/rmi/config
2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 16
16
17
17
<channel id =" testErrorChannel" />
18
18
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}" />
20
21
21
22
<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}" />
23
25
24
26
<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}" />
26
29
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}" />
28
32
29
33
<rmi : inbound-gateway id =" gatewayWithExecutorRef"
30
34
request-channel =" testChannel"
31
35
remote-invocation-executor =" invocationExecutor"
32
- auto-startup =" false" />
36
+ auto-startup =" false"
37
+ registry-port =" #{T(org.springframework.integration.rmi.config.RmiInboundGatewayParserTests).PORT}" />
33
38
34
39
<beans : bean id =" invocationExecutor"
35
40
class=" org.springframework.integration.rmi.config.StubRemoteInvocationExecutor" />
Original file line number Diff line number Diff line change 29
29
import org .springframework .messaging .MessageChannel ;
30
30
import org .springframework .test .annotation .DirtiesContext ;
31
31
import org .springframework .test .context .junit4 .SpringRunner ;
32
+ import org .springframework .util .SocketUtils ;
32
33
33
34
/**
34
35
* @author Mark Fisher
39
40
@ DirtiesContext
40
41
public class RmiInboundGatewayParserTests {
41
42
43
+ public static final int PORT = SocketUtils .findAvailableTcpPort ();
44
+
42
45
@ Autowired
43
46
@ Qualifier ("testChannel" )
44
47
private MessageChannel channel ;
@@ -78,7 +81,7 @@ public void gatewayWithHost() {
78
81
@ Test
79
82
public void gatewayWithPort () {
80
83
RmiInboundGateway gateway = (RmiInboundGateway ) context .getBean ("gatewayWithPort" );
81
- assertThat (TestUtils .getPropertyValue (gateway , "registryPort" )).isEqualTo (1234 );
84
+ assertThat (TestUtils .getPropertyValue (gateway , "registryPort" )).isEqualTo (PORT );
82
85
}
83
86
84
87
@ Test
You can’t perform that action at this time.
0 commit comments