Skip to content

Commit 33abe5f

Browse files
committed
mapstruct#202 Refactor integration tests to use Maven Verifier, different JDKs using toolchains, and the Eclipse JDT compiler.
1 parent 716b34b commit 33abe5f

File tree

55 files changed

+1230
-209
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1230
-209
lines changed

build-config/src/main/resources/build-config/checkstyle.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
<module name="InnerAssignment"/>
164164
<!-- <module name="MagicNumber"/> -->
165165
<module name="MissingSwitchDefault"/>
166-
<module name="RedundantThrows"/>
166+
<!-- <module name="RedundantThrows"/> -->
167167
<module name="SimplifyBooleanExpression"/>
168168
<module name="SimplifyBooleanReturn"/>
169169

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="UTF8"?>
2+
<toolchains>
3+
<toolchain>
4+
<type>jdk</type>
5+
<provides>
6+
<version>1.6</version>
7+
<vendor>oracle</vendor>
8+
<id>jdk1.6</id>
9+
</provides>
10+
<configuration>
11+
<jdkHome>/opt/jdk/jdk1.6.latest</jdkHome>
12+
</configuration>
13+
</toolchain>
14+
<toolchain>
15+
<type>jdk</type>
16+
<provides>
17+
<version>1.7</version>
18+
<vendor>oracle</vendor>
19+
<id>jdk1.7</id>
20+
</provides>
21+
<configuration>
22+
<jdkHome>/opt/jdk/jdk1.7.latest</jdkHome>
23+
</configuration>
24+
</toolchain>
25+
<toolchain>
26+
<type>jdk</type>
27+
<provides>
28+
<version>1.8</version>
29+
<vendor>oracle</vendor>
30+
<id>jdk1.8</id>
31+
</provides>
32+
<configuration>
33+
<jdkHome>/opt/jdk/jdk8.latest</jdkHome>
34+
</configuration>
35+
</toolchain>
36+
37+
</toolchains>

etc/toolchains-example.xml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF8"?>
2+
<toolchains>
3+
<toolchain>
4+
<type>jdk</type>
5+
<provides>
6+
<version>1.6.0_45</version>
7+
<vendor>oracle</vendor>
8+
<id>jdk1.6</id>
9+
</provides>
10+
<configuration>
11+
<jdkHome>C:\Program Files\Java\jdk1.6.0_45</jdkHome>
12+
</configuration>
13+
</toolchain>
14+
<toolchain>
15+
<type>jdk</type>
16+
<provides>
17+
<version>1.7.0_51</version>
18+
<vendor>oracle</vendor>
19+
<id>jdk1.7</id>
20+
</provides>
21+
<configuration>
22+
<jdkHome>C:\Program Files\Java\jdk1.7.0_51</jdkHome>
23+
</configuration>
24+
</toolchain>
25+
<toolchain>
26+
<type>jdk</type>
27+
<provides>
28+
<version>1.8.0_11</version>
29+
<vendor>oracle</vendor>
30+
<id>jdk1.8</id>
31+
</provides>
32+
<configuration>
33+
<jdkHome>C:\Program Files\Java\jdk1.8.0_11</jdkHome>
34+
</configuration>
35+
</toolchain>
36+
</toolchains>

integrationtest-jdk8/pom.xml

Lines changed: 0 additions & 118 deletions
This file was deleted.

integrationtest/pom.xml

Lines changed: 37 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
limitations under the License.
2020
2121
-->
22-
<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">
22+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2324
<modelVersion>4.0.0</modelVersion>
2425

2526
<parent>
@@ -33,13 +34,11 @@
3334
<packaging>jar</packaging>
3435
<name>MapStruct Integration Test</name>
3536

36-
<dependencies>
37-
<dependency>
38-
<groupId>${project.groupId}</groupId>
39-
<artifactId>mapstruct</artifactId>
40-
<scope>provided</scope>
41-
</dependency>
37+
<properties>
38+
<mapstruct.version>${project.version}</mapstruct.version>
39+
</properties>
4240

41+
<dependencies>
4342
<!-- Testing -->
4443
<dependency>
4544
<groupId>junit</groupId>
@@ -51,92 +50,34 @@
5150
<artifactId>fest-assert</artifactId>
5251
<scope>test</scope>
5352
</dependency>
54-
55-
<!-- CDI, Weld, Arquillian -->
56-
<dependency>
57-
<groupId>javax.enterprise</groupId>
58-
<artifactId>cdi-api</artifactId>
59-
</dependency>
60-
<dependency>
61-
<groupId>javax.inject</groupId>
62-
<artifactId>javax.inject</artifactId>
63-
</dependency>
64-
<dependency>
65-
<groupId>org.jboss.arquillian.junit</groupId>
66-
<artifactId>arquillian-junit-container</artifactId>
67-
<scope>test</scope>
68-
</dependency>
69-
<dependency>
70-
<groupId>org.jboss.arquillian.container</groupId>
71-
<artifactId>arquillian-weld-se-embedded-1.1</artifactId>
72-
<scope>test</scope>
73-
</dependency>
74-
<dependency>
75-
<groupId>org.jboss.arquillian.container</groupId>
76-
<artifactId>arquillian-container-test-api</artifactId>
77-
<scope>test</scope>
78-
</dependency>
79-
<dependency>
80-
<groupId>org.jboss.arquillian.junit</groupId>
81-
<artifactId>arquillian-junit-core</artifactId>
82-
<scope>test</scope>
83-
</dependency>
84-
<dependency>
85-
<groupId>org.jboss.shrinkwrap</groupId>
86-
<artifactId>shrinkwrap-api</artifactId>
87-
<scope>test</scope>
88-
</dependency>
89-
<dependency>
90-
<groupId>org.jboss.weld</groupId>
91-
<artifactId>weld-core</artifactId>
92-
<scope>test</scope>
93-
</dependency>
9453
<dependency>
95-
<groupId>org.glassfish</groupId>
96-
<artifactId>javax.el</artifactId>
54+
<groupId>org.apache.maven.shared</groupId>
55+
<artifactId>maven-verifier</artifactId>
9756
<scope>test</scope>
9857
</dependency>
99-
100-
<!-- Spring -->
101-
<dependency>
102-
<groupId>org.springframework</groupId>
103-
<artifactId>spring-test</artifactId>
104-
<scope>test</scope>
105-
</dependency>
106-
<dependency>
107-
<groupId>org.springframework</groupId>
108-
<artifactId>spring-beans</artifactId>
109-
</dependency>
110-
<dependency>
111-
<groupId>org.springframework</groupId>
112-
<artifactId>spring-context</artifactId>
113-
</dependency>
11458
</dependencies>
11559

11660
<build>
61+
<testResources>
62+
<testResource>
63+
<directory>src/test/resources</directory>
64+
<filtering>true</filtering>
65+
</testResource>
66+
</testResources>
11767
<plugins>
11868
<plugin>
119-
<groupId>org.jvnet.jaxb2.maven2</groupId>
120-
<artifactId>maven-jaxb2-plugin</artifactId>
121-
<executions>
122-
<execution>
123-
<goals>
124-
<goal>generate</goal>
125-
</goals>
126-
</execution>
127-
</executions>
69+
<groupId>org.apache.maven.plugins</groupId>
70+
<artifactId>maven-resources-plugin</artifactId>
12871
<configuration>
129-
<schemaDirectory>${project.build.resources[0].directory}/schema/</schemaDirectory>
130-
<schemaIncludes>
131-
<include>**/test1.xsd</include>
132-
</schemaIncludes>
133-
<bindingDirectory>${project.build.resources[0].directory}/binding</bindingDirectory>
134-
<bindingIncludes>
135-
<include>**/binding.xjb</include>
136-
</bindingIncludes>
137-
<extension>true</extension>
138-
<verbose>true</verbose>
139-
<specVersion>2.1</specVersion>
72+
<escapeString>\</escapeString>
73+
</configuration>
74+
</plugin>
75+
<plugin>
76+
<groupId>org.apache.maven.plugins</groupId>
77+
<artifactId>maven-compiler-plugin</artifactId>
78+
<configuration>
79+
<source>1.8</source>
80+
<target>1.8</target>
14081
</configuration>
14182
</plugin>
14283
<plugin>
@@ -176,6 +117,18 @@
176117
<skip>true</skip>
177118
</configuration>
178119
</plugin>
120+
<plugin>
121+
<groupId>org.apache.maven.plugins</groupId>
122+
<artifactId>maven-surefire-plugin</artifactId>
123+
<configuration>
124+
<!-- do not execute the tests in a new process
125+
to allow using the embedded mode of the Maven Verifier based tests -->
126+
<forkCount>0</forkCount>
127+
<systemPropertyVariables>
128+
<verifier.forkMode>auto</verifier.forkMode>
129+
</systemPropertyVariables>
130+
</configuration>
131+
</plugin>
179132
<plugin>
180133
<groupId>org.apache.maven.plugins</groupId>
181134
<artifactId>maven-checkstyle-plugin</artifactId>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* Copyright 2012-2014 Gunnar Morling (http://www.gunnarmorling.de/)
3+
* and/or other contributors as indicated by the @authors tag. See the
4+
* copyright.txt file in the distribution for a full listing of all
5+
* contributors.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
package org.mapstruct.itest.tests;
20+
21+
import org.junit.runner.RunWith;
22+
import org.mapstruct.itest.testutil.runner.ProcessorSuite;
23+
import org.mapstruct.itest.testutil.runner.ProcessorSuite.ProcessorType;
24+
import org.mapstruct.itest.testutil.runner.ProcessorSuiteRunner;
25+
26+
/**
27+
* @author Andreas Gudian
28+
*
29+
*/
30+
@RunWith( ProcessorSuiteRunner.class )
31+
@ProcessorSuite( baseDir = "cdiTest", processorTypes = ProcessorType.ALL )
32+
public class CdiTest {
33+
}

0 commit comments

Comments
 (0)