On 18 February 2011 12:45, Ewerton Vale Leal <ewerto...@gmail.com> wrote:
> My directory structure is this:
> src/main/java
> src/main/resources
> src/main/webapp
> src/test/java/unitTest
> src/test/java/functionalTest

This is unusual. I would suggest src/test/java for your unit tests and
something else (src/test/it ?) for your integration/functional tests.
That way at least your unit tests should run.

You need to check out the Maven Surefire Plugin. For your integration
tests, you'll have to change the testSourceDirectory.

> I have  unit tests and integration tests in the same project.

FYI, normally, you would put the integration tests in a separate
project that depends on the project it's testing. I would still
recommend that but I don't know how you would get Cobertura working in
that scenario.

> I running the commands mvn install.

That's fine. The "verify" phase in the Maven Build Cycle is the one
just before "install". While you're trying things out it's a tiny bit
faster. :-)

> "Why are you using <skip>true<skip>? Isn't the whole point to
> run the tests?"
> I do not know right to use maven. I'm new at this.
> In the configuration it has "<skip>false</skip> " and not true.
> If true, the tests not execute.

I would remove <skip>.

> To run the tests, I use a test suite, the class "AllTeste.java",
> running the unit tests and integration.

You mean you're running your unit tests and integration tests all at
the same time? I don't think that's what you want. Also test suites
are not run by Surefire. It uses a pattern to identify tests. See the
Maven Surefire Plugin documentation.

Run your unit tests first in phase "test" (that should not require any
setup as long as you've named your tests appropriately), then run your
integration tests in phase "integration-test". You should be able to
set up Surefire to run in different phases with a different
testSourceDirectory.

I think you're pretty close.

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

Reply via email to