Search in sources :

Example 11 with FileMd5Rule

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

the class Test_FileMD5Rule method constructorWithMachineBinaryRepencrypt.

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

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

the class Test_FileMD5Rule method constructorWithNullMachineBinaryRepencrypt.

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

use of com.axway.ats.rbv.filesystem.rules.FileMd5Rule 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 14 with FileMd5Rule

use of com.axway.ats.rbv.filesystem.rules.FileMd5Rule 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 15 with FileMd5Rule

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

the class Test_FileMD5Rule method constructorWithMachine.

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

Aggregations

FileMd5Rule (com.axway.ats.rbv.filesystem.rules.FileMd5Rule)19 BaseTest (com.axway.ats.rbv.BaseTest)15 Test (org.junit.Test)15 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)15 MetaData (com.axway.ats.rbv.MetaData)10 FileSystemMetaData (com.axway.ats.rbv.filesystem.FileSystemMetaData)10 FilePackage (com.axway.ats.action.objects.FilePackage)6 PublicAtsApi (com.axway.ats.common.PublicAtsApi)4