use of com.axway.ats.action.filesystem.FileSystemOperations 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.action.filesystem.FileSystemOperations 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();
}
use of com.axway.ats.action.filesystem.FileSystemOperations in project ats-framework by Axway.
the class Test_FileSystemOperations method setUpTest_FileSystemOperations.
/**
* Setup method
*/
@Before
public void setUpTest_FileSystemOperations() {
fileSystemOperationsLocal = new FileSystemOperations();
fileSystemOperationsRemote = new FileSystemOperations(REMOTE_HOST_NAME_VALID);
localFSOperationsMock = createMock(LocalFileSystemOperations.class);
remoteFSOperationsMock = createMock(RemoteFileSystemOperations.class, REMOTE_HOST_NAME_VALID);
}
use of com.axway.ats.action.filesystem.FileSystemOperations in project ats-framework by Axway.
the class Test_FileSystemFolder method setUpTest_FileSystemFolder.
@Before
public void setUpTest_FileSystemFolder() throws Exception {
fileSystemOperations = createMock(FileSystemOperations.class);
systemOperations = createMock(SystemOperations.class);
storage = new FileSystemStorage();
}
Aggregations