Search in sources :

Example 1 with SerializerFactory

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);
}
Also used : SerializerFactory(com.caucho.hessian.io.SerializerFactory) HessianProxyFactory(com.caucho.hessian.client.HessianProxyFactory) Test(org.junit.Test)

Example 2 with SerializerFactory

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);
}
Also used : SerializerFactory(com.caucho.hessian.io.SerializerFactory) HessianProxyFactory(com.caucho.hessian.client.HessianProxyFactory) Test(org.junit.Test)

Example 3 with SerializerFactory

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);
}
Also used : SerializerFactory(com.caucho.hessian.io.SerializerFactory) HessianProxyFactory(com.caucho.hessian.client.HessianProxyFactory) Test(org.junit.Test)

Aggregations

HessianProxyFactory (com.caucho.hessian.client.HessianProxyFactory)3 SerializerFactory (com.caucho.hessian.io.SerializerFactory)3 Test (org.junit.Test)3