You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2019/11/06 13:08:49 UTC

[cxf] 03/03: Remove MD5 from testcase

This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit bef95402f7281aca28cd501633c15c1856f00f80
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Wed Nov 6 13:08:26 2019 +0000

    Remove MD5 from testcase
---
 .../java/org/apache/cxf/systest/jaxws/JaxWsDynamicClientTest.java | 8 ++++----
 .../main/java/org/apache/cxf/no_body_parts/NoBodyPartsImpl.java   | 6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/JaxWsDynamicClientTest.java b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/JaxWsDynamicClientTest.java
index d820499..b431c16 100644
--- a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/JaxWsDynamicClientTest.java
+++ b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/JaxWsDynamicClientTest.java
@@ -46,10 +46,10 @@ public class JaxWsDynamicClientTest extends AbstractBusClientServerTestBase {
     static final String PORT = TestUtil.getPortNumber(ServerNoBodyParts.class);
     static final String PORT1 = TestUtil.getPortNumber(ArrayServiceServer.class);
 
-    private String md5(byte[] bytes) {
+    private String digest(byte[] bytes) {
         MessageDigest algorithm;
         try {
-            algorithm = MessageDigest.getInstance("MD5");
+            algorithm = MessageDigest.getInstance("SHA-256");
         } catch (NoSuchAlgorithmException e) {
             throw new RuntimeException(e);
         }
@@ -85,13 +85,13 @@ public class JaxWsDynamicClientTest extends AbstractBusClientServerTestBase {
         parameters.setTargetType("tar-get");
         Object[] rparts = client.invoke("operation1", parameters, bucketOfBytes);
         Operation1Response r = (Operation1Response)rparts[0];
-        assertEquals(md5(bucketOfBytes), r.getStatus());
+        assertEquals(digest(bucketOfBytes), r.getStatus());
 
         ClientCallback callback = new ClientCallback();
         client.invoke(callback, "operation1", parameters, bucketOfBytes);
         rparts = callback.get();
         r = (Operation1Response)rparts[0];
-        assertEquals(md5(bucketOfBytes), r.getStatus());
+        assertEquals(digest(bucketOfBytes), r.getStatus());
     }
 
     @Test
diff --git a/testutils/src/main/java/org/apache/cxf/no_body_parts/NoBodyPartsImpl.java b/testutils/src/main/java/org/apache/cxf/no_body_parts/NoBodyPartsImpl.java
index 31730b3..d0b8829 100644
--- a/testutils/src/main/java/org/apache/cxf/no_body_parts/NoBodyPartsImpl.java
+++ b/testutils/src/main/java/org/apache/cxf/no_body_parts/NoBodyPartsImpl.java
@@ -36,8 +36,8 @@ import org.apache.cxf.no_body_parts.wsdl.NoBodyPartsSEI;
 @WebService(targetNamespace = "urn:org:apache:cxf:no_body_parts/wsdl")
 public class NoBodyPartsImpl implements NoBodyPartsSEI {
 
-    private String md5(byte[] bytes) throws NoSuchAlgorithmException {
-        MessageDigest algorithm = MessageDigest.getInstance("MD5");
+    private String digest(byte[] bytes) throws NoSuchAlgorithmException {
+        MessageDigest algorithm = MessageDigest.getInstance("SHA-256");
         algorithm.reset();
         algorithm.update(bytes);
         byte[] messageDigest = algorithm.digest();
@@ -53,7 +53,7 @@ public class NoBodyPartsImpl implements NoBodyPartsSEI {
     public Operation1Response operation1(Operation1 parameters, Holder<byte[]> mimeAttachment) {
         Operation1Response r = new Operation1Response();
         try {
-            r.setStatus(md5(mimeAttachment.value));
+            r.setStatus(digest(mimeAttachment.value));
         } catch (NoSuchAlgorithmException e) {
             throw new WebServiceException(e);
         }