terrymanu commented on code in PR #19047:
URL: https://github.com/apache/shardingsphere/pull/19047#discussion_r920720639


##########
shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/type/DatabaseTypeFactoryTest.java:
##########
@@ -57,4 +65,16 @@ public void assertGetInstances() {
         assertThat(iterator.next(), instanceOf(SQLServerDatabaseType.class));
         assertThat(iterator.next(), instanceOf(H2DatabaseType.class));
     }
+    
+    @Test
+    public void assertGetDatabaseTypeWithUrl() {
+        
assertThat(DatabaseTypeEngine.getDatabaseType("jdbc:mysql://localhost:3306/test").getType(),
 is("MySQL"));
+        
assertThat(DatabaseTypeEngine.getDatabaseType("jdbc:sqlite:test").getType(), 
is("SQL92"));
+        
assertThat(DatabaseTypeEngine.getDatabaseType("jdbc:postgresql://localhost:5432/test").getType(),
 is("PostgreSQL"));
+        
assertThat(DatabaseTypeEngine.getDatabaseType("jdbc:mariadb://localhost:3306/test").getType(),
 is("MariaDB"));
+        
assertThat(DatabaseTypeEngine.getDatabaseType("jdbc:opengauss://localhost:5432/test").getType(),
 is("openGauss"));
+        
assertThat(DatabaseTypeEngine.getDatabaseType("jdbc:oracle:thin:localhost:1522/test").getType(),
 is("Oracle"));
+        
assertThat(DatabaseTypeEngine.getDatabaseType("jdbc:microsoft:sqlserver://localhost:1433;
 DatabaseName=test").getType(), is("SQLServer"));
+        
assertThat(DatabaseTypeEngine.getDatabaseType("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MySQL").getType(),
 is("H2"));

Review Comment:
   This method tests DatabaseTypeEngine, not DatabaseTypeFactory, and there are 
duplicated test cases in DatabaseTypeFactory. Can you remove it?



-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to