CvsScmTestUtils.executeCVS( assertionDirectory.getParentFile(), arguments );
// A new check out should return 0 updated files.
ScmRepository scmRepository = scmManager.makeScmRepository( scmUrl );
UpdateScmResult result = scmManager.update( scmRepository, new ScmFileSet( assertionDirectory ) );
assertNotNull( result );
if ( !result.isSuccess() )
{
System.out.println( "result.providerMessage: " + result.getProviderMessage() );
System.out.println( "result.commandOutput: " + result.getCommandOutput() );
fail( "Command failed" );
}
assertNull( result.getProviderMessage() );
assertNull( result.getCommandOutput() );
assertNotNull( result.getUpdatedFiles() );
assertEquals( 0, result.getUpdatedFiles().size() );
// Modifing a file
File fooJava = new File( workingDirectory, "Foo.java" );
String content = FileUtils.fileRead( fooJava );
writer = new FileWriter( fooJava );
writer.write( content + System.getProperty( "line.separator" ) );
writer.write( "extra line" );
writer.close();
// Adding a new file
writer = new FileWriter( new File( workingDirectory, "New.txt" ) );
writer.write( "new file" );
writer.close();
arguments = "-f -d " + repository.getAbsolutePath() + " add New.txt";
CvsScmTestUtils.executeCVS( workingDirectory, arguments );
// Committing
arguments = "-f -d " + repository.getAbsolutePath() + " commit -m .";
CvsScmTestUtils.executeCVS( workingDirectory, arguments );
// Check the updated files
result = scmManager.update( scmRepository, new ScmFileSet( assertionDirectory ) );
assertNotNull( result );
if ( !result.isSuccess() )
{