Re: integration-test practices

2008-05-30 Thread Paul Davis
It looks like my original problem has been solved, it's an issue (bug?) with
the latest version of the surefire plugin.

http://www.nabble.com/Re%3A-Integration-testing-via-profile-fails-in-2.0.9-p17532410.html

Maybe the plugin could use a little automated testing too  ;-)

On Tue, May 27, 2008 at 10:19 PM, Jerome Lacoste <[EMAIL PROTECTED]>
wrote:

> On Tue, May 27, 2008 at 11:34 PM, Wendy Smoak <[EMAIL PROTECTED]> wrote:
> > On Tue, May 27, 2008 at 1:57 PM, Jerome Lacoste
> > <[EMAIL PROTECTED]> wrote:
> >> On Mon, May 26, 2008 at 1:41 AM, Kaizer H. Sogiawala <[EMAIL PROTECTED]>
> wrote:
> >>> A while back I came across a note about integration test - From a
> >>> single project POM you can only choose to execute either unit or the
> >>> integration test, not both. Could that be a factor in the outcome you
> >>> see?
> >>
> >> Are you sure of that ? Maven doesn't limit you. You can attach your
> >> mojos to the phase you want.
> >>
> >> I have a project under my eyes that binds surefire to the test phase,
> >> and easyb tests to the integration-test one.
> >
> > The limitation is that there is only one testSourceDirectory in the
> > pom.  If you use Surefire in both the test and integration-test
> > phases, you have to configure includes and excludes to get it to use
> > the right code for each set of tests.
>
> You're right: there's at least one big limitation is the compiler
> plugin. testCompile only uses the test source directory defined in the
> POM:
>
>/**
> * The source directories containing the test-source to be compiled.
> *
> * @parameter expression="${project.testCompileSourceRoots}"
> * @required
> * @readonly
> */
>private List compileSourceRoots;
>
> > My guess is that 'easyb' is using a different default or configuration
> > for its test source directory.
>
> yep. And all tools I've used for integration-tests had their own source
> dirs.
>
> So the problem is probably not that you can chose to execute it or
> unit test, it's that you can only compile one of them easily.
>
> Cheers,
>
> Jerome
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: integration-test practices

2008-05-27 Thread Jerome Lacoste
On Tue, May 27, 2008 at 11:34 PM, Wendy Smoak <[EMAIL PROTECTED]> wrote:
> On Tue, May 27, 2008 at 1:57 PM, Jerome Lacoste
> <[EMAIL PROTECTED]> wrote:
>> On Mon, May 26, 2008 at 1:41 AM, Kaizer H. Sogiawala <[EMAIL PROTECTED]> 
>> wrote:
>>> A while back I came across a note about integration test - From a
>>> single project POM you can only choose to execute either unit or the
>>> integration test, not both. Could that be a factor in the outcome you
>>> see?
>>
>> Are you sure of that ? Maven doesn't limit you. You can attach your
>> mojos to the phase you want.
>>
>> I have a project under my eyes that binds surefire to the test phase,
>> and easyb tests to the integration-test one.
>
> The limitation is that there is only one testSourceDirectory in the
> pom.  If you use Surefire in both the test and integration-test
> phases, you have to configure includes and excludes to get it to use
> the right code for each set of tests.

You're right: there's at least one big limitation is the compiler
plugin. testCompile only uses the test source directory defined in the
POM:

/**
 * The source directories containing the test-source to be compiled.
 *
 * @parameter expression="${project.testCompileSourceRoots}"
 * @required
 * @readonly
 */
private List compileSourceRoots;

> My guess is that 'easyb' is using a different default or configuration
> for its test source directory.

yep. And all tools I've used for integration-tests had their own source dirs.

So the problem is probably not that you can chose to execute it or
unit test, it's that you can only compile one of them easily.

Cheers,

Jerome

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: integration-test practices

2008-05-27 Thread Wendy Smoak
On Tue, May 27, 2008 at 1:57 PM, Jerome Lacoste
<[EMAIL PROTECTED]> wrote:
> On Mon, May 26, 2008 at 1:41 AM, Kaizer H. Sogiawala <[EMAIL PROTECTED]> 
> wrote:
>> A while back I came across a note about integration test - From a
>> single project POM you can only choose to execute either unit or the
>> integration test, not both. Could that be a factor in the outcome you
>> see?
>
> Are you sure of that ? Maven doesn't limit you. You can attach your
> mojos to the phase you want.
>
> I have a project under my eyes that binds surefire to the test phase,
> and easyb tests to the integration-test one.

The limitation is that there is only one testSourceDirectory in the
pom.  If you use Surefire in both the test and integration-test
phases, you have to configure includes and excludes to get it to use
the right code for each set of tests.

My guess is that 'easyb' is using a different default or configuration
for its test source directory.

-- 
Wendy

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: integration-test practices

2008-05-27 Thread Jerome Lacoste
On Mon, May 26, 2008 at 1:41 AM, Kaizer H. Sogiawala <[EMAIL PROTECTED]> wrote:
> A while back I came across a note about integration test - From a
> single project POM you can only choose to execute either unit or the
> integration test, not both. Could that be a factor in the outcome you
> see?

Are you sure of that ? Maven doesn't limit you. You can attach your
mojos to the phase you want.

I have a project under my eyes that binds surefire to the test phase,
and easyb tests to the integration-test one.

J

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: integration-test practices

2008-05-25 Thread Kaizer H. Sogiawala
A while back I came across a note about integration test - From a
single project POM you can only choose to execute either unit or the
integration test, not both. Could that be a factor in the outcome you
see?

On Thu, May 22, 2008 at 3:42 PM, Paul Davis <[EMAIL PROTECTED]> wrote:
> Before my response, I just want to say, I really appreciate you taking the
> time to help me with this.
>
> Yes, I am defining the src to look in "src/it/java".
> I heard a rumor that maven 2.1 would support that for integration tests so,
> I wanted to start using the location.
>
> I also have the integration tests in a separate module.
>
> My project structure looks like:
> /pom.xml
> /my-data-api/pom.xml
> /my-data-impl/pom.xml
> /my-web-module/pom.xml
> /functest/pom.xml
>
> The functest module contains the integration tests
> from the functest pom:
>
>
>src/it/java
>
>
>false
>src/it/resources
>
>
>
>
> There is a profile defined in that module to use the surefire plugin to run
> the tests in the integration test phase. The profile also uses the cargo
> plugin to start tomcat, deploy the web app for "pre-integration-test", and
> undeploy/shutdown tomcat for "post-integration-test".
>
> Everything is working fine for the integration tests to execute on the
> "integration-test" part of the project life-cycle except getting the
> resources to load up (unless they are in both places, mentioned before).
>
> The app is designed so that the "my-data-impl" module uses REST to
> communicate with an external server. It is instrumented with JMX so the
> integration test can tell it to use mock data, injected via JMX, instead of
> hitting the external server. This ensures tests that are repeatable.
>
> The thing is, the tests need to load up the mock data in order to be
> injected. Thus, my issue getting the files loaded from the classpath.
>
> I could have the files duplicated but, it's going to cause maintenance
> problems down the road
>
> On Thu, May 22, 2008 at 11:55 AM, Wendy Smoak <[EMAIL PROTECTED]> wrote:
>
>> On Thu, May 22, 2008 at 8:39 AM, Paul Davis <[EMAIL PROTECTED]> wrote:
>>
>> > I have found that if I place the resource (xml file) in both places, it
>> > works
>> > src/it/java
>> > src/test/resources
>> > However, if I only have one copy (in either location) it does not work.
>>
>> I wouldn't expect src/it/* to work, unless you are configuring a
>> plugin to look there.  AFAIK, nothing looks there by default.  Neither
>> are any plugins bound to the integration test phases in the default
>> lifecycle, so if you want to use those phases you need to do the
>> bindings yourself.
>>
>> I still don't have a good idea of what you're trying to do.  Can you
>> include some of the pom config and explain the project structure?  Are
>> the integration tests in a separate module?
>>
>> --
>> Wendy
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>



-- 
-- Kaizer H. Sogiawala

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: integration-test practices

2008-05-22 Thread Paul Davis
Before my response, I just want to say, I really appreciate you taking the
time to help me with this.

Yes, I am defining the src to look in "src/it/java".
I heard a rumor that maven 2.1 would support that for integration tests so,
I wanted to start using the location.

I also have the integration tests in a separate module.

My project structure looks like:
/pom.xml
/my-data-api/pom.xml
/my-data-impl/pom.xml
/my-web-module/pom.xml
/functest/pom.xml

The functest module contains the integration tests
from the functest pom:


src/it/java


false
src/it/resources




There is a profile defined in that module to use the surefire plugin to run
the tests in the integration test phase. The profile also uses the cargo
plugin to start tomcat, deploy the web app for "pre-integration-test", and
undeploy/shutdown tomcat for "post-integration-test".

Everything is working fine for the integration tests to execute on the
"integration-test" part of the project life-cycle except getting the
resources to load up (unless they are in both places, mentioned before).

The app is designed so that the "my-data-impl" module uses REST to
communicate with an external server. It is instrumented with JMX so the
integration test can tell it to use mock data, injected via JMX, instead of
hitting the external server. This ensures tests that are repeatable.

The thing is, the tests need to load up the mock data in order to be
injected. Thus, my issue getting the files loaded from the classpath.

I could have the files duplicated but, it's going to cause maintenance
problems down the road

On Thu, May 22, 2008 at 11:55 AM, Wendy Smoak <[EMAIL PROTECTED]> wrote:

> On Thu, May 22, 2008 at 8:39 AM, Paul Davis <[EMAIL PROTECTED]> wrote:
>
> > I have found that if I place the resource (xml file) in both places, it
> > works
> > src/it/java
> > src/test/resources
> > However, if I only have one copy (in either location) it does not work.
>
> I wouldn't expect src/it/* to work, unless you are configuring a
> plugin to look there.  AFAIK, nothing looks there by default.  Neither
> are any plugins bound to the integration test phases in the default
> lifecycle, so if you want to use those phases you need to do the
> bindings yourself.
>
> I still don't have a good idea of what you're trying to do.  Can you
> include some of the pom config and explain the project structure?  Are
> the integration tests in a separate module?
>
> --
> Wendy
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: integration-test practices

2008-05-22 Thread Wendy Smoak
On Thu, May 22, 2008 at 8:39 AM, Paul Davis <[EMAIL PROTECTED]> wrote:

> I have found that if I place the resource (xml file) in both places, it
> works
> src/it/java
> src/test/resources
> However, if I only have one copy (in either location) it does not work.

I wouldn't expect src/it/* to work, unless you are configuring a
plugin to look there.  AFAIK, nothing looks there by default.  Neither
are any plugins bound to the integration test phases in the default
lifecycle, so if you want to use those phases you need to do the
bindings yourself.

I still don't have a good idea of what you're trying to do.  Can you
include some of the pom config and explain the project structure?  Are
the integration tests in a separate module?

-- 
Wendy

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: integration-test practices

2008-05-22 Thread Paul Davis
I actually meant
src/test/resources

I have found that if I place the resource (xml file) in both places, it
works
src/it/java
src/test/resources
However, if I only have one copy (in either location) it does not work.

I didn't try "src/main/resources" because it's an integration test.
Should I put it there?

Maybe my confusion is a result of the integration-test phase doesn't have a
similar life-cycle as the test phase?


On Wed, May 21, 2008 at 8:57 PM, Wendy Smoak <[EMAIL PROTECTED]> wrote:

> On Wed, May 21, 2008 at 3:35 PM, Paul Davis <[EMAIL PROTECTED]> wrote:
>
> > It seems the documentation for the integration-test phase is pretty thin
> (as
> > in, where is it?).
>
> There are some notes on the wiki:
> http://docs.codehaus.org/display/MAVENUSER/Maven+and+Integration+Testing
>
> > I can't seem to get "resources" accessible by the test code.
>
> We'll need more info in order to help.  Do you mean files in
> src/main/resources?
>
> --
> Wendy
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: integration-test practices

2008-05-21 Thread Wendy Smoak
On Wed, May 21, 2008 at 3:35 PM, Paul Davis <[EMAIL PROTECTED]> wrote:

> It seems the documentation for the integration-test phase is pretty thin (as
> in, where is it?).

There are some notes on the wiki:
http://docs.codehaus.org/display/MAVENUSER/Maven+and+Integration+Testing

> I can't seem to get "resources" accessible by the test code.

We'll need more info in order to help.  Do you mean files in
src/main/resources?

-- 
Wendy

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



integration-test practices

2008-05-21 Thread Paul Davis
It seems the documentation for the integration-test phase is pretty thin (as
in, where is it?).

I can't seem to get "resources" accessible by the test code.

Is there some undocumented "convention" I should be following?