Package org.apache.fop.fotreetest

Examples of org.apache.fop.fotreetest.ResultCollector


                            Locator locator,
                            Attributes attlist,
                            PropertyList propertyList) throws FOPException {
        //super.processNode(elementName, locator, attlist, propertyList);

        ResultCollector collector = ResultCollector.getInstance();
        String propName = attlist.getValue("property");
        String component = null;
        int dotIndex = propName.indexOf('.');
        if (dotIndex >= 0) {
            component = propName.substring(dotIndex + 1);
            propName = propName.substring(0, dotIndex);
        }
        int propID = FOPropertyMapping.getPropertyId(propName);
        if (propID < 0) {
            collector.notifyException(new IllegalArgumentException(
                    "Property not found: " + propName));
        } else {
            Property prop;
            prop = propertyList.getParentPropertyList().get(propID);
            if (component != null) {
                //Access subcomponent
                Property mainProp = prop;
                prop = null;
                LengthPairProperty lpp = mainProp.getLengthPair();
                if (lpp != null) {
                    prop = lpp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
                LengthRangeProperty lrp = mainProp.getLengthRange();
                if (lrp != null) {
                    prop = lrp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
                KeepProperty kp = mainProp.getKeep();
                if (kp != null) {
                    prop = kp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
                SpaceProperty sp = mainProp.getSpace();
                if (sp != null) {
                    prop = sp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
            }
            String s;
            if (prop instanceof PercentLength) {
                s = ((PercentLength)prop).getString();
            } else {
                s = String.valueOf(prop);
            }
            String expected = attlist.getValue("expected");
            if (!expected.equals(s)) {
                collector.notifyException(
                    new IllegalStateException(locator.getSystemId()
                        + "\nProperty '" + propName
                        + "' expected to evaluate to '" + expected
                        + "' but got '" + s
                        + "'\n(test:assert in "
View Full Code Here


                            Locator locator,
                            Attributes attlist,
                            PropertyList propertyList) throws FOPException {
        //super.processNode(elementName, locator, attlist, propertyList);

        ResultCollector collector = ResultCollector.getInstance();
        String propName = attlist.getValue("property");
        String expected = attlist.getValue("expected");       
        String component = null;
        int dotIndex = propName.indexOf('.');
        if (dotIndex >= 0) {
            component = propName.substring(dotIndex + 1);
            propName = propName.substring(0, dotIndex);
        }
        int propID = FOPropertyMapping.getPropertyId(propName);
        if (propID < 0) {
            collector.notifyAssertionFailure("Property not found: " + propName);
        } else {
            Property prop;
            prop = propertyList.getParentPropertyList().get(propID);
            if (component != null) {
                //Access subcomponent
                Property mainProp = prop;
                prop = null;
                LengthPairProperty lpp = mainProp.getLengthPair();
                if (lpp != null) {
                    prop = lpp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
                LengthRangeProperty lrp = mainProp.getLengthRange();
                if (lrp != null) {
                    prop = lrp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
                KeepProperty kp = mainProp.getKeep();
                if (kp != null) {
                    prop = kp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
                SpaceProperty sp = mainProp.getSpace();
                if (sp != null) {
                    prop = sp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
            }
            String s;
            if (prop instanceof PercentLength) {
                s = prop.getString();
            } else {
                s = String.valueOf(prop);
            }
            if (!expected.equals(s)) {
                collector.notifyAssertionFailure(
                    locator.getSystemId()
                        + "\nProperty '" + propName
                        + "' expected to evaluate to '" + expected
                        + "' but got '" + s
                        + "'\n(test:assert in "
View Full Code Here

                            Locator locator,
                            Attributes attlist,
                            PropertyList propertyList) throws FOPException {
        //super.processNode(elementName, locator, attlist, propertyList);

        ResultCollector collector = ResultCollector.getInstance();
        String propName = attlist.getValue("property");
        String expected = attlist.getValue("expected");
        String component = null;
        int dotIndex = propName.indexOf('.');
        if (dotIndex >= 0) {
            component = propName.substring(dotIndex + 1);
            propName = propName.substring(0, dotIndex);
        }
        int propID = FOPropertyMapping.getPropertyId(propName);
        if (propID < 0) {
            collector.notifyAssertionFailure("Property not found: " + propName);
        } else {
            Property prop;
            prop = propertyList.getParentPropertyList().get(propID);
            if (component != null) {
                //Access subcomponent
                Property mainProp = prop;
                prop = null;
                LengthPairProperty lpp = mainProp.getLengthPair();
                if (lpp != null) {
                    prop = lpp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
                LengthRangeProperty lrp = mainProp.getLengthRange();
                if (lrp != null) {
                    prop = lrp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
                KeepProperty kp = mainProp.getKeep();
                if (kp != null) {
                    prop = kp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
                SpaceProperty sp = mainProp.getSpace();
                if (sp != null) {
                    prop = sp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
            }
            String s;
            if (prop instanceof PercentLength) {
                s = prop.getString();
            } else {
                s = String.valueOf(prop);
            }
            if (!expected.equals(s)) {
                collector.notifyAssertionFailure(
                    locator.getSystemId()
                        + "\nProperty '" + propName
                        + "' expected to evaluate to '" + expected
                        + "' but got '" + s
                        + "'\n(test:assert in "
View Full Code Here

                            Locator locator,
                            Attributes attlist,
                            PropertyList propertyList) throws FOPException {
        //super.processNode(elementName, locator, attlist, propertyList);

        ResultCollector collector = ResultCollector.getInstance();
        String propName = attlist.getValue("property");
        String component = null;
        int dotIndex = propName.indexOf('.');
        if (dotIndex >= 0) {
            component = propName.substring(dotIndex + 1);
            propName = propName.substring(0, dotIndex);
        }
        int propID = FOPropertyMapping.getPropertyId(propName);
        if (propID < 0) {
            collector.notifyException(new IllegalArgumentException(
                    "Property not found: " + propName));
        } else {
            Property prop;
            prop = propertyList.getParentPropertyList().get(propID);
            if (component != null) {
                //Access subcomponent
                Property mainProp = prop;
                prop = null;
                LengthPairProperty lpp = mainProp.getLengthPair();
                if (lpp != null) {
                    prop = lpp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
                LengthRangeProperty lrp = mainProp.getLengthRange();
                if (lrp != null) {
                    prop = lrp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
                KeepProperty kp = mainProp.getKeep();
                if (kp != null) {
                    prop = kp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
                SpaceProperty sp = mainProp.getSpace();
                if (sp != null) {
                    prop = sp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
            }
            String s = String.valueOf(prop);
            String expected = attlist.getValue("expected");
            if (!expected.equals(s)) {
                collector.notifyException(
                    new IllegalStateException(locator.getSystemId()
                        + "\nProperty '" + propName
                        + "' expected to evaluate to '" + expected
                        + "' but got '" + s
                        + "'\n(test:assert in "
View Full Code Here

                            Locator locator,
                            Attributes attlist,
                            PropertyList propertyList) throws FOPException {
        //super.processNode(elementName, locator, attlist, propertyList);

        ResultCollector collector = ResultCollector.getInstance();
        String propName = attlist.getValue("property");
        String component = null;
        int dotIndex = propName.indexOf('.');
        if (dotIndex >= 0) {
            component = propName.substring(dotIndex + 1);
            propName = propName.substring(0, dotIndex);
        }
        int propID = FOPropertyMapping.getPropertyId(propName);
        if (propID < 0) {
            collector.notifyException(new IllegalArgumentException(
                    "Property not found: " + propName));
        } else {
            Property prop;
            prop = propertyList.getParentPropertyList().get(propID);
            if (component != null) {
                //Access subcomponent
                Property mainProp = prop;
                prop = null;
                LengthPairProperty lpp = mainProp.getLengthPair();
                if (lpp != null) {
                    prop = lpp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
                LengthRangeProperty lrp = mainProp.getLengthRange();
                if (lrp != null) {
                    prop = lrp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
                KeepProperty kp = mainProp.getKeep();
                if (kp != null) {
                    prop = kp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
            }
            String s = String.valueOf(prop);
            String expected = attlist.getValue("expected");
            if (!expected.equals(s)) {
                collector.notifyException(new IllegalStateException("Property '" + propName
                        + "' expected to evaluate to '" + expected + "' but got: " + s
                        + "\nLine #" + locator.getLineNumber()
                        + " Column #" + locator.getColumnNumber()));
            }
        }
View Full Code Here

                            Locator locator,
                            Attributes attlist,
                            PropertyList propertyList) throws FOPException {
        //super.processNode(elementName, locator, attlist, propertyList);

        ResultCollector collector = ResultCollector.getInstance();
        String propName = attlist.getValue("property");
        String component = null;
        int dotIndex = propName.indexOf('.');
        if (dotIndex >= 0) {
            component = propName.substring(dotIndex + 1);
            propName = propName.substring(0, dotIndex);
        }
        int propID = FOPropertyMapping.getPropertyId(propName);
        if (propID < 0) {
            collector.notifyException(new IllegalArgumentException(
                    "Property not found: " + propName));
        } else {
            Property prop;
            prop = propertyList.getParentPropertyList().get(propID);
            if (component != null) {
                //Access subcomponent
                Property mainProp = prop;
                prop = null;
                LengthPairProperty lpp = mainProp.getLengthPair();
                if (lpp != null) {
                    prop = lpp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
                LengthRangeProperty lrp = mainProp.getLengthRange();
                if (lrp != null) {
                    prop = lrp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
            }
            String s = String.valueOf(prop);
            String expected = attlist.getValue("expected");
            if (!expected.equals(s)) {
                collector.notifyException(new IllegalStateException("Property '" + propName
                        + "' expected to evaluate to '" + expected + "' but got: " + s
                        + "\nLine #" + locator.getLineNumber()
                        + " Column #" + locator.getColumnNumber()));
            }
        }
View Full Code Here

                            Locator locator,
                            Attributes attlist,
                            PropertyList propertyList) throws FOPException {
        //super.processNode(elementName, locator, attlist, propertyList);

        ResultCollector collector = ResultCollector.getInstance();
        String propName = attlist.getValue("property");
        String component = null;
        int dotIndex = propName.indexOf('.');
        if (dotIndex >= 0) {
            component = propName.substring(dotIndex + 1);
            propName = propName.substring(0, dotIndex);
        }
        int propID = FOPropertyMapping.getPropertyId(propName);
        if (propID < 0) {
            collector.notifyException(new IllegalArgumentException(
                    "Property not found: " + propName));
        } else {
            Property prop;
            prop = propertyList.getParentPropertyList().get(propID);
            if (component != null) {
                //Access subcomponent
                Property mainProp = prop;
                prop = null;
                LengthPairProperty lpp = mainProp.getLengthPair();
                if (lpp != null) {
                    prop = lpp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
            }
            String s = String.valueOf(prop);
            String expected = attlist.getValue("expected");
            if (!expected.equals(s)) {
                collector.notifyException(new IllegalStateException("Property '" + propName
                        + "' expected to evaluate to '" + expected + "' but got: " + s
                        + "\nLine #" + locator.getLineNumber()
                        + " Column #" + locator.getColumnNumber()));
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.fop.fotreetest.ResultCollector

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.