use of com.axway.ats.action.objects.model.PackageException 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.objects.model.PackageException in project ats-framework by Axway.
the class Test_FileGIDRule method performMatchOtherFileException.
@Test(expected = RbvException.class)
public void performMatchOtherFileException() throws Exception {
FilePackage remotePack = createMock(FilePackage.class);
expectNew(FilePackage.class, null, null, "/root/file.name").andReturn(remotePack);
expect(remotePack.getGid()).andThrow(new PackageException(""));
replayAll();
rule = new FileGidRule(null, "/root/file.name", "ruleName", true);
verifyAll();
}
use of com.axway.ats.action.objects.model.PackageException in project ats-framework by Axway.
the class Test_FileUIDRule method performMatchOtherFileException.
@Test(expected = RbvException.class)
public void performMatchOtherFileException() throws Exception {
FilePackage remotePack = createMock(FilePackage.class, null, "/root/file.name");
expectNew(FilePackage.class, null, null, "/root/file.name").andReturn(remotePack);
expect(remotePack.getUid()).andThrow(new PackageException("Test"));
replayAll();
rule = new FileUidRule(null, "/root/file.name", "ruleName", true);
verifyAll();
}
use of com.axway.ats.action.objects.model.PackageException in project ats-framework by Axway.
the class Test_FileUIDRule method performMatchNegativeWxception.
@Test(expected = RbvException.class)
public void performMatchNegativeWxception() throws RbvException, PackageException {
expect(meta.getFilePackage()).andReturn(pack);
expect(pack.getUid()).andThrow(new PackageException(""));
replayAll();
rule = new FileUidRule(1, "ruleName", true);
rule.performMatch(meta);
verifyAll();
}
use of com.axway.ats.action.objects.model.PackageException in project ats-framework by Axway.
the class Test_FileContentRule method isMatchNegativeException.
@Test(expected = RbvException.class)
public void isMatchNegativeException() throws Exception {
expect(testFilePackage.grep(EXPRESSION, false)).andThrow(new PackageException(""));
replayAll();
FileContentRule rule = new FileContentRule(EXPRESSION, RULE_NAME, false, true);
MetaData metaData = new FileSystemMetaData(testFilePackage);
rule.isMatch(metaData);
verifyAll();
}
Aggregations