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