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