You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Jason van Zyl <jv...@maven.org> on 2004/01/05 05:28:58 UTC

xml unit testing

Howdy,

I know that XmlUnit exists but does anyone have any recommendations for
xml unit testing tools? A lot of the plugins generate xml and I want to
improve the testing across the plugins so I figure with a good xml unit
testing tool I can probably make a start at plugin tests for many of the
plugins missing tests.

./ant/src/plugin-test
./aspectwerkz/src/plugin-test
./changes/src/plugin-test
./checkstyle/src/plugin-test
./clean/clean/src/plugin-test
./clean/src/plugin-test
./clover/src/plugin-test
./dashboard/src/plugin-test
./deploy/src/plugin-test
./dist/src/plugin-test
./ear/src/plugin-test
./faq/src/plugin-test
./gump/src/plugin-test
./html2xdoc/src/plugin-test
./java/src/plugin-test
./plugin/src/plugin-test
./war/src/plugin-test
./xdoc/src/plugin-test

That's all we have which I will take a stab at improving tomorrow. I
hope to make a shell of a little tool, a harness of sorts, for testing
plugins independently across various versions of maven.

-- 
jvz.

Jason van Zyl
jason@zenplex.com
http://tambora.zenplex.org

In short, man creates for himself a new religion of a rational
and technical order to justify his work and to be justified in it.
  
  -- Jacques Ellul, The Technological Society


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


html2xdoc test error

Posted by Anthony Vito <vi...@mnis.com>.
Thought I'd throw this at the devel list, might help come up with a good
solution to this type of issue.

I built HEAD today I get this error in the testing of html2xdoc,
and bunch of related exceptions that follow.

<snip>
     [exec] +----------------------------------------
     [exec] | Testing Maven Html2XDoc Plug-in
     [exec] | Memory: 36M/50M
     [exec] +----------------------------------------
<snip>
     [exec] Validating project-info.html
     [exec] Validating team-list.html
     [exec]     [echo] Generating
/home/<snip>/maven-plugins/html2xdoc/src/plugin-test/target/docs/linkcheck.html from /home/<snip>/maven-plugins/html2xdoc/src/plugin-test/target/linkcheck/docs/linkcheck.xml
     [exec] com.werken.werkz.UnattainableGoalException: Unable to obtain
goal [test-html2xdoc-site] --
file:/usr/local/maven/plugins/maven-xdoc-plugin-1.6-SNAPSHOT/plugin.jelly:327:54: <j:include> could not include jelly script: file://usr/local/maven/plugins/maven-xdoc-plugin-1.6-SNAPSHOT/plugin-resources/site.jsl. Reason: org.apache.commons.jelly.JellyException: null:-1:-1: <null> Could not parse Jelly script
     [exec]     at com.werken.werkz.Goal.fire(Goal.java:646)
     [exec]     at com.werken.werkz.Goal.attain(Goal.java:575)
<snip>

Now the funny this is the site.jsl is just fine for everything else
using xdocs up until this point. I was able to prevent this error from
occuring with the following patch to the xdoc plugin.jelly. I know I've
ran into these issues with Xerces vs other xml libraries before. I've
often found adding more slashes makes everything work.

Index: plugin.jelly
===================================================================
RCS file: /home/cvspublic/maven-plugins/xdoc/plugin.jelly,v
retrieving revision 1.54
diff -u -r1.54 plugin.jelly
--- plugin.jelly        2 Feb 2004 04:40:25 -0000       1.54
+++ plugin.jelly        1 Mar 2004 19:35:04 -0000
@@ -362,7 +362,7 @@
         plugin='maven-xdoc-plugin'
property='maven.xdoc.crumb.separator' />

       <j:set var="outputDirectory" value="${maven.gen.docs}" />
-      <j:set var="stylesheet"
value="file:/${plugin.resources}/site.jsl" />
+      <j:set var="stylesheet"
value="file://${plugin.resources}/site.jsl" />

       <j:set var="outputencoding" value="${maven.docs.outputencoding}"
/>

-vito

ps. keep google turd on bottom.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: xml unit testing

Posted by Jason van Zyl <jv...@maven.org>.
On Mon, 2004-01-05 at 08:54, Jeffrey D. Brekke wrote:
> Thinking along the lines of acceptance/customer tests...
> 
> If what you're really wanting to test is that the generated xml
> matches some golden xml file, ala diff of two xml files, xmlunit is
> the best I've found.

