You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Morgan Delagrange <md...@yahoo.com> on 2003/01/14 22:19:12 UTC

[Jelly] using bean, junit, etc. tags in core unit tests

Hey all,

So I can't see an obvious way to do it in project.xml,
but I can write a preGoal in maven.xml that will allow
the core build to use non-core tags for unit tests. 
E.g. this is what you would need to do if we removed
the "bean" classes from the core:

  <preGoal name="test:compile">
  
    <mkdir dir="target/test-source"/>

    <copy todir="target/test-source">
      <!-- core unit test classes -->
      <fileset dir="src/test"/>
 
      <!-- 
        core unit tests rely on both the bean
        taglib and classes in the bean taglib's
        unit tests
      -->
      <fileset dir="jelly-tags/bean/src/test">
          <exclude name="**/Test*.java"/>
      </fileset>
      <fileset dir="jelly-tags/bean/src/java"/>
    </copy>
    
  </preGoal>

And then, of course, the "unitTestSourceDirectory" in
project.xml becomes "target/test-source".  Works
great, but unfortunately it doesn't allow for
automatic generation of the ant script.  Does anyone
know of a way to create a similar result while
preserving ant script generation?

- Morgan

=====
Morgan Delagrange
http://jakarta.apache.org/taglibs
http://jakarta.apache.org/commons
http://axion.tigris.org
http://jakarta.apache.org/watchdog

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Jelly] using bean, junit, etc. tags in core unit tests

Posted by di...@multitask.com.au.
Morgan Delagrange <md...@yahoo.com> wrote on 15/01/2003 10:24:30 AM:
>
> I don't think of it as a dependency, it's essentially
> just declaring multiple source trees for the test
> classes, and some of those test classes happen to have
> a Jelly tag interface.  It's not an elegant approach,
> but it does allow bean, junit, log, etc. tags to be
> released independently of the core, which I think is a
> good goal.
+1.

> Theoretically, do you think that an approach like this
> can be reflected in the generated Ant script?  Even if
> not, it may be worth an extra manual step to creating
> Ant scripts if no better way presents itself.
Sure, the junit tags would just be test source rather than project source.

> > I'd be happier if we could change the tests to not
> > rely on them.
> 
> I'd be fine with that if it didn't affect the
> effectiveness of the tests.  If we end up with equally
> good, non-convoluted tests, +1.
> 
> > I'm currently working on removing the bean code from
> > the core tests. It's 
> > tedious and error prone, but worthwhile AFAIK.
> 
> I was wondering what was going on there.  :)
> 
> Cool.  Even if we did end up including tags like junit
> in the unit tests, I'd prefer core to be completely
> decoupled from bean.
+1.

> It's inconvenient, but I think it's important that
> junit tags have a separate release cycle.  We can
> achieve this by including the junit tag classes with
> the test classes or by removing the junit tags in the
> core unit tests.  I'm fine with either, whatever works
> out the best for us.  There may be better approaches
> too; I'm open to suggestions.
Ditto.

Ok, enough 'me too'-ing.
--
dIon Gillard, Multitask Consulting
Blog:      http://www.freeroller.net/page/dion/Weblog
Work:      http://www.multitask.com.au




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Jelly] using bean, junit, etc. tags in core unit tests

Posted by Morgan Delagrange <md...@yahoo.com>.
--- dion@multitask.com.au wrote:
> I'm not so sure I like the idea of using jars for
> testing without 
> declaring them as a dependency.

I don't think of it as a dependency, it's essentially
just declaring multiple source trees for the test
classes, and some of those test classes happen to have
a Jelly tag interface.  It's not an elegant approach,
but it does allow bean, junit, log, etc. tags to be
released independently of the core, which I think is a
good goal.

Theoretically, do you think that an approach like this
can be reflected in the generated Ant script?  Even if
not, it may be worth an extra manual step to creating
Ant scripts if no better way presents itself.

> I'd be happier if we could change the tests to not
> rely on them.

I'd be fine with that if it didn't affect the
effectiveness of the tests.  If we end up with equally
good, non-convoluted tests, +1.

> I'm currently working on removing the bean code from
> the core tests. It's 
> tedious and error prone, but worthwhile AFAIK.

I was wondering what was going on there.  :)

Cool.  Even if we did end up including tags like junit
in the unit tests, I'd prefer core to be completely
decoupled from bean.

> If the core couldn't use the test and log taglibs I
> wouldn't be averse to 
> rewriting the existing tests to stop using them.

It's inconvenient, but I think it's important that
junit tags have a separate release cycle.  We can
achieve this by including the junit tag classes with
the test classes or by removing the junit tags in the
core unit tests.  I'm fine with either, whatever works
out the best for us.  There may be better approaches
too; I'm open to suggestions.

