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 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 checkGID(String srcAtsAgent, String srcFile) throws RbvException {
FileGidRule rule = new FileGidRule(srcAtsAgent, srcFile, "checkGID", true);
rootRule.addRule(rule);
}
use of com.axway.ats.rbv.filesystem.rules.FileGidRule in project ats-framework by Axway.
the class Test_FileGIDRule method performMatchNotSupported.
@Test
public void performMatchNotSupported() throws RbvException, PackageException {
expect(meta.getFilePackage()).andReturn(pack);
expect(pack.getGid()).andReturn(FilePackage.ATTRIBUTE_NOT_SUPPORTED);
replayAll();
rule = new FileGidRule(1, "ruleName", true);
assertTrue(rule.performMatch(meta));
verifyAll();
}
use of com.axway.ats.rbv.filesystem.rules.FileGidRule in project ats-framework by Axway.
the class Test_FileGIDRule method performMatchOtherFileException.
@Test(expected = RbvException.class)
public void performMatchOtherFileException() throws Exception {
FilePackage remotePack = createMock(FilePackage.class);
expectNew(FilePackage.class, null, null, "/root/file.name").andReturn(remotePack);
expect(remotePack.getGid()).andThrow(new PackageException(""));
replayAll();
rule = new FileGidRule(null, "/root/file.name", "ruleName", true);
verifyAll();
}
use of com.axway.ats.rbv.filesystem.rules.FileGidRule in project ats-framework by Axway.
the class Test_FileGIDRule method performMatch.
@Test
public void performMatch() throws RbvException, PackageException {
expect(meta.getFilePackage()).andReturn(pack);
expect(pack.getGid()).andReturn(1L);
replayAll();
rule = new FileGidRule(1, "ruleName", true);
assertTrue(rule.performMatch(meta));
verifyAll();
}
use of com.axway.ats.rbv.filesystem.rules.FileGidRule in project ats-framework by Axway.
the class Test_FileGIDRule method performMatchOtherFileNull.
@Test
public void performMatchOtherFileNull() 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();
}
Aggregations