use of com.axway.ats.rbv.filesystem.rules.FileMd5Rule in project ats-framework by Axway.
the class FileSystemVerification method checkMd5.
/**
* Add rule to check that the MD5 sum of the received file is the same
* as the MD5 sum of the source file in the selected mode - binary or ASCII
*
* @param srcAtsAgent the remote ATS agent address on which the source file is located
* @param srcFile the full name of the file
* @param binaryMode true to check in binary mode, false to check in ASCII mode
* @throws RbvException thrown on error
*/
@PublicAtsApi
public void checkMd5(String srcAtsAgent, String srcFile, boolean binaryMode) throws RbvException {
FileMd5Rule rule = new FileMd5Rule(srcAtsAgent, srcFile, binaryMode, "checkMd5", true);
rootRule.addRule(rule);
}
use of com.axway.ats.rbv.filesystem.rules.FileMd5Rule in project ats-framework by Axway.
the class FileSystemVerification method checkMd5Different.
/**
* Add rule to check that the MD5 sum of the received file is different
* than the MD5 sum of the source file in the selected mode - binary or ASCII
*
* @param srcAtsAgent the remote ATS agent address on which the source file is located
* @param srcFile the full name of the file
* @param binaryMode true to check in binary mode, false to check in ASCII mode
* @throws RbvException thrown on error
*/
@PublicAtsApi
public void checkMd5Different(String srcAtsAgent, String srcFile, boolean binaryMode) throws RbvException {
FileMd5Rule rule = new FileMd5Rule(srcAtsAgent, srcFile, binaryMode, "checkMd5Different", false);
rootRule.addRule(rule);
}
use of com.axway.ats.rbv.filesystem.rules.FileMd5Rule in project ats-framework by Axway.
the class Test_FileMD5Rule method constructorWithNullMachine.
@Test
public void constructorWithNullMachine() throws Exception {
expectNew(FilePackage.class, null, null, testFilePath).andReturn(pack);
expect(pack.getMd5sum()).andReturn(md5sum);
replayAll();
FileMd5Rule rule = new FileMd5Rule(null, testFilePath, "constructorWithNullMachine", true);
assertTrue(rule != null);
verifyAll();
}
use of com.axway.ats.rbv.filesystem.rules.FileMd5Rule in project ats-framework by Axway.
the class Test_FileMD5Rule method isMatchConstructWithMd5ExpectTruePositive.
@Test
public void isMatchConstructWithMd5ExpectTruePositive() throws PackageException, RbvException {
expect(pack.getMd5sum(true)).andReturn(md5sum);
replayAll();
FileMd5Rule rule = new FileMd5Rule(md5sum, "isMatchConstructWithMd5ExpectTruePositive", true);
MetaData metaData = new FileSystemMetaData(pack);
assertTrue(rule.isMatch(metaData));
verifyAll();
}
use of com.axway.ats.rbv.filesystem.rules.FileMd5Rule in project ats-framework by Axway.
the class Test_FileMD5Rule method isMatchNullMetaDataContent.
@Test(expected = MetaDataIncorrectException.class)
public void isMatchNullMetaDataContent() throws PackageException, RbvException {
expect(pack.getMd5sum(true)).andReturn(md5sum);
replayAll();
FileMd5Rule rule = new FileMd5Rule("", "isMatchNullMetaDataContent", true);
MetaData metaData = new FileSystemMetaData(null);
assertFalse(rule.isMatch(metaData));
verifyAll();
}
Aggregations