use of com.axway.ats.rbv.filesystem.FileSystemMetaData 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.filesystem.FileSystemMetaData in project ats-framework by Axway.
the class Test_FileSizeRule method isMatchNullMetaDataContent.
@Test(expected = MetaDataIncorrectException.class)
public void isMatchNullMetaDataContent() throws Exception {
expect(pack.getSize()).andReturn(100l);
replayAll();
FileSizeRule rule = new FileSizeRule(100l, "isMatchNullMetaDataContent", true);
MetaData metaData = new FileSystemMetaData(null);
assertFalse(rule.isMatch(metaData));
verifyAll();
}
use of com.axway.ats.rbv.filesystem.FileSystemMetaData in project ats-framework by Axway.
the class Test_FileSizeRule method isMatchConstructWithFilePositive.
@Test
public void isMatchConstructWithFilePositive() throws Exception {
expectNew(FilePackage.class, null, null, testPath).andReturn(pack);
expect(pack.getSize()).andReturn(100l).times(2);
replayAll();
FileSizeRule rule = new FileSizeRule(null, testPath, "isMatchConstructWithFilePositive", true);
MetaData metaData = new FileSystemMetaData(pack);
assertTrue(rule.isMatch(metaData));
verifyAll();
}
use of com.axway.ats.rbv.filesystem.FileSystemMetaData 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.FileSystemMetaData 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();
}
Aggregations