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