Search in sources :

Example 6 with FileMd5Rule

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();
}
Also used : FileSystemMetaData(com.axway.ats.rbv.filesystem.FileSystemMetaData) MetaData(com.axway.ats.rbv.MetaData) FileMd5Rule(com.axway.ats.rbv.filesystem.rules.FileMd5Rule) FileSystemMetaData(com.axway.ats.rbv.filesystem.FileSystemMetaData) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 7 with FileMd5Rule

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);
}
Also used : FileMd5Rule(com.axway.ats.rbv.filesystem.rules.FileMd5Rule) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 8 with FileMd5Rule

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);
}
Also used : FileMd5Rule(com.axway.ats.rbv.filesystem.rules.FileMd5Rule) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 9 with FileMd5Rule

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
     *
     * @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 checkMd5(String srcAtsAgent, String srcFile) throws RbvException {
    FileMd5Rule rule = new FileMd5Rule(srcAtsAgent, srcFile, "checkMd5", true);
    rootRule.addRule(rule);
}
Also used : FileMd5Rule(com.axway.ats.rbv.filesystem.rules.FileMd5Rule) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 10 with FileMd5Rule

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
     * as the given one
     *
     *  @param md5
     */
@PublicAtsApi
public void checkMd5Different(String md5) {
    FileMd5Rule rule = new FileMd5Rule(md5, "checkMd5Different", false);
    rootRule.addRule(rule);
}
Also used : FileMd5Rule(com.axway.ats.rbv.filesystem.rules.FileMd5Rule) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Aggregations

FileMd5Rule (com.axway.ats.rbv.filesystem.rules.FileMd5Rule)19 BaseTest (com.axway.ats.rbv.BaseTest)15 Test (org.junit.Test)15 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)15 MetaData (com.axway.ats.rbv.MetaData)10 FileSystemMetaData (com.axway.ats.rbv.filesystem.FileSystemMetaData)10 FilePackage (com.axway.ats.action.objects.FilePackage)6 PublicAtsApi (com.axway.ats.common.PublicAtsApi)4