[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [tycho-user] Problem with tycho-surefire-plugin and include/exclude patterns
|
As requested
---
MikeN
On 27/01/2012 3:46 PM, Igor Fedorenko wrote:
Please attach a zip/tar of the example project.
--
Regards,
Igor
On 12-01-27 11:17 AM, Michael Norman wrote:
Ok, I created an 'example project' based on some tutorials I read - New
Project - > Maven Project -> 'maven-archetype-quickstart'
${project.root}
| .classpath
| .project ...
<projectDescription><name>example-project</name> ...
| pom.xml
|
+---src
| +---main
| | \---java
| | \---org
| | \---example
| | SomeObject.java
| |
| \---test
| \---java
| \---org
| \---example
| \---test
| | AllTests.java
| |
| +---another
| | AnotherNestedTestSuite.java
| |
| \---nested
| NestedTestSuite.java
AllTests is a JUnit4 testsuite that points to nested testsuites that in
turn contain either more testsuites or actual tests:
package org.example.test;
//JUnit4 imports
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
//test imports
import org.example.test.another.AnotherNestedTestSuite;
import org.example.test.nested.NestedTestSuite;
/**
* suite of tests for SomeObject
*/
@RunWith(Suite.class)
@SuiteClasses({
NestedTestSuite.class,
AnotherNestedTestSuite.class
}
)
public class AllTests {
}
package org.example.test.another;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
public class AnotherNestedTestSuite {
@BeforeClass
static public void setUp() {
System.out.println("one-time setUp for
AnotherNestedTestSuite");
}
@AfterClass
static public void tearDown() {
System.out.println("one-time tearDown for
AnotherNestedTestSuite");
}
@Test
public void aTest() {
System.out.println("This is another test");
}
}
I added the following to the pom.xml file:
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.9</version>
<executions>
<execution>
<id>test</id>
<phase>test</phase>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<includes>
<include>**/AllTests.java</include>
</includes>
</configuration>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<executions>
<execution>
<id>generate-test-report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
</plugin>
</plugins>
</reporting>
Everything works as expected when I run 'mvn compile
compiler:testCompile test' - however, if I switch to
'tycho-surefire-plugin' (instead of 'maven-surefire-plugin'), the
<include>**/AllTests.java</include> does
not work.
For this type of simple project (not OSGi, not an Eclipse plugin),
should I stick with 'maven-surefire-plugin'?
What advantages would 'tycho-surefire-plugin' have (if I could get the
include pattern to work)?
---
Mike Norman
P.S. is there a way to get the 'compile' goal to include compiling the
tests?
On 25/01/2012 4:14 AM, Sievers, Jan wrote:
we would need a stripped down sample project demonstrating the issue
to tell if this is a bug or just some configuration problem.
Regards
Jan
From:tycho-user-bounces@xxxxxxxxxxx
[mailto:tycho-user-bounces@xxxxxxxxxxx] On Behalf Of Michael Norman
Sent: Freitag, 20. Januar 2012 21:23
To:tycho-user@xxxxxxxxxxx
Subject: [tycho-user] Problem with tycho-surefire-plugin and
include/exclude patterns
I am trying to get the tycho-surefire-plugin to run a specific test.
My directory layout:
${project.root}
| .classpath
| .project
| build.properties
| pom.xml
| ...
|
+---src
| +---main
| | +---java
| | | \---
| ...
| |
| \---test
| \---java
| \---org
| \---eclipse
| \---persistence
| \---tools
| \---oracleddl
| \---test
| | AllTests.java
| | TestHelper.java
| |
| +---databasetypebuilder
| |
DatabaseTypeBuilderTestSuite.java
| | IOTTableDDLTestSuite.java
| | ProcedureDDLTestSuite.java
| | TableDDLTestSuite.java
| | TransformsTestSuite.java
| |
TypeResolutionTestSuite.java
| |
| +---ddlparser
| |
CaseSensitivePackageTestSuite.java
| | DDLParserTestSuite.java
| | FunctionDDLTestSuite.java
| | PackageDDLTestSuite.java
| | ProcedureDDLTestSuite.java
| | TableDDLTestSuite.java
| | TypeDDLTestSuite.java
| |
| \---visit
| FunctionTypeTest.java
| FunctionTypeVisitor.java
| IntervalTypeTest.java
| IntervalVisitor.java
| PrecisionTypeTest.java
| PrecisionTypeVisitor.java
| ProcedureTypeTest.java
| ProcedureTypeVisitor.java
| SizedTypeTest.java
| SizedTypeVisitor.java
| TableTypeTest.java
| TableTypeVisitor.java
| VisitorsTestSuite.java
The AllTests.java file is annotated with:
@RunWith(Suite.class)
@SuiteClasses({
AdvancedJDBCPackageTestSuite.class,
ComplexPLSQLSFTestSuite.class,
ComplexPLSQLSPTestSuite.class,
CustomSQLTestSuite.class,
.
.
.
VeryLongIdentifierTestSuite.class
}
)
So my goal is to get the tycho-surefire-plugin to run AllTests and
then the rest of the tests are run from there.
In my pom.xml file, I specify the following:
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
<testSuite>org.eclipse.persistence.tools.oracleddl.test</testSuite>
<testClass>org.eclipse.persistence.tools.oracleddl.test.AllTests</testClass>
<systemProperties combine.children="append">
<db.user>${db.user}</db.user>
<db.pwd>${db.pwd}</db.pwd>
<db.url>${db.url}</db.url>
<db.ddl.create>${db.ddl.create}</db.ddl.create>
<db.ddl.drop>${db.ddl.drop}</db.ddl.drop>
<db.ddl.debug>${db.ddl.debug}</db.ddl.debug>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>
The<testSuite> and<testClass> elements are ignored and the usual
'**/*Test.java' pattern is being used.
I've tried various combinations of
<excludes>
<exclude>**/*</exclude>
</excludes>
<includes>
<include>**/AllTests.java</include>
</includes>
but nothing seems to work.
Any help would be greatly appreciated.
_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user
Attachment:
example-project.jar
Description: Binary data