File workingDirectory = getTestFile( "target/working-directory" );
Mock commandLineMock = new Mock( Commandline.class );
commandLineMock.expects( new InvokeOnceMatcher() ).method( "setWorkingDirectory" ).with(
new IsEqual( workingDirectory.getAbsolutePath() ) );
commandLineMock.expects( new InvokeOnceMatcher() ).method( "addEnvironment" ).with(
new IsEqual( "MAVEN_TERMINATE_CMD" ), new IsEqual( "on" ) );
commandLineMock.expects( new InvokeOnceMatcher() ).method( "execute" ).will(
new ThrowStub( new CommandLineException( "..." ) ) );
expectDefaultArguments( commandLineMock );