You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Trygve Laugstøl <tr...@codehaus.org> on 2005/09/28 17:27:02 UTC

Re: Delivering mock objects for a public API [was Re: [m2] custom compiler mojo]

On Mon, 2005-09-26 at 22:02 +0000, John Fallows wrote:
> On 9/25/05, Trygve Laugstøl <tr...@codehaus.org> wrote:
> > On Sat, 2005-09-24 at 04:31 +0000, John Fallows wrote:
> > > On 9/23/05, Trygve Laugstøl <tr...@codehaus.org> wrote:
> > > > On Fri, 2005-09-23 at 08:03 +0000, John Fallows wrote:

[snip]

> > [1]: http://jira.codehaus.org/browse/MNG-932
> 
> Yes, I understand that it would be generally useful to deliver a
> subset of the unit test code as a JAR.
> 
> The above proposal still stands though, although the name "mock" can
> be treated as a placeholder for that subset until we have a better
> name.

Not sure I agree, what more than distributing the test do you need?

> Alternatively, is there any mileage in the idea of having completely
> separate sub-modules for main, mock, and test, all inside the
> api-module?

Don't think so, but I also think I'm missing some information here :)

--
Trygve


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


Re: Delivering mock objects for a public API [was Re: [m2] custom compiler mojo]

Posted by Brett Porter <br...@gmail.com>.
I think this one might be a new issue.

- Brett

On 10/13/05, John Fallows <jo...@gmail.com> wrote:
> Looks like the issue has been closed, but I couldn't find any way to
> customize the includes/excludes for the test jar.
>
> Is this supported already or should I file another issue?
>
> Kind Regards,
> John Fallows.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


Re: Delivering mock objects for a public API [was Re: [m2] custom compiler mojo]

Posted by John Fallows <jo...@gmail.com>.
On 10/9/05, Trygve Laugstøl <tr...@codehaus.org> wrote:
> On Thu, 2005-10-06 at 19:06 +0000, John Fallows wrote:
> > On 9/28/05, Trygve Laugstøl <tr...@codehaus.org> wrote:
> > > On Mon, 2005-09-26 at 22:02 +0000, John Fallows wrote:
> > > > On 9/25/05, Trygve Laugstøl <tr...@codehaus.org> wrote:
> > > > > On Sat, 2005-09-24 at 04:31 +0000, John Fallows wrote:
> > > > > > On 9/23/05, Trygve Laugstøl <tr...@codehaus.org> wrote:
> > > > > > > On Fri, 2005-09-23 at 08:03 +0000, John Fallows wrote:
> > >
> > > [snip]
> > >
> > > > > [1]: http://jira.codehaus.org/browse/MNG-932
> > > >
> > > > Yes, I understand that it would be generally useful to deliver a
> > > > subset of the unit test code as a JAR.
> > > >
> > > > The above proposal still stands though, although the name "mock" can
> > > > be treated as a placeholder for that subset until we have a better
> > > > name.
> > >
> > > Not sure I agree, what more than distributing the test do you need?
> >
> > We need to make sure that not all the test code is delivered in the
> > JAR, just the mocks.
> >
> > The reason is that this mock JAR is essentially a public API for
> > testing, so any other test implementation code for the API project
> > should not be included.
> >
> > This will prevent test authors using the mock JAR from inadvertently
> > establishing a dependency on non-public test code in their own tests,
> > that would then break when the API tests are changed.
>
> I think that the above JIRA issue is sufficient for your use case too as
> it will have to include some form of includes/excludes thing. At least
> there's a lot of stuff that's shared between installing a -test and a
> -mock jar that will have to be resolved (as commented in the issue)
> first.

Looks like the issue has been closed, but I couldn't find any way to
customize the includes/excludes for the test jar.

Is this supported already or should I file another issue?

Kind Regards,
John Fallows.

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


Re: Delivering mock objects for a public API [was Re: [m2] custom compiler mojo]

Posted by Trygve Laugstøl <tr...@codehaus.org>.
On Thu, 2005-10-06 at 19:06 +0000, John Fallows wrote:
> On 9/28/05, Trygve Laugstøl <tr...@codehaus.org> wrote:
> > On Mon, 2005-09-26 at 22:02 +0000, John Fallows wrote:
> > > On 9/25/05, Trygve Laugstøl <tr...@codehaus.org> wrote:
> > > > On Sat, 2005-09-24 at 04:31 +0000, John Fallows wrote:
> > > > > On 9/23/05, Trygve Laugstøl <tr...@codehaus.org> wrote:
> > > > > > On Fri, 2005-09-23 at 08:03 +0000, John Fallows wrote:
> >
> > [snip]
> >
> > > > [1]: http://jira.codehaus.org/browse/MNG-932
> > >
> > > Yes, I understand that it would be generally useful to deliver a
> > > subset of the unit test code as a JAR.
> > >
> > > The above proposal still stands though, although the name "mock" can
> > > be treated as a placeholder for that subset until we have a better
> > > name.
> >
> > Not sure I agree, what more than distributing the test do you need?
> 
> We need to make sure that not all the test code is delivered in the
> JAR, just the mocks.
> 
> The reason is that this mock JAR is essentially a public API for
> testing, so any other test implementation code for the API project
> should not be included.
> 
> This will prevent test authors using the mock JAR from inadvertently
> establishing a dependency on non-public test code in their own tests,
> that would then break when the API tests are changed.

I think that the above JIRA issue is sufficient for your use case too as
it will have to include some form of includes/excludes thing. At least
there's a lot of stuff that's shared between installing a -test and a
-mock jar that will have to be resolved (as commented in the issue)
first.

> >
> > > Alternatively, is there any mileage in the idea of having completely
> > > separate sub-modules for main, mock, and test, all inside the
> > > api-module?
> >
> > Don't think so, but I also think I'm missing some information here :)
> 
> Let me know what you think, now that the above additional requirement
> is more clear.

--
Trygve


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


Re: Delivering mock objects for a public API [was Re: [m2] custom compiler mojo]

Posted by John Fallows <jo...@gmail.com>.
On 9/28/05, Trygve Laugstøl <tr...@codehaus.org> wrote:
> On Mon, 2005-09-26 at 22:02 +0000, John Fallows wrote:
> > On 9/25/05, Trygve Laugstøl <tr...@codehaus.org> wrote:
> > > On Sat, 2005-09-24 at 04:31 +0000, John Fallows wrote:
> > > > On 9/23/05, Trygve Laugstøl <tr...@codehaus.org> wrote:
> > > > > On Fri, 2005-09-23 at 08:03 +0000, John Fallows wrote:
>
> [snip]
>
> > > [1]: http://jira.codehaus.org/browse/MNG-932
> >
> > Yes, I understand that it would be generally useful to deliver a
> > subset of the unit test code as a JAR.
> >
> > The above proposal still stands though, although the name "mock" can
> > be treated as a placeholder for that subset until we have a better
> > name.
>
> Not sure I agree, what more than distributing the test do you need?

We need to make sure that not all the test code is delivered in the
JAR, just the mocks.

The reason is that this mock JAR is essentially a public API for
testing, so any other test implementation code for the API project
should not be included.

This will prevent test authors using the mock JAR from inadvertently
establishing a dependency on non-public test code in their own tests,
that would then break when the API tests are changed.

>
> > Alternatively, is there any mileage in the idea of having completely
> > separate sub-modules for main, mock, and test, all inside the
> > api-module?
>
> Don't think so, but I also think I'm missing some information here :)

Let me know what you think, now that the above additional requirement
is more clear.

Thanks in advance.

Kind Regards,
John Fallows.

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