maven-surefire-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Connolly <stephen.alan.conno...@gmail.com>
Subject Re: Question concerning executing tests from a parent POM.Xml file
Date Thu, 09 Dec 2010 09:04:48 GMT
Here is what it looks like you are trying to do:

"I am trying to execute the tests of a child module from within a POM
project"

If that is the case then you need to:

1. bind an execution of surefire to the aggregator pom and have that
execution not inherited.
2. ensure that the aggregator pom depends on all the child poms, and that
the child poms do not inherit from the aggregator pom (i.e. it cannot be a
parent any more)

And then what it looks like you are trying to do will be done....


BUT

You really don't want to do that.

You are fighting the maven way.

Leave the tests for each module in that module

Put the tests of everything else in their own testing module that depends on
the previous modules.

Lather-rinse-repeat

-Stephen

On 8 December 2010 22:35, Ed Abshire <eabshire@cybersource.com> wrote:

> So I have the following directory structure:
>
>
> -          QA
>
> o   Businessobjects
>
> o   Framework
>
> o   Utilities
>
> o   Uimodel
>
> o   Keywords
>
> o   Fixtures
>
> o   Unittests
>
> o   Tests
>
> Under QA, I have a parent pom.xml that includes all the modules to build
> the projects underneath the QA directory above as one project.
>
> I am trying to set up surefire to execute tests from the tests directory
> using testing.
>
> Is there a proper way of doing this?
>
>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>                      http://maven.apache.org/xsd/maven-4.0.0.xsd">
>  <modelVersion>4.0.0</modelVersion>
>  <groupId>cybs.qa.framework</groupId>
>  <version>2.0</version>
>  <artifactId>QA-Automation</artifactId>
>  <packaging>pom</packaging>
>  <modules>
>    <module>businessobjects</module>
>    <module>framework</module>
>                <module>utilities</module>
>                <module>uimodel</module>
>                <module>keywords</module>
>                <module>fixtures</module>
>                <module>unittests</module>
>                <module>tests</module>
>  </modules>
>
> <dependencies>
>            <dependency>
>                        <groupId>org.testng</groupId>
>                        <artifactId>testng</artifactId>
>                        <version>5.14</version>
>                        <scope>test</scope>
>            </dependency>
>  </dependencies>
>
>            <build>
>                        <pluginManagement>
>                                    <plugins>
>                                                <plugin>
>
>  <groupId>org.apache.maven.plugins</groupId>
>
>  <artifactId>maven-surefire-plugin</artifactId>
>
>  <version>2.6</version>
>                                                            <configuration>
>
>  <workingDirectory>${basedir}\Tests</workingDirectory>
>
>  <testClassesDirectory>target/classes</testClassesDirectory>
>
>  <suiteXmlFiles>
>
>        <suiteXmlFile>tests\genericTests.xml</suiteXmlFile>
>
>  </suiteXmlFiles>
>                                                            </configuration>
>                                                </plugin>
>                                    </plugins>
>                        </pluginManagement>
>            </build>
> </project>
> _________________________________________
> Ed Abshire
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message