You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Todd Nine <to...@gmail.com> on 2006/08/31 03:35:01 UTC

Multipart question regarding releasing with an assembly and integration tests.

Hi all,
  I have a couple of questions that don't seem to be documented (at least
not that I could find).  Any help would be greatly appreciated.

1. I have a project that is simply a testing utility for our admins to test
their message queue setups.  I have the assembler plug in create a zip file
that contains all the jars and the class path for the executable jar.  Is it
possible for me to automatically run the assembly and upload the created zip
during release:perform?

2. I have a project that has both unit tests and integration tests.  The
unit tests use mock objects and obviously execute automatically when test is
performed.  How do I specify the tests that need to run for integration
testing?  Also note that I will need to start Jboss in the
pre-integration-test phase and shut it down in the post-integration-test
phase.  I'm trying the codehaus mojo plug in, but it doesn't quite work as
expected, I may end up using cargo.  Does anyone have a strong opinion of
cargo and any relevant experience?


Thanks,
Todd

Re: Multipart question regarding releasing with an assembly and integration tests.

Posted by Barrie Treloar <ba...@gmail.com>.
> 1. I have a project that is simply a testing utility for our admins to test
> their message queue setups.  I have the assembler plug in create a zip file
> that contains all the jars and the class path for the executable jar.  Is it
> possible for me to automatically run the assembly and upload the created zip
> during release:perform?

Check out the nabble archives there are a couple posts I have replied
to that provide examples of this.  One in particular is
http://www.nabble.com/forum/ViewPost.jtp?post=6069982&framed=y

You can bind the assembly plugin so that it will run during the
package phase and this will automatically attach the *-bin.zip file
created in the repository during deploy and releases.

This means your admins can "self-serve" the test utilities by web
browsing your internal maven repository and downloading the correct
versions.

> 2. I have a project that has both unit tests and integration tests.  The
> unit tests use mock objects and obviously execute automatically when test is
> performed.  How do I specify the tests that need to run for integration
> testing?  Also note that I will need to start Jboss in the
> pre-integration-test phase and shut it down in the post-integration-test
> phase.  I'm trying the codehaus mojo plug in, but it doesn't quite work as
> expected, I may end up using cargo.  Does anyone have a strong opinion of
> cargo and any relevant experience?

I haven't done this step yet so can't help with anything but theory.

I do know that you need to separate out your integration tests or else
they will get matched by surefire and will be run as unit tests (which
isn't what you want).
Your choices are move the tests to src/integration-test/java or move
them to another project.

You can then bind the plugins you need to the correct phases to run
your integration tests.

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


Re: Multipart question regarding releasing with an assembly and integration tests.

Posted by Wendy Smoak <ws...@gmail.com>.
On 9/1/06, Todd Nine <to...@gmail.com> wrote:

Most of these questions would best be addressed to the Cargo user list.

   http://cargo.codehaus.org/Mailing+Lists

Clustered JBoss configuration is beyond me, but I bet Vincent can help. :)

Just picking out one thing:

>  Also, what project structure do I lay out, do I use the following?
>
> src/integration-tests/java
> src/integration-test/resources
>
> I'm not clear on how to include this as a project, but exclude the tests
> from the unit tests, and only run them during the integration tests, and I
> can't find any documentation on it.

You can only have one <testSourceDirectory> per module.

If you want to run both unit and integration tests in the same module,
they must be in the same directory structure, which is usually
src/test/java .

