0

I have this maven profile setup.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.8</version>
    <configuration>
        <includes>
            <include>com.something.test.X.java</include>
        </includes>

        <properties>
            <property>
                <name>reporter</name>
                <value>org.testng.reporters.XMLReporter</value>
            </property>
            <property>
                <name>listener</name>                          
                <value>Listener</value>
            </property>
        </properties>

        <systemProperties>
            <property>
                <name>x.host</name>
                <value>${server.ip}</value>
            </property>
            <property>
                <name>http_port</name>
                <value>${http_port}</value>
            </property>
            <property>
                <name>https_port</name>
                <value>${https_port}</value>
            </property>
            <property>
                <name>jmx_remote_port</name>
                <value>${jmx_remote_port}</value>
            </property>
        </systemProperties>

        <systemPropertyVariables>
            <x.host>${server.ip}</x.host>
            <env.BUILD_NUMBER>${env.BUILD_NUMBER}</env.BUILD_NUMBER>
            <env.HOSTNAME>${env.HOSTNAME}</env.HOSTNAME>
        </systemPropertyVariables>
    </configuration>

    <executions>
        <execution>
            <id>test</id>
            <phase>integration-test</phase>
            <goals>
                <goal>test</goal>
            </goals>
            <configuration>
                <skip>false</skip>
            </configuration>
        </execution>
    </executions>
</plugin>

When i run the profile, the test included does not run! What am i doing wrong? i even tried it with the suitexmlfile but i get a parsing error where it cannot find the class.

JeffS
  • 432
  • 2
  • 10
12rad
  • 829
  • 2
  • 13
  • 28
  • I'm not sure this will help (cannot test it myself now), but can you try to specify only class name instead of full class name (with package) in `include` section. – Andrew Logvinov Jul 24 '12 at 18:37
  • I did try that. It doesn't work. I basically want to run one of the integration tests instead of all. I've tried using , , , -Dtest.... i am out of ideas now:( – 12rad Jul 24 '12 at 19:18
  • 2
    Ah, I see now. Remove `.java` in the end of the test name. – Andrew Logvinov Jul 24 '12 at 19:22

1 Answers1

1

As Andrew Logvinov suggested, you should remove .java from the name of the test you include. In general, test coordinates are specified as <class-name>[#<method-name>].

yegor256
  • 102,010
  • 123
  • 446
  • 597