Home | History | Annotate | Download | only in it-site-failsafe
      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  *    Evgeny Mandrikov - initial API and implementation
     10  *
     11  *******************************************************************************/
     12 import java.io.*;
     13 import org.codehaus.plexus.util.*;
     14 
     15 String projectReportsPage = FileUtils.fileRead( new File( basedir, "target/site/project-reports.html" ) );
     16 if ( projectReportsPage.indexOf( "JaCoCo Coverage Report." ) < 0 ) {
     17     throw new RuntimeException( "project-reports.html does not contain link to JaCoCo report" );
     18 }
     19 
     20 File htmlReportFile = new File( basedir, "target/site/jacoco/index.html" );
     21 if ( !htmlReportFile.isFile() ) {
     22     throw new RuntimeException( "HTML report was not created" );
     23 }
     24 
     25 File xmlReportFile = new File( basedir, "target/site/jacoco/jacoco.xml" );
     26 if ( !xmlReportFile.isFile() ) {
     27     throw new RuntimeException( "XML report was not created" );
     28 }
     29 
     30 File csvReportFile = new File( basedir, "target/site/jacoco/jacoco.csv" );
     31 if ( !csvReportFile.isFile() ) {
     32     throw new RuntimeException( "CSV report was not created" );
     33 }
     34 
     35 if ( projectReportsPage.indexOf( "JaCoCo IT Coverage Report." ) < 0 ) {
     36     throw new RuntimeException( "project-reports.html does not contain link to JaCoCo Integration report" );
     37 }
     38 
     39 File htmlReportFile = new File( basedir, "target/site/jacoco-it/index.html" );
     40 if ( !htmlReportFile.isFile() ) {
     41     throw new RuntimeException( "Integration HTML report was not created" );
     42 }
     43 
     44 File xmlReportFile = new File( basedir, "target/site/jacoco-it/jacoco.xml" );
     45 if ( !xmlReportFile.isFile() ) {
     46     throw new RuntimeException( "Integration XML report was not created" );
     47 }
     48 
     49 File csvReportFile = new File( basedir, "target/site/jacoco-it/jacoco.csv" );
     50 if ( !csvReportFile.isFile() ) {
     51     throw new RuntimeException( "Integration CSV report was not created" );
     52 }
     53