Package org.auraframework.impl.adapter.format.css

Examples of org.auraframework.impl.adapter.format.css.StyleDefCSSFormatAdapter


    public void testDifferentPropsCheckAllOff() throws Exception {
        prepare(new DuplicateFontFacePlugin(false, false));
        DefDescriptor<StyleDef> desc1 = addStyleDef("@font-face {font-family: Custom1; font-weight:bold; src: url(Custom1.woff)}");
        DefDescriptor<StyleDef> desc2 = addStyleDef("@font-face {font-family: Custom1; font-style:italic; src: url(Custom1.woff)}");

        StyleDefCSSFormatAdapter cssFormatAdapter = new StyleDefCSSFormatAdapter();

        try {
            cssFormatAdapter.writeCollection(Lists.newArrayList(desc1.getDef(), desc2.getDef()), out);
            fail("expected to get exception");
        } catch (Exception e) {
            checkExceptionContains(e, AuraRuntimeException.class, "was already declared");
        }
    }
View Full Code Here


    public void testSamePropsBothHaveAnnotation() throws Exception {
        prepare(new DuplicateFontFacePlugin(true, false));
        DefDescriptor<StyleDef> desc1 = addStyleDef("@font-face {/* @allowDuplicate */ font-family: Custom1; font-weight:bold; src: url(Custom1.woff)}");
        DefDescriptor<StyleDef> desc2 = addStyleDef("@font-face {/* @allowDuplicate */ font-family: Custom1; font-weight:bold; src: url(Custom1.woff)}");

        StyleDefCSSFormatAdapter cssFormatAdapter = new StyleDefCSSFormatAdapter();

        cssFormatAdapter.writeCollection(Lists.newArrayList(desc1.getDef(), desc2.getDef()), out);
        // no error
    }
View Full Code Here

    public void testSamePropsOnlyFirstHasAnnotation() throws Exception {
        prepare(new DuplicateFontFacePlugin(true, false));
        DefDescriptor<StyleDef> desc1 = addStyleDef("@font-face {/* @allowDuplicate */ font-family: Custom1; font-weight:bold; src: url(Custom1.woff)}");
        DefDescriptor<StyleDef> desc2 = addStyleDef("@font-face {font-family: Custom1; font-weight:bold; src: url(Custom1.woff)}");

        StyleDefCSSFormatAdapter cssFormatAdapter = new StyleDefCSSFormatAdapter();

        try {
            cssFormatAdapter.writeCollection(Lists.newArrayList(desc1.getDef(), desc2.getDef()), out);
            fail("expected to get exception");
        } catch (Exception e) {
            checkExceptionContains(e, AuraRuntimeException.class, "was already declared");
        }
    }
View Full Code Here

    public void testSamePropsOnlySecondHasAnnotation() throws Exception {
        prepare(new DuplicateFontFacePlugin(true, false));
        DefDescriptor<StyleDef> desc1 = addStyleDef("@font-face {font-family: Custom1; font-weight:bold; src: url(Custom1.woff)}");
        DefDescriptor<StyleDef> desc2 = addStyleDef("@font-face {/* @allowDuplicate */ font-family: Custom1; font-weight:bold; src: url(Custom1.woff)}");

        StyleDefCSSFormatAdapter cssFormatAdapter = new StyleDefCSSFormatAdapter();

        try {
            cssFormatAdapter.writeCollection(Lists.newArrayList(desc1.getDef(), desc2.getDef()), out);
            fail("expected to get exception");
        } catch (Exception e) {
            checkExceptionContains(e, AuraRuntimeException.class, "was already declared");
        }
    }
View Full Code Here

    public void testSamePropsBothHaveAnnotationButNotAllowed() throws Exception {
        prepare(new DuplicateFontFacePlugin(false, false));
        DefDescriptor<StyleDef> desc1 = addStyleDef("@font-face {/* @allowDuplicate */ font-family: Custom1; font-weight:bold; src: url(Custom1.woff)}");
        DefDescriptor<StyleDef> desc2 = addStyleDef("@font-face {/* @allowDuplicate */ font-family: Custom1; font-weight:bold; src: url(Custom1.woff)}");

        StyleDefCSSFormatAdapter cssFormatAdapter = new StyleDefCSSFormatAdapter();

        try {
            cssFormatAdapter.writeCollection(Lists.newArrayList(desc1.getDef(), desc2.getDef()), out);
            fail("expected to get exception");
        } catch (Exception e) {
            checkExceptionContains(e, AuraRuntimeException.class, "was already declared");
        }
    }
View Full Code Here

TOP

Related Classes of org.auraframework.impl.adapter.format.css.StyleDefCSSFormatAdapter

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.