Search in sources :

Example 6 with FileGidRule

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

the class FileSystemVerification method checkGIDDifferent.

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

Example 7 with FileGidRule

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

the class FileSystemVerification method checkGIDDifferent.

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

Example 8 with FileGidRule

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

the class FileSystemVerification method checkGID.

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

Example 9 with FileGidRule

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

the class Test_FileGIDRule method performMatchOtherFile.

@Test
public void performMatchOtherFile() throws Exception {
    FilePackage remotePack = createMock(FilePackage.class);
    expectNew(FilePackage.class, null, null, "/root/file.name").andReturn(remotePack);
    expect(remotePack.getGid()).andReturn(1L);
    expect(meta.getFilePackage()).andReturn(pack);
    expect(pack.getGid()).andReturn(1L);
    replayAll();
    rule = new FileGidRule(null, "/root/file.name", "ruleName", true);
    assertTrue(rule.performMatch(meta));
    verifyAll();
}
Also used : FilePackage(com.axway.ats.action.objects.FilePackage) FileGidRule(com.axway.ats.rbv.filesystem.rules.FileGidRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 10 with FileGidRule

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

the class Test_FileGIDRule method getMetaDataKeys.

@Test
public void getMetaDataKeys() {
    List<String> metaKeys = new ArrayList<String>();
    metaKeys.add(FileSystemMetaData.FILE_PACKAGE);
    rule = new FileGidRule(1, "ruleName", true);
    assertEquals(rule.getMetaDataKeys(), metaKeys);
}
Also used : ArrayList(java.util.ArrayList) FileGidRule(com.axway.ats.rbv.filesystem.rules.FileGidRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Aggregations

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