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 2020/04/18 10:27:08 UTC

[servicecomb-java-chassis] 01/03: [SCB-1867] dependency update: netty, from 4.1.45.Final to 4.1.47.Final

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 250eae3a9cc937b1ddbbb52353617382bd22210b
Author: liubao <bi...@qq.com>
AuthorDate: Fri Apr 17 09:48:16 2020 +0800

    [SCB-1867] dependency update: netty, from 4.1.45.Final to 4.1.47.Final
---
 .../springmvc/client/TestMaxHttpUrlLength.java     | 61 ++++++++++++++++++++++
 dependencies/default/pom.xml                       |  2 +-
 .../it/testcase/TestRestVertxTransportConfig.java  |  2 +-
 .../core/publish/TestDefaultLogPublisher.java      |  8 ++-
 4 files changed, 66 insertions(+), 7 deletions(-)

diff --git a/demo/demo-springmvc/springmvc-client/src/main/java/org/apache/servicecomb/demo/springmvc/client/TestMaxHttpUrlLength.java b/demo/demo-springmvc/springmvc-client/src/main/java/org/apache/servicecomb/demo/springmvc/client/TestMaxHttpUrlLength.java
new file mode 100644
index 0000000..44cb66e
--- /dev/null
+++ b/demo/demo-springmvc/springmvc-client/src/main/java/org/apache/servicecomb/demo/springmvc/client/TestMaxHttpUrlLength.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2012 The Netty Project
+ *
+ * The Netty Project licenses this file to you under the Apache License,
+ * version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at:
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.servicecomb.demo.springmvc.client;
+
+import org.apache.servicecomb.demo.CategorizedTestCase;
+import org.apache.servicecomb.demo.TestMgr;
+import org.apache.servicecomb.provider.springmvc.reference.RestTemplateBuilder;
+import org.apache.servicecomb.swagger.invocation.exception.InvocationException;
+import org.springframework.stereotype.Component;
+import org.springframework.web.client.RestTemplate;
+
+import com.google.common.base.Strings;
+
+@Component
+public class TestMaxHttpUrlLength implements CategorizedTestCase {
+  @Override
+  public void testRestTransport() throws Exception {
+    testUrlNotLongerThan4096();
+  }
+
+  private void testUrlNotLongerThan4096() {
+    RestTemplate restTemplate = RestTemplateBuilder.create();
+
+    String q = Strings.repeat("q", 4096 - "GET /springmvc/controller/sayhi?name=".length() - " HTTP/1.1\r".length());
+    TestMgr.check("hi " + q + " [" + q + "]",
+        restTemplate.getForObject("cse://springmvc/springmvc/controller/sayhi?name=" + q,
+            String.class));
+
+    q = Strings.repeat("q", 4096 + 1 - "GET /springmvc/controller/sayhi?name=".length() - " HTTP/1.1\r".length());
+    try {
+      restTemplate.getForObject("cse://springmvc/springmvc/controller/sayhi?name=" + q,
+          String.class);
+      TestMgr.check(true, false);
+    } catch (InvocationException e) {
+      TestMgr.check(414, e.getStatusCode());
+    }
+  }
+
+  @Override
+  public void testHighwayTransport() throws Exception {
+
+  }
+
+  @Override
+  public void testAllTransport() throws Exception {
+
+  }
+}
diff --git a/dependencies/default/pom.xml b/dependencies/default/pom.xml
index ade9b5b..4f0be82 100644
--- a/dependencies/default/pom.xml
+++ b/dependencies/default/pom.xml
@@ -82,7 +82,7 @@
     <mock-server.version>3.10.4</mock-server.version>
     <narayana.version>5.3.2.Final</narayana.version>
     <netflix-commons.version>0.3.0</netflix-commons.version>
-    <netty.version>4.1.45.Final</netty.version>
+    <netty.version>4.1.47.Final</netty.version>
     <okhttp3.version>3.14.2</okhttp3.version>
     <powermock.version>1.6.2</powermock.version>
     <prometheus.version>0.6.0</prometheus.version>
diff --git a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestRestVertxTransportConfig.java b/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestRestVertxTransportConfig.java
index 509be60..96531e9 100644
--- a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestRestVertxTransportConfig.java
+++ b/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestRestVertxTransportConfig.java
@@ -30,7 +30,7 @@ import com.google.common.base.Strings;
 
 public class TestRestVertxTransportConfig {
   // GET /v1/restServerConfig/testMaxInitialLineLength?q=...... HTTP/1.1
-  private static final String INITIAL_LINE_SUFFIX = " HTTP/1.1";
+  private static final String INITIAL_LINE_SUFFIX = " HTTP/1.1\r";
 
   private static final String INITIAL_LINE_PREFIX = "GET /v1/restVertxTransportConfig/testMaxInitialLineLength?q=";
 
diff --git a/metrics/metrics-core/src/test/java/org/apache/servicecomb/metrics/core/publish/TestDefaultLogPublisher.java b/metrics/metrics-core/src/test/java/org/apache/servicecomb/metrics/core/publish/TestDefaultLogPublisher.java
index f0948fc..3b6efe0 100644
--- a/metrics/metrics-core/src/test/java/org/apache/servicecomb/metrics/core/publish/TestDefaultLogPublisher.java
+++ b/metrics/metrics-core/src/test/java/org/apache/servicecomb/metrics/core/publish/TestDefaultLogPublisher.java
@@ -54,6 +54,7 @@ import com.netflix.spectator.api.Measurement;
 
 import io.vertx.core.impl.VertxImpl;
 import mockit.Expectations;
+import mockit.Injectable;
 import mockit.Mock;
 import mockit.MockUp;
 import mockit.Mocked;
@@ -135,8 +136,8 @@ public class TestDefaultLogPublisher {
   }
 
   @Test
-  public void onPolledEvent(@Mocked VertxImpl vertxImpl, @Mocked MeasurementTree tree,
-      @Mocked GlobalRegistry globalRegistry, @Mocked EventBus eventBus, @Mocked MetricsBootstrapConfig config) {
+  public void onPolledEvent(@Injectable VertxImpl vertxImpl, @Injectable MeasurementTree tree,
+      @Injectable GlobalRegistry globalRegistry, @Injectable EventBus eventBus, @Injectable MetricsBootstrapConfig config) {
     try {
       ArchaiusUtils.setProperty("servicecomb.metrics.publisher.defaultLog.enabled", true);
       ArchaiusUtils.setProperty("servicecomb.metrics.invocation.latencyDistribution", "0,1,100");
@@ -145,9 +146,6 @@ public class TestDefaultLogPublisher {
         {
           VertxUtils.getVertxMap();
           result = Collections.singletonMap("v", vertxImpl);
-          // TODO will be fixed by next vertx update.
-          //        vertxImpl.getEventLoopContextCreatedCount();;
-          //        result = 1;
         }
       };
       DefaultPublishModel model = new DefaultPublishModel();