Search in sources :

Example 11 with FilePermRule

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

the class Test_FilePermRule method isMatchConstructorWithPermissionExpectFalsePositive.

@Test
public void isMatchConstructorWithPermissionExpectFalsePositive() throws Exception {
    expect(pack.getPermissions()).andReturn(123l);
    replayAll();
    FilePermRule rule = new FilePermRule(456l, "isMatchConstructorWithPermissionExpectFalsePositive", false);
    MetaData metaData = new FileSystemMetaData(pack);
    assertTrue(rule.isMatch(metaData));
    verifyAll();
}
Also used : FilePermRule(com.axway.ats.rbv.filesystem.rules.FilePermRule) 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 FilePermRule

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

the class Test_FilePermRule method isMatchNullMetaData.

@Test(expected = RbvException.class)
public void isMatchNullMetaData() throws Exception {
    expect(pack.getPermissions()).andReturn(123l);
    replayAll();
    FilePermRule rule = new FilePermRule(123l, "isMatchNullMetaData", true);
    assertFalse(rule.isMatch(null));
    verifyAll();
}
Also used : FilePermRule(com.axway.ats.rbv.filesystem.rules.FilePermRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 13 with FilePermRule

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

the class Test_FilePermRule method isMatchInvalidMetaDataContent.

@Test(expected = MetaDataIncorrectException.class)
public void isMatchInvalidMetaDataContent() throws Exception {
    expect(pack.getPermissions()).andReturn(123l);
    replayAll();
    FilePermRule rule = new FilePermRule(123l, "isMatchInvalidMetaDataContent", true);
    MetaData metaData = new MetaData();
    assertFalse(rule.isMatch(metaData));
    verifyAll();
}
Also used : FilePermRule(com.axway.ats.rbv.filesystem.rules.FilePermRule) 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)

Aggregations

FilePermRule (com.axway.ats.rbv.filesystem.rules.FilePermRule)13 BaseTest (com.axway.ats.rbv.BaseTest)9 Test (org.junit.Test)9 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)9 MetaData (com.axway.ats.rbv.MetaData)6 FileSystemMetaData (com.axway.ats.rbv.filesystem.FileSystemMetaData)6 PublicAtsApi (com.axway.ats.common.PublicAtsApi)4 FilePackage (com.axway.ats.action.objects.FilePackage)2