use of com.caucho.hessian.io.SerializerFactory in project tomee by apache.
the class HessianCdiByConfigTest method client.
@Test
public void client() throws MalformedURLException {
final ClassLoader loader = Thread.currentThread().getContextClassLoader();
final HessianProxyFactory clientFactory = new HessianProxyFactory(loader);
final SerializerFactory factory = new SerializerFactory(loader);
factory.setAllowNonSerializable(true);
clientFactory.setSerializerFactory(factory);
final CdiService client = CdiService.class.cast(clientFactory.create(CdiService.class, "http://127.0.0.1:" + port + "/web/hessian/foo"));
final Out out = client.call(new In("test"));
assertThat(out, instanceOf(Out.class));
assertEquals("test", out.value);
}
use of com.caucho.hessian.io.SerializerFactory in project tomee by apache.
the class HessianCdiTest method client.
@Test
public void client() throws MalformedURLException {
final ClassLoader loader = Thread.currentThread().getContextClassLoader();
final HessianProxyFactory clientFactory = new HessianProxyFactory(loader);
final SerializerFactory factory = new SerializerFactory(loader);
factory.setAllowNonSerializable(true);
clientFactory.setSerializerFactory(factory);
final CdiService client = CdiService.class.cast(clientFactory.create(CdiService.class, "http://127.0.0.1:" + port + "/web/hessian/service"));
final Out out = client.call(new In("test"));
assertThat(out, instanceOf(Out.class));
assertEquals("test", out.value);
}
use of com.caucho.hessian.io.SerializerFactory in project tomee by apache.
the class HessianServiceTest method client.
@Test
public void client() throws MalformedURLException {
final ClassLoader loader = Thread.currentThread().getContextClassLoader();
final HessianProxyFactory clientFactory = new HessianProxyFactory(loader);
final SerializerFactory factory = new SerializerFactory(loader);
factory.setAllowNonSerializable(true);
clientFactory.setSerializerFactory(factory);
final HessianWebService client = HessianWebService.class.cast(clientFactory.create(HessianWebService.class, "http://127.0.0.1:" + port + "/HessianServiceTest/hessian/" + MyHessianWebService.class.getSimpleName()));
final Out out = client.call(new In("test"));
assertThat(out, instanceOf(Out.class));
assertEquals("test", out.value);
}
Aggregations