@Test public void testClient() throws Exception { System.out.println( "-----------------------------------" + tcpRestServer.getClass().getCanonicalName() + "--------------------------------"); tcpRestServer.addResource(HelloWorldResource.class); TcpRestClientFactory factory = new TcpRestClientFactory(HelloWorld.class, "localhost", tcpRestServer.getServerPort()); HelloWorld client = (HelloWorld) factory.getInstance(); assertEquals("Hello, world!", client.helloWorld()); assertEquals("a,2,true123.0111", client.allTypes("a", 2, true, (short) 1, 2L, 3.0, (byte) 'o')); }