diff options
author | Marc R. Hoffmann <hoffmann@mountainminds.com> | 2014-01-22 22:34:49 -0800 |
---|---|---|
committer | Marc R. Hoffmann <hoffmann@mountainminds.com> | 2014-01-22 22:34:49 -0800 |
commit | 38a27cd6745f678d29203119c7023543acacbd24 (patch) | |
tree | 336b9c483da5ce41b5d8abdd13c76f22e30f45a2 /jacoco-maven-plugin.test | |
parent | a7617e95423a1929577a59f03e08d67478b589bf (diff) | |
parent | 68dc5ebfa0cc8e718e514a25cd4276a6ca86dd96 (diff) | |
download | jacoco-38a27cd6745f678d29203119c7023543acacbd24.tar.gz |
Merge pull request #185 from jacoco/issue-185
Print warning if class ids differ
Diffstat (limited to 'jacoco-maven-plugin.test')
-rw-r--r-- | jacoco-maven-plugin.test/it/it-report-nomatch/nomatch.exec | bin | 0 -> 24 bytes | |||
-rw-r--r-- | jacoco-maven-plugin.test/it/it-report-nomatch/pom.xml | 44 | ||||
-rw-r--r-- | jacoco-maven-plugin.test/it/it-report-nomatch/src/main/java/Example.java | 14 | ||||
-rw-r--r-- | jacoco-maven-plugin.test/it/it-report-nomatch/verify.bsh | 24 |
4 files changed, 82 insertions, 0 deletions
diff --git a/jacoco-maven-plugin.test/it/it-report-nomatch/nomatch.exec b/jacoco-maven-plugin.test/it/it-report-nomatch/nomatch.exec Binary files differnew file mode 100644 index 00000000..31cad96f --- /dev/null +++ b/jacoco-maven-plugin.test/it/it-report-nomatch/nomatch.exec diff --git a/jacoco-maven-plugin.test/it/it-report-nomatch/pom.xml b/jacoco-maven-plugin.test/it/it-report-nomatch/pom.xml new file mode 100644 index 00000000..73b6a096 --- /dev/null +++ b/jacoco-maven-plugin.test/it/it-report-nomatch/pom.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright (c) 2009, 2014 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 +--> +<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-report-nomatch</artifactId> + + <build> + <plugins> + <plugin> + <groupId>@project.groupId@</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <executions> + <execution> + <id>report</id> + <phase>prepare-package</phase> + <goals> + <goal>report</goal> + </goals> + <configuration> + <dataFile>nomatch.exec</dataFile> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/jacoco-maven-plugin.test/it/it-report-nomatch/src/main/java/Example.java b/jacoco-maven-plugin.test/it/it-report-nomatch/src/main/java/Example.java new file mode 100644 index 00000000..5d2c1392 --- /dev/null +++ b/jacoco-maven-plugin.test/it/it-report-nomatch/src/main/java/Example.java @@ -0,0 +1,14 @@ +/******************************************************************************* + * Copyright (c) 2009, 2014 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 + * + *******************************************************************************/ +public class Example { + +} diff --git a/jacoco-maven-plugin.test/it/it-report-nomatch/verify.bsh b/jacoco-maven-plugin.test/it/it-report-nomatch/verify.bsh new file mode 100644 index 00000000..e45c9ad7 --- /dev/null +++ b/jacoco-maven-plugin.test/it/it-report-nomatch/verify.bsh @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2009, 2014 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 + * + *******************************************************************************/ +import java.io.*; +import org.codehaus.plexus.util.*; + +String buildLog = FileUtils.fileRead( new File( basedir, "build.log" ) ); +if ( buildLog.indexOf( "Classes in bundle 'it-report-nomatch' do no match with execution data." ) < 0 ) { + throw new RuntimeException( "Warning 1 was not printed" ); +} +if ( buildLog.indexOf( "For report generation the same class files must be used as at runtime." ) < 0 ) { + throw new RuntimeException( "Warning 2 was not printed" ); +} +if ( buildLog.indexOf( "Execution data for class Example does not match." ) < 0 ) { + throw new RuntimeException( "Warning 3 was not printed" ); +} |