From a4414f27a1076dbf53224c22765c4dc64c5b7bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20=C3=98rbekk?= Date: Wed, 11 Apr 2012 14:53:23 +0200 Subject: Remove old RpcChannel. Fix tests with NewRpcChannel. --- .../java/com/orbekk/protobuf/ProtobufFunctionalTest.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/test/java') diff --git a/src/test/java/com/orbekk/protobuf/ProtobufFunctionalTest.java b/src/test/java/com/orbekk/protobuf/ProtobufFunctionalTest.java index e0757d4..1f1bc46 100644 --- a/src/test/java/com/orbekk/protobuf/ProtobufFunctionalTest.java +++ b/src/test/java/com/orbekk/protobuf/ProtobufFunctionalTest.java @@ -18,6 +18,8 @@ package com.orbekk.protobuf; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; +import java.io.IOException; +import java.net.UnknownHostException; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicBoolean; @@ -33,11 +35,13 @@ public class ProtobufFunctionalTest { CountDownLatch returnC = new CountDownLatch(1); SimpleProtobufServer server = SimpleProtobufServer.create(0, 50, 1); int serverport = server.getPort(); - RpcChannel channel = RpcChannel.create("localhost", serverport); + NewRpcChannel channel; TestService directService = new TestService(); - Test.Service service = Test.Service.newStub(channel); + Test.Service service; - @Before public void setUp() { + @Before public void setUp() throws Exception { + channel = NewRpcChannel.create("localhost", serverport); + service = Test.Service.newStub(channel); server.start(); server.registerService(directService); } @@ -150,7 +154,7 @@ public class ProtobufFunctionalTest { service.testC(rpc, request, new RpcCallback() { @Override public void run(Type2 result) { assertThat(rpc.failed(), is(true)); - assertThat(rpc.errorText(), is("connection closed")); + assertThat(rpc.errorText(), is("channel closed")); stop.countDown(); } }); -- cgit v1.2.3