import java.io.*;
import org.codehaus.plexus.util.FileUtils;

String log = FileUtils.fileRead( new File( basedir, "build.log" ) );
String expected = "jruby-1.5.6 mode 1.8: 1 tests, 1 assertions, 0 failures, 0 errors";
if ( !log.contains( expected ) )
{
    throw new RuntimeException( "log file does not contain '" + expected + "'" );
}

expected = "jruby-1.6.1 mode 1.8: 1 tests, 1 assertions, 0 failures, 0 errors";
if ( !log.contains( expected ) )
{
    throw new RuntimeException( "log file does not contain '" + expected + "'" );
}

expected = "jruby-1.6.1 mode 1.9: 1 tests, 1 assertions, 0 failures, 0 errors, 0 skips";
if ( !log.contains( expected ) )
{
    throw new RuntimeException( "log file does not contain '" + expected + "'" );
}

File file = new File( basedir, "target/surefire-reports/TEST-minitest-1.5.6--1.8.xml");
if ( !file.exists() )
{
    throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" );
}

file = new File( basedir, "target/surefire-reports/TEST-minitest-1.6.1--1.8.xml");
if ( !file.exists() )
{
    throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" );
}

file = new File( basedir, "target/surefire-reports/TEST-minitest-1.6.1--1.9.xml");
if ( !file.exists() )
{
    throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" );
}
