use of com.axway.ats.rbv.MetaData in project ats-framework by Axway.
the class Test_FileMD5Rule method isMatchConstructWithMd5ExpectTruePositive.
@Test
public void isMatchConstructWithMd5ExpectTruePositive() throws PackageException, RbvException {
expect(pack.getMd5sum(true)).andReturn(md5sum);
replayAll();
FileMd5Rule rule = new FileMd5Rule(md5sum, "isMatchConstructWithMd5ExpectTruePositive", true);
MetaData metaData = new FileSystemMetaData(pack);
assertTrue(rule.isMatch(metaData));
verifyAll();
}
use of com.axway.ats.rbv.MetaData in project ats-framework by Axway.
the class Test_FileMD5Rule method isMatchNullMetaDataContent.
@Test(expected = MetaDataIncorrectException.class)
public void isMatchNullMetaDataContent() throws PackageException, RbvException {
expect(pack.getMd5sum(true)).andReturn(md5sum);
replayAll();
FileMd5Rule rule = new FileMd5Rule("", "isMatchNullMetaDataContent", true);
MetaData metaData = new FileSystemMetaData(null);
assertFalse(rule.isMatch(metaData));
verifyAll();
}
use of com.axway.ats.rbv.MetaData in project ats-framework by Axway.
the class Test_FileMD5Rule method isMatchConstructWithFileExpectFalseNegative.
@Test
public void isMatchConstructWithFileExpectFalseNegative() throws Exception {
expectNew(FilePackage.class, null, null, testFilePath).andReturn(pack);
expect(pack.getMd5sum()).andReturn(md5sum);
expect(pack.getMd5sum(true)).andReturn(md5sum);
replayAll();
FileMd5Rule rule = new FileMd5Rule(null, testFilePath, "isMatchConstructWithFileExpectFalseNegative", false);
MetaData metaData = new FileSystemMetaData(pack);
assertFalse(rule.isMatch(metaData));
verifyAll();
}
use of com.axway.ats.rbv.MetaData in project ats-framework by Axway.
the class Test_FilePathRule method isMatchExpectedTruePositiveRegex.
@Test
public void isMatchExpectedTruePositiveRegex() throws Exception {
expect(pack.getAbsolutePath()).andReturn(testFileAbsPath);
expect(pack.getName()).andReturn(testFileAbsPath.substring(testFileAbsPath.lastIndexOf('/') + 1));
replayAll();
FilePathRule rule = new FilePathRule(testFileDir, "p.*1.+xt", "isMatchExpectedTruePositive", true, 1);
MetaData metaData = new FileSystemMetaData(pack);
assertTrue(rule.isMatch(metaData));
verifyAll();
}
use of com.axway.ats.rbv.MetaData in project ats-framework by Axway.
the class Test_FilePathRule method isMatchNullMetaDataContent.
@Test(expected = MetaDataIncorrectException.class)
public void isMatchNullMetaDataContent() throws Exception {
expect(pack.getAbsolutePath()).andReturn(testFileAbsPath);
replayAll();
FilePathRule rule = new FilePathRule(testFileAbsPath, "isMatchNullMetaDataContent", true);
MetaData metaData = new FileSystemMetaData(null);
assertFalse(rule.isMatch(metaData));
verifyAll();
}
Aggregations