You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by js...@apache.org on 2002/08/09 17:46:55 UTC
cvs commit: jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/junit suite.jelly
jstrachan 2002/08/09 08:46:55
Modified: jelly/src/test/org/apache/commons/jelly/junit suite.jelly
Log:
Patched the <assert> tag so that <assert xpath="$doc/foo/bar"/> along with relative XPath assertions, like
<x:forEach select="$doc//foo">
<test:assert xpath="bar = 'cheese'"/>
now work fine. Also added unit test cases for these things finally
Revision Changes Path
1.2 +23 -1 jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/junit/suite.jelly
Index: suite.jelly
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/junit/suite.jelly,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- suite.jelly 22 Jul 2002 07:16:52 -0000 1.1
+++ suite.jelly 9 Aug 2002 15:46:55 -0000 1.2
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
-<test:suite xmlns:j="jelly:core" xmlns:test="jelly:junit">
+<test:suite xmlns:j="jelly:core" xmlns:test="jelly:junit" xmlns:x="jelly:xml">
<test:case name="assertTests">
@@ -7,6 +7,28 @@
<j:catch var="ex">
<test:assert test="${2 != 2}">This should always fail</test:assert>
+ </j:catch>
+
+ <test:assert test="${ex != null}">We should have created an exception</test:assert>
+
+ The exception was: ${ex.message}
+ </test:case>
+
+
+ <test:case name="assertXPathTests">
+
+ <x:parse var="doc">
+ <foo>
+ <bar>cheese</bar>
+ </foo>
+ </x:parse>
+
+
+ <test:assert xpath="$doc/foo/bar">This should never fail</test:assert>
+ <test:assert xpath="$doc/foo/bar = 'cheese'">This should never fail</test:assert>
+
+ <j:catch var="ex">
+ <test:assert xpath="$doc/foo/xyz">This should always fail</test:assert>
</j:catch>
<test:assert test="${ex != null}">We should have created an exception</test:assert>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>