Package org.auraframework.def

Examples of org.auraframework.def.ThemeDefRef


            // 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


        ThemeDefRefHandler<ThemeDef> handler = new ThemeDefRefHandler<>(null, xmlReader, ss);
        return handler.getElement();
    }

    public void testThemeDescriptor() throws Exception {
        ThemeDefRef def = source("<aura:importTheme name='test:theme'/>");
        DefDescriptor<ThemeDef> desc = DefDescriptorImpl.getInstance("test:theme", ThemeDef.class);
        assertEquals(desc, def.getThemeDescriptor());
    }
View Full Code Here

        DefDescriptor<ThemeDef> desc = DefDescriptorImpl.getInstance("test:theme", ThemeDef.class);
        assertEquals(desc, def.getThemeDescriptor());
    }

    public void testDescription() throws Exception {
        ThemeDefRef def = source("<aura:importTheme name='test:theme' description='test'/>");
        assertEquals("test", def.getDescription());
    }
View Full Code Here

        ThemeDefRefHandler<ThemeDef> handler = new ThemeDefRefHandler<>(null, xmlReader, ss);
        return handler.getElement();
    }

    public void testEqualsWhenSame() throws Exception {
        ThemeDefRef def1 = source("<aura:importTheme name='blah:blah'/>");
        assertEquals(def1, def1);
    }
View Full Code Here

        ThemeDefRef def1 = source("<aura:importTheme name='blah:blah'/>");
        assertEquals(def1, def1);
    }

    public void testNotEquals() throws Exception {
        ThemeDefRef def1 = source("<aura:importTheme name='blah:blah'/>");
        ThemeDefRef def2 = source("<aura:importTheme name='blah2:blah2'/>");
        assertFalse(def1.equals(def2));
        assertFalse(def2.equals(def1));
        assertFalse(def2.equals(null));
    }
View Full Code Here

        assertFalse(def2.equals(null));
    }

    public void testAppendDependencies() throws Exception {
        DefDescriptor<ThemeDef> desc = addSeparateTheme(theme());
        ThemeDefRef def = source(String.format("<aura:importTheme name='%s'/>", desc.getDescriptorName()));

        Set<DefDescriptor<?>> deps = Sets.newHashSet();
        def.appendDependencies(deps);
        assertTrue(deps.contains(desc));
    }
View Full Code Here

        assertTrue(deps.contains(desc));
    }

    public void testInvalidReference() throws Exception {
        try {
            ThemeDefRef def = source("<aura:importTheme name='blah:blah'/>");
            def.validateReferences();
            fail("expected to get an exception");
        } catch (Exception e) {
            checkExceptionContains(e, DefinitionNotFoundException.class, "No THEME");
        }
    }
View Full Code Here

TOP

Related Classes of org.auraframework.def.ThemeDefRef

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.