Search in sources :

Example 11 with MetaData

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

the class Test_FilePermRule method isMatchConstructorWithPermissionNegative.

@Test
public void isMatchConstructorWithPermissionNegative() throws Exception {
    expect(pack.getPermissions()).andReturn(123l);
    replayAll();
    FilePermRule rule = new FilePermRule(456l, "isMatchConstructorWithPermissionNegative", true);
    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 12 with MetaData

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

the class Test_FilePermRule method isMatchNullMetaDataContent.

@Test(expected = MetaDataIncorrectException.class)
public void isMatchNullMetaDataContent() throws Exception {
    expect(pack.getPermissions()).andReturn(123l);
    replayAll();
    FilePermRule rule = new FilePermRule(123l, "isMatchNullMetaDataContent", true);
    MetaData metaData = new FileSystemMetaData(null);
    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 13 with MetaData

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

the class Test_FileContentRule method isMatchNegativeException.

@Test(expected = RbvException.class)
public void isMatchNegativeException() throws Exception {
    expect(testFilePackage.grep(EXPRESSION, false)).andThrow(new PackageException(""));
    replayAll();
    FileContentRule rule = new FileContentRule(EXPRESSION, RULE_NAME, false, true);
    MetaData metaData = new FileSystemMetaData(testFilePackage);
    rule.isMatch(metaData);
    verifyAll();
}
Also used : FileContentRule(com.axway.ats.rbv.filesystem.rules.FileContentRule) FileSystemMetaData(com.axway.ats.rbv.filesystem.FileSystemMetaData) MetaData(com.axway.ats.rbv.MetaData) PackageException(com.axway.ats.action.objects.model.PackageException) FileSystemMetaData(com.axway.ats.rbv.filesystem.FileSystemMetaData) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 14 with MetaData

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

the class Test_FileContentRule method isMatchRegularExpression.

@Test
public void isMatchRegularExpression() throws Exception {
    expect(testFilePackage.grep(EXPRESSION, true)).andReturn(new String[] { EXPRESSION });
    replayAll();
    FileContentRule rule = new FileContentRule(EXPRESSION, RULE_NAME, true, true);
    MetaData metaData = new FileSystemMetaData(testFilePackage);
    assertTrue(rule.isMatch(metaData));
    verifyAll();
}
Also used : FileContentRule(com.axway.ats.rbv.filesystem.rules.FileContentRule) 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)

Example 15 with MetaData

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

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