Package org.auraframework.impl.javascript.controller

Examples of org.auraframework.impl.javascript.controller.JavascriptActionDef


        setDefBuilderFields(builder);
        builder.actionDefs = Maps.newTreeMap();
        for (Map.Entry<String, Object> e : map.entrySet()) {
            JsFunction f = (JsFunction) e.getValue();
            String name = e.getKey();
            JavascriptActionDef action = createActionDef(name, f);
            builder.actionDefs.put(name, action);
        }
        return builder.build();
    }
View Full Code Here


        assertTrue(controllerActions.containsKey("functionName"));
        // If we have more than one controller function with same name, the
        // later one will replace the previous one
        assertTrue(controllerActions.size() == 1);
        // Verify the only JavascriptAction Def we have
        JavascriptActionDef jsActionDef = null;
        jsActionDef = controllerActions.get("functionName");
        assertEquals(ActionType.CLIENT, jsActionDef.getActionType());
        String[] jsonres = (Json.serialize(jsActionDef)).split("\"");
        // Verify the second function did replace the first one
        assertEquals("second function didn't survive",
                ":function(component) {var v = 2;},", jsonres[10]);
    }
View Full Code Here

        // 3.2: Verify the name of actiodefs
        assertTrue(controllerActions.containsKey("functionName1"));
        assertTrue(controllerActions.containsKey("functionName2"));

        // 3.3: Verify each JavascriptAction Def
        JavascriptActionDef jsActionDef = null;
        // 3.3.1 Action Def 1
        jsActionDef = controllerActions.get("functionName1");
        // Javascript Controllers are to be called on the Client side
        assertEquals(ActionType.CLIENT, jsActionDef.getActionType());
        // Javascript actions have no return type
        assertNull(jsActionDef.getReturnType());
        // Verify the Serialized form of the objects
        serializeAndGoldFile(controllerActions.get("functionName1"),
                "_actionDef_functionName1");

        // OBject that is to be verified, Qualified name
        assertEquals("unexpected qualifiedName for functionName1",
                "js://test.testJSController/ACTION$functionName1", jsActionDef
                        .getDescriptor().getQualifiedName());

        // 3.3.2 Action Def 2
        jsActionDef = controllerActions.get("functionName2");
        // Javascript Controllers are to be called on the Client side
        assertEquals(ActionType.CLIENT, jsActionDef.getActionType());
        // Javascript actions have no return type
        assertNull(jsActionDef.getReturnType());
        // Verify the Serialized form of the objects
        serializeAndGoldFile(controllerActions.get("functionName2"),
                "_actionDef_functionName2");
        // OBject that is to be verified, Qualified name
        assertEquals("unexpected qualifiedName for functionName2",
                "js://test.testJSController/ACTION$functionName2", jsActionDef
                        .getDescriptor().getQualifiedName());

    }
View Full Code Here

        assertTrue(controllerActions.size() == 1);
        // 3.2: Verify the name of ActionDefs
        assertTrue(controllerActions.containsKey("functionName1"));

        // 3.4: Verify each JavascriptAction Def
        JavascriptActionDef jsActionDef = null;
        // 3.4.1 Action Def 1
        jsActionDef = controllerActions.get("functionName1");
        assertEquals(ActionType.CLIENT, jsActionDef.getActionType());
        assertNull(jsActionDef.getReturnType());
        // 3.4.2: Verify the Serialized form of the objects
        serializeAndGoldFile(jsActionDef, "_actionDef_functionName1");

        // OBject that is to be verified, Qualified name
        assertEquals("unexpected qualifiedName of functionName1",
                "js://test.testJSControllerParent/ACTION$functionName1",
                jsActionDef.getDescriptor().getQualifiedName());
    }
View Full Code Here

TOP

Related Classes of org.auraframework.impl.javascript.controller.JavascriptActionDef

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.