use of com.axway.ats.rbv.MetaData in project ats-framework by Axway.
the class Test_FileSizeRule method isMatchConstructWithSizeExpectFalsePositive.
@Test
public void isMatchConstructWithSizeExpectFalsePositive() throws Exception {
expect(pack.getSize()).andReturn(100l);
replayAll();
FileSizeRule rule = new FileSizeRule(11100l, "isMatchConstructWithSizeExpectFalsePositive", false);
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_FileSizeRule method isMatchConstructWithFileExpectFalsePositive.
@Test
public void isMatchConstructWithFileExpectFalsePositive() throws Exception {
expectNew(FilePackage.class, null, null, testPath).andReturn(pack);
expect(pack.getSize()).andReturn(11100l);
expect(pack.getSize()).andReturn(100l);
replayAll();
FileSizeRule rule = new FileSizeRule(null, testPath, "isMatchConstructWithFileExpectFalsePositive", false);
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_FileSizeRule method isMatchConstructWithSizePositive.
@Test
public void isMatchConstructWithSizePositive() throws Exception {
expect(pack.getSize()).andReturn(100l);
replayAll();
FileSizeRule rule = new FileSizeRule(100l, "isMatchConstructWithSizePositive", 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_MimePartCountRule method isMatchWrongMetaData.
@Test(expected = MetaDataIncorrectException.class)
public void isMatchWrongMetaData() throws RbvException {
MimePartCountRule rule = new MimePartCountRule(5, true, "isMatchEmptyMetaData", true);
metaData = new MetaData();
assertFalse(rule.isMatch(metaData));
}
use of com.axway.ats.rbv.MetaData in project ats-framework by Axway.
the class Test_FilePermRule method isMatchConstructorWithPermissionPositive.
@Test
public void isMatchConstructorWithPermissionPositive() throws Exception {
expect(pack.getPermissions()).andReturn(FilePackage.ATTRIBUTE_NOT_SUPPORTED);
replayAll();
FilePermRule rule = new FilePermRule(FilePackage.ATTRIBUTE_NOT_SUPPORTED, "isMatchConstructorWithPermissionPositive", true);
MetaData metaData = new FileSystemMetaData(pack);
assertTrue(rule.isMatch(metaData));
verifyAll();
}
Aggregations