]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Minor enhancement of FOTree test output
authorAndreas L. Delmelle <adelmelle@apache.org>
Tue, 22 Aug 2006 01:39:35 +0000 (01:39 +0000)
committerAndreas L. Delmelle <adelmelle@apache.org>
Tue, 22 Aug 2006 01:39:35 +0000 (01:39 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@433456 13f79535-47bb-0310-9956-ffa450edef68

test/java/org/apache/fop/fotreetest/ext/AssertElement.java

index 3b678cdaef96ede9cf411d767b93cdba073eabb2..38bc0eb0004a6a430c3509b672d6d0dfe900d386 100644 (file)
@@ -28,6 +28,7 @@ import org.apache.fop.fo.properties.KeepProperty;
 import org.apache.fop.fo.properties.LengthPairProperty;
 import org.apache.fop.fo.properties.LengthRangeProperty;
 import org.apache.fop.fo.properties.Property;
+import org.apache.fop.fo.properties.SpaceProperty;
 import org.apache.fop.fotreetest.ResultCollector;
 
 import org.xml.sax.Attributes;
@@ -85,14 +86,23 @@ public class AssertElement extends TestObj {
                 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("Property '" + propName 
-                        + "' expected to evaluate to '" + expected + "' but got: " + s
-                        + "\nLine #" + locator.getLineNumber() 
-                        + " Column #" + locator.getColumnNumber()));
+                collector.notifyException(
+                    new IllegalStateException(locator.getSystemId()
+                        + "\nProperty '" + propName 
+                        + "' expected to evaluate to '" + expected 
+                        + "' but got '" + s
+                        + "'\n(test:assert in " 
+                        + propertyList.getParentFObj().getName()
+                        + " at line #" + locator.getLineNumber() 
+                        + ", column #" + locator.getColumnNumber() + ")\n"));
             }
         }