- Morgan

> --
> dIon Gillard, Multitask Consulting
> Blog:     
> http://www.freeroller.net/page/dion/Weblog
> Work:      http://www.multitask.com.au
> 
> 
> Morgan Delagrange <md...@yahoo.com> wrote on
> 15/01/2003 08:19:12 AM:
> 
> > Hey all,
> > 
> > So I can't see an obvious way to do it in
> project.xml,
> > but I can write a preGoal in maven.xml that will
> allow
> > the core build to use non-core tags for unit
> tests. 
> > E.g. this is what you would need to do if we
> removed
> > the "bean" classes from the core:
> > 
> >   <preGoal name="test:compile">
> > 
> >     <mkdir dir="target/test-source"/>
> > 
> >     <copy todir="target/test-source">
> >       <!-- core unit test classes -->
> >       <fileset dir="src/test"/>
> > 
> >       <!-- 
>         core unit tests rely on both the bean
>  
> > taglib and classes in the bean taglib's
>         unit tests
>       -->
> >       <fileset dir="jelly-tags/bean/src/test">
> >           <exclude name="**/Test*.java"/>
> >       </fileset>
> >       <fileset dir="jelly-tags/bean/src/java"/>
> >     </copy>
> > 
> >   </preGoal>
> > 
> > And then, of course, the "unitTestSourceDirectory"
> in
> > project.xml becomes "target/test-source".  Works
> > great, but unfortunately it doesn't allow for
> > automatic generation of the ant script.  Does
> anyone
> > know of a way to create a similar result while
> > preserving ant script generation?
> > 
> > - Morgan
> > 
> > =====
> > Morgan Delagrange
> > http://jakarta.apache.org/taglibs
> > http://jakarta.apache.org/commons
> > http://axion.tigris.org
> > http://jakarta.apache.org/watchdog
> > 
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! Mail Plus - Powerful. Affordable. Sign up
> now.
> > http://mailplus.yahoo.com
> > 
> > --
> > To unsubscribe, e-mail: 
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
> > 
> 
> > ForwardSourceID:NT000A2D6E 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


=====
Morgan Delagrange
http://jakarta.apache.org/taglibs
http://jakarta.apache.org/commons
http://axion.tigris.org
http://jakarta.apache.org/watchdog

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Jelly] using bean, junit, etc. tags in core unit tests

Posted by di...@multitask.com.au.
I'm not so sure I like the idea of using jars for testing without 
declaring them as a dependency.

I'd be happier if we could change the tests to not rely on them.

I'm currently working on removing the bean code from the core tests. It's 
tedious and error prone, but worthwhile AFAIK.

If the core couldn't use the test and log taglibs I wouldn't be averse to 
rewriting the existing tests to stop using them.
--
dIon Gillard, Multitask Consulting
Blog:      http://www.freeroller.net/page/dion/Weblog
Work:      http://www.multitask.com.au


Morgan Delagrange <md...@yahoo.com> wrote on 15/01/2003 08:19:12 AM:

> Hey all,
> 
> So I can't see an obvious way to do it in project.xml,
> but I can write a preGoal in maven.xml that will allow
> the core build to use non-core tags for unit tests. 
> E.g. this is what you would need to do if we removed
> the "bean" classes from the core:
> 
>   <preGoal name="test:compile">
> 
>     <mkdir dir="target/test-source"/>
> 
>     <copy todir="target/test-source">
>       <!-- core unit test classes -->
>       <fileset dir="src/test"/>
> 
>       <!-- 
        core unit tests rely on both the bean
 
> taglib and classes in the bean taglib's
        unit tests
      -->
>       <fileset dir="jelly-tags/bean/src/test">
>           <exclude name="**/Test*.java"/>
>       </fileset>
>       <fileset dir="jelly-tags/bean/src/java"/>
>     </copy>
> 
>   </preGoal>
> 
> And then, of course, the "unitTestSourceDirectory" in
> project.xml becomes "target/test-source".  Works
> great, but unfortunately it doesn't allow for
> automatic generation of the ant script.  Does anyone
> know of a way to create a similar result while
> preserving ant script generation?
> 
> - Morgan
> 
> =====
> Morgan Delagrange
> http://jakarta.apache.org/taglibs
> http://jakarta.apache.org/commons
> http://axion.tigris.org
> http://jakarta.apache.org/watchdog
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
> 
> --
> To unsubscribe, e-mail: 
<ma...@jakarta.apache.org>
> For additional commands, e-mail: 
<ma...@jakarta.apache.org>
> 

> ForwardSourceID:NT000A2D6E 

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>