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/09/05 19:58:40 UTC
cvs commit: jakarta-commons-sandbox/jelly/xdocs jellyunit.xml index.xml navigation.xml
jstrachan 2002/09/05 10:58:40
Modified: jelly/xdocs jellyunit.xml index.xml navigation.xml
Log:
Added documentation on Mock Tags.
Also used the new meme from Joe Germuska, which is the best one anyone's come up with yet 'executable XML'.
Revision Changes Path
1.6 +30 -0 jakarta-commons-sandbox/jelly/xdocs/jellyunit.xml
Index: jellyunit.xml
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/xdocs/jellyunit.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- jellyunit.xml 30 Aug 2002 15:30:57 -0000 1.5
+++ jellyunit.xml 5 Sep 2002 17:58:40 -0000 1.6
@@ -30,6 +30,7 @@
Jelly scripts or XML data files and use this data to define new test cases.
</p>
</section>
+
<section name="Examples">
<p>
There is a simple example JellyUnit script
@@ -47,6 +48,35 @@
<a href="http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/validate/suite.jelly?rev=HEAD">here</a>
</p>
</section>
+
+ <section name="Mock Tags">
+ <p>
+ In unit testing scenarios its often useful to use
+ <a href="http://c2.com/cgi/wiki?MockObject">Mock Objects</a> to test application logic and stub the behaviour
+ of other service
+ </p>
+ <p>
+ JellyUnit supports a feature called <i>Mock Tags</i> which are very similar to Mock Objects.
+ Mock Tags were invented by by Joe Walnes.
+ </p>
+ <p>
+ Essentially the technique is to mock, or stub the behaviour of Jelly tags so that they give the results that you expect
+ from services.
+ For example imagine you had a Jelly script with tags which worked with databases or web services.
+ You could use mock tags to stub what the tags are meant to do, to test your script invokes them correctly
+ without requiring the underlying services
+ </p>
+ <p>
+ There's an and example of using Mock Tags via the <a href="tags.html#jelly:define">define</a> library
+ <a href="http://cvs.apache.org/viewcvs.cgi/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/mock/suite.jelly?rev=HEAD">here</a>
+ which creates the mock tags, inside a JellyUnit test case and then invokes this example
+ <a href="http://cvs.apache.org/viewcvs.cgi/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/mock/service.jelly?rev=HEAD">service</a>
+ using the mock tags rather than the underlying SQL and web service tags.
+ Running the same service from outside of the Mock Tags JellyUnit test case would use the real tag implementations.
+ </p>
+ </section>
+
+
<section name="Integration with TestRunners">
<p>
To integrate cleanly inside JUnit TestRunner frameworks there is a helper class,
1.13 +14 -10 jakarta-commons-sandbox/jelly/xdocs/index.xml
Index: index.xml
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/xdocs/index.xml,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- index.xml 22 Jul 2002 08:08:46 -0000 1.12
+++ index.xml 5 Sep 2002 17:58:40 -0000 1.13
@@ -3,26 +3,30 @@
<document>
<properties>
- <title>Jelly : Java and XML based processing engine</title>
+ <title>Jelly : Executable XML</title>
<author email="jstrachan@apache.org">James Strachan</author>
</properties>
<body>
-<section name="Jelly : Java and XML based processing engine">
+<section name="Jelly : Executable XML">
-<p><em>Jelly</em> is a Java and XML based scripting and processing engine.
-Jelly can be used as a more flexible front end to <a href="http://jakarta.apache.org/ant/">Ant</a>
+<p><em>Jelly</em> is a tool for turning XML into executable code.
+So Jelly is a Java and XML based scripting and processing engine.
+Jelly can be used as a more flexible and powerful front end
+to <a href="http://jakarta.apache.org/ant/">Ant</a>
such as in the <a href="http://jakarta.apache.org/turbine/maven/">Maven</a>
-project, as a testing framework such as <a href="jellyunit.html">JellyUnit</a>, in an intgration or workflow
-system such as <a href="http://werkflow.werken.com/">werkflow</a> or as a page templating system
-inside engines like <a href="http://xml.apache.org/cocoon/">Cocoon</a>.
+project, as a testing framework such as <a href="jellyunit.html">JellyUnit</a>,
+in an intergration or workflow
+system such as <a href="http://werkflow.werken.com/">werkflow</a>
+or as a page templating system inside engines like
+<a href="http://xml.apache.org/cocoon/">Cocoon</a>.
</p>
<p>
-Jelly borrows many good ideas from both JSP custom tags, Velocity, Cocoon, Ant and the
-scripting engine inside XDoclet. Jelly can be used from the command line, inside
-Ant and Maven or inside a Servlet, Web Service, JMS MessageListener or embedded directly into your software.
+Jelly borrows many good ideas from both JSP custom tags, Velocity, Cocoon, Ant.
+Jelly can be used from the command line, inside Ant and
+Maven or inside a Servlet, Web Service, JMS MessageListener or embedded directly into your software.
</p>
<p>
1.13 +2 -2 jakarta-commons-sandbox/jelly/xdocs/navigation.xml
Index: navigation.xml
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/xdocs/navigation.xml,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- navigation.xml 1 Aug 2002 05:39:02 -0000 1.12
+++ navigation.xml 5 Sep 2002 17:58:40 -0000 1.13
@@ -14,8 +14,8 @@
<item name="To Do List" href="/todo.html"/>
</menu>
<menu name="Community">
- <item name="News Blog" href="http://blogs.werken.com/projects/jelly/"/>
- <item name="IRC" href="/irc.html"/>
+ <item name="News Blog" href="http://blogs.werken.com/projects/jelly/"/>
+ <item name="IRC" href="/irc.html"/>
<item name="Powered By" href="/powered.html"/>
</menu>
<menu name="Libraries">
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>