use of org.eclipse.scout.rt.shared.servicetunnel.ServiceTunnelResponse in project scout.rt by eclipse.
the class ServiceOperationInvokerTest method testInvokeInvalidWithoutSession.
// exception is handled with JUnitExceptionHandler
@Test(expected = ProcessingException.class)
public void testInvokeInvalidWithoutSession() {
String exceptionMessage = "xxx";
when(m_pingSvc.ping(any(String.class))).thenThrow(new ProcessingException(exceptionMessage));
ServiceTunnelResponse res = invokePingService(ServerRunContexts.empty());
assertProcessingException(res, exceptionMessage);
}
use of org.eclipse.scout.rt.shared.servicetunnel.ServiceTunnelResponse in project scout.rt by eclipse.
the class ServiceTunnelServletTest method testPostSuccessful.
@Test
public void testPostSuccessful() throws ServletException, IOException {
ServiceTunnelServlet s = new ServiceTunnelServlet();
Class[] parameterTypes = new Class[] { String.class };
Object[] args = new Object[] { "test" };
ServiceTunnelRequest req = new ServiceTunnelRequest(IPingService.class.getName(), "ping", parameterTypes, args);
ServiceTunnelResponse res = s.doPost(req);
assertEquals("test", res.getData());
assertNull(res.getException());
assertEquals(0, res.getNotifications().size());
}
use of org.eclipse.scout.rt.shared.servicetunnel.ServiceTunnelResponse in project scout.rt by eclipse.
the class ServiceOperationInvokerTest method testInvokeInvalidWithSession.
// exception is handled with JUnitExceptionHandler
@Test(expected = ProcessingException.class)
public void testInvokeInvalidWithSession() {
String exceptionMessage = "xxx";
when(m_pingSvc.ping(any(String.class))).thenThrow(new ProcessingException(exceptionMessage));
ServiceTunnelResponse res = invokePingService(createRunContextWithSession());
assertProcessingException(res, exceptionMessage);
}
use of org.eclipse.scout.rt.shared.servicetunnel.ServiceTunnelResponse in project scout.rt by eclipse.
the class ServiceOperationInvokerTest method testInvokeInspectedWithSession.
@Test
public void testInvokeInspectedWithSession() {
try {
BEANS.get(ProcessInspector.class).setEnabled(true);
when(m_pingSvc.ping(any(String.class))).thenReturn(m_testData);
ServiceTunnelResponse res = invokePingService(createRunContextWithSession());
assertValidResponse(res, m_testData);
} finally {
BEANS.get(ProcessInspector.class).setEnabled(false);
}
}
use of org.eclipse.scout.rt.shared.servicetunnel.ServiceTunnelResponse in project scout.rt by eclipse.
the class ServiceOperationInvokerTest method testInvokeWithoutSession.
@Test
public void testInvokeWithoutSession() {
when(m_pingSvc.ping(any(String.class))).thenReturn(m_testData);
ServiceTunnelResponse res = invokePingService(ServerRunContexts.empty());
assertValidResponse(res, m_testData);
}
Aggregations