>From there, you can exclude, for example, **/systest/** during the
unit testing phase, and reverse it for integration tests.  That's what
you see in the shale-blank pom I posted.

HTH,
-- 
Wendy

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


Re: Multipart question regarding releasing with an assembly and integration tests.

Posted by Todd Nine <to...@gmail.com>.
Thanks for the feedback Barrie and Wendy.  The inclusion of the assembly
worked great, the admins and I thank you.  Wendy, I've downloaded the book
and read it, as well as viewed your example pom, but I'm still having a
difficult time getting my mind around how to do this.  We run our own custom
version of jboss with several modifications.  I have created a zip with the
server and installed it on our intranet maven 2 area.  I have the following
plug in declared.

<plugin>
     <groupId>org.codehaus.cargo</groupId>
      <artifactId>cargo-maven2-plugin</artifactId>
           <configuration>
                <container>
                    <containerId>jboss3x</containerId>
                      <zipUrlInstaller>
                        <url>

http://homer.nine.homelinux.com/jboss/jboss-3.2.6-default-with-clustering.zip
                         </url>
                       <installDir>${installDir}</installDir>
                     </zipUrlInstaller>
                   </container>
               </configuration>
         </plugin>

When cargo downloads the zip file, it extracts it then I receive this error

org.codehaus.cargo.container.ContainerException: Invalid JBoss installation:
[C:\development\server\integrationserver\jboss-
3.2.6-default-with-clustering\jboss-3.2.6\lib\endorsed] is an empty
directory

We're using Jboss 3.2.6.  It runs fine with without endorsed when using the
run.bat as well as run.sh.  So I have a few questions that I could really
need your help with.

1. Any ideas where to start fixing the error above?  Why does it need this
directory?

2. Is there any good documentation/examples on how to configure what
artifact gets deployed and where?  My integration test artifact generates an
ear, I don't want to copy it to the "deploy" directory, I want to copy it to
the "farm" instead of directory so we can test it in clustered mode.

3. How do I lay out my projects for integration testing?  I have 3 projects.

messageDrivenPojo
messageDrivenDelegate
messageDrivenSender

I need to integration test both messageDrivenSender and
messageDrivenDelegate.  Message driven delegate integration tests should
produce an ear that includes the delegate and a test POJO the sender needs
to start and connect to JMS, send a message, and then the delegate needs to
acknowledge the return.  How can I correctly assert the receive to the
integration-tests when the messageDrivenDelegate is running in Jboss?  Also,
what project structure do I lay out, do I use the following?

src/integration-tests/java
src/integration-test/resources

I'm not clear on how to include this as a project, but exclude the tests
from the unit tests, and only run them during the integration tests, and I
can't find any documentation on it.

Thanks,
Todd


On 8/30/06, Wendy Smoak <ws...@gmail.com> wrote:
>
> On 8/30/06, Todd Nine <to...@gmail.com> wrote:
>
> > 2. I have a project that has both unit tests and integration tests.  The
> > unit tests use mock objects and obviously execute automatically when
> test is
> > performed.  How do I specify the tests that need to run for integration
> > testing?  Also note that I will need to start Jboss in the
> > pre-integration-test phase and shut it down in the post-integration-test
> > phase.  I'm trying the codehaus mojo plug in, but it doesn't quite work
> as
> > expected, I may end up using cargo.  Does anyone have a strong opinion
> of
> > cargo and any relevant experience?
>
> Yes. Cargo is great. :)
>
> Maven doesn't handle having both unit _and_ integration tests in the
> same module very well yet.  If you have the option, move the
> integration tests to a separate module.  There is an example of this
> in the 'Better Builds with Maven' book:
> http://www.mergere.com/m2book_download.jsp
>
> If not, and you have to keep the tests together, here's a simple example:
>
> http://svn.apache.org/repos/asf/shale/framework/trunk/shale-apps/shale-blank/pom.xml
>
> You have to play around with the includes/excludes so the integration
> tests don't run during 'mvn test'.  Then you reverse the pattern when
> the "itest" profile is active.  You can also see the configuration for
> Cargo, which gets used in the CargoTestSetup class to start and stop
> the container.
>
> Please come join us on the mailing lists if you have more questions about
> Cargo:
>   http://cargo.codehaus.org/Mailing+Lists
>
> --
> Wendy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Multipart question regarding releasing with an assembly and integration tests.

Posted by Wendy Smoak <ws...@gmail.com>.
On 8/30/06, Todd Nine <to...@gmail.com> wrote:

> 2. I have a project that has both unit tests and integration tests.  The
> unit tests use mock objects and obviously execute automatically when test is
> performed.  How do I specify the tests that need to run for integration
> testing?  Also note that I will need to start Jboss in the
> pre-integration-test phase and shut it down in the post-integration-test
> phase.  I'm trying the codehaus mojo plug in, but it doesn't quite work as
> expected, I may end up using cargo.  Does anyone have a strong opinion of
> cargo and any relevant experience?

Yes. Cargo is great. :)

Maven doesn't handle having both unit _and_ integration tests in the
same module very well yet.  If you have the option, move the
integration tests to a separate module.  There is an example of this
in the 'Better Builds with Maven' book:
http://www.mergere.com/m2book_download.jsp

If not, and you have to keep the tests together, here's a simple example:
  http://svn.apache.org/repos/asf/shale/framework/trunk/shale-apps/shale-blank/pom.xml

You have to play around with the includes/excludes so the integration
tests don't run during 'mvn test'.  Then you reverse the pattern when
the "itest" profile is active.  You can also see the configuration for
Cargo, which gets used in the CargoTestSetup class to start and stop
the container.

Please come join us on the mailing lists if you have more questions about Cargo:
  http://cargo.codehaus.org/Mailing+Lists

-- 
Wendy

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