use of com.axway.ats.rbv.filesystem.rules.FileSizeRule in project ats-framework by Axway.
the class FileSystemVerification method checkSizeDifferent.
/**
* Add rule to check that the size of the received file is different
* than the given one
*
* @param size
*/
@PublicAtsApi
public void checkSizeDifferent(long size) {
FileSizeRule rule = new FileSizeRule(size, "checkSizeDifferent", false);
rootRule.addRule(rule);
}
use of com.axway.ats.rbv.filesystem.rules.FileSizeRule in project ats-framework by Axway.
the class FileSystemVerification method checkSizeDifferent.
/**
* Add rule to check that the size of the received file is different
* than the size of the source file
*
* @param srcAtsAgent the remote ATS agent address on which the source file is located
* @param srcFile the full name of the file
* @throws RbvException thrown on error
*/
@PublicAtsApi
public void checkSizeDifferent(String srcAtsAgent, String srcFile) throws RbvException {
FileSizeRule rule = new FileSizeRule(srcAtsAgent, srcFile, "checkSizeDifferent", false);
rootRule.addRule(rule);
}
use of com.axway.ats.rbv.filesystem.rules.FileSizeRule in project ats-framework by Axway.
the class FileSystemVerification method checkSize.
/**
* Add rule to check that the size of the received file is the same
* as the given one
*
* @param size
*/
@PublicAtsApi
public void checkSize(long size) {
FileSizeRule rule = new FileSizeRule(size, "checkSize", true);
rootRule.addRule(rule);
}
use of com.axway.ats.rbv.filesystem.rules.FileSizeRule 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.filesystem.rules.FileSizeRule in project ats-framework by Axway.
the class Test_FileSizeRule method isMatchConstructWithFileExpectFalseNegative.
@Test
public void isMatchConstructWithFileExpectFalseNegative() throws Exception {
expectNew(FilePackage.class, null, null, testPath).andReturn(pack);
expect(pack.getSize()).andReturn(100l).times(2);
replayAll();
FileSizeRule rule = new FileSizeRule(null, testPath, "isMatchConstructWithFileExpectFalseNegative", false);
MetaData metaData = new FileSystemMetaData(pack);
assertFalse(rule.isMatch(metaData));
verifyAll();
}
Aggregations