Examples of VarDef


Examples of org.auraframework.def.VarDef

    @Override
    protected void handleChildTag() throws XMLStreamException, QuickFixException {
        String tag = getTagName();

        if (VarDefHandler.TAG.equalsIgnoreCase(tag)) {
            VarDef def = new VarDefHandler<ThemeDef>(this, xmlReader, source).getElement();
            if (builder.vars().containsKey(def.getName())) {
                error("Duplicate var %s", def.getName());
            }
            builder.addVarDef(def);

        } else if (ThemeDefRefHandler.TAG.equalsIgnoreCase(tag)) {
            // imports must come before vars. This is mainly for simplifying the var lookup implementation, while still
            // matching the most common expected usages of imports vs. declared vars.
            if (!builder.vars().isEmpty()) {
                error("tag %s must come before all declared vars", ThemeDefRefHandler.TAG);
            }

            ThemeDefRef def = new ThemeDefRefHandler<ThemeDef>(this, xmlReader, source).getElement();
            if (builder.imports().contains(def.getThemeDescriptor())) {
                error("Duplicate theme import %s", def.getName());
            }
            builder.addImport(def.getThemeDescriptor());
        } else {
            error("Found unexpected tag %s", tag);
        }
    }
View Full Code Here

Examples of org.auraframework.def.VarDef

    public VarDefHandlerTest(String name) {
        super(name);
    }

    public void testName() throws Exception {
        VarDef def = source("<aura:var name='color' value='red'/>");
        assertEquals("didn't get expected aura:var name", "color", def.getName());
    }
View Full Code Here

Examples of org.auraframework.def.VarDef

        VarDef def = source("<aura:var name='color' value='red'/>");
        assertEquals("didn't get expected aura:var name", "color", def.getName());
    }

    public void testValue() throws Exception {
        VarDef def = source("<aura:var name='color' value='red'/>");
        assertEquals("didn't get expected aura:var value", "red", def.getValue().toString());
    }
View Full Code Here

Examples of org.auraframework.def.VarDef

        VarDef def = source("<aura:var name='color' value='red'/>");
        assertEquals("didn't get expected aura:var value", "red", def.getValue().toString());
    }

    public void testDescription() throws Exception {
        VarDef def = source("<aura:var name='color' value='red' description='test'/>");
        assertEquals("didn't get expected aura:var description", "test", def.getDescription());
    }
View Full Code Here

Examples of org.auraframework.def.VarDef

        VarDef def = source("<aura:var name='color' value='red' description='test'/>");
        assertEquals("didn't get expected aura:var description", "test", def.getDescription());
    }

    public void testValueIsExpression() throws Exception {
        VarDef def = source("<aura:var name='myColor' value='{!color}'/><aura:var name='color' value='red'/>");
        assertTrue(def.getValue() instanceof PropertyReference);
    }
View Full Code Here

Examples of org.auraframework.def.VarDef

       
        testAuraContext = contextService.startContext(Mode.UTEST, Format.JSON, Authentication.AUTHENTICATED);
    }

    public void testEqualsWhenSame() throws Exception {
        VarDef def1 = buildDefinition();
        assertEquals(def1, def1);
    }
View Full Code Here

Examples of org.auraframework.def.VarDef

        assertEquals(def1, def1);
    }

    public void testNotEquals() throws Exception {
        builder.setValue("def1");
        VarDef def1 = buildDefinition();
        builder.setValue("def2");
        VarDef def2 = buildDefinition();
        assertFalse(def1.equals(def2));
        assertFalse(def2.equals(def1));
        assertFalse(def2.equals(null));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.