Skip to content

Commit

Permalink
Adjust JarSigningTest
Browse files Browse the repository at this point in the history
  • Loading branch information
laeubi authored and akurtakov committed Mar 15, 2023
1 parent b226922 commit b38da64
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void testSigning() throws Exception {
verifier.executeGoal("verify");
verifier.verifyErrorFreeLog();
verifier.verifyTextInLog("verified successfully");
checkMD5SumsArePresent(verifier);
checkSha256SumsArePresent(verifier);
}

@Test
Expand All @@ -50,10 +50,10 @@ public void testExtraSigning() throws Exception {
verifier.executeGoal("verify");
verifier.verifyErrorFreeLog();
verifier.verifyTextInLog("verified successfully");
checkMD5SumsArePresent(verifier);
checkSha256SumsArePresent(verifier);
}

private void checkMD5SumsArePresent(Verifier verifier) throws Exception {
private void checkSha256SumsArePresent(Verifier verifier) throws Exception {
File repoDir = new File(verifier.getBasedir(), "rcp/target/repository");
File artifacts = new File(repoDir, "artifacts.jar");
assertTrue(artifacts.isFile());
Expand All @@ -71,16 +71,16 @@ private void checkMD5SumsArePresent(Verifier verifier) throws Exception {
Element artifactNode = (Element) nodeList.item(i);
NodeList properties = (NodeList) xpath.evaluate("properties/property", artifactNode,
XPathConstants.NODESET);
boolean hasMD5 = false;
boolean hasSha256 = false;
for (int j = 0; j < properties.getLength(); j++) {
Element property = (Element) properties.item(j);
String propName = property.getAttribute("name");
if ("download.md5".equals(propName)) {
hasMD5 = true;
if ("download.checksum.sha-256".equals(propName)) {
hasSha256 = true;
break;
}
}
assertTrue("bug 357513 - artifact does not have a 'download.md5' attribute", hasMD5);
assertTrue("artifact does not have a 'download.checksum.sha-256' attribute", hasSha256);
}
}
}

0 comments on commit b38da64

Please sign in to comment.