use of com.axway.ats.action.system.SystemOperations 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.system.SystemOperations in project ats-framework by Axway.
the class Test_FileSystemFolder method open.
@Test
public void open() 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();
verifyAll();
}
use of com.axway.ats.action.system.SystemOperations 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();
}
use of com.axway.ats.action.system.SystemOperations in project ats-framework by Axway.
the class Test_FileSystemFolder method openNegativeFolderAlreadyOpen.
@Test(expected = MatchableAlreadyOpenException.class)
public void openNegativeFolderAlreadyOpen() 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.open();
verifyAll();
}
Aggregations