use of com.axway.ats.rbv.filesystem.FileSystemFolder in project ats-framework by Axway.
the class Test_FileSystemFolder method getAllMetadataExceptionFetchingModTimePositive.
@Test
public void getAllMetadataExceptionFetchingModTimePositive() throws Exception {
// constructors
expectNew(SystemOperations.class, "localhost:0000").andReturn(systemOperations);
expectNew(FileSystemOperations.class, "localhost:0000").andReturn(fileSystemOperations);
// open()
expect(systemOperations.getOperatingSystemType()).andReturn(OperatingSystemType.SOLARIS);
// getAllMetaData()
expect(fileSystemOperations.findFiles("some.path/", ".*", true, true, false)).andReturn(new String[] { "some.path/some.file1", "some.path/some.file2" });
FilePackage pack1 = createMock(FilePackage.class);
expectNew(FilePackage.class, "localhost:0000", "some.path/some.file1", OperatingSystemType.SOLARIS).andReturn(pack1);
expect(pack1.getUniqueIdentifier()).andThrow(new PackageException(""));
FilePackage pack2 = createMock(FilePackage.class);
expectNew(FilePackage.class, "localhost:0000", "some.path/some.file2", OperatingSystemType.SOLARIS).andReturn(pack2);
expect(pack2.getUniqueIdentifier()).andReturn("some.path/some.file1.1.1.1");
replayAll();
FileSystemFolder folder = new FileSystemFolder("localhost:0000", "some.path", null, true, false);
folder.open();
assertEquals(folder.getAllMetaData().size(), 1);
verifyAll();
}
use of com.axway.ats.rbv.filesystem.FileSystemFolder in project ats-framework by Axway.
the class Test_FileSystemFolder method getDescription.
@Test
public void getDescription() {
FileSystemFolder folder = (FileSystemFolder) storage.getFolder(new FileSystemFolderSearchTerm(path, null, true, false));
assertEquals("File system folder '" + path + "' on the local machine", folder.getDescription());
}
use of com.axway.ats.rbv.filesystem.FileSystemFolder in project ats-framework by Axway.
the class Test_FileSystemFolder method close.
@Test
public void close() throws Exception {
expectNew(SystemOperations.class, "localhost:0000").andReturn(systemOperations);
expect(systemOperations.getOperatingSystemType()).andReturn(OperatingSystemType.LINUX);
replayAll();
FileSystemFolder folder = (FileSystemFolder) storage.getFolder(new FileSystemFolderSearchTerm(path, null, true, false));
folder.open();
folder.close();
verifyAll();
}
use of com.axway.ats.rbv.filesystem.FileSystemFolder in project ats-framework by Axway.
the class Test_FileSystemFolder method getMetaDataCountsNegativeFolderNotOpen.
@Test(expected = MatchableNotOpenException.class)
public void getMetaDataCountsNegativeFolderNotOpen() throws Exception {
FileSystemFolder folder = (FileSystemFolder) storage.getFolder(new FileSystemFolderSearchTerm(path, null, true, false));
folder.getMetaDataCounts();
}
use of com.axway.ats.rbv.filesystem.FileSystemFolder in project ats-framework by Axway.
the class Test_FileSystemFolder method getAllMetadataNoSuchEntity.
@Test
public void getAllMetadataNoSuchEntity() throws Exception {
// constructors
expectNew(SystemOperations.class, "localhost:0000").andReturn(systemOperations);
expectNew(FileSystemOperations.class, "localhost:0000").andReturn(fileSystemOperations);
// open()
expect(systemOperations.getOperatingSystemType()).andReturn(OperatingSystemType.SOLARIS);
// getAllMetaData()
expect(fileSystemOperations.findFiles("some.path/", ".*", true, true, false)).andReturn(new String[0]);
replayAll();
FileSystemFolder folder = new FileSystemFolder("localhost:0000", "some.path", null, true, false);
folder.open();
assertEquals(folder.getAllMetaData(), new ArrayList<MetaData>());
verifyAll();
}
Aggregations