use of org.apache.cxf.javascript.JavascriptTestUtilities.Notifier in project cxf by apache.
the class DocLitBareClientTest method compliantCaller.
private Void compliantCaller(Context context) {
TestBean1 b1 = new TestBean1();
b1.stringItem = "strung";
b1.beanTwoNotRequiredItem = new TestBean2("bean2");
Scriptable jsBean1 = testBean1ToJS(testUtilities, context, b1);
LOG.info("About to call compliant" + getAddress());
Notifier notifier = testUtilities.rhinoCallConvert("compliantTest", Notifier.class, testUtilities.javaToJS(getAddress()), jsBean1);
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 response = (String) testUtilities.rhinoEvaluate("globalResponseObject");
assertEquals("strung", response);
return null;
}
use of org.apache.cxf.javascript.JavascriptTestUtilities.Notifier in project cxf by apache.
the class DocLitBareClientTest method compliantNoArgsCaller.
private Void compliantNoArgsCaller(Context context) {
LOG.info("About to call compliantNoArgs " + getAddress());
Notifier notifier = testUtilities.rhinoCallConvert("compliantNoArgsTest", Notifier.class, testUtilities.javaToJS(getAddress()));
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
Scriptable response = (Scriptable) testUtilities.rhinoEvaluate("globalResponseObject");
String item = testUtilities.rhinoCallMethodConvert(String.class, response, "getStringItem");
assertEquals("horsefeathers", item);
return null;
}
use of org.apache.cxf.javascript.JavascriptTestUtilities.Notifier 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;
}
Aggregations