Search in sources :

Example 16 with MetaData

use of com.axway.ats.rbv.MetaData 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 17 with MetaData

use of com.axway.ats.rbv.MetaData 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 18 with MetaData

use of com.axway.ats.rbv.MetaData 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)

Example 19 with MetaData

use of com.axway.ats.rbv.MetaData in project ats-framework by Axway.

the class Test_StringInMimePartRule method isMatchWrongMetaData.

@Test(expected = MetaDataIncorrectException.class)
public void isMatchWrongMetaData() throws RbvException {
    StringInMimePartRule rule = new StringInMimePartRule("US AIR FORCE", false, 2, false, "isMatchEmptyMetaData", false);
    metaData = new MetaData();
    assertFalse(rule.isMatch(metaData));
}
Also used : StringInMimePartRule(com.axway.ats.rbv.imap.rules.StringInMimePartRule) ImapMetaData(com.axway.ats.rbv.imap.ImapMetaData) MetaData(com.axway.ats.rbv.MetaData) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 20 with MetaData

use of com.axway.ats.rbv.MetaData in project ats-framework by Axway.

the class Test_FileMD5Rule method isMatchConstructWithFileExpectTruePositive.

@Test
public void isMatchConstructWithFileExpectTruePositive() throws Exception {
    expectNew(FilePackage.class, null, null, testFilePath).andReturn(pack);
    expect(pack.getMd5sum()).andReturn(md5sum);
    expect(pack.getMd5sum(true)).andReturn(md5sum);
    replayAll();
    FileMd5Rule rule = new FileMd5Rule(null, testFilePath, "isMatchConstructWithFileExpectTruePositive", true);
    MetaData metaData = new FileSystemMetaData(pack);
    assertTrue(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) FileMd5Rule(com.axway.ats.rbv.filesystem.rules.FileMd5Rule) 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

MetaData (com.axway.ats.rbv.MetaData)85 Test (org.junit.Test)74 BaseTest (com.axway.ats.rbv.BaseTest)71 FileSystemMetaData (com.axway.ats.rbv.filesystem.FileSystemMetaData)49 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)45 DbMetaData (com.axway.ats.rbv.db.DbMetaData)16 DbStringFieldRule (com.axway.ats.rbv.db.rules.DbStringFieldRule)15 SnapshotExecutor (com.axway.ats.rbv.executors.SnapshotExecutor)15 FileMd5Rule (com.axway.ats.rbv.filesystem.rules.FileMd5Rule)10 FilePathRule (com.axway.ats.rbv.filesystem.rules.FilePathRule)10 FileSizeRule (com.axway.ats.rbv.filesystem.rules.FileSizeRule)10 FilePackage (com.axway.ats.action.objects.FilePackage)9 ArrayList (java.util.ArrayList)7 FileModtimeRule (com.axway.ats.rbv.filesystem.rules.FileModtimeRule)6 FilePermRule (com.axway.ats.rbv.filesystem.rules.FilePermRule)6 ImapMetaData (com.axway.ats.rbv.imap.ImapMetaData)5 FileContentRule (com.axway.ats.rbv.filesystem.rules.FileContentRule)4 RbvException (com.axway.ats.rbv.model.RbvException)4 S3ObjectInfo (com.axway.ats.action.s3.S3ObjectInfo)3 FileSystemFolder (com.axway.ats.rbv.filesystem.FileSystemFolder)3