Search in sources :

Example 6 with FilePermRule

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

the class FileSystemVerification method checkPermissionsDifferent.

/**
     * Add rule to check that the permissions of the received file are different
     * as the given ones (NOT SUPPORTED ON WINDOWS)
     *
     *  @param permissions
     */
@PublicAtsApi
public void checkPermissionsDifferent(long permissions) {
    FilePermRule rule = new FilePermRule(permissions, "checkPermissionsDifferent", false);
    rootRule.addRule(rule);
}
Also used : FilePermRule(com.axway.ats.rbv.filesystem.rules.FilePermRule) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 7 with FilePermRule

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

the class FileSystemVerification method checkPermissions.

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

Example 8 with FilePermRule

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

the class FileSystemVerification method checkPermissions.

/**
     * Add rule to check that the permissions of the received file are the same
     * as the permissions 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 checkPermissions(String srcAtsAgent, String srcFile) throws RbvException {
    FilePermRule rule = new FilePermRule(srcAtsAgent, srcFile, "checkPermissions", true);
    rootRule.addRule(rule);
}
Also used : FilePermRule(com.axway.ats.rbv.filesystem.rules.FilePermRule) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 9 with FilePermRule

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

the class FileSystemVerification method checkPermissionsDifferent.

/**
     * Add rule to check that the permissions of the received file are different
     * than the permissions 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 checkPermissionsDifferent(String srcAtsAgent, String srcFile) throws RbvException {
    FilePermRule rule = new FilePermRule(srcAtsAgent, srcFile, "checkPermissionsDifferent", false);
    rootRule.addRule(rule);
}
Also used : FilePermRule(com.axway.ats.rbv.filesystem.rules.FilePermRule) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 10 with FilePermRule

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

the class Test_FilePermRule method isMatchConstructorWithPermissionExpectFalseNegative.

@Test
public void isMatchConstructorWithPermissionExpectFalseNegative() throws Exception {
    expect(pack.getPermissions()).andReturn(FilePackage.ATTRIBUTE_NOT_SUPPORTED);
    replayAll();
    FilePermRule rule = new FilePermRule(FilePackage.ATTRIBUTE_NOT_SUPPORTED, "isMatchConstructorWithPermissionExpectFalseNegative", false);
    MetaData metaData = new FileSystemMetaData(pack);
    assertFalse(rule.isMatch(metaData));
    verifyAll();
}
Also used : FilePermRule(com.axway.ats.rbv.filesystem.rules.FilePermRule) FileSystemMetaData(com.axway.ats.rbv.filesystem.FileSystemMetaData) MetaData(com.axway.ats.rbv.MetaData) FileSystemMetaData(com.axway.ats.rbv.filesystem.FileSystemMetaData) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Aggregations

FilePermRule (com.axway.ats.rbv.filesystem.rules.FilePermRule)13 BaseTest (com.axway.ats.rbv.BaseTest)9 Test (org.junit.Test)9 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)9 MetaData (com.axway.ats.rbv.MetaData)6 FileSystemMetaData (com.axway.ats.rbv.filesystem.FileSystemMetaData)6 PublicAtsApi (com.axway.ats.common.PublicAtsApi)4 FilePackage (com.axway.ats.action.objects.FilePackage)2