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

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


        return new TestSuiteDefJSONFormatAdapter();
    }

    @Impl
    public static FormatAdapter<?> styleDefCSSFormatAdapter() {
        return new StyleDefCSSFormatAdapter();
    }
View Full Code Here


        desc2.getDef();
        desc3.getDef();

        assertEquals("did not expect plugin to run at runtime", 0, observer.count);

        StyleDefCSSFormatAdapter cssFormatAdapter = new StyleDefCSSFormatAdapter();
        cssFormatAdapter.writeCollection(Lists.newArrayList(desc1.getDef(), desc2.getDef(), desc3.getDef()),
                new StringBuilder());

        assertEquals("expected the same plugin instance to once for each styledef", 3, observer.count);
    }
View Full Code Here

    public void testNoErrorOnDifferentFonts() throws Exception {
        prepare(new DuplicateFontFacePlugin());
        DefDescriptor<StyleDef> desc1 = addStyleDef("@font-face {font-family: Custom1; src: url(Custom1.woff)}");
        DefDescriptor<StyleDef> desc2 = addStyleDef("@font-face {font-family: Custom2; src: url(Custom2.woff)}");

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

    public void testErrorsOnDupeFontsSameFile() throws Exception {
        prepare(new DuplicateFontFacePlugin());
        String s = "@font-face {font-family: Custom1; src: url(Custom1.woff)}";
        DefDescriptor<StyleDef> desc = addStyleDef(s + "\n" + s);

        StyleDefCSSFormatAdapter cssFormatAdapter = new StyleDefCSSFormatAdapter();

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

        prepare(new DuplicateFontFacePlugin());
        DefDescriptor<StyleDef> desc1 = addStyleDef("@font-face {font-family: Custom1; src: url(Custom1.woff)}");
        DefDescriptor<StyleDef> desc2 = addStyleDef("@font-face {font-family: Custom2; src: url(Custom2.woff)}");
        DefDescriptor<StyleDef> desc3 = addStyleDef("@font-face {font-family: Custom1; src: url(Custom1.woff)}");

        StyleDefCSSFormatAdapter cssFormatAdapter = new StyleDefCSSFormatAdapter();

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

    public void testErrorsOnDupeQuotedAndUnquoted() throws Exception {
        prepare(new DuplicateFontFacePlugin());
        DefDescriptor<StyleDef> desc1 = addStyleDef("@font-face {font-family: Custom1; src: url(Custom1.woff)}");
        DefDescriptor<StyleDef> desc2 = addStyleDef("@font-face {font-family: \"Custom1\"; 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 testErrorsOnDupeDifferentQuotes() throws Exception {
        prepare(new DuplicateFontFacePlugin());
        DefDescriptor<StyleDef> desc1 = addStyleDef("@font-face {font-family: 'Custom1'; src: url(Custom1.woff)}");
        DefDescriptor<StyleDef> desc2 = addStyleDef("@font-face {font-family: \"Custom1\"; 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 testSamePropsCheckAllOn() throws Exception {
        prepare(new DuplicateFontFacePlugin(false, true));
        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-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 testSamePropsCheckAllOff() 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-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 testDifferentPropsCheckAllOn() throws Exception {
        prepare(new DuplicateFontFacePlugin(false, true));
        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();

        cssFormatAdapter.writeCollection(Lists.newArrayList(desc1.getDef(), desc2.getDef()), out);
        // no error
    }
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.