Examples of calcDigestString()


Examples of org.rhq.core.util.MessageDigestGenerator.calcDigestString()

        if (actualResourcePackageDetails.getInstallationTimestamp() > System.currentTimeMillis()) {
            Assert.fail("Timestamp is not in the past.");
        }

        MessageDigestGenerator digest = new MessageDigestGenerator(MessageDigestGenerator.SHA_256);
        String expectedSha256 = digest.calcDigestString(fileUsedInTest);

        Assert.assertEquals(actualResourcePackageDetails.getSHA256(), expectedSha256);
        Assert.assertEquals(actualResourcePackageDetails.getDisplayVersion(), null);

        verify(mockResourceContext, times(1)).getPluginConfiguration();
View Full Code Here

Examples of org.rhq.core.util.MessageDigestGenerator.calcDigestString()

        Manifest manifest = new Manifest(manifestStream);
        String actualSha256Attribute = manifest.getMainAttributes().getValue("RHQ-Sha256");
        manifestStream.close();

        MessageDigestGenerator digest = new MessageDigestGenerator(MessageDigestGenerator.SHA_256);
        String expectedSHA256 = digest.calcDigestString(sampleWithManifestWar);

        Assert.assertEquals(actualSha256Attribute, expectedSHA256);
        Assert.assertEquals(actualShaReturned, expectedSHA256);

        //cleanup resources created for this test
View Full Code Here

Examples of org.rhq.core.util.MessageDigestGenerator.calcDigestString()

        Manifest manifest = new Manifest(manifestStream);
        String actualSha256Attribute = manifest.getMainAttributes().getValue("RHQ-Sha256");
        manifestStream.close();

        MessageDigestGenerator digest = new MessageDigestGenerator(MessageDigestGenerator.SHA_256);
        String expectedSHA256 = digest.calcDigestString(sampleWithoutManifestWar);

        Assert.assertEquals(actualSha256Attribute, expectedSHA256);
        Assert.assertEquals(actualShaReturned, expectedSHA256);

        deleteRecursive(deploymentDirectory);
View Full Code Here

Examples of org.rhq.core.util.MessageDigestGenerator.calcDigestString()

        //verify the results (Assert and mock verification)
        Assert.assertTrue(deploymentFile.exists(), "Deployment did not happen.");
        Assert.assertFalse(deploymentFile.isDirectory(), "Deployment was exploded when it should not have been.");

        MessageDigestGenerator digest = new MessageDigestGenerator(MessageDigestGenerator.SHA_256);
        String expectedSHA256 = digest.calcDigestString(sampleWithoutManifestWar);
        String actualSHA256OfDeployment = digest.calcDigestString(deploymentFile);

        Assert.assertEquals(actualSHA256OfDeployment, expectedSHA256);
        Assert.assertEquals(actualShaReturned, expectedSHA256);
View Full Code Here

Examples of org.rhq.core.util.MessageDigestGenerator.calcDigestString()

        Assert.assertTrue(deploymentFile.exists(), "Deployment did not happen.");
        Assert.assertFalse(deploymentFile.isDirectory(), "Deployment was exploded when it should not have been.");

        MessageDigestGenerator digest = new MessageDigestGenerator(MessageDigestGenerator.SHA_256);
        String expectedSHA256 = digest.calcDigestString(sampleWithoutManifestWar);
        String actualSHA256OfDeployment = digest.calcDigestString(deploymentFile);

        Assert.assertEquals(actualSHA256OfDeployment, expectedSHA256);
        Assert.assertEquals(actualShaReturned, expectedSHA256);

        //cleanup resources created for this test
View Full Code Here

Examples of org.rhq.core.util.MessageDigestGenerator.calcDigestString()

        //run code under test
        String actualShaReturned = objectUnderTest.getSHA(sampleWithoutManifestWar);

        //verify the results (Assert and mock verification)
        MessageDigestGenerator digest = new MessageDigestGenerator(MessageDigestGenerator.SHA_256);
        String expectedSHA256 = digest.calcDigestString(sampleWithoutManifestWar);

        //cleanup resources created for this test
        Assert.assertEquals(actualShaReturned, expectedSHA256);
    }
View Full Code Here

Examples of org.rhq.core.util.MessageDigestGenerator.calcDigestString()

        when(mockFile.getName()).thenReturn("testResource");

        MessageDigestGenerator mockMessageDigestGenerator = mock(MessageDigestGenerator.class);
        PowerMockito.whenNew(MessageDigestGenerator.class).withParameterTypes(String.class).withArguments(anyString())
            .thenReturn(mockMessageDigestGenerator);
        when(mockMessageDigestGenerator.calcDigestString(any(File.class))).thenReturn("abcd1234");

        PackageType mockPackageType = mock(PackageType.class);
        when(mockPackageType.getName()).thenReturn("script");

        //create object to test and inject required dependencies
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.