Skip to content

Commit 9d7f91d

Browse files
committed
Add Integration Tests
1 parent 94286aa commit 9d7f91d

File tree

32 files changed

+517
-0
lines changed

32 files changed

+517
-0
lines changed

pom.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
<exclude>src/site/**</exclude>
109109
<exclude>.editorconfig</exclude>
110110
<exclude>etc/*</exclude>
111+
<exclude>src/it/**</exclude>
111112
</excludes>
112113
</configuration>
113114
<executions>
@@ -166,6 +167,28 @@
166167
<goals>deploy site-deploy</goals>
167168
</configuration>
168169
</plugin>
170+
<plugin>
171+
<artifactId>maven-invoker-plugin</artifactId>
172+
<version>2.0.0</version>
173+
<configuration>
174+
<projectsDirectory>src/it</projectsDirectory>
175+
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
176+
<settingsFile>src/it/settings.xml</settingsFile>
177+
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
178+
<cloneClean>true</cloneClean>
179+
<showVersion>true</showVersion>
180+
<postBuildHookScript>verify.groovy</postBuildHookScript>
181+
</configuration>
182+
<executions>
183+
<execution>
184+
<id>integration-test</id>
185+
<goals>
186+
<goal>install</goal>
187+
<goal>run</goal>
188+
</goals>
189+
</execution>
190+
</executions>
191+
</plugin>
169192
</plugins>
170193
</build>
171194

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Build Plan for list-multimodule-outputfile
2+
----------------------------------------------------------
3+
PLUGIN | PHASE | ID | GOAL
4+
----------------------------------------------------------
5+
maven-install-plugin | install | default-install | install
6+
maven-deploy-plugin | deploy | default-deploy | deploy
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:list -Dbuildplan.outputFile=list.txt
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Build Plan for list-multimodule-outputfile-module-a
2+
---------------------------------------------------------------------------------------
3+
PLUGIN | PHASE | ID | GOAL
4+
---------------------------------------------------------------------------------------
5+
maven-resources-plugin | process-resources | default-resources | resources
6+
maven-compiler-plugin | compile | default-compile | compile
7+
maven-resources-plugin | process-test-resources | default-testResources | testResources
8+
maven-compiler-plugin | test-compile | default-testCompile | testCompile
9+
maven-surefire-plugin | test | default-test | test
10+
maven-jar-plugin | package | default-jar | jar
11+
maven-install-plugin | install | default-install | install
12+
maven-deploy-plugin | deploy | default-deploy | deploy
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<parent>
8+
<groupId>com.github.jcgay.buildplan</groupId>
9+
<artifactId>list-multimodule-outputfile</artifactId>
10+
<version>1.0-SNAPSHOT</version>
11+
</parent>
12+
13+
<artifactId>list-multimodule-outputfile-module-a</artifactId>
14+
15+
</project>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Build Plan for list-multimodule-outputfile-module-b
2+
------------------------------------------------------------------------------------------
3+
PLUGIN | PHASE | ID | GOAL
4+
------------------------------------------------------------------------------------------
5+
maven-resources-plugin | process-resources | default-resources | resources
6+
maven-compiler-plugin | compile | default-compile | compile
7+
maven-resources-plugin | process-test-resources | default-testResources | testResources
8+
maven-compiler-plugin | test-compile | default-testCompile | testCompile
9+
maven-surefire-plugin | test | default-test | test
10+
maven-jar-plugin | package | default-jar | jar
11+
maven-failsafe-plugin | integration-test | default | integration-test
12+
maven-failsafe-plugin | verify | default | verify
13+
maven-install-plugin | install | default-install | install
14+
maven-deploy-plugin | deploy | default-deploy | deploy
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<parent>
8+
<groupId>com.github.jcgay.buildplan</groupId>
9+
<artifactId>list-multimodule-outputfile</artifactId>
10+
<version>1.0-SNAPSHOT</version>
11+
</parent>
12+
13+
<artifactId>list-multimodule-outputfile-module-b</artifactId>
14+
15+
<build>
16+
<plugins>
17+
<plugin>
18+
<artifactId>maven-failsafe-plugin</artifactId>
19+
<version>2.19.1</version>
20+
<executions>
21+
<execution>
22+
<goals>
23+
<goal>integration-test</goal>
24+
<goal>verify</goal>
25+
</goals>
26+
</execution>
27+
</executions>
28+
</plugin>
29+
</plugins>
30+
</build>
31+
32+
</project>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>com.github.jcgay.buildplan</groupId>
8+
<artifactId>list-multimodule-outputfile</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
<packaging>pom</packaging>
11+
12+
<description>
13+
Test buildplan:list on multimodule project with output file
14+
</description>
15+
16+
<modules>
17+
<module>module-a</module>
18+
<module>module-b</module>
19+
</modules>
20+
21+
</project>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env groovy
2+
3+
check(new File(basedir, 'list.txt').text, new File(basedir, 'expected.txt').text)
4+
check(new File(basedir, '/module-a/list.txt').text, new File(basedir, '/module-a/expected.txt').text)
5+
check(new File(basedir, '/module-b/list.txt').text, new File(basedir, '/module-b/expected.txt').text)
6+
7+
def check(String actual, String expected) {
8+
try {
9+
assert actual == expected
10+
} catch (AssertionError error) {
11+
assert printable(actual) == printable(expected)
12+
}
13+
}
14+
15+
String printable(String string) {
16+
string.replaceAll(" ", "·").replaceAll( "[\n\r]+", "¬\n" )
17+
}
18+
19+
20+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Build Plan for list-multimodule-single-outputfile
2+
----------------------------------------------------------
3+
PLUGIN | PHASE | ID | GOAL
4+
----------------------------------------------------------
5+
maven-install-plugin | install | default-install | install
6+
maven-deploy-plugin | deploy | default-deploy | deploy
7+
Build Plan for list-multimodule-single-outputfile-module-a
8+
---------------------------------------------------------------------------------------
9+
PLUGIN | PHASE | ID | GOAL
10+
---------------------------------------------------------------------------------------
11+
maven-resources-plugin | process-resources | default-resources | resources
12+
maven-compiler-plugin | compile | default-compile | compile
13+
maven-resources-plugin | process-test-resources | default-testResources | testResources
14+
maven-compiler-plugin | test-compile | default-testCompile | testCompile
15+
maven-surefire-plugin | test | default-test | test
16+
maven-jar-plugin | package | default-jar | jar
17+
maven-install-plugin | install | default-install | install
18+
maven-deploy-plugin | deploy | default-deploy | deploy
19+
Build Plan for list-multimodule-single-outputfile-module-b
20+
------------------------------------------------------------------------------------------
21+
PLUGIN | PHASE | ID | GOAL
22+
------------------------------------------------------------------------------------------
23+
maven-resources-plugin | process-resources | default-resources | resources
24+
maven-compiler-plugin | compile | default-compile | compile
25+
maven-resources-plugin | process-test-resources | default-testResources | testResources
26+
maven-compiler-plugin | test-compile | default-testCompile | testCompile
27+
maven-surefire-plugin | test | default-test | test
28+
maven-jar-plugin | package | default-jar | jar
29+
maven-failsafe-plugin | integration-test | default | integration-test
30+
maven-failsafe-plugin | verify | default | verify
31+
maven-install-plugin | install | default-install | install
32+
maven-deploy-plugin | deploy | default-deploy | deploy

0 commit comments

Comments
 (0)