Package com.volantis.mcs.dom2theme.impl.optimizer

Examples of com.volantis.mcs.dom2theme.impl.optimizer.ShorthandAnalyzer


                StylePropertyDetails.BORDER_TOP_COLOR,
                OptimizerHelper.ANY, PropertyStatus.REQUIRED);
        final MutableStylePropertySet propertySet =
                new MutableStylePropertySetImpl(); // number of properties
       
        ShorthandAnalyzer analyzer;
        // check for null default value
        try {
             analyzer = new EdgeCharacteristicAnalyzer(
                    StyleShorthands.BORDER_COLOR, checkerMock, null, shorthandSetMock);
            fail();
        } catch (IllegalArgumentException e) {
            // expected
        }
       
        final StyleValue defaultStyleValue =
            StyleValueFactory.getDefaultInstance().getColorByRGB(null, 100);
        analyzer = new EdgeCharacteristicAnalyzer(
                StyleShorthands.BORDER_COLOR, checkerMock, defaultStyleValue,
                shorthandSetMock);
        analyzer.analyze(TargetEntity.ELEMENT, inputValues, deviceValuesMock);
       
        // verify test
        // 2 is because of ':' and ';' in getShorthandCost()
        assertEquals(StyleShorthands.BORDER_COLOR.getName().length() +
                defaultStyleValue.getStandardCost() + 2,
                analyzer.getShorthandCost(propertySet, propertySet));
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.dom2theme.impl.optimizer.ShorthandAnalyzer

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.