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


String log = FileUtils.fileRead( new File( basedir, "build.log" ) );
String expected = "Jars.lock created";
if ( !log.contains( expected ) )
{
    throw new RuntimeException( "log file does not contain '" + expected + "'" );
} 

expected = "Jars.lock is up to date";
if ( !log.contains( expected ) )
{
    throw new RuntimeException( "log file does not contain '" + expected + "'" );
}

expected = "Jars2.lock has outdated dependencies";
if ( !log.contains( expected ) )
{
    throw new RuntimeException( "log file does not contain '" + expected + "'" );
}

expected = "no such artifact in Jars.lock: unknown";
if ( !log.contains( expected ) )
{
    throw new RuntimeException( "log file does not contain '" + expected + "'" );
}

expected = "updated org.slf4j:slf4j-simple:jar:1.7.12:compile";
if ( !log.contains( expected ) )
{
    throw new RuntimeException( "log file does not contain '" + expected + "'" );
}

expected = "Jars2.lock updated";
if ( !log.contains( expected ) )
{
    throw new RuntimeException( "log file does not contain '" + expected + "'" );
}

expected = "Jars3.lock updated";
if ( !log.contains( expected ) )
{
    throw new RuntimeException( "log file does not contain '" + expected + "'" );
}

File file = new File( basedir, "target/jars/joda-time/joda-time/2.7/joda-time-2.7.jar" );
if ( !file.exists() )
{
    throw new RuntimeException( "expected file does not exists '" + file + "'" );
}

file = new File( basedir, "target/jars/org/apache/kafka/kafka_2.10/0.8.1.1/kafka_2.10-0.8.1.1.jar" );
if ( !file.exists() )
{
    throw new RuntimeException( "expected file does not exists '" + file + "'" );
}

file = new File( basedir, "target/jars/org/bouncycastle/bcprov-jdk15on/1.49/bcprov-jdk15on-1.49.jar" );
if ( !file.exists() )
{
    throw new RuntimeException( "expected file does not exists '" + file + "'" );
}
