use of com.axway.ats.action.objects.FilePackage in project ats-framework by Axway.
the class Test_FileGIDRule method performMatchOtherFile.
@Test
public void performMatchOtherFile() throws Exception {
FilePackage remotePack = createMock(FilePackage.class);
expectNew(FilePackage.class, null, null, "/root/file.name").andReturn(remotePack);
expect(remotePack.getGid()).andReturn(1L);
expect(meta.getFilePackage()).andReturn(pack);
expect(pack.getGid()).andReturn(1L);
replayAll();
rule = new FileGidRule(null, "/root/file.name", "ruleName", true);
assertTrue(rule.performMatch(meta));
verifyAll();
}
use of com.axway.ats.action.objects.FilePackage in project ats-framework by Axway.
the class FileModtimeRule method performMatch.
@Override
public boolean performMatch(MetaData metaData) throws RbvException {
boolean actualResult = false;
if (metaData instanceof FileSystemMetaData) {
//get the file from the meta data
FilePackage file = ((FileSystemMetaData) metaData).getFilePackage();
try {
//get destination file's size
long destModtime = file.getModTime();
actualResult = destModtime == this.srcModtime;
} catch (PackageException pe) {
throw new RbvStorageException(pe);
}
}
return actualResult;
}
Aggregations