Cool, I will look into that today and make a little tool with it and try
it.

> I've also just read the xml into domain objects and checked those and
> actually used jrcs to diff two streams/readers in a generic way as
> alternatives.

That's interesting, maybe we can chat in IRC about your technique. I can
think of some non-XML where that would be useful.

> >>>>> On Sun, 04 Jan 2004 23:28:58 -0500, Jason van Zyl <jv...@maven.org> said:
> 
> > Howdy, I know that XmlUnit exists but does anyone have any
> > recommendations for xml unit testing tools? A lot of the plugins
> > generate xml and I want to improve the testing across the plugins so
> > I figure with a good xml unit testing tool I can probably make a
> > start at plugin tests for many of the plugins missing tests.
> 
> > ./ant/src/plugin-test ./aspectwerkz/src/plugin-test
> > ./changes/src/plugin-test ./checkstyle/src/plugin-test
> > ./clean/clean/src/plugin-test ./clean/src/plugin-test
> > ./clover/src/plugin-test ./dashboard/src/plugin-test
> > ./deploy/src/plugin-test ./dist/src/plugin-test
> > ./ear/src/plugin-test ./faq/src/plugin-test ./gump/src/plugin-test
> > ./html2xdoc/src/plugin-test ./java/src/plugin-test
> > ./plugin/src/plugin-test ./war/src/plugin-test
> > ./xdoc/src/plugin-test
> 
> > That's all we have which I will take a stab at improving tomorrow. I
> > hope to make a shell of a little tool, a harness of sorts, for
> > testing plugins independently across various versions of maven.
> 
> > -- jvz.
> 
> > Jason van Zyl jason@zenplex.com http://tambora.zenplex.org
> 
> > In short, man creates for himself a new religion of a rational and
> > technical order to justify his work and to be justified in it.
>   
> >   -- Jacques Ellul, The Technological Society
> 
> 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For
> > additional commands, e-mail: dev-help@maven.apache.org
-- 
jvz.

Jason van Zyl
jason@zenplex.com
http://tambora.zenplex.org

In short, man creates for himself a new religion of a rational
and technical order to justify his work and to be justified in it.
  
  -- Jacques Ellul, The Technological Society


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: xml unit testing

Posted by "Jeffrey D. Brekke" <jb...@wi.rr.com>.
Thinking along the lines of acceptance/customer tests...

If what you're really wanting to test is that the generated xml
matches some golden xml file, ala diff of two xml files, xmlunit is
the best I've found.

I've also just read the xml into domain objects and checked those and
actually used jrcs to diff two streams/readers in a generic way as
alternatives.

>>>>> On Sun, 04 Jan 2004 23:28:58 -0500, Jason van Zyl <jv...@maven.org> said:

> Howdy, I know that XmlUnit exists but does anyone have any
> recommendations for xml unit testing tools? A lot of the plugins
> generate xml and I want to improve the testing across the plugins so
> I figure with a good xml unit testing tool I can probably make a
> start at plugin tests for many of the plugins missing tests.

> ./ant/src/plugin-test ./aspectwerkz/src/plugin-test
> ./changes/src/plugin-test ./checkstyle/src/plugin-test
> ./clean/clean/src/plugin-test ./clean/src/plugin-test
> ./clover/src/plugin-test ./dashboard/src/plugin-test
> ./deploy/src/plugin-test ./dist/src/plugin-test
> ./ear/src/plugin-test ./faq/src/plugin-test ./gump/src/plugin-test
> ./html2xdoc/src/plugin-test ./java/src/plugin-test
> ./plugin/src/plugin-test ./war/src/plugin-test
> ./xdoc/src/plugin-test

> That's all we have which I will take a stab at improving tomorrow. I
> hope to make a shell of a little tool, a harness of sorts, for
> testing plugins independently across various versions of maven.

> -- jvz.

> Jason van Zyl jason@zenplex.com http://tambora.zenplex.org

> In short, man creates for himself a new religion of a rational and
> technical order to justify his work and to be justified in it.
  
>   -- Jacques Ellul, The Technological Society


> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For
> additional commands, e-mail: dev-help@maven.apache.org

-- 
=====================================================================
Jeffrey D. Brekke                                   jbrekke@wi.rr.com
Wisconsin,  USA                                     brekke@apache.org
                                                    ekkerbj@yahoo.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


RE: xml unit testing

