"mrtrout",
"drools" );
CompositeScmAction actions = new CompositeScmAction();
ScmAction addDirectory = new AddDirectory( "",
"folder1" );
actions.addScmAction( addDirectory );
byte[] content1 = new byte[]{1, 1, 1, 1};
ScmAction addFile = new AddFile( "folder1",
"file1.dat",
content1 );
actions.addScmAction( addFile );
addDirectory = new AddDirectory( "folder1",
"folder1_1" );
actions.addScmAction( addDirectory );
byte[] content2 = new byte[]{1, 0, 0, 1};
addFile = new AddFile( "folder1/folder1_1",
"file1.dat",
content2 );
actions.addScmAction( addFile );
svn.execute( actions,
"test message" );
ByteArrayOutputStream baos = new ByteArrayOutputStream();
svn.getContent( "folder1",
"file1.dat",
-1,
baos );
assertTrue( Arrays.equals( content1,
baos.toByteArray() ) );
baos = new ByteArrayOutputStream();
svn.getContent( "folder1/folder1_1",
"file1.dat",
-1,
baos );
assertTrue( Arrays.equals( content2,
baos.toByteArray() ) );
List list = convertToStringList( svn.listEntries( "" ) );
assertTrue( list.contains( "folder1" ) );
assertTrue( list.contains( "folder1/folder1_1/file1.dat" ) );
assertFalse( list.contains( "folder2/folder1/file1.dat" ) );
// Now copy the directory
actions = new CompositeScmAction();
addDirectory = new AddDirectory( "",
"folder2" );
actions.addScmAction( addDirectory );
ScmAction copyDirectory = new CopyDirectory( "folder1",
"folder2/folder1",
svn.getLatestRevision() );