You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2019/06/20 03:55:47 UTC

[servicecomb-java-chassis] branch master updated (6d5d662 -> 9c73a01)

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

liubao pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git.


    from 6d5d662  [SCB-1305] add IT and ITSCBAsyncRestTemplate
     new 59b70c7  [SCB-1306] When VertxServerRequestToHttpServletRequest modified body,but get inputStream is from original body
     new 9c73a01  [SCB-1306] Add UT

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../vertx/http/VertxServerRequestToHttpServletRequest.java  |  1 +
 .../http/TestVertxServerRequestToHttpServletRequest.java    | 13 +++++++++----
 2 files changed, 10 insertions(+), 4 deletions(-)


[servicecomb-java-chassis] 02/02: [SCB-1306] Add UT

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git

commit 9c73a01e99dce81723e5b7070e0937a8a99908ef
Author: wangsheng <wa...@huawei.com>
AuthorDate: Tue Jun 18 10:07:14 2019 +0800

    [SCB-1306] Add UT
---
 .../http/TestVertxServerRequestToHttpServletRequest.java    | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/foundations/foundation-vertx/src/test/java/org/apache/servicecomb/foundation/vertx/http/TestVertxServerRequestToHttpServletRequest.java b/foundations/foundation-vertx/src/test/java/org/apache/servicecomb/foundation/vertx/http/TestVertxServerRequestToHttpServletRequest.java
index 2e98a83..0ec60b8 100644
--- a/foundations/foundation-vertx/src/test/java/org/apache/servicecomb/foundation/vertx/http/TestVertxServerRequestToHttpServletRequest.java
+++ b/foundations/foundation-vertx/src/test/java/org/apache/servicecomb/foundation/vertx/http/TestVertxServerRequestToHttpServletRequest.java
@@ -425,11 +425,16 @@ public class TestVertxServerRequestToHttpServletRequest {
       }
     };
 
-    ServletInputStream is = request.getInputStream();
-    Assert.assertSame(is, request.getInputStream());
-    int value = is.read();
-    is.close();
+    ServletInputStream is1 = request.getInputStream();
+    Assert.assertSame(is1, request.getInputStream());
+    int value = is1.read();
+    is1.close();
     Assert.assertEquals(1, value);
+    Assert.assertSame(is1, request.getInputStream());
+
+    request.setBodyBuffer(Buffer.buffer().appendByte((byte)2));
+    ServletInputStream is2 = request.getInputStream();
+    Assert.assertNotSame(is1, is2);
   }
 
   @Test


[servicecomb-java-chassis] 01/02: [SCB-1306] When VertxServerRequestToHttpServletRequest modified body, but get inputStream is from original body

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git

commit 59b70c772b54b3c17082520d1be959584d9e1e8f
Author: wangsheng <wa...@huawei.com>
AuthorDate: Fri May 31 14:45:41 2019 +0800

    [SCB-1306] When VertxServerRequestToHttpServletRequest modified body,but get inputStream is from original body
---
 .../foundation/vertx/http/VertxServerRequestToHttpServletRequest.java    | 1 +
 1 file changed, 1 insertion(+)

diff --git a/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/http/VertxServerRequestToHttpServletRequest.java b/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/http/VertxServerRequestToHttpServletRequest.java
index d7dfdcc..a670480 100644
--- a/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/http/VertxServerRequestToHttpServletRequest.java
+++ b/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/http/VertxServerRequestToHttpServletRequest.java
@@ -84,6 +84,7 @@ public class VertxServerRequestToHttpServletRequest extends AbstractHttpServletR
   public void setBodyBuffer(Buffer bodyBuffer) {
     super.setBodyBuffer(bodyBuffer);
     context.setBody(bodyBuffer);
+    this.inputStream = null;
   }
 
   @Override