Posted by Jason van Zyl <jv...@maven.org>.
On Mon, 2004-01-05 at 02:44, Vincent Massol wrote:
> Hi Jason,
> 
> I can think of 2 ways for doing this:
> 
> - xmlunit :-)

Yah, that seems to be the front runner.

> - using directly Jelly (the xml taglib) as I've done in several plugin
> tests. It won't test the full generated XML (is that necessary? I don't
> think so) but only the "important" parts.

I'm not using Jelly.

> -Vincent
> 
> > -----Original Message-----
> > From: Jason van Zyl [mailto:jvanzyl@maven.org]
> > Sent: 05 January 2004 05:29
> > To: Maven Developers List
> > Subject: xml unit testing
> > 
> > Howdy,
> > 
> > I know that XmlUnit exists but does anyone have any recommendations
> for
> > xml unit testing tools? A lot of the plugins generate xml and I want
> to
> > improve the testing across the plugins so I figure with a good xml
> unit
> > testing tool I can probably make a start at plugin tests for many of
> the
> > plugins missing tests.
> > 
> > ./ant/src/plugin-test
> > ./aspectwerkz/src/plugin-test
> > ./changes/src/plugin-test
> > ./checkstyle/src/plugin-test
> > ./clean/clean/src/plugin-test
> > ./clean/src/plugin-test
> > ./clover/src/plugin-test
> > ./dashboard/src/plugin-test
> > ./deploy/src/plugin-test
> > ./dist/src/plugin-test
> > ./ear/src/plugin-test
> > ./faq/src/plugin-test
> > ./gump/src/plugin-test
> > ./html2xdoc/src/plugin-test
> > ./java/src/plugin-test
> > ./plugin/src/plugin-test
> > ./war/src/plugin-test
> > ./xdoc/src/plugin-test
> > 
> > That's all we have which I will take a stab at improving tomorrow. I
> > hope to make a shell of a little tool, a harness of sorts, for testing
> > plugins independently across various versions of maven.
> > 
> > --
> > jvz.
> > 
> > Jason van Zyl
> > jason@zenplex.com
> > http://tambora.zenplex.org
> > 
> > In short, man creates for himself a new religion of a rational
> > and technical order to justify his work and to be justified in it.
> > 
> >   -- Jacques Ellul, The Technological Society
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
-- 
jvz.

Jason van Zyl
jason@zenplex.com
http://tambora.zenplex.org

In short, man creates for himself a new religion of a rational
and technical order to justify his work and to be justified in it.
  
  -- Jacques Ellul, The Technological Society


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


RE: xml unit testing

Posted by Vincent Massol <vm...@pivolis.com>.
Hi Jason,

I can think of 2 ways for doing this:

- xmlunit :-)
- using directly Jelly (the xml taglib) as I've done in several plugin
tests. It won't test the full generated XML (is that necessary? I don't
think so) but only the "important" parts.

-Vincent

> -----Original Message-----
> From: Jason van Zyl [mailto:jvanzyl@maven.org]
> Sent: 05 January 2004 05:29
> To: Maven Developers List
> Subject: xml unit testing
> 
> Howdy,
> 
> I know that XmlUnit exists but does anyone have any recommendations
for
> xml unit testing tools? A lot of the plugins generate xml and I want
to
> improve the testing across the plugins so I figure with a good xml
unit
> testing tool I can probably make a start at plugin tests for many of
the
> plugins missing tests.
> 
> ./ant/src/plugin-test
> ./aspectwerkz/src/plugin-test
> ./changes/src/plugin-test
> ./checkstyle/src/plugin-test
> ./clean/clean/src/plugin-test
> ./clean/src/plugin-test
> ./clover/src/plugin-test
> ./dashboard/src/plugin-test
> ./deploy/src/plugin-test
> ./dist/src/plugin-test
> ./ear/src/plugin-test
> ./faq/src/plugin-test
> ./gump/src/plugin-test
> ./html2xdoc/src/plugin-test
> ./java/src/plugin-test
> ./plugin/src/plugin-test
> ./war/src/plugin-test
> ./xdoc/src/plugin-test
> 
> That's all we have which I will take a stab at improving tomorrow. I
> hope to make a shell of a little tool, a harness of sorts, for testing
> plugins independently across various versions of maven.
> 
> --
> jvz.
> 
> Jason van Zyl
> jason@zenplex.com
> http://tambora.zenplex.org
> 
> In short, man creates for himself a new religion of a rational
> and technical order to justify his work and to be justified in it.
> 
>   -- Jacques Ellul, The Technological Society
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org