aboutsummaryrefslogtreecommitdiff
path: root/jacoco-maven-plugin.test
diff options
context:
space:
mode:
authorMads Mohr Christensen <hr.mohr@gmail.com>2013-08-24 18:40:24 +0200
committerMads Mohr Christensen <hr.mohr@gmail.com>2013-08-25 01:02:48 +0200
commite34295fec9bb05b374d2d8c8234c394620146c81 (patch)
treeb5566b3c693ccef3b695c695e1302a951650af0e /jacoco-maven-plugin.test
parenta29d607b63098351e08ca11050c762b3588f5f66 (diff)
downloadjacoco-e34295fec9bb05b374d2d8c8234c394620146c81.tar.gz
Added integration test for the MergeMojo
Diffstat (limited to 'jacoco-maven-plugin.test')
-rw-r--r--jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-merge/pom.xml58
-rw-r--r--jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project1/pom.xml53
-rw-r--r--jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project1/src/main/java/Example.java20
-rw-r--r--jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project1/src/test/java/ExampleTest.java23
-rw-r--r--jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project2/pom.xml53
-rw-r--r--jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project2/src/main/java/Example.java20
-rw-r--r--jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project2/src/test/java/ExampleTest.java23
-rw-r--r--jacoco-maven-plugin.test/it/it-merge-passes/pom.xml33
-rw-r--r--jacoco-maven-plugin.test/it/it-merge-passes/verify.bsh23
9 files changed, 306 insertions, 0 deletions
diff --git a/jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-merge/pom.xml b/jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-merge/pom.xml
new file mode 100644
index 00000000..7d871d2e
--- /dev/null
+++ b/jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-merge/pom.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2009, 2013 Mountainminds GmbH & Co. KG and Contributors
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Evgeny Mandrikov - initial API and implementation
+ Kyle Lieber - implementation of CheckMojo
+ Mads Mohr Christensen - implementation of MergeMojo
+-->
+<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>
+
+ <parent>
+ <groupId>jacoco</groupId>
+ <artifactId>it-merge-passes</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>it-merge-passes-merge</artifactId>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>@project.groupId@</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>merge</id>
+ <goals>
+ <goal>merge</goal>
+ </goals>
+ <configuration>
+ <fileSets>
+ <fileSet>
+ <directory>${project.parent.build.directory}</directory>
+ <includes>
+ <include>jacoco1.exec</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>${project.parent.build.directory}</directory>
+ <includes>
+ <include>jacoco2.exec</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project> \ No newline at end of file
diff --git a/jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project1/pom.xml b/jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project1/pom.xml
new file mode 100644
index 00000000..a391103b
--- /dev/null
+++ b/jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project1/pom.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2009, 2013 Mountainminds GmbH & Co. KG and Contributors
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Evgeny Mandrikov - initial API and implementation
+ Kyle Lieber - implementation of CheckMojo
+ Mads Mohr Christensen - implementation of MergeMojo
+-->
+<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>
+
+ <parent>
+ <groupId>jacoco</groupId>
+ <artifactId>it-merge-passes</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>it-merge-passes-project1</artifactId>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>@project.groupId@</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>prepare-agent1</id>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ <configuration>
+ <propertyName>coverageAgent1</propertyName>
+ <destFile>${project.parent.build.directory}/jacoco1.exec</destFile>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <argLine>${coverageAgent1}</argLine>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project1/src/main/java/Example.java b/jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project1/src/main/java/Example.java
new file mode 100644
index 00000000..a23613de
--- /dev/null
+++ b/jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project1/src/main/java/Example.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 Mountainminds GmbH & Co. KG and Contributors
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Evgeny Mandrikov - initial API and implementation
+ * Kyle Lieber - implementation of CheckMojo
+ * Mads Mohr Christensen - implementation of MergeMojo
+ *
+ *******************************************************************************/
+public class Example {
+
+ public void sayHello() {
+ System.out.println("Hello world");
+ }
+
+}
diff --git a/jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project1/src/test/java/ExampleTest.java b/jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project1/src/test/java/ExampleTest.java
new file mode 100644
index 00000000..72deefe4
--- /dev/null
+++ b/jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project1/src/test/java/ExampleTest.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 Mountainminds GmbH & Co. KG and Contributors
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Evgeny Mandrikov - initial API and implementation
+ * Kyle Lieber - implementation of CheckMojo
+ * Mads Mohr Christensen - implementation of MergeMojo
+ *
+ *******************************************************************************/
+import org.junit.Test;
+
+public class ExampleTest {
+
+ @Test
+ public void test() {
+ new Example().sayHello();
+ }
+
+}
diff --git a/jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project2/pom.xml b/jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project2/pom.xml
new file mode 100644
index 00000000..73717cf8
--- /dev/null
+++ b/jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project2/pom.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2009, 2013 Mountainminds GmbH & Co. KG and Contributors
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Evgeny Mandrikov - initial API and implementation
+ Kyle Lieber - implementation of CheckMojo
+ Mads Mohr Christensen - implementation of MergeMojo
+-->
+<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>
+
+ <parent>
+ <groupId>jacoco</groupId>
+ <artifactId>it-merge-passes</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>it-merge-passes-project2</artifactId>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>@project.groupId@</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>prepare-agent2</id>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ <configuration>
+ <propertyName>coverageAgent2</propertyName>
+ <destFile>${project.parent.build.directory}/jacoco2.exec</destFile>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <argLine>${coverageAgent2}</argLine>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project2/src/main/java/Example.java b/jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project2/src/main/java/Example.java
new file mode 100644
index 00000000..a23613de
--- /dev/null
+++ b/jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project2/src/main/java/Example.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 Mountainminds GmbH & Co. KG and Contributors
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Evgeny Mandrikov - initial API and implementation
+ * Kyle Lieber - implementation of CheckMojo
+ * Mads Mohr Christensen - implementation of MergeMojo
+ *
+ *******************************************************************************/
+public class Example {
+
+ public void sayHello() {
+ System.out.println("Hello world");
+ }
+
+}
diff --git a/jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project2/src/test/java/ExampleTest.java b/jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project2/src/test/java/ExampleTest.java
new file mode 100644
index 00000000..72deefe4
--- /dev/null
+++ b/jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project2/src/test/java/ExampleTest.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 Mountainminds GmbH & Co. KG and Contributors
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Evgeny Mandrikov - initial API and implementation
+ * Kyle Lieber - implementation of CheckMojo
+ * Mads Mohr Christensen - implementation of MergeMojo
+ *
+ *******************************************************************************/
+import org.junit.Test;
+
+public class ExampleTest {
+
+ @Test
+ public void test() {
+ new Example().sayHello();
+ }
+
+}
diff --git a/jacoco-maven-plugin.test/it/it-merge-passes/pom.xml b/jacoco-maven-plugin.test/it/it-merge-passes/pom.xml
new file mode 100644
index 00000000..43d8a80b
--- /dev/null
+++ b/jacoco-maven-plugin.test/it/it-merge-passes/pom.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2009, 2013 Mountainminds GmbH & Co. KG and Contributors
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Evgeny Mandrikov - initial API and implementation
+ Kyle Lieber - implementation of CheckMojo
+ Mads Mohr Christensen - implementation of MergeMojo
+-->
+<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>
+
+ <parent>
+ <groupId>jacoco</groupId>
+ <artifactId>setup-parent</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>it-merge-passes</artifactId>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>it-merge-passes-project1</module>
+ <module>it-merge-passes-project2</module>
+ <module>it-merge-passes-merge</module>
+ </modules>
+
+</project>
diff --git a/jacoco-maven-plugin.test/it/it-merge-passes/verify.bsh b/jacoco-maven-plugin.test/it/it-merge-passes/verify.bsh
new file mode 100644
index 00000000..383dd129
--- /dev/null
+++ b/jacoco-maven-plugin.test/it/it-merge-passes/verify.bsh
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 Mountainminds GmbH & Co. KG and Contributors
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Evgeny Mandrikov - initial API and implementation
+ * Kyle Lieber - implementation of CheckMojo
+ * Mads Mohr Christensen - implementation of MergeMojo
+ *
+ *******************************************************************************/
+ import java.io.*;
+ import org.codehaus.plexus.util.*;
+
+ String buildLog = FileUtils.fileRead( new File( basedir, "build.log" ) );
+ if ( buildLog.indexOf( "Loading execution data file" ) < 0 ) {
+ throw new RuntimeException( "Could not load execution data file" );
+ }
+ if ( buildLog.indexOf( "Writing merged execution data to" ) < 0 ) {
+ throw new RuntimeException( "Could not write merged execution data" );
+ } \ No newline at end of file