Search in sources :

Example 1 with SimpleRPCImpl

use of org.apache.cxf.javascript.fortest.SimpleRPCImpl in project cxf by apache.

the class RPCClientTest method simpleCaller.

private Void simpleCaller(Context context) {
    LOG.info("About to call simpleTest " + getAddress());
    Notifier notifier = testUtilities.rhinoCallConvert("simpleTest", Notifier.class, testUtilities.javaToJS(getAddress()), "String Parameter", testUtilities.javaToJS(new Integer(1776)));
    boolean notified = notifier.waitForJavascript(1000 * 10);
    assertTrue(notified);
    Integer errorStatus = testUtilities.rhinoEvaluateConvert("globalErrorStatus", Integer.class);
    assertNull(errorStatus);
    String errorText = testUtilities.rhinoEvaluateConvert("globalErrorStatusText", String.class);
    assertNull(errorText);
    // this method returns a String.
    String responseObject = testUtilities.rhinoEvaluateConvert("globalResponseObject", String.class);
    assertEquals("String Parameter", responseObject);
    SimpleRPCImpl impl = getBean(SimpleRPCImpl.class, "rpc-service");
    assertEquals("String Parameter", impl.getLastString());
    assertEquals(1776, impl.getLastInt());
    return null;
}
Also used : SimpleRPCImpl(org.apache.cxf.javascript.fortest.SimpleRPCImpl) Notifier(org.apache.cxf.javascript.JavascriptTestUtilities.Notifier)

Aggregations

Notifier (org.apache.cxf.javascript.JavascriptTestUtilities.Notifier)1 SimpleRPCImpl (org.apache.cxf.javascript.fortest.SimpleRPCImpl)1