Search in sources :

Example 1 with FileFolderRule

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

the class Test_FileFolderRule method getRuleDescFolder.

@Test
public void getRuleDescFolder() {
    rule = new FileFolderRule(false, "ruleName", true);
    assertEquals(rule.getRuleDescription(), "which expects a 'folder'");
}
Also used : FileFolderRule(com.axway.ats.rbv.filesystem.rules.FileFolderRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 2 with FileFolderRule

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

the class Test_FileFolderRule method getRuleDescFile.

@Test
public void getRuleDescFile() {
    rule = new FileFolderRule(true, "ruleName", true);
    assertEquals(rule.getRuleDescription(), "which expects a 'file'");
}
Also used : FileFolderRule(com.axway.ats.rbv.filesystem.rules.FileFolderRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 3 with FileFolderRule

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

the class Test_FileFolderRule method performMatch.

@Test
public void performMatch() throws RbvException, PackageException {
    expect(meta.getFilePackage()).andReturn(pack);
    expect(pack.isFile()).andReturn(true);
    replayAll();
    rule = new FileFolderRule(true, "ruleName", true);
    assertTrue(rule.performMatch(meta));
    verifyAll();
}
Also used : FileFolderRule(com.axway.ats.rbv.filesystem.rules.FileFolderRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 4 with FileFolderRule

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

the class Test_FileFolderRule method getMetaDataKeys.

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

Example 5 with FileFolderRule

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

the class FileSystemVerification method addFolderCheckRule.

private void addFolderCheckRule() {
    // set the second highest priority for this rule - if the folder path is correct the second most
    // important thing is to check if the entity is a folder
    FileFolderRule rule = new FileFolderRule(false, "checkIsDirectory", true, Integer.MIN_VALUE);
    rootRule.addRule(rule);
}
Also used : FileFolderRule(com.axway.ats.rbv.filesystem.rules.FileFolderRule)

Aggregations

FileFolderRule (com.axway.ats.rbv.filesystem.rules.FileFolderRule)9 BaseTest (com.axway.ats.rbv.BaseTest)7 Test (org.junit.Test)7 FilePackage (com.axway.ats.action.objects.FilePackage)1 PackageException (com.axway.ats.action.objects.model.PackageException)1 FileSystemMetaData (com.axway.ats.rbv.filesystem.FileSystemMetaData)1 FilePathRule (com.axway.ats.rbv.filesystem.rules.FilePathRule)1 AndRuleOperation (com.axway.ats.rbv.rules.AndRuleOperation)1 ArrayList (java.util.ArrayList)1