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