Search in sources :

Example 1 with CountDownNotifier

use of org.apache.cxf.javascript.JavascriptTestUtilities.CountDownNotifier in project cxf by apache.

the class GreeterClientTest method sayHiClosureCaller.

private Void sayHiClosureCaller(Context context) {
    CountDownNotifier notifier = testUtilities.rhinoCallConvert("requestClosureTest", CountDownNotifier.class, testUtilities.javaToJS(getAddress()));
    boolean notified = notifier.waitForJavascript(1000 * 15);
    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 inside of an object, since there's an @WebResponse
    String responseObject = testUtilities.rhinoEvaluateConvert("globalResponseObject.getResponseType()", String.class);
    assertEquals("Bonjour", responseObject);
    responseObject = testUtilities.rhinoEvaluateConvert("globalSecondResponseObject.getResponseType()", String.class);
    assertEquals("Bonjour", responseObject);
    return null;
}
Also used : CountDownNotifier(org.apache.cxf.javascript.JavascriptTestUtilities.CountDownNotifier)

Aggregations

CountDownNotifier (org.apache.cxf.javascript.JavascriptTestUtilities.CountDownNotifier)1