[axis-axis2-java-core] branch master updated (6404f98 -> 153aed7)

2021-04-07 Thread veithen
This is an automated email from the ASF dual-hosted git repository.

veithen pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/axis-axis2-java-core.git.


from 6404f98  Bump hermetic-maven-plugin from 0.6.0 to 0.6.1
 add 153aed7  Bump tomcat.version from 10.0.4 to 10.0.5

No new revisions were added by this update.

Summary of changes:
 modules/clustering/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[axis-axis2-java-core] branch master updated: AXIS2-5959 replace org.apache.commons.httpclient with org.apache.http in the json samples and unit tests

2021-04-07 Thread robertlazarski
This is an automated email from the ASF dual-hosted git repository.

robertlazarski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/axis-axis2-java-core.git


The following commit(s) were added to refs/heads/master by this push:
 new 91be03f  AXIS2-5959 replace org.apache.commons.httpclient with 
org.apache.http in the json samples and unit tests
91be03f is described below

commit 91be03fe100c63ea7e611be08aa8510c3b29abfa
Author: robert lazarski 
AuthorDate: Wed Apr 7 09:15:48 2021 -1000

AXIS2-5959 replace org.apache.commons.httpclient with org.apache.http in 
the json samples and unit tests
---
 .../axis2/json/gson/JSONXMLStreamAPITest.java  |  6 +-
 .../test/org/apache/axis2/json/gson/UtilTest.java  | 36 
 .../json/gson/rpc/JSONRPCIntegrationTest.java  |  7 +--
 .../json/src/sample/json/client/JsonClient.java| 64 +-
 4 files changed, 66 insertions(+), 47 deletions(-)

diff --git 
a/modules/json/test/org/apache/axis2/json/gson/JSONXMLStreamAPITest.java 
b/modules/json/test/org/apache/axis2/json/gson/JSONXMLStreamAPITest.java
index bb11e97..348ab23 100644
--- a/modules/json/test/org/apache/axis2/json/gson/JSONXMLStreamAPITest.java
+++ b/modules/json/test/org/apache/axis2/json/gson/JSONXMLStreamAPITest.java
@@ -32,8 +32,6 @@ public class JSONXMLStreamAPITest {
 public void xmlStreamAPITest()throws Exception{
 String getLibURL = server.getEndpoint("LibraryService") + "getLibrary";
 String echoLibURL = server.getEndpoint("LibraryService") + 
"echoLibrary";
-String contentType = "application/json";
-String charSet = "UTF-8";
 
 String echoLibrary = 
"{\"echoLibrary\":{\"args0\":{\"admin\":{\"address\":{\"city\":\"My 
City\",\"country\":" +
 "\"My Country\",\"street\":\"My 
Street\",\"zipCode\":\"0\"},\"age\":24,\"name\":\"micheal\"," +
@@ -67,11 +65,11 @@ public class JSONXMLStreamAPITest {
 
"{\"author\":\"Jhon_4\",\"numOfPages\":175,\"publisher\":\"Foxier\",\"reviewers\":[\"rev1\",\"rev2\","
 +
 "\"rev3\"]}],\"staff\":50}}}";
 
-String actualResponse = UtilTest.post(echoLibrary, echoLibURL, 
contentType, charSet);
+String actualResponse = UtilTest.post(echoLibrary, echoLibURL);
 Assert.assertNotNull(actualResponse);
 Assert.assertEquals(echoLibraryResponse , actualResponse);
 
-String actualRespose_2 = UtilTest.post(getLibrary, getLibURL, 
contentType, charSet);
+String actualRespose_2 = UtilTest.post(getLibrary, getLibURL);
 Assert.assertNotNull(actualRespose_2);
 Assert.assertEquals(getLibraryResponse, actualRespose_2);
 
diff --git a/modules/json/test/org/apache/axis2/json/gson/UtilTest.java 
b/modules/json/test/org/apache/axis2/json/gson/UtilTest.java
index ac1df45..c70937b 100644
--- a/modules/json/test/org/apache/axis2/json/gson/UtilTest.java
+++ b/modules/json/test/org/apache/axis2/json/gson/UtilTest.java
@@ -19,26 +19,38 @@
 
 package org.apache.axis2.json.gson;
 
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.methods.PostMethod;
-import org.apache.commons.httpclient.methods.RequestEntity;
-import org.apache.commons.httpclient.methods.StringRequestEntity;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.HttpEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
 
 import java.io.IOException;
 
 public class UtilTest {
 
-public static String post(String jsonString, String strURL, String 
contentType, String charSet)
+public static String post(String jsonString, String strURL)
 throws IOException {
-PostMethod post = new PostMethod(strURL);
-RequestEntity entity = new StringRequestEntity(jsonString, 
contentType, charSet);
-post.setRequestEntity(entity);
-HttpClient httpclient = new HttpClient();
+HttpEntity stringEntity = new 
StringEntity(jsonString,ContentType.APPLICATION_JSON);
+   HttpPost httpPost = new HttpPost(strURL);
+httpPost.setEntity(stringEntity);
+   CloseableHttpClient httpclient = HttpClients.createDefault();
+
 try {
-int result = httpclient.executeMethod(post);
-return post.getResponseBodyAsString();
+CloseableHttpResponse response = httpclient.execute(httpPost);
+   int status = response.getStatusLine().getStatusCode();
+if (status >= 200 && status < 300) {
+HttpEntity entity = response.getEntity();
+return entity != null ? EntityUtils.toString(entity,"UTF-8") : 
null;
+} else {
+ 

[axis-axis2-java-core] branch dependabot/maven/org.mockito-mockito-core-3.9.0 created (now 5ce6ce2)

2021-04-07 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch 
dependabot/maven/org.mockito-mockito-core-3.9.0
in repository https://gitbox.apache.org/repos/asf/axis-axis2-java-core.git.


  at 5ce6ce2  Bump mockito-core from 3.8.0 to 3.9.0

No new revisions were added by this update.