Package org.auraframework.def

Examples of org.auraframework.def.HelperDef


                        json.writeMapEntry("rendererDef", rendererDef);
                    }
                } finally {
                    context.popCallingDescriptor();
                }
                HelperDef helperDef = getHelperDef();
                if (helperDef != null && !helperDef.isLocal()) {
                    json.writeMapEntry("helperDef", helperDef);
                }

                json.writeMapEntry("styleDef", getStyleDef());
                json.writeMapEntry("controllerDef", getControllerDef());
View Full Code Here


     * @return The primary helper def. If multiple exist, this will be the remote one.
     * @throws QuickFixException
     */
    @Override
    public HelperDef getHelperDef() throws QuickFixException {
        HelperDef def = null;
        if (helperDescriptors != null) {
            for (DefDescriptor<HelperDef> desc : helperDescriptors) {
                def = desc.getDef();
                if (!def.isLocal()) {
                    break;
                }
            }
        }
        return def;
View Full Code Here

     * JavascriptHelperDef can be used only on the client side.
     *
     * @throws Exception
     */
    public void testIsNotLocal() throws Exception {
        HelperDef hlprDef = Aura.getDefinitionService().getDefinition("js://test.test_SimpleHelper", HelperDef.class);
        assertNotNull("Failed to extract helper def on component.", hlprDef);
        assertTrue("Should have obtained a javascript helper def.", hlprDef instanceof JavascriptHelperDef);
        assertEquals("Failed to create correct helper def for test component.", "js://test.test_SimpleHelper", hlprDef
                .getDescriptor().getQualifiedName());
        assertFalse("Javascript helper defs are not local.", hlprDef.isLocal());
    }
View Full Code Here

     * Verify that javascript helper defs are serializable.
     *
     * @throws Exception
     */
    public void testJavascriptHelperDefAreSerializable() throws Exception {
        HelperDef hlprDef = Aura.getDefinitionService().getDefinition("js://test.test_SimpleHelper", HelperDef.class);
        assertNotNull("Failed to extract helper def on component.", hlprDef);
        this.serializeAndGoldFile(hlprDef);
    }
View Full Code Here

     * @throws Exception
     */
    public void testDefaultNamingConventionForHelper() throws Exception {
        ComponentDef cmpDef = Aura.getDefinitionService().getDefinition("test:test_SimpleHelper", ComponentDef.class);
        assertNotNull(cmpDef);
        HelperDef hlprDef = cmpDef.getHelperDef();
        assertNotNull("Failed to extract helper def on component.", hlprDef);
        assertTrue("By default BaseComponentDefHandler shoud assume that a component has a javascript helper.",
                hlprDef instanceof JavascriptHelperDef);
        assertEquals("Failed to create correct helper def for test component.", "js://test.test_SimpleHelper", hlprDef
                .getDescriptor().getQualifiedName());
    }
View Full Code Here

     */
    public void testExplicitHelperDirectiveSpecification() throws Exception {
        String explicitHelperMarkup = String.format(baseComponentTag, "helper='js://test.test_SimpleHelper'", "");
        DefDescriptor<ComponentDef> cmpDescriptor = addSourceAutoCleanup(ComponentDef.class, explicitHelperMarkup);
        assertNotNull(cmpDescriptor.getDef());
        HelperDef hlprDef = cmpDescriptor.getDef().getHelperDef();
        assertNotNull("Failed to extract helper def on component.", hlprDef);
        assertTrue("Helper directive provided a javascript helper, but component definition has something else.",
                hlprDef instanceof JavascriptHelperDef);
        assertEquals("Failed to create correct helper def for test component.", "js://test.test_SimpleHelper", hlprDef
                .getDescriptor().getQualifiedName());

    }
View Full Code Here

    // HelperDef has a isLocal() method.
    public void _testInheritedHelpers() throws Exception {
        ComponentDef cmpDef = Aura.getDefinitionService().getDefinition("test:testJSHelperInheritedOnly",
                ComponentDef.class);

        HelperDef hlprDef = cmpDef.getHelperDef();
        assertNotNull("Failed to extract helper def inherited from parent component.", hlprDef);
        assertTrue("failed to recognize javascript helper def on parent.", hlprDef instanceof JavascriptHelperDef);
        assertEquals("Failed to use parent's helper def.", "js://test.testJSHelperSuper", hlprDef.getDescriptor()
                .getQualifiedName());
    }
View Full Code Here

TOP

Related Classes of org.auraframework.def.HelperDef

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.