1/******************************************************************************* 2 * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * Marc R. Hoffmann, Jan Wloka - initial API and implementation 10 * 11 *******************************************************************************/ 12import org.codehaus.plexus.util.*; 13import java.util.regex.*; 14 15String buildLog = FileUtils.fileRead( new File( basedir, "build.log" ) ); 16 17if ( !Pattern.compile( "Loading execution data file \\S*child1.target.jacoco.exec").matcher( buildLog ).find() ) { 18 throw new RuntimeException( "Execution data from child1 was not loaded." ); 19} 20 21if ( !Pattern.compile( "Loading execution data file \\S*child1-test.target.jacoco.exec").matcher( buildLog ).find() ) { 22 throw new RuntimeException( "Execution data from child1-test was not loaded." ); 23} 24 25if ( !Pattern.compile( "Loading execution data file \\S*child2.target.jacoco.exec").matcher( buildLog ).find() ) { 26 throw new RuntimeException( "Execution data from child2 was not loaded." ); 27} 28 29if ( !Pattern.compile( "Loading execution data file \\S*report.target.jacoco.exec").matcher( buildLog ).find() ) { 30 throw new RuntimeException( "Execution data from report was not loaded." ); 31} 32 33File reportChild1 = new File( basedir, "report/target/site/jacoco-aggregate/child1/index.html" ); 34if ( !reportChild1.isFile() ) { 35 throw new RuntimeException( "Report for child1 was not created." ); 36} 37 38File reportChild1test = new File( basedir, "report/target/site/jacoco-aggregate/child1-test/index.html" ); 39if ( reportChild1test.isFile() ) { 40 throw new RuntimeException( "Report for child1-test should not be created." ); 41} 42 43File reportChild2 = new File( basedir, "report/target/site/jacoco-aggregate/child2/index.html" ); 44if ( !reportChild2.isFile() ) { 45 throw new RuntimeException( "Report for child2 was not created." ); 46} 47