Search in sources :

Example 1 with FileModtimeRule

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

the class Test_FileModtimeRule method isMatchConstructWithModTimeExpectTrueNegative.

@Test
public void isMatchConstructWithModTimeExpectTrueNegative() throws Exception {
    expect(pack.getModTime()).andReturn(modtime);
    replayAll();
    FileModtimeRule rule = new FileModtimeRule(123l, "isMatchConstructWithModTimeExpectTrueNegative", true);
    MetaData metaData = new FileSystemMetaData(pack);
    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) 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 2 with FileModtimeRule

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

the class Test_FileModtimeRule method isMatchConstructWithModTimeExpectTrueNegativeWrongFile.

@Test
public void isMatchConstructWithModTimeExpectTrueNegativeWrongFile() throws Exception {
    expect(pack.getModTime()).andReturn(123L);
    replayAll();
    FileModtimeRule rule = new FileModtimeRule(modtime, "isMatchConstructWithModTimeExpectTrueNegativeWrongFile", true);
    MetaData metaData = new FileSystemMetaData(pack);
    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) 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 3 with FileModtimeRule

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

the class Test_FileModtimeRule method constructorWithMachineNullMachine.

@Test
public void constructorWithMachineNullMachine() throws Exception {
    expectNew(FilePackage.class, null, null, testFilePath).andReturn(pack);
    expect(pack.getModTime()).andReturn(modtime);
    replayAll();
    FileModtimeRule rule = new FileModtimeRule(null, testFilePath, "constructorWithMachineNullMachine", true);
    assertTrue(rule != null);
    verifyAll();
}
Also used : FilePackage(com.axway.ats.action.objects.FilePackage) 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 4 with FileModtimeRule

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

the class Test_FileModtimeRule method isMatchConstructWithModTimeExpectTruePositive.

@Test
public void isMatchConstructWithModTimeExpectTruePositive() throws Exception {
    expect(pack.getModTime()).andReturn(modtime);
    replayAll();
    FileModtimeRule rule = new FileModtimeRule(modtime, "isMatchConstructWithModTimeExpectTruePositive", true);
    MetaData metaData = new FileSystemMetaData(pack);
    assertTrue(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) 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 5 with FileModtimeRule

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

the class Test_FileModtimeRule method isMatchConstructWithFileExpectTruePositive.

@Test
public void isMatchConstructWithFileExpectTruePositive() throws Exception {
    expectNew(FilePackage.class, null, null, testFilePath).andReturn(pack);
    expect(pack.getModTime()).andReturn(modtime);
    expect(pack.getModTime()).andReturn(modtime);
    replayAll();
    FileModtimeRule rule = new FileModtimeRule(null, testFilePath, "isMatchConstructWithFileExpectTruePositive", true);
    MetaData metaData = new FileSystemMetaData(pack);
    assertTrue(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