You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/05/26 05:14:04 UTC

[GitHub] [shardingsphere] complone commented on a diff in pull request #17910: add unit tests for DialectDDLGeneratorFactoryTest

complone commented on code in PR #17910:
URL: https://github.com/apache/shardingsphere/pull/17910#discussion_r882321513


##########
shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-api/src/test/java/org/apache/shardingsphere/data/pipeline/spi/ddlgenerator/DialectDDLGeneratorFactoryTest.java:
##########
@@ -0,0 +1,48 @@
+package org.apache.shardingsphere.data.pipeline.spi.ddlgenerator;
+
+import java.sql.SQLException;
+import javax.sql.DataSource;
+import org.apache.shardingsphere.infra.database.type.DatabaseType;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeFactory;
+import org.apache.shardingsphere.infra.database.type.dialect.MySQLDatabaseType;
+import org.apache.shardingsphere.infra.exception.ShardingSphereException;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThat;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+
+import org.mockito.junit.MockitoJUnitRunner;
+
+@RunWith(MockitoJUnitRunner.class)
+public final class DialectDDLGeneratorFactoryTest {
+
+    @Mock(extraInterfaces = AutoCloseable.class)
+    private DataSource dataSource;
+
+    @Test
+    public void assertFindInstanceWithDialectDDLGenerator() {
+        boolean thrown = false;
+
+        if (DialectDDLSQLGeneratorFactory.findInstance(new MySQLDatabaseType()).isPresent()) {
+            assertThat(DialectDDLSQLGeneratorFactory.findInstance(new MySQLDatabaseType()).get(), is(DialectDDLGenerator.class));
+

Review Comment:
   I'm solved.



##########
shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-api/src/test/java/org/apache/shardingsphere/data/pipeline/spi/ddlgenerator/DialectDDLGeneratorFactoryTest.java:
##########
@@ -0,0 +1,48 @@
+package org.apache.shardingsphere.data.pipeline.spi.ddlgenerator;

Review Comment:
   I'm solved.



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org