use of com.axway.ats.rbv.filesystem.FileSystemFolderSearchTerm in project ats-framework by Axway.
the class Test_FileSystemFolderSearchTerm method constructorWithNoFolder.
@Test
public void constructorWithNoFolder() {
FileSystemFolderSearchTerm searchTerm = new FileSystemFolderSearchTerm("/test/", null, true);
assertEquals("/test/", searchTerm.getPath());
assertEquals(true, searchTerm.isIncludeDirs());
}
use of com.axway.ats.rbv.filesystem.FileSystemFolderSearchTerm in project ats-framework by Axway.
the class Test_FileSystemStorage method getFolder.
@Test
public void getFolder() {
FileSystemStorage storage = new FileSystemStorage("localhost:0000");
assertNotNull(storage.getFolder(new FileSystemFolderSearchTerm("/", null, true)));
}
use of com.axway.ats.rbv.filesystem.FileSystemFolderSearchTerm in project ats-framework by Axway.
the class Test_FileSystemFolder method getNewMetaDataNegativeFolderNotOpen.
@Test(expected = MatchableNotOpenException.class)
public void getNewMetaDataNegativeFolderNotOpen() throws Exception {
FileSystemFolder folder = (FileSystemFolder) storage.getFolder(new FileSystemFolderSearchTerm(path, null, true, false));
folder.getNewMetaData();
}
use of com.axway.ats.rbv.filesystem.FileSystemFolderSearchTerm in project ats-framework by Axway.
the class Test_FileSystemFolder method getNewMetadataChangeLastModified.
@Test
public void getNewMetadataChangeLastModified() throws Exception {
expectNew(SystemOperations.class, "localhost:0000").andReturn(systemOperations).times(7);
expect(systemOperations.getOperatingSystemType()).andReturn(OperatingSystemType.LINUX);
// now we call getNewMetaData() 3 times
expect(fileSystemOperations.findFiles(path, ".*", true, true, false)).andReturn(fileList).times(3);
// 3 times x 2 files
expectNew(FileSystemOperations.class, "localhost:0000").andReturn(fileSystemOperations).times(7);
expect(fileSystemOperations.getFileUniqueId(file1)).andReturn(file1_hash).times(2);
expect(fileSystemOperations.getFileUniqueId(file2)).andReturn(file2_hash).times(3);
// modify the modification timestamp of file1 for the last getNewMetaData() call
expect(fileSystemOperations.getFileUniqueId(file1)).andReturn(file1_hash_changed);
replayAll();
FileSystemFolder folder = (FileSystemFolder) storage.getFolder(new FileSystemFolderSearchTerm(path, null, true, false));
folder.open();
List<MetaData> list = folder.getNewMetaData();
assertEquals(2, list.size());
for (MetaData metaData : list) {
((FileSystemMetaData) metaData).getFilePackage();
}
assertEquals(0, folder.getNewMetaData().size());
assertEquals(1, folder.getNewMetaData().size());
verifyAll();
}
use of com.axway.ats.rbv.filesystem.FileSystemFolderSearchTerm in project ats-framework by Axway.
the class Test_FileSystemFolder method getAllMetaDataNegativeFolderNotOpen.
@Test(expected = MatchableNotOpenException.class)
public void getAllMetaDataNegativeFolderNotOpen() throws Exception {
FileSystemFolder folder = (FileSystemFolder) storage.getFolder(new FileSystemFolderSearchTerm(path, null, true, false));
folder.getAllMetaData();
}
Aggregations