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:

    <build>
        <testSourceDirectory>src/it/java</testSourceDirectory>
        <testResources>
            <testResource>
                <filtering>false</filtering>
                <directory>src/it/resources</directory>
            </testResource>
        </testResources>
    </build>

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]
>
>

Reply via email to