You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Martin Marinschek <ma...@gmail.com> on 2006/01/24 12:30:45 UTC

Using testclasses across modules

Hi Maven-Gurus,

how do I solve the following problem:

I've written my mock-classes for certain testing issues in one module
(e.g. impl) and now need the same functionality in a dependent module
(e.g. tomahawk).

Is there anything like a test-test-dependency or so? Or do I have to
create a new module where this stuff is stored?

regards,

Martin

--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: Using testclasses across modules

Posted by Wendy Smoak <ws...@gmail.com>.
On 1/24/06, Sean Schofield <se...@gmail.com> wrote:

> @Wendy and Craig: Is Shale 1.0 officially "released" as alpha now or
> are we still dealing with snapshots?
>
> If we can use a stable alpha
> release (instead of a moving snapshot) I think a Shale dependency (for
> testing) is perfectly acceptable.

Shale 1.0.0 was officially graded alpha, and it's in the internal
Maven 1 repo.  I'm working on poms for the m2 snapshot repository;
that should be done by this weekend.

There are some notes on using Shale with m2, here:
   http://wiki.wsmoak.net/cgi-bin/wiki.pl?ShaleMaven2#use

HTH,
--
Wendy

Re: Using testclasses across modules

Posted by Sean Schofield <se...@gmail.com>.
This is a tricky problem.  If the mock stuff was for things in the api
it would be ideal to put it in commons.  (Commons depends on the api
but just for compiling - so we have a depedency on the already
released 1.1.1 version there.)

The only problem is that the test classes are not part of the local
snapshot of commons that you are building.  Normally this is a good
thing but it makes things difficult in your situation.

There are a few solutions as I see them.  Unfortunately none of them
are very attractive.

1.) Duplicate the code (worst solution of all)

2.) Create a new mock subproject.  It has a dependency on myfaces-api
1.1.1 (just like commons does.)  Then you tomahawk and impl have a
dependency on this snapshot with a scope of test.

3.) Create a dependency on shale's mock stuff.  You should check out
what Craig has done.  I haven't looked in detail but it seems pretty
complete.  Shale is still alpha but since this is a *test* dependency
I'm not so sure this is a bad thing.  I'm sure the Maven zealots will
disagree though.

@Wendy and Craig: Is Shale 1.0 officially "released" as alpha now or
are we still dealing with snapshots?  If we can use a stable alpha
release (instead of a moving snapshot) I think a Shale dependency (for
testing) is perfectly acceptable.

If the Shale stuff is missing something you need you can always send
me the patch since I'm a committer over there.

Sean

On 1/24/06, Martin Marinschek <ma...@gmail.com> wrote:
> to state it correct: I didn't want to imply that tomahawk has any
> dependency whatsoever on impl ;) ... bad example from my side...
>
> regards,
>
> Martin
>
> On 1/24/06, Martin Marinschek <ma...@gmail.com> wrote:
> > Hi Maven-Gurus,
> >
> > how do I solve the following problem:
> >
> > I've written my mock-classes for certain testing issues in one module
> > (e.g. impl) and now need the same functionality in a dependent module
> > (e.g. tomahawk).
> >
> > Is there anything like a test-test-dependency or so? Or do I have to
> > create a new module where this stuff is stored?
> >
> > regards,
> >
> > Martin
> >
> > --
> >
> > http://www.irian.at
> >
> > Your JSF powerhouse -
> > JSF Consulting, Development and
> > Courses in English and German
> >
> > Professional Support for Apache MyFaces
> >
>
>
> --
>
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>

Re: Using testclasses across modules

Posted by Martin Marinschek <ma...@gmail.com>.
to state it correct: I didn't want to imply that tomahawk has any
dependency whatsoever on impl ;) ... bad example from my side...

regards,

Martin

On 1/24/06, Martin Marinschek <ma...@gmail.com> wrote:
> Hi Maven-Gurus,
>
> how do I solve the following problem:
>
> I've written my mock-classes for certain testing issues in one module
> (e.g. impl) and now need the same functionality in a dependent module
> (e.g. tomahawk).
>
> Is there anything like a test-test-dependency or so? Or do I have to
> create a new module where this stuff is stored?
>
> regards,
>
> Martin
>
> --
>
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>


--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces