Search in sources :

Example 11 with FileModtimeRule

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

the class Test_FileModtimeRule method isMatchInvalidMetaDataContent.

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

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

the class Test_FileModtimeRule method isMatchNullMetaData.

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

Example 13 with FileModtimeRule

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

the class Test_FileModtimeRule method isMatchConstructWithFileExpectTrueNegativeWrongFile.

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

FileModtimeRule (com.axway.ats.rbv.filesystem.rules.FileModtimeRule)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 FilePackage (com.axway.ats.action.objects.FilePackage)4 PublicAtsApi (com.axway.ats.common.PublicAtsApi)4