Search in sources :

Example 11 with FilePathRule

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

the class Test_FilePathRule method isMatchExpectedFalseNegative.

@Test
public void isMatchExpectedFalseNegative() throws Exception {
    expect(pack.getAbsolutePath()).andReturn(testFileAbsPath);
    replayAll();
    FilePathRule rule = new FilePathRule(testFileAbsPath, "isMatchExpectedFalseNegative", false);
    MetaData metaData = new FileSystemMetaData(pack);
    assertFalse(rule.isMatch(metaData));
    verifyAll();
}
Also used : FilePathRule(com.axway.ats.rbv.filesystem.rules.FilePathRule) 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)

Example 12 with FilePathRule

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

the class Test_FilePathRule method isMatchExpectedTrueNegative.

@Test
public void isMatchExpectedTrueNegative() throws Exception {
    expect(pack.getAbsolutePath()).andReturn(testFileAbsPath);
    replayAll();
    FilePathRule rule = new FilePathRule(wrongFilePath, "isMatchExpectedTrueNegative", true);
    MetaData metaData = new FileSystemMetaData(pack);
    assertFalse(rule.isMatch(metaData));
    verifyAll();
}
Also used : FilePathRule(com.axway.ats.rbv.filesystem.rules.FilePathRule) 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)

Example 13 with FilePathRule

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

the class Test_FilePathRule method isMatchInvalidMetaDataContent.

@Test(expected = MetaDataIncorrectException.class)
public void isMatchInvalidMetaDataContent() throws Exception {
    expect(pack.getAbsolutePath()).andReturn(testFileAbsPath);
    replayAll();
    FilePathRule rule = new FilePathRule(testFileAbsPath, "isMatchInvalidMetaDataContent", true);
    MetaData metaData = new MetaData();
    assertFalse(rule.isMatch(metaData));
    verifyAll();
}
Also used : FilePathRule(com.axway.ats.rbv.filesystem.rules.FilePathRule) FileSystemMetaData(com.axway.ats.rbv.filesystem.FileSystemMetaData) MetaData(com.axway.ats.rbv.MetaData) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 14 with FilePathRule

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

the class Test_FilePathRule method isMatchExpectedTrueNegativeNullPath.

@Test
public void isMatchExpectedTrueNegativeNullPath() throws Exception {
    expect(pack.getAbsolutePath()).andReturn(testFileAbsPath);
    replayAll();
    FilePathRule rule = new FilePathRule(null, "isMatchExpectedTrueNegativeNullPath", true);
    MetaData metaData = new FileSystemMetaData(pack);
    assertFalse(rule.isMatch(metaData));
    verifyAll();
}
Also used : FilePathRule(com.axway.ats.rbv.filesystem.rules.FilePathRule) 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

BaseTest (com.axway.ats.rbv.BaseTest)14 FilePathRule (com.axway.ats.rbv.filesystem.rules.FilePathRule)14 Test (org.junit.Test)14 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)13 FileSystemMetaData (com.axway.ats.rbv.filesystem.FileSystemMetaData)11 MetaData (com.axway.ats.rbv.MetaData)10 FilePackage (com.axway.ats.action.objects.FilePackage)1 FileFolderRule (com.axway.ats.rbv.filesystem.rules.FileFolderRule)1 AndRuleOperation (com.axway.ats.rbv.rules.AndRuleOperation)1 ArrayList (java.util.ArrayList)1