Search in sources :

Example 61 with MetaData

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

the class Test_FilePermRule method isMatchConstructorWithPermissionExpectFalseNegative.

@Test
public void isMatchConstructorWithPermissionExpectFalseNegative() throws Exception {
    expect(pack.getPermissions()).andReturn(FilePackage.ATTRIBUTE_NOT_SUPPORTED);
    replayAll();
    FilePermRule rule = new FilePermRule(FilePackage.ATTRIBUTE_NOT_SUPPORTED, "isMatchConstructorWithPermissionExpectFalseNegative", false);
    MetaData metaData = new FileSystemMetaData(pack);
    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) 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 62 with MetaData

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

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

the class Test_FileMD5Rule method isMatchConstructWithMd5ExpectTrueNegative.

@Test
public void isMatchConstructWithMd5ExpectTrueNegative() throws PackageException, RbvException {
    expect(pack.getMd5sum(true)).andReturn(md5sum);
    replayAll();
    FileMd5Rule rule = new FileMd5Rule("23234234", "isMatchConstructWithMd5ExpectTrueNegative", 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) 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)

Example 64 with MetaData

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

the class Test_FileMD5Rule method isMatchInvalidMetaDataContent.

@Test(expected = MetaDataIncorrectException.class)
public void isMatchInvalidMetaDataContent() throws PackageException, RbvException {
    expect(pack.getMd5sum(true)).andReturn(md5sum);
    replayAll();
    FileMd5Rule rule = new FileMd5Rule("", "isMatchInvalidMetaDataContent", true);
    MetaData metaData = new MetaData();
    assertFalse(rule.isMatch(metaData));
    verifyAll();
}
Also used : FileSystemMetaData(com.axway.ats.rbv.filesystem.FileSystemMetaData) MetaData(com.axway.ats.rbv.MetaData) FileMd5Rule(com.axway.ats.rbv.filesystem.rules.FileMd5Rule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 65 with MetaData

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

the class Test_FileMD5Rule method isMatchConstructWithMd5ExpectFalsePositive.

@Test
public void isMatchConstructWithMd5ExpectFalsePositive() throws PackageException, RbvException {
    expect(pack.getMd5sum(true)).andReturn(md5sum);
    replayAll();
    FileMd5Rule rule = new FileMd5Rule("23234234", "isMatchConstructWithMd5ExpectFalsePositive", false);
    MetaData metaData = new FileSystemMetaData(pack);
    assertTrue(rule.isMatch(metaData));
    verifyAll();
}
Also used : 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)81 Test (org.junit.Test)76 BaseTest (com.axway.ats.rbv.BaseTest)71 FileSystemMetaData (com.axway.ats.rbv.filesystem.FileSystemMetaData)49 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)45 DbStringFieldRule (com.axway.ats.rbv.db.rules.DbStringFieldRule)17 DbMetaData (com.axway.ats.rbv.db.DbMetaData)16 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 FileSystemFolder (com.axway.ats.rbv.filesystem.FileSystemFolder)3 RbvException (com.axway.ats.rbv.model.RbvException)3 FileSystemOperations (com.axway.ats.action.filesystem.FileSystemOperations)2