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 &gt; $2"
> >
> > The generated orion-ejb-jar.xml has:
> >
> >          <finder-method query="community = 1 AND expire &gt; 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

Reply via email to