Home | History | Annotate | Download | only in it-site
      1 /*******************************************************************************
      2  * Copyright (c) 2009, 2015 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 Test 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