/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.*; import org.codehaus.plexus.util.*; File pdfFile = new File( basedir, "target/pdf/test.pdf" ); System.out.println( "Checking for existence of " + pdfFile ); if ( !pdfFile.isFile() ) { throw new FileNotFoundException( pdfFile + " missing" ); } InputStream in = new FileInputStream( pdfFile ); byte[] bytes = IOUtil.toByteArray( in ); in.close(); String content = new String( bytes, "ISO-8859-1" ); if ( !content.contains( "/Title (Continuous Integration)" ) ) { System.err.println( "MPIR CIM report not included in pdf." ); // return false; MPDF-48: known issue with Maven 3... } if ( !content.contains( "/Title (APT)" ) ) { System.err.println( "APT Doxia Markup not included in pdf." ); return false; } if ( !content.contains( "/Title (FML)" ) ) { System.err.println( "FML Doxia Markup not included in pdf." ); return false; } if ( !content.contains( "/Title (Xdoc)" ) ) { System.err.println( "Xdoc Doxia Markup not included in pdf." ); return false; } if ( !content.contains( "/Title (XHTML)" ) ) { System.err.println( "XHTML Doxia Markup not included in pdf." ); return false; } if ( !content.contains( "/Title (Markdown)" ) ) { System.err.println( "Markdown Doxia Markup not included in pdf." ); return false; } return true;