Skip to content

Commit

Permalink
change unit port (apache#2513)
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrick-zhu authored Sep 17, 2018
1 parent bcc3e74 commit fbf4be9
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public void testDelayFixedTime() throws Exception {
}
assertNotNull(urls);
assertEquals(1, urls.size());
assertEquals("dubbo://" + NetUtils.getLocalHost() + ":20883/org.apache.dubbo.config.spring.api.DemoService", urls.get(0).toIdentityString());
assertEquals("dubbo://" + NetUtils.getLocalHost() + ":20888/org.apache.dubbo.config.spring.api.DemoService", urls.get(0).toIdentityString());
} finally {
ctx.stop();
ctx.close();
Expand All @@ -262,7 +262,7 @@ public void testDelayOnInitialized() throws Exception {
List<URL> urls = registryService.getRegistered().get("org.apache.dubbo.config.spring.api.DemoService");
assertNotNull(urls);
assertEquals(1, urls.size());
assertEquals("dubbo://" + NetUtils.getLocalHost() + ":20883/org.apache.dubbo.config.spring.api.DemoService", urls.get(0).toIdentityString());
assertEquals("dubbo://" + NetUtils.getLocalHost() + ":20888/org.apache.dubbo.config.spring.api.DemoService", urls.get(0).toIdentityString());
} finally {
ctx.stop();
ctx.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<dubbo:registry address="N/A"/>

<dubbo:protocol name="dubbo" port="20883"/>
<dubbo:protocol name="dubbo" port="20888"/>

<dubbo:service interface="org.apache.dubbo.config.spring.api.DemoService" ref="demoService" delay="300"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<dubbo:registry address="127.0.0.1:4548"/>

<!-- protocol configuration -->
<dubbo:protocol name="dubbo" port="20883"/>
<dubbo:protocol name="dubbo" port="20888"/>

<!-- service configuration -->
<dubbo:service interface="org.apache.dubbo.config.spring.api.DemoService" ref="demoService" delay="-1"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void setUp() {
mockChannel.removeAttribute("telnet.service");
givenLastCall();
given(mockInvoker.getInterface()).willReturn(DemoService.class);
given(mockInvoker.getUrl()).willReturn(URL.valueOf("dubbo://127.0.0.1:20883/demo"));
given(mockInvoker.getUrl()).willReturn(URL.valueOf("dubbo://127.0.0.1:20884/demo"));
}

private void givenLastCall() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ public void after() {
public void testInvokeDefaultSService() throws RemotingException {
mockInvoker = mock(Invoker.class);
given(mockInvoker.getInterface()).willReturn(DemoService.class);
given(mockInvoker.getUrl()).willReturn(URL.valueOf("dubbo://127.0.0.1:20883/demo"));
given(mockInvoker.getUrl()).willReturn(URL.valueOf("dubbo://127.0.0.1:20886/demo"));
given(mockInvoker.invoke(any(Invocation.class))).willReturn(new RpcResult("ok"));
mockChannel = mock(Channel.class);
given(mockChannel.getAttribute("telnet.service")).willReturn("org.apache.dubbo.rpc.protocol.dubbo.support.DemoService");
given(mockChannel.getLocalAddress()).willReturn(NetUtils.toAddress("127.0.0.1:5555"));
given(mockChannel.getRemoteAddress()).willReturn(NetUtils.toAddress("127.0.0.1:20883"));
given(mockChannel.getRemoteAddress()).willReturn(NetUtils.toAddress("127.0.0.1:20886"));

DubboProtocol.getDubboProtocol().export(mockInvoker);
String result = invoke.telnet(mockChannel, "DemoService.echo(\"ok\")");
Expand All @@ -74,12 +74,12 @@ public void testInvokeDefaultSService() throws RemotingException {
public void testInvokeByPassingNullValue() throws RemotingException {
mockInvoker = mock(Invoker.class);
given(mockInvoker.getInterface()).willReturn(DemoService.class);
given(mockInvoker.getUrl()).willReturn(URL.valueOf("dubbo://127.0.0.1:20883/demo"));
given(mockInvoker.getUrl()).willReturn(URL.valueOf("dubbo://127.0.0.1:20886/demo"));
given(mockInvoker.invoke(any(Invocation.class))).willReturn(new RpcResult("ok"));
mockChannel = mock(Channel.class);
given(mockChannel.getAttribute("telnet.service")).willReturn("org.apache.dubbo.rpc.protocol.dubbo.support.DemoService");
given(mockChannel.getLocalAddress()).willReturn(NetUtils.toAddress("127.0.0.1:5555"));
given(mockChannel.getRemoteAddress()).willReturn(NetUtils.toAddress("127.0.0.1:20883"));
given(mockChannel.getRemoteAddress()).willReturn(NetUtils.toAddress("127.0.0.1:20886"));

DubboProtocol.getDubboProtocol().export(mockInvoker);

Expand Down Expand Up @@ -113,12 +113,12 @@ public void testInvokeByPassingNullValue() throws RemotingException {
public void testInvokeAutoFindMethod() throws RemotingException {
mockInvoker = mock(Invoker.class);
given(mockInvoker.getInterface()).willReturn(DemoService.class);
given(mockInvoker.getUrl()).willReturn(URL.valueOf("dubbo://127.0.0.1:20883/demo"));
given(mockInvoker.getUrl()).willReturn(URL.valueOf("dubbo://127.0.0.1:20886/demo"));
given(mockInvoker.invoke(any(Invocation.class))).willReturn(new RpcResult("ok"));
mockChannel = mock(Channel.class);
given(mockChannel.getAttribute("telnet.service")).willReturn(null);
given(mockChannel.getLocalAddress()).willReturn(NetUtils.toAddress("127.0.0.1:5555"));
given(mockChannel.getRemoteAddress()).willReturn(NetUtils.toAddress("127.0.0.1:20883"));
given(mockChannel.getRemoteAddress()).willReturn(NetUtils.toAddress("127.0.0.1:20886"));

DubboProtocol.getDubboProtocol().export(mockInvoker);
String result = invoke.telnet(mockChannel, "echo(\"ok\")");
Expand Down

0 comments on commit fbf4be9

Please sign in to comment.