aboutsummaryrefslogtreecommitdiff
path: root/jacoco-maven-plugin.test
diff options
context:
space:
mode:
authorEvgeny Mandrikov <mandrikov@gmail.com>2012-09-14 00:04:50 +0600
committerEvgeny Mandrikov <mandrikov@gmail.com>2012-09-14 00:11:55 +0600
commit0d5ab6f2a3003055dd3fd8b205ff68196fcbbbd0 (patch)
tree002fe08f8b98ad4e4740854e771719033d1a3413 /jacoco-maven-plugin.test
parent47c3fbb8fad69c0e278eedf28bda0398b84773c4 (diff)
downloadjacoco-0d5ab6f2a3003055dd3fd8b205ff68196fcbbbd0.tar.gz
GitHub #19: Fail build if unable to read execution data file or create report
Diffstat (limited to 'jacoco-maven-plugin.test')
-rw-r--r--jacoco-maven-plugin.test/it/it-report-unreadable-dump/data.txt1
-rw-r--r--jacoco-maven-plugin.test/it/it-report-unreadable-dump/invoker.properties1
-rw-r--r--jacoco-maven-plugin.test/it/it-report-unreadable-dump/pom.xml44
-rw-r--r--jacoco-maven-plugin.test/it/it-report-unreadable-dump/verify.bsh18
4 files changed, 64 insertions, 0 deletions
diff --git a/jacoco-maven-plugin.test/it/it-report-unreadable-dump/data.txt b/jacoco-maven-plugin.test/it/it-report-unreadable-dump/data.txt
new file mode 100644
index 00000000..04df08ff
--- /dev/null
+++ b/jacoco-maven-plugin.test/it/it-report-unreadable-dump/data.txt
@@ -0,0 +1 @@
+Invalid data
diff --git a/jacoco-maven-plugin.test/it/it-report-unreadable-dump/invoker.properties b/jacoco-maven-plugin.test/it/it-report-unreadable-dump/invoker.properties
new file mode 100644
index 00000000..c21e972f
--- /dev/null
+++ b/jacoco-maven-plugin.test/it/it-report-unreadable-dump/invoker.properties
@@ -0,0 +1 @@
+invoker.buildResult = failure
diff --git a/jacoco-maven-plugin.test/it/it-report-unreadable-dump/pom.xml b/jacoco-maven-plugin.test/it/it-report-unreadable-dump/pom.xml
new file mode 100644
index 00000000..a32b142a
--- /dev/null
+++ b/jacoco-maven-plugin.test/it/it-report-unreadable-dump/pom.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2009, 2012 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-unreadable-dump</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>data.txt</dataFile>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/jacoco-maven-plugin.test/it/it-report-unreadable-dump/verify.bsh b/jacoco-maven-plugin.test/it/it-report-unreadable-dump/verify.bsh
new file mode 100644
index 00000000..113afe98
--- /dev/null
+++ b/jacoco-maven-plugin.test/it/it-report-unreadable-dump/verify.bsh
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2012 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( "Unable to read execution data file" ) < 0 ) {
+ throw new RuntimeException( "Error was not printed" );
+}