@@ -44,12 +44,12 @@ public class StoregateCopyFeatureTest extends AbstractStoregateTest {
4444 @ Test
4545 public void testCopyFileServerSide () throws Exception {
4646 final StoregateIdProvider nodeid = new StoregateIdProvider (session );
47- final Path room = new StoregateDirectoryFeature (session , nodeid ).mkdir (new Path (
47+ final Path room = new StoregateDirectoryFeature (session , nodeid ).mkdir (new StoregateWriteFeature ( session , nodeid ), new Path (
4848 String .format ("/My files/%s" , new AlphanumericRandomStringService ().random ()), EnumSet .of (Path .Type .directory , Path .Type .volume )), new TransferStatus ());
49- final Path test = new StoregateTouchFeature (session , nodeid ).touch (new Path (room , new AlphanumericRandomStringService ().random (), EnumSet .of (Path .Type .file )), new TransferStatus ());
50- final Path copy = new Path (new StoregateDirectoryFeature (session , nodeid ).mkdir (new Path (room , new AlphanumericRandomStringService ().random (), EnumSet .of (Path .Type .directory )), new TransferStatus ()), test .getName (), EnumSet .of (Path .Type .file ));
49+ final Path test = new StoregateTouchFeature (session , nodeid ).touch (new StoregateWriteFeature ( session , nodeid ), new Path (room , new AlphanumericRandomStringService ().random (), EnumSet .of (Path .Type .file )), new TransferStatus ());
50+ final Path copy = new Path (new StoregateDirectoryFeature (session , nodeid ).mkdir (new StoregateWriteFeature ( session , nodeid ), new Path (room , new AlphanumericRandomStringService ().random (), EnumSet .of (Path .Type .directory )), new TransferStatus ()), test .getName (), EnumSet .of (Path .Type .file ));
5151 final TransferStatus status = new TransferStatus ();
52- new StoregateTouchFeature (session , nodeid ).touch (copy , status );
52+ new StoregateTouchFeature (session , nodeid ).touch (new StoregateWriteFeature ( session , nodeid ), copy , status );
5353 final StoregateCopyFeature feature = new StoregateCopyFeature (session , nodeid );
5454 assertTrue (feature .isSupported (test , Optional .of (copy )));
5555 assertNotEquals (test .attributes ().getFileId (), new StoregateCopyFeature (session , nodeid ).copy (test , copy , new TransferStatus (), new DisabledConnectionCallback (), new DisabledStreamListener ()).attributes ().getFileId ());
@@ -61,10 +61,10 @@ public void testCopyFileServerSide() throws Exception {
6161 @ Test
6262 public void testCopyFileWithRename () throws Exception {
6363 final StoregateIdProvider fileid = new StoregateIdProvider (session );
64- final Path room = new StoregateDirectoryFeature (session , fileid ).mkdir (new Path (
64+ final Path room = new StoregateDirectoryFeature (session , fileid ).mkdir (new StoregateWriteFeature ( session , fileid ), new Path (
6565 String .format ("/My files/%s" , new AlphanumericRandomStringService ().random ()), EnumSet .of (Path .Type .directory , Path .Type .volume )), new TransferStatus ());
66- final Path test = new StoregateTouchFeature (session , fileid ).touch (new Path (room , new AlphanumericRandomStringService ().random (), EnumSet .of (Path .Type .file )), new TransferStatus ());
67- final Path copy = new Path (new StoregateDirectoryFeature (session , fileid ).mkdir (new Path (room , new AlphanumericRandomStringService ().random (), EnumSet .of (Path .Type .directory )), new TransferStatus ()), new AlphanumericRandomStringService ().random (), EnumSet .of (Path .Type .file ));
66+ final Path test = new StoregateTouchFeature (session , fileid ).touch (new StoregateWriteFeature ( session , fileid ), new Path (room , new AlphanumericRandomStringService ().random (), EnumSet .of (Path .Type .file )), new TransferStatus ());
67+ final Path copy = new Path (new StoregateDirectoryFeature (session , fileid ).mkdir (new StoregateWriteFeature ( session , fileid ), new Path (room , new AlphanumericRandomStringService ().random (), EnumSet .of (Path .Type .directory )), new TransferStatus ()), new AlphanumericRandomStringService ().random (), EnumSet .of (Path .Type .file ));
6868 assertNotEquals (test .attributes ().getFileId (), new StoregateCopyFeature (session , fileid ).copy (test , copy , new TransferStatus (), new DisabledConnectionCallback (), new DisabledStreamListener ()).attributes ().getFileId ());
6969 assertTrue (new DefaultFindFeature (session ).find (test ));
7070 assertTrue (new DefaultFindFeature (session ).find (copy ));
@@ -74,15 +74,15 @@ public void testCopyFileWithRename() throws Exception {
7474 @ Test
7575 public void testCopyServerSideToExistingFile () throws Exception {
7676 final StoregateIdProvider fileid = new StoregateIdProvider (session );
77- final Path top = new StoregateDirectoryFeature (session , fileid ).mkdir (new Path (
77+ final Path top = new StoregateDirectoryFeature (session , fileid ).mkdir (new StoregateWriteFeature ( session , fileid ), new Path (
7878 String .format ("/My files/%s" , new AlphanumericRandomStringService ().random ()), EnumSet .of (Path .Type .directory , Path .Type .volume )), new TransferStatus ());
7979 final Path sourceFolder = new Path (top , new AlphanumericRandomStringService ().random (), EnumSet .of (Path .Type .directory ));
8080 final Path targetFolder = new Path (top , new AlphanumericRandomStringService ().random (), EnumSet .of (Path .Type .directory ));
81- new StoregateDirectoryFeature (session , fileid ).mkdir (sourceFolder , new TransferStatus ());
82- new StoregateDirectoryFeature (session , fileid ).mkdir (targetFolder , new TransferStatus ());
83- final Path test = new StoregateTouchFeature (session , fileid ).touch (new Path (sourceFolder , new AlphanumericRandomStringService ().random (), EnumSet .of (Path .Type .file )), new TransferStatus ());
81+ new StoregateDirectoryFeature (session , fileid ).mkdir (new StoregateWriteFeature ( session , fileid ), sourceFolder , new TransferStatus ());
82+ new StoregateDirectoryFeature (session , fileid ).mkdir (new StoregateWriteFeature ( session , fileid ), targetFolder , new TransferStatus ());
83+ final Path test = new StoregateTouchFeature (session , fileid ).touch (new StoregateWriteFeature ( session , fileid ), new Path (sourceFolder , new AlphanumericRandomStringService ().random (), EnumSet .of (Path .Type .file )), new TransferStatus ());
8484 final Path copy = new Path (targetFolder , test .getName (), EnumSet .of (Path .Type .file ));
85- new StoregateTouchFeature (session , fileid ).touch (copy , new TransferStatus ());
85+ new StoregateTouchFeature (session , fileid ).touch (new StoregateWriteFeature ( session , fileid ), copy , new TransferStatus ());
8686 final StoregateCopyFeature feature = new StoregateCopyFeature (session , fileid );
8787 assertTrue (feature .isSupported (test , Optional .of (copy )));
8888 assertNotEquals (test .attributes ().getFileId (), new StoregateCopyFeature (session , fileid ).copy (test , copy , new TransferStatus ().setExists (true ), new DisabledConnectionCallback (), new DisabledStreamListener ()).attributes ().getFileId ());
@@ -95,13 +95,13 @@ public void testCopyServerSideToExistingFile() throws Exception {
9595 @ Test
9696 public void testCopyWithRenameToExistingFile () throws Exception {
9797 final StoregateIdProvider fileid = new StoregateIdProvider (session );
98- final Path top = new StoregateDirectoryFeature (session , fileid ).mkdir (new Path (
98+ final Path top = new StoregateDirectoryFeature (session , fileid ).mkdir (new StoregateWriteFeature ( session , fileid ), new Path (
9999 String .format ("/My files/%s" , new AlphanumericRandomStringService ().random ()), EnumSet .of (Path .Type .directory , Path .Type .volume )), new TransferStatus ());
100100 final Path folder = new Path (top , new AlphanumericRandomStringService ().random (), EnumSet .of (Path .Type .directory ));
101- new StoregateDirectoryFeature (session , fileid ).mkdir (folder , new TransferStatus ());
102- final Path test = new StoregateTouchFeature (session , fileid ).touch (new Path (folder , new AlphanumericRandomStringService ().random (), EnumSet .of (Path .Type .file )), new TransferStatus ());
101+ new StoregateDirectoryFeature (session , fileid ).mkdir (new StoregateWriteFeature ( session , fileid ), folder , new TransferStatus ());
102+ final Path test = new StoregateTouchFeature (session , fileid ).touch (new StoregateWriteFeature ( session , fileid ), new Path (folder , new AlphanumericRandomStringService ().random (), EnumSet .of (Path .Type .file )), new TransferStatus ());
103103 final Path test2 = new Path (folder , new AlphanumericRandomStringService ().random (), EnumSet .of (Path .Type .file ));
104- new StoregateTouchFeature (session , fileid ).touch (test2 , new TransferStatus ());
104+ new StoregateTouchFeature (session , fileid ).touch (new StoregateWriteFeature ( session , fileid ), test2 , new TransferStatus ());
105105 assertNotEquals (test .attributes ().getFileId (), new StoregateCopyFeature (session , fileid ).copy (test , test2 , new TransferStatus ().setExists (true ), new DisabledConnectionCallback (), new DisabledStreamListener ()).attributes ().getFileId ());
106106 final Find find = new DefaultFindFeature (session );
107107 assertTrue (find .find (test ));
@@ -112,13 +112,13 @@ public void testCopyWithRenameToExistingFile() throws Exception {
112112 @ Test
113113 public void testCopyDirectoryServerSide () throws Exception {
114114 final StoregateIdProvider fileid = new StoregateIdProvider (session );
115- final Path top = new StoregateDirectoryFeature (session , fileid ).mkdir (new Path (
115+ final Path top = new StoregateDirectoryFeature (session , fileid ).mkdir (new StoregateWriteFeature ( session , fileid ), new Path (
116116 String .format ("/My files/%s" , new AlphanumericRandomStringService ().random ()), EnumSet .of (Path .Type .directory , Path .Type .volume )), new TransferStatus ());
117- final Path directory = new StoregateDirectoryFeature (session , fileid ).mkdir (new Path (top , new AlphanumericRandomStringService ().random (), EnumSet .of (Path .Type .directory )), new TransferStatus ());
117+ final Path directory = new StoregateDirectoryFeature (session , fileid ).mkdir (new StoregateWriteFeature ( session , fileid ), new Path (top , new AlphanumericRandomStringService ().random (), EnumSet .of (Path .Type .directory )), new TransferStatus ());
118118 final String name = new AlphanumericRandomStringService ().random ();
119119 final TransferStatus status = new TransferStatus ();
120- final Path file = new StoregateTouchFeature (session , fileid ).touch (new Path (directory , name , EnumSet .of (Path .Type .file )), status );
121- final Path target_parent = new StoregateDirectoryFeature (session , fileid ).mkdir (new Path (top , new AlphanumericRandomStringService ().random (), EnumSet .of (Path .Type .directory )), new TransferStatus ());
120+ final Path file = new StoregateTouchFeature (session , fileid ).touch (new StoregateWriteFeature ( session , fileid ), new Path (directory , name , EnumSet .of (Path .Type .file )), status );
121+ final Path target_parent = new StoregateDirectoryFeature (session , fileid ).mkdir (new StoregateWriteFeature ( session , fileid ), new Path (top , new AlphanumericRandomStringService ().random (), EnumSet .of (Path .Type .directory )), new TransferStatus ());
122122 final Path target = new Path (target_parent , directory .getName (), EnumSet .of (Path .Type .directory ));
123123 final StoregateCopyFeature feature = new StoregateCopyFeature (session , fileid );
124124 assertTrue (feature .isSupported (directory , Optional .of (target )));
0 commit comments