tuohai666 commented on a change in pull request #6352:
URL: https://github.com/apache/shardingsphere/pull/6352#discussion_r456240880



##########
File path: 
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/resources/META-INF/services/org.apache.shardingsphere.proxy.backend.communication.jdbc.recognizer.spi.JDBCDriverURLRecognizer
##########
@@ -20,3 +20,4 @@ 
org.apache.shardingsphere.proxy.backend.communication.jdbc.recognizer.impl.Postg
 
org.apache.shardingsphere.proxy.backend.communication.jdbc.recognizer.impl.OracleRecognizer
 
org.apache.shardingsphere.proxy.backend.communication.jdbc.recognizer.impl.SQLServerRecognizer
 
org.apache.shardingsphere.proxy.backend.communication.jdbc.recognizer.impl.H2Recognizer
+org.apache.shardingsphere.proxy.backend.communication.jdbc.recognizer.impl.P6SpyDriverRecognizer

Review comment:
       Need an empty line.

##########
File path: 
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/recognizer/impl/PostgreSQLRecognizer.java
##########
@@ -27,9 +28,11 @@
  */
 public final class PostgreSQLRecognizer implements JDBCDriverURLRecognizer {
     
+    private PostgreSQLDatabaseType databaseType = new PostgreSQLDatabaseType();

Review comment:
       Field 'databaseType' may be 'final'

##########
File path: 
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/recognizer/impl/OracleRecognizer.java
##########
@@ -27,9 +28,11 @@
  */
 public final class OracleRecognizer implements JDBCDriverURLRecognizer {
     
+    private OracleDatabaseType databaseType = new OracleDatabaseType();

Review comment:
       Field 'databaseType' may be 'final'

##########
File path: 
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/recognizer/JDBCDriverURLRecognizerEngine.java
##########
@@ -20,6 +20,7 @@
 import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
 import org.apache.shardingsphere.infra.exception.ShardingSphereException;
+import 
org.apache.shardingsphere.proxy.backend.communication.jdbc.recognizer.spi.JDBCDriverComposeURLRecognizer;

Review comment:
       Please update all config-*.yaml

##########
File path: 
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/recognizer/impl/SQLServerRecognizer.java
##########
@@ -27,9 +28,11 @@
  */
 public final class SQLServerRecognizer implements JDBCDriverURLRecognizer {
     
+    private SQLServerDatabaseType databaseType = new SQLServerDatabaseType();

Review comment:
       Field 'databaseType' may be 'final'

##########
File path: 
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/recognizer/impl/MySQLRecognizer.java
##########
@@ -27,9 +28,11 @@
  */
 public final class MySQLRecognizer implements JDBCDriverURLRecognizer {
     
+    private MySQLDatabaseType databaseType = new MySQLDatabaseType();

Review comment:
       Field 'databaseType' may be 'final'

##########
File path: 
shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/recognizer/impl/P6SpyDriverRecognizerTest.java
##########
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.shardingsphere.proxy.backend.communication.jdbc.recognizer.impl;
+
+import org.junit.Test;
+
+import java.util.Collections;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class P6SpyDriverRecognizerTest {
+    
+    private final P6SpyDriverRecognizer recognizer = new 
P6SpyDriverRecognizer();
+    
+    @Test
+    public void getURLPrefixes() throws Exception {
+        assertThat(recognizer.getURLPrefixes(), 
is(Collections.singletonList("jdbc:p6spy:")));
+    }
+    
+    @Test
+    public void getDriverClassName() throws Exception {

Review comment:
       Redundant exception.

##########
File path: 
shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/recognizer/impl/P6SpyDriverRecognizerTest.java
##########
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.shardingsphere.proxy.backend.communication.jdbc.recognizer.impl;
+
+import org.junit.Test;
+
+import java.util.Collections;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class P6SpyDriverRecognizerTest {
+    
+    private final P6SpyDriverRecognizer recognizer = new 
P6SpyDriverRecognizer();
+    
+    @Test
+    public void getURLPrefixes() throws Exception {

Review comment:
       Redundant exception.

##########
File path: 
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/recognizer/impl/H2Recognizer.java
##########
@@ -27,9 +28,11 @@
  */
 public final class H2Recognizer implements JDBCDriverURLRecognizer {
     
+    private H2DatabaseType databaseType = new H2DatabaseType();

Review comment:
       Field 'databaseType' may be 'final'




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to