Search in sources :

Example 6 with FileUidRule

use of com.axway.ats.rbv.filesystem.rules.FileUidRule in project ats-framework by Axway.

the class Test_FileUIDRule method performMatchNegativeWxception.

@Test(expected = RbvException.class)
public void performMatchNegativeWxception() throws RbvException, PackageException {
    expect(meta.getFilePackage()).andReturn(pack);
    expect(pack.getUid()).andThrow(new PackageException(""));
    replayAll();
    rule = new FileUidRule(1, "ruleName", true);
    rule.performMatch(meta);
    verifyAll();
}
Also used : FileUidRule(com.axway.ats.rbv.filesystem.rules.FileUidRule) PackageException(com.axway.ats.action.objects.model.PackageException) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 7 with FileUidRule

use of com.axway.ats.rbv.filesystem.rules.FileUidRule in project ats-framework by Axway.

the class FileSystemVerification method checkUID.

/**
     * Add rule to check that the UID of the received file is the same
     * as the UID of the source file (NOT SUPPORTED ON WINDOWS)
     *
     * @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 checkUID(String srcAtsAgent, String srcFile) throws RbvException {
    FileUidRule rule = new FileUidRule(srcAtsAgent, srcFile, "checkUID", true);
    rootRule.addRule(rule);
}
Also used : FileUidRule(com.axway.ats.rbv.filesystem.rules.FileUidRule) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 8 with FileUidRule

use of com.axway.ats.rbv.filesystem.rules.FileUidRule in project ats-framework by Axway.

the class FileSystemVerification method checkUIDDifferent.

/**
     * Add rule to check that the UID of the received file is different
     * than the UID of the source file (NOT SUPPORTED ON WINDOWS)
     *
     * @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 checkUIDDifferent(String srcAtsAgent, String srcFile) throws RbvException {
    FileUidRule rule = new FileUidRule(srcAtsAgent, srcFile, "checkUIDDifferent", false);
    rootRule.addRule(rule);
}
Also used : FileUidRule(com.axway.ats.rbv.filesystem.rules.FileUidRule) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 9 with FileUidRule

use of com.axway.ats.rbv.filesystem.rules.FileUidRule in project ats-framework by Axway.

the class FileSystemVerification method checkUIDDifferent.

/**
     * Add rule to check that the UID of the received file is different
     * than the given one (NOT SUPPORTED ON WINDOWS)
     *
     *  @param uid
     */
@PublicAtsApi
public void checkUIDDifferent(long uid) {
    FileUidRule rule = new FileUidRule(uid, "checkUIDDifferent", false);
    rootRule.addRule(rule);
}
Also used : FileUidRule(com.axway.ats.rbv.filesystem.rules.FileUidRule) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 10 with FileUidRule

use of com.axway.ats.rbv.filesystem.rules.FileUidRule in project ats-framework by Axway.

the class FileSystemVerification method checkUID.

/**
     * Add rule to check that the UID of the received file is the same
     * as the given one (NOT SUPPORTED ON WINDOWS)
     *
     *  @param uid
     */
@PublicAtsApi
public void checkUID(long uid) {
    FileUidRule rule = new FileUidRule(uid, "checkUID", true);
    rootRule.addRule(rule);
}
Also used : FileUidRule(com.axway.ats.rbv.filesystem.rules.FileUidRule) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Aggregations

FileUidRule (com.axway.ats.rbv.filesystem.rules.FileUidRule)11 BaseTest (com.axway.ats.rbv.BaseTest)7 Test (org.junit.Test)7 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)7 PublicAtsApi (com.axway.ats.common.PublicAtsApi)4 FilePackage (com.axway.ats.action.objects.FilePackage)2 PackageException (com.axway.ats.action.objects.model.PackageException)2 ArrayList (java.util.ArrayList)1