Search in sources :

Example 16 with FileSizeRule

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

the class Test_FileSizeRule method isMatchConstructWithSizeNegative.

@Test
public void isMatchConstructWithSizeNegative() throws Exception {
    expect(pack.getSize()).andReturn(100l);
    replayAll();
    FileSizeRule rule = new FileSizeRule(11100l, "isMatchConstructWithSizeNegative", true);
    MetaData metaData = new FileSystemMetaData(pack);
    assertFalse(rule.isMatch(metaData));
    verifyAll();
}
Also used : FileSystemMetaData(com.axway.ats.rbv.filesystem.FileSystemMetaData) MetaData(com.axway.ats.rbv.MetaData) FileSizeRule(com.axway.ats.rbv.filesystem.rules.FileSizeRule) 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 17 with FileSizeRule

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

the class Test_FileSizeRule method isMatchConstructWithFileNegative.

@Test
public void isMatchConstructWithFileNegative() throws Exception {
    expectNew(FilePackage.class, null, null, testPath).andReturn(pack);
    expect(pack.getSize()).andReturn(11100l);
    expect(pack.getSize()).andReturn(100l);
    replayAll();
    FileSizeRule rule = new FileSizeRule(null, testPath, "isMatchConstructWithFileNegative", true);
    MetaData metaData = new FileSystemMetaData(pack);
    assertFalse(rule.isMatch(metaData));
    verifyAll();
}
Also used : FilePackage(com.axway.ats.action.objects.FilePackage) FileSystemMetaData(com.axway.ats.rbv.filesystem.FileSystemMetaData) MetaData(com.axway.ats.rbv.MetaData) FileSizeRule(com.axway.ats.rbv.filesystem.rules.FileSizeRule) 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

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