maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Fallows <john.r.fall...@gmail.com>
Subject Re: [m2] mock classes
Date Thu, 15 Sep 2005 06:33:58 GMT
There seems to be a bigger issue here too.

What if I have the following project structure

project/
  api-module/
    src/
      main/
      mock/
      test/
  impl-module/
    src/
      main/
      test/

Now, api-module needs to provide mocks for use by both the api-module
unit tests the impl-module unit tests.

For impl-module unit test code to get the right dependency, the
api-module mocks must be delivered as a JAR.  This must be separate
from the the main api-module JAR.

So, why not just put the mocks in src/mock (alongside src/test) and
make a mocks JAR as the secondary api-module deliverable?

Well, that would need to JAR up the compiled mock classes which will
be in api-module/target/test-classes.  However, these test classes
also include the compiled src/test/java classes, as well as test
resources.

Note: it is also not possible to split this out as a separate module,
because there would be a cyclic dependency between api-module and
"api-mock-module".

Is there a way to deliver an api-module mock JAR that only contains
classes for mocks, and can be used by both the api-module unit tests
and the impl-module unit tests?

Kind Regards,
John Fallows.

On 9/13/05, Jorg Heymans <jh@domek.be> wrote:
> 
> Trygve Laugstøl wrote:
> 
> > Just treat the mocks as unit test source code and use
> >
> > <project>
> >   ..
> >   <build>
> >     ..
> >     <testSourceDirectory>mocks</testSourceDirectory>
> >     ..
> >   </build>
> > </project>
> >
> 
> Just tried this, doesn't seem to work.
> 
> 
> Jorg
> 
> 
> ---------------------------------------------------------------------
> 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


Mime
View raw message