diff options
author | Mirko Friedenhagen <mfriedenhagen@gmail.com> | 2013-11-16 22:10:02 +0100 |
---|---|---|
committer | Mirko Friedenhagen <mfriedenhagen@gmail.com> | 2013-11-16 22:10:02 +0100 |
commit | b578b2c6a2ba06530912b97e6ebafedf0328a278 (patch) | |
tree | 16450c504f0be5e43d2ce06d4de6bcfba6276a3c /jacoco-maven-plugin.test | |
parent | 1e8b9c314307b4866efe257dab9d396ba2ff9363 (diff) | |
parent | 5419f780c527eef2122712d0fb844d40db7293e7 (diff) | |
download | jacoco-b578b2c6a2ba06530912b97e6ebafedf0328a278.tar.gz |
Merge remote-tracking branch 'upstream/master' into multiple-maven-reports-new
Diffstat (limited to 'jacoco-maven-plugin.test')
-rw-r--r-- | jacoco-maven-plugin.test/it/it-dump/pom.xml | 105 | ||||
-rw-r--r-- | jacoco-maven-plugin.test/it/it-dump/src/main/java/Server.java | 36 | ||||
-rw-r--r-- | jacoco-maven-plugin.test/it/it-dump/verify.bsh | 19 |
3 files changed, 160 insertions, 0 deletions
diff --git a/jacoco-maven-plugin.test/it/it-dump/pom.xml b/jacoco-maven-plugin.test/it/it-dump/pom.xml new file mode 100644 index 00000000..628b4a31 --- /dev/null +++ b/jacoco-maven-plugin.test/it/it-dump/pom.xml @@ -0,0 +1,105 @@ +<?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: + Charles Honton +--> +<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-dump</artifactId> + + <build> + <plugins> + <plugin> + <groupId>@project.groupId@</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <executions> + <execution> + <id>prepare-agent</id> + <goals> + <goal>prepare-agent</goal> + </goals> + <configuration> + <output>tcpserver</output> + </configuration> + </execution> + <execution> + <id>dump</id> + <phase>integration-test</phase> + <goals> + <goal>dump</goal> + </goals> + </execution> + <execution> + <id>check</id> + <goals> + <goal>check</goal> + </goals> + <configuration> + <rules> + <rule> + <element>BUNDLE</element> + <limits> + <limit> + <counter>CLASS</counter> + <value>COVEREDCOUNT</value> + <minimum>1</minimum> + </limit> + </limits> + </rule> + </rules> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <version>1.6</version> + <executions> + <execution> + <id>launch-server</id> + <phase>pre-integration-test</phase> + <goals> + <goal>run</goal> + </goals> + <configuration> + <target> + <java classname="Server" spawn="true" fork="true"> + <classpath refid="maven.runtime.classpath"/> + <jvmarg value="${argLine}"/> + <arg value="${project.build.directory}/term.txt"/> + </java> + </target> + </configuration> + </execution> + <execution> + <id>stop-server</id> + <phase>post-integration-test</phase> + <goals> + <goal>run</goal> + </goals> + <configuration> + <target> + <touch file="${project.build.directory}/term.txt" /> + </target> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/jacoco-maven-plugin.test/it/it-dump/src/main/java/Server.java b/jacoco-maven-plugin.test/it/it-dump/src/main/java/Server.java new file mode 100644 index 00000000..307fb1e0 --- /dev/null +++ b/jacoco-maven-plugin.test/it/it-dump/src/main/java/Server.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * 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: + * Marc R. Hoffmann - initial API and implementation + * + *******************************************************************************/ + +import java.io.File; + +/** + * Simple server which runs as long a termination file is created. + */ +public class Server { + + public static void main(String[] args) throws Exception { + System.out.println("Test server started"); + + // Wait for termination file to turn up + // This option puts the target in a pseudo 'server' mode + if (args.length == 1) { + final File termFile = new File(args[0]); + + while (!termFile.exists()) { + Thread.sleep(100); + } + } + + System.out.println("Test server stopped"); + } + +} diff --git a/jacoco-maven-plugin.test/it/it-dump/verify.bsh b/jacoco-maven-plugin.test/it/it-dump/verify.bsh new file mode 100644 index 00000000..99c3bd63 --- /dev/null +++ b/jacoco-maven-plugin.test/it/it-dump/verify.bsh @@ -0,0 +1,19 @@ +/******************************************************************************* + * 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 + * + *******************************************************************************/ +import java.io.*; +import org.codehaus.plexus.util.*; + +String buildLog = FileUtils.fileRead( new File( basedir, "build.log" ) ); +if ( buildLog.indexOf( "All coverage checks have been met." ) < 0 ) { + throw new RuntimeException( "Coverage checks were not met." ); +} |