private static Process createMockProcess( int exitCode )
{
Mock mockProcess = new Mock( Process.class );
mockProcess.expects( new InvokeOnceMatcher() ).method( "getInputStream" ).will(
new ReturnStub( new StringInputStream( "" ) ) );
mockProcess.expects( new InvokeOnceMatcher() ).method( "getErrorStream" ).will(
new ReturnStub( new StringInputStream( "" ) ) );
mockProcess.expects( new InvokeOnceMatcher() ).method( "waitFor" ).will(
new ReturnStub( new Integer( exitCode ) ) );
if ( exitCode != 0 )
{
mockProcess.expects( new InvokeOnceMatcher() ).method( "exitValue" ).will(