Package org.apache.cxf.javascript.JavascriptTestUtilities

Examples of org.apache.cxf.javascript.JavascriptTestUtilities.Notifier


    @Test
    public void callIntReturnMethod() {
        testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
            public Void run(Context context) {
                LOG.info("About to call test3/IntFunction" + getAddress());
                Notifier notifier =
                    testUtilities.rhinoCallConvert("test3", Notifier.class,
                                                   testUtilities.javaToJS(getAddress()),
                                                   testUtilities.javaToJS(Double.valueOf(17.0)),
                                                   testUtilities.javaToJS(Float.valueOf((float)111.0)),
                                                   testUtilities.javaToJS(Integer.valueOf(142)),
                                                   testUtilities.javaToJS(Long.valueOf(1240000)),
                                                   null);
                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);
View Full Code Here


    @Test
    public void callMethodWithoutWrappers() {
        testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
            public Void run(Context context) {
                LOG.info("About to call test2 " + getAddress());
                Notifier notifier =
                    testUtilities.rhinoCallConvert("test2", Notifier.class,
                                                   testUtilities.javaToJS(getAddress()),
                                                   testUtilities.javaToJS(Double.valueOf(17.0)),
                                                   testUtilities.javaToJS(Float.valueOf((float)111.0)),
                                                   testUtilities.javaToJS(Integer.valueOf(142)),
                                                   testUtilities.javaToJS(Long.valueOf(1240000)),
                                                   "This is the cereal shot from gnus");
                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);
View Full Code Here

    public void callMethodWithWrappers() {
        testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
            public Void run(Context context) {
                LOG.info("About to call test1 " + getAddress());

                Notifier notifier = testUtilities.rhinoCallConvert("test1", Notifier.class, testUtilities
                    .javaToJS(getAddress()), testUtilities.javaToJS(Double.valueOf(7.0)),
                                                                   testUtilities.javaToJS(Float
                                                                       .valueOf((float)11.0)), testUtilities
                                                                       .javaToJS(Integer.valueOf(42)),
                                                                   testUtilities.javaToJS(Long
                                                                       .valueOf(240000)),
                                                                   "This is the cereal shot from guns");
                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);
View Full Code Here

    @Test
    public void inheritedProperties() {
        testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {

            public Void run(Context context) {
                Notifier notifier = testUtilities.rhinoCallConvert("testInheritance", Notifier.class,
                                                                   testUtilities.javaToJS(getAddress()));
                boolean notified = notifier.waitForJavascript(1000 * 10);
                assertTrue(notified);
                SimpleDocLitWrappedImpl impl = (SimpleDocLitWrappedImpl)rawImplementor;
                assertEquals("less", impl.getLastInheritanceTestDerived().getName());
                return null;
            }
View Full Code Here

    @Test
    public void callTest2WithNullString() {
        testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
            public Void run(Context context) {
                LOG.info("About to call test2 with null string " + getAddress());
                Notifier notifier =
                    testUtilities.rhinoCallConvert("test2", Notifier.class,
                                                   testUtilities.javaToJS(getAddress()),
                                                   testUtilities.javaToJS(Double.valueOf(17.0)),
                                                   testUtilities.javaToJS(Float.valueOf((float)111.0)),
                                                   testUtilities.javaToJS(Integer.valueOf(142)),
                                                   testUtilities.javaToJS(Long.valueOf(1240000)),
                                                   null);
                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);
View Full Code Here

        });
    }
   

    private Void returnBeanWithAnyTypeArray(Context context) {
        Notifier notifier =
            testUtilities.rhinoCallConvert("testReturningBeanWithAnyTypeArray", 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);
View Full Code Here

TOP

Related Classes of org.apache.cxf.javascript.JavascriptTestUtilities.Notifier

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.