aboutsummaryrefslogtreecommitdiffstats
path: root/test/java/org/apache/fop/fotreetest/ext
diff options
context:
space:
mode:
authorAndreas L. Delmelle <adelmelle@apache.org>2009-04-19 17:54:06 +0000
committerAndreas L. Delmelle <adelmelle@apache.org>2009-04-19 17:54:06 +0000
commit5deedc814cedf4e1c2ffa746a22bdba34b031d5d (patch)
tree8f837336338a9fb058ab5c6998698ebdfe58db4f /test/java/org/apache/fop/fotreetest/ext
parent8ba60984938cc6250b507f5742b4e99e437b7497 (diff)
downloadxmlgraphics-fop-5deedc814cedf4e1c2ffa746a22bdba34b031d5d.tar.gz
xmlgraphics-fop-5deedc814cedf4e1c2ffa746a22bdba34b031d5d.zip
Bugzilla 47027: Correction for interpretation of pixel-lengths, as suggested by Jeremias.
+ minor changes to the fotreetest-classes: distinguish between fatal errors due to malformed testcases, and genuine assertion failures. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@766492 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/java/org/apache/fop/fotreetest/ext')
-rw-r--r--test/java/org/apache/fop/fotreetest/ext/AssertElement.java19
1 files changed, 10 insertions, 9 deletions
diff --git a/test/java/org/apache/fop/fotreetest/ext/AssertElement.java b/test/java/org/apache/fop/fotreetest/ext/AssertElement.java
index 97b73947c..f4a76d7ed 100644
--- a/test/java/org/apache/fop/fotreetest/ext/AssertElement.java
+++ b/test/java/org/apache/fop/fotreetest/ext/AssertElement.java
@@ -41,7 +41,10 @@ import org.xml.sax.Locator;
public class AssertElement extends TestObj {
/**
- * @see org.apache.fop.fo.FONode#FONode(FONode)
+ * Creates a new AssertElement instance that is a child
+ * of the given {@link FONode}
+ *
+ * @param parent the parent {@link FONode}
*/
public AssertElement(FONode parent) {
super(parent);
@@ -58,6 +61,7 @@ public class AssertElement extends TestObj {
ResultCollector collector = ResultCollector.getInstance();
String propName = attlist.getValue("property");
+ String expected = attlist.getValue("expected");
String component = null;
int dotIndex = propName.indexOf('.');
if (dotIndex >= 0) {
@@ -66,8 +70,7 @@ public class AssertElement extends TestObj {
}
int propID = FOPropertyMapping.getPropertyId(propName);
if (propID < 0) {
- collector.notifyException(new IllegalArgumentException(
- "Property not found: " + propName));
+ collector.notifyAssertionFailure("Property not found: " + propName);
} else {
Property prop;
prop = propertyList.getParentPropertyList().get(propID);
@@ -94,21 +97,20 @@ public class AssertElement extends TestObj {
}
String s;
if (prop instanceof PercentLength) {
- s = ((PercentLength)prop).getString();
+ s = prop.getString();
} else {
s = String.valueOf(prop);
}
- String expected = attlist.getValue("expected");
if (!expected.equals(s)) {
- collector.notifyException(
- new IllegalStateException(locator.getSystemId()
+ collector.notifyAssertionFailure(
+ 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"));
+ + ", column #" + locator.getColumnNumber() + ")\n");
}
}
@@ -120,4 +122,3 @@ public class AssertElement extends TestObj {
}
}
-