You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by sh...@apache.org on 2022/06/23 04:57:40 UTC
[servicecomb-java-chassis] branch master updated: [SCB-2593] enable checkstyle LocalFinalVariableName (#3111)
This is an automated email from the ASF dual-hosted git repository.
shoothzj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git
The following commit(s) were added to refs/heads/master by this push:
new 367e3ebd7 [SCB-2593] enable checkstyle LocalFinalVariableName (#3111)
367e3ebd7 is described below
commit 367e3ebd7310860223a5c68bb611b4015ea5fe51
Author: TingTing Wang <19...@qq.com>
AuthorDate: Thu Jun 23 12:57:34 2022 +0800
[SCB-2593] enable checkstyle LocalFinalVariableName (#3111)
---
ci/checkstyle/checkstyle.xml | 5 +++++
.../servicecomb/qps/QpsControllerManagerTest.java | 20 ++++++++++----------
2 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/ci/checkstyle/checkstyle.xml b/ci/checkstyle/checkstyle.xml
index 08abf89ec..21df6b51b 100644
--- a/ci/checkstyle/checkstyle.xml
+++ b/ci/checkstyle/checkstyle.xml
@@ -48,6 +48,11 @@
<!-- Checks for placement of the left curly brace ('{'). -->
<property name="severity" value="error"/>
</module>
+ <module name="LocalFinalVariableName">
+ <!-- Validates identifiers for local final variables against the
+ expression "^[a-z][a-zA-Z0-9]*$". -->
+ <property name="severity" value="error"/>
+ </module>
<module name="LocalVariableName">
<!-- Validates identifiers for local variables against the
expression "^[a-z][a-zA-Z0-9]*$". -->
diff --git a/handlers/handler-flowcontrol-qps/src/test/java/org/apache/servicecomb/qps/QpsControllerManagerTest.java b/handlers/handler-flowcontrol-qps/src/test/java/org/apache/servicecomb/qps/QpsControllerManagerTest.java
index 3405e7f92..3cd0fc690 100644
--- a/handlers/handler-flowcontrol-qps/src/test/java/org/apache/servicecomb/qps/QpsControllerManagerTest.java
+++ b/handlers/handler-flowcontrol-qps/src/test/java/org/apache/servicecomb/qps/QpsControllerManagerTest.java
@@ -485,22 +485,22 @@ public class QpsControllerManagerTest {
@Test
public void testDeleteQpsController() {
- final String MICROSERVICE_NAME = "springmvcClient";
- final String SCHEMA_ID = "controller";
- final String OPERATION_ID = "add";
- final String CONFIG_KEY = "springmvcClient.controller.add";
+ final String microserviceName = "springmvcClient";
+ final String schemaId = "controller";
+ final String operationId = "add";
+ final String configKey = "springmvcClient.controller.add";
QpsControllerManager testManager = new QpsControllerManager(true);
- Invocation testInvocation = getMockInvocation(MICROSERVICE_NAME, SCHEMA_ID, OPERATION_ID);
- Mockito.when(testInvocation.getSchemaId()).thenReturn(SCHEMA_ID);
+ Invocation testInvocation = getMockInvocation(microserviceName, schemaId, operationId);
+ Mockito.when(testInvocation.getSchemaId()).thenReturn(schemaId);
- QpsStrategy strategy1 = testManager.getOrCreate(MICROSERVICE_NAME, testInvocation);
+ QpsStrategy strategy1 = testManager.getOrCreate(microserviceName, testInvocation);
- setConfigWithDefaultPrefix(true, CONFIG_KEY, 1);
+ setConfigWithDefaultPrefix(true, configKey, 1);
- deleteConfigWithDefaultPrefix(true, CONFIG_KEY);
+ deleteConfigWithDefaultPrefix(true, configKey);
- QpsStrategy strategy2 = testManager.getOrCreate(MICROSERVICE_NAME, testInvocation);
+ QpsStrategy strategy2 = testManager.getOrCreate(microserviceName, testInvocation);
Assertions.assertEquals(strategy1, strategy2);
}