use of com.axway.ats.rbv.MetaData in project ats-framework by Axway.
the class Test_FilePermRule method isMatchConstructorWithPermissionNegative.
@Test
public void isMatchConstructorWithPermissionNegative() throws Exception {
expect(pack.getPermissions()).andReturn(123l);
replayAll();
FilePermRule rule = new FilePermRule(456l, "isMatchConstructorWithPermissionNegative", true);
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_FilePermRule method isMatchNullMetaDataContent.
@Test(expected = MetaDataIncorrectException.class)
public void isMatchNullMetaDataContent() throws Exception {
expect(pack.getPermissions()).andReturn(123l);
replayAll();
FilePermRule rule = new FilePermRule(123l, "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_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();
}
use of com.axway.ats.rbv.MetaData in project ats-framework by Axway.
the class Test_FileContentRule method isMatchRegularExpression.
@Test
public void isMatchRegularExpression() throws Exception {
expect(testFilePackage.grep(EXPRESSION, true)).andReturn(new String[] { EXPRESSION });
replayAll();
FileContentRule rule = new FileContentRule(EXPRESSION, RULE_NAME, true, true);
MetaData metaData = new FileSystemMetaData(testFilePackage);
assertTrue(rule.isMatch(metaData));
verifyAll();
}
use of com.axway.ats.rbv.MetaData in project ats-framework by Axway.
the class Test_FileModtimeRule method isMatchConstructWithModTimeExpectTrueNegative.
@Test
public void isMatchConstructWithModTimeExpectTrueNegative() throws Exception {
expect(pack.getModTime()).andReturn(modtime);
replayAll();
FileModtimeRule rule = new FileModtimeRule(123l, "isMatchConstructWithModTimeExpectTrueNegative", true);
MetaData metaData = new FileSystemMetaData(pack);
assertFalse(rule.isMatch(metaData));
verifyAll();
}
Aggregations