use of com.axway.ats.rbv.filesystem.rules.FilePermRule in project ats-framework by Axway.
the class Test_FilePermRule method constructWithMachine.
@Test
public void constructWithMachine() throws Exception {
expectNew(FilePackage.class, null, null, filePath).andReturn(pack);
expect(pack.getPermissions()).andReturn(123l);
replayAll();
FilePermRule rule = new FilePermRule(null, filePath, "constructWithMachine", true);
assertTrue(rule != null);
verifyAll();
}
use of com.axway.ats.rbv.filesystem.rules.FilePermRule 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();
}
use of com.axway.ats.rbv.filesystem.rules.FilePermRule 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.filesystem.rules.FilePermRule 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.filesystem.rules.FilePermRule in project ats-framework by Axway.
the class Test_FilePermRule method constructWithNullMachine.
@Test
public void constructWithNullMachine() throws Exception {
expectNew(FilePackage.class, null, null, filePath).andReturn(pack);
expect(pack.getPermissions()).andReturn(123l);
replayAll();
FilePermRule rule = new FilePermRule(null, filePath, "constructWithNullMachine", true);
assertTrue(rule != null);
verifyAll();
}
Aggregations