Home | History | Annotate | Download | only in it-report-aggregate-customization
      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  *******************************************************************************/
     12 import org.codehaus.plexus.util.*;
     13 import java.util.regex.*;
     14 
     15 String buildLog = FileUtils.fileRead( new File( basedir, "build.log" ) );
     16 
     17 // Test customization of dataFileIncludes and dataFileExcludes
     18 
     19 if ( !Pattern.compile( "Loading execution data file \\S*child1.target.child1.coverage").matcher( buildLog ).find() ) {
     20     throw new RuntimeException( "Execution data from child1 was not loaded." );
     21 }
     22 
     23 if ( Pattern.compile( "Loading execution data file \\S*child2").matcher( buildLog ).find() ) {
     24     throw new RuntimeException( "Execution data from child2 was loaded." );
     25 }
     26 
     27 // Test customization of outputDirectory
     28 
     29 File reportChild1 = new File( basedir, "report/target/jacoco-aggregate-customization/child1/index.html" );
     30 if ( !reportChild1.isFile() ) {
     31     throw new RuntimeException( "Report for child1 was not created." );
     32 }
     33 
     34 File reportChild2 = new File( basedir, "report/target/jacoco-aggregate-customization/child2/index.html" );
     35 if ( !reportChild2.isFile() ) {
     36     throw new RuntimeException( "Report for child2 was not created." );
     37 }
     38