I just commit this.
Rules
========
All Test Java sources will be under "xdoclet.test" and "xdoclet.retest"
(re is for Regression)
In directory "core/test" :
- src/xdoclet/test : put here unit tests for xdoclet classes. Follow
same package naming
Example
xdoclet.test.xdoclet.XDocletTagSupportTest
for unit testing
xdoclet.XDocletTagSupport
- src/xdoclet/retest/test : put here Regression/Comparison test cases
- src/xdoclet/retest/bean : the tagged sources from wich you will
generate
- src/xdoclet/retest/ref : the reference sources (if any) to compare
with generated sources
- src/xml-ref : the reference deployment descriptor to compare
with generated ones
These are tests that will compare generated files from one or multiple
simple tagged sources.
You have basic TestCase to compare what you want to compare (All DD,
JBossDD, ejb-jar DD, EntityBean, Home interfaces, ...)
Example
xdoclet.retest.test.ejb.SimpleSLBeanTest do class and DD
comparison for the bean:
xdoclet.retest.bean.ejb.ejb.SimpleSLBean
References for this one are under:
xdoclet.retest.bean.ejb.ejb.SimpleSL*
xdoclet.retest.bean.ejb.interfaces.SimpleSL*
xml-ref/SimpleSL
Example 2
xdoclet.retest.test.ejb.EnvBeanTest do DD comparison only
(env-entry is tested here)
References of ejb-jar.xml is under:
xml-ref/Env
How to run build :
build (-) : runs xdoclet classes test cases AND
regression test cases
build test-xdoclet : runs xdoclet classes test cases only (Avoid xdoclet
generation ==> fast)
For both a Junit HTML report is generated under
build/junit/reports/index.html
Some tests will not pass, this is ok for the moment
This certainly needs improvement, build clean has never been tested
!(ooooppppssss), etc...
Vincent.
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]] On Behalf
> Of Erik Hatcher
> Sent: lundi 11 mars 2002 19:07
> To: [EMAIL PROTECTED]
> Subject: [Xdoclet-devel] Re: [Xdoclet-user] 1.1.2 breakage
>
>
> I took a quick look at how the test cases in XDoclet are laid
> out and I didn't find a simple way to drop in a test case to
> verify that Ant property substitution is working properly.
> Here's the quick hack that I used to make sure its working ok though:
>
> Map map = new HashMap();
> map.put( "prop", "val" );
> map.put( "prop2", "val2" );
> System.out.println( "should be $123: " + replaceProperties(
> "$123", map ) );
> System.out.println( "should be val: " + replaceProperties(
> "${prop}", map ) );
> System.out.println( "should be val,val2: " +
> replaceProperties( "${prop},${prop2}", map ) );
> System.out.println( "should be xyz: " + replaceProperties(
> "xyz", map ) );
> System.out.println( "should be ${prop: " +
> replaceProperties( "${prop", map ) );
> System.out.println( "should be ${no.prop}: " +
> replaceProperties( "${no.prop}", map ) );
>
> Please drop this into a test case with asserts for the
> "should be" stuff. Let me know where I can place a test case
> if you'd like me to do it.
>
> Erik
>
>
>
> ----- Original Message -----
> From: "Erik Hatcher" <[EMAIL PROTECTED]>
> To: "Hani Suleiman" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Monday, March 11, 2002 12:48 PM
> Subject: Re: [Xdoclet-user] 1.1.2 breakage
>
>
> > Yes, this turns out to have been my fault. I will attempt to get a
> > test case written to ensure this doesn't happen again. The
> patch to
> > fix this
> is:
> >
> > cvs -q diff -u core/src/xdoclet/XDocletTagSupport.java
> > Index: core/src/xdoclet/XDocletTagSupport.java
> > ===================================================================
> > RCS file:
> /cvsroot/xdoclet/xdoclet/core/src/xdoclet/XDocletTagSupport.java,v
> > retrieving revision 1.24
> > diff -u -r1.24 XDocletTagSupport.java
> > --- core/src/xdoclet/XDocletTagSupport.java 4 Mar 2002
> 21:57:32 -0000
> > 1.24
> > +++ core/src/xdoclet/XDocletTagSupport.java 11 Mar 2002
> 17:46:09 -0000
> > @@ -458,8 +458,8 @@
> > }
> > else if( value.charAt( pos + 1 ) != '{' )
> > {
> > - fragments.addElement( value.substring( pos + 1, pos + 2 ) );
> > - prev = pos + 2;
> > + fragments.addElement( value.substring(
> pos, pos + 1 ) );
> > + prev = pos + 1;
> > }
> > else
> > {
> >
> >
> >
> >
> > ----- Original Message -----
> > From: "Hani Suleiman" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, March 11, 2002 11:41 AM
> > Subject: Re: [Xdoclet-user] 1.1.2 breakage
> >
> >
> > > No idea, the template hasn't changed, so it's something that'd
> > > affect anything using a $ I would image...in my ejb I have:
> > >
> > > orion-query="$community = $1 AND $expire > $2"
> > >
> > > The generated orion-ejb-jar.xml has:
> > >
> > > <finder-method query="community = 1 AND expire > 2">
> > >
> > > On 11/3/02 11:32 am, "Erik Hatcher" <[EMAIL PROTECTED]>
> > > wrote:
> > >
> > > > Uh, oh..... is this related to my Ant properties patch? I'm
> > > > pretty
> > certain
> > > > that it should not have stripped "$" out though.
> > > >
> > > >
> > > > ----- Original Message -----
> > > > From: "Hani Suleiman" <[EMAIL PROTECTED]>
> > > > To: <[EMAIL PROTECTED]>
> > > > Sent: Monday, March 11, 2002 11:08 AM
> > > > Subject: [Xdoclet-user] 1.1.2 breakage
> > > >
> > > >
> > > >> Something changed in 1.1.2, such that orion finder
> automatically
> > > >> lose
> > the
> > > >> '$' character, this is no good as it makes the sql
> hardcoded per
> > finder,
> > > >> rather than allowing the appserver to substitute in the column
> > name/value
> > > >> correctly. I'm not sure when this broke, as I have
> been running a
> > > >> cvs version a few weeks old.
> > > >>
> > > >> Eg:
> > > >>
> > > >> Orion-query="$field1 = $1 and $field2 = $2"
> > > >>
> > > >> Shows up as:
> > > >>
> > > >> Orion-query="field1 = 1 and field2 =2"
> > > >>
> > > >>
> > > >> _______________________________________________
> > > >> Xdoclet-user mailing list [EMAIL PROTECTED]
> > > >> https://lists.sourceforge.net/lists/listinfo/xdoclet-user
> > > >>
> > > >
> > > >
> > > > _______________________________________________
> > > > Xdoclet-user mailing list [EMAIL PROTECTED]
> > > > https://lists.sourceforge.net/lists/listinfo/xdoclet-user
> > > >
> > >
> > >
> > > _______________________________________________
> > > Xdoclet-user mailing list [EMAIL PROTECTED]
> > > https://lists.sourceforge.net/lists/listinfo/xdoclet-user
> > >
> >
> >
> > _______________________________________________
> > Xdoclet-user mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/xdoclet-user
> >
>
>
> _______________________________________________
> Xdoclet-devel mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/xdoclet-devel
>
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel