jingshanglu commented on code in PR #19293: URL: https://github.com/apache/shardingsphere/pull/19293#discussion_r924221806
########## shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/cases/commitrollback/CommitAndRollbackTestCase.java: ########## @@ -0,0 +1,69 @@ +/* + * 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.integration.transaction.cases.commitrollback; + +import lombok.SneakyThrows; +import org.apache.shardingsphere.integration.transaction.cases.base.BaseTransactionTestCase; +import org.apache.shardingsphere.integration.transaction.engine.base.TransactionTestCase; + +import javax.sql.DataSource; +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.Statement; + +/** + * Commit and rollback transaction integration test. + */ +@TransactionTestCase +public final class CommitAndRollbackTestCase extends BaseTransactionTestCase { + + public CommitAndRollbackTestCase(final DataSource dataSource) { Review Comment: Is it same to `BindingTestCase`? ########## shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/cases/savepoint/BaseSavePointTestCase.java: ########## @@ -0,0 +1,71 @@ +/* + * 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.integration.transaction.cases.savepoint; + +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.apache.shardingsphere.integration.transaction.cases.base.BaseTransactionTestCase; + +import javax.sql.DataSource; +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.Savepoint; + +/** + * Auto commit transaction integration test. + */ Review Comment: Base save point test case? ########## shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/cases/autocommit/AutoCommitTestCase.java: ########## @@ -0,0 +1,70 @@ +/* + * 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.integration.transaction.cases.autocommit; + +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.apache.shardingsphere.data.pipeline.core.util.ThreadUtil; +import org.apache.shardingsphere.integration.transaction.cases.base.BaseTransactionTestCase; +import org.apache.shardingsphere.integration.transaction.engine.base.TransactionTestCase; +import org.junit.Assert; + +import javax.sql.DataSource; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.concurrent.TimeUnit; + +/** + * Auto commit transaction integration test. + */ +@Slf4j +@TransactionTestCase +public final class AutoCommitTestCase extends BaseTransactionTestCase { + + public AutoCommitTestCase(final DataSource dataSource) { + super(dataSource); + } + + @Override + @SneakyThrows(SQLException.class) + public void assertTest() { + assertAutoCommit(); + } Review Comment: Maybe need to think of a more appropriate function name. ########## shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/cases/savepoint/MySQLSavePointTestCase.java: ########## @@ -0,0 +1,44 @@ +/* + * 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.integration.transaction.cases.savepoint; + +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.apache.shardingsphere.integration.transaction.engine.base.TransactionTestCase; +import org.apache.shardingsphere.integration.transaction.engine.constants.TransactionTestConstants; + +import javax.sql.DataSource; + +/** + * MySQL auto commit transaction integration test. + */ Review Comment: MySQL save point test case? ########## shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/cases/savepoint/OpenGaussSavePointTestCase.java: ########## @@ -0,0 +1,72 @@ +/* + * 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.integration.transaction.cases.savepoint; + +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.apache.shardingsphere.integration.transaction.engine.base.TransactionTestCase; +import org.apache.shardingsphere.integration.transaction.engine.constants.TransactionTestConstants; +import org.junit.Assert; +import org.opengauss.jdbc.PSQLSavepoint; + +import javax.sql.DataSource; +import java.sql.Connection; +import java.sql.SQLException; + +/** + * OpenGauss auto commit transaction integration test. + */ Review Comment: OpenGauss save point test case? ########## shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/constants/TransactionTestConstants.java: ########## @@ -0,0 +1,37 @@ +/* + * 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.integration.transaction.engine.constants; + +public class TransactionTestConstants { + Review Comment: final ########## shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/cases/savepoint/PostgreSQLSavePointTestCase.java: ########## @@ -0,0 +1,72 @@ +/* + * 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.integration.transaction.cases.savepoint; + +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.apache.shardingsphere.integration.transaction.engine.base.TransactionTestCase; +import org.apache.shardingsphere.integration.transaction.engine.constants.TransactionTestConstants; +import org.junit.Assert; +import org.opengauss.jdbc.PSQLSavepoint; + +import javax.sql.DataSource; +import java.sql.Connection; +import java.sql.SQLException; + +/** + * PostgreSQL auto commit transaction integration test. + */ Review Comment: PostgreSQL save point test case? ########## shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/cases/savepoint/OpenGaussSavePointTestCase.java: ########## @@ -0,0 +1,72 @@ +/* + * 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.integration.transaction.cases.savepoint; + +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.apache.shardingsphere.integration.transaction.engine.base.TransactionTestCase; +import org.apache.shardingsphere.integration.transaction.engine.constants.TransactionTestConstants; +import org.junit.Assert; +import org.opengauss.jdbc.PSQLSavepoint; + +import javax.sql.DataSource; +import java.sql.Connection; +import java.sql.SQLException; + +/** + * OpenGauss auto commit transaction integration test. + */ +@Slf4j +@TransactionTestCase(dbTypes = {TransactionTestConstants.OPENGAUSS}) +public class OpenGaussSavePointTestCase extends BaseSavePointTestCase { + Review Comment: final ########## shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/cases/savepoint/MySQLSavePointTestCase.java: ########## @@ -0,0 +1,44 @@ +/* + * 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.integration.transaction.cases.savepoint; + +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.apache.shardingsphere.integration.transaction.engine.base.TransactionTestCase; +import org.apache.shardingsphere.integration.transaction.engine.constants.TransactionTestConstants; + +import javax.sql.DataSource; + +/** + * MySQL auto commit transaction integration test. + */ +@Slf4j +@TransactionTestCase(dbTypes = {TransactionTestConstants.MYSQL}) +public class MySQLSavePointTestCase extends BaseSavePointTestCase { + Review Comment: final ########## shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/cases/savepoint/PostgreSQLSavePointTestCase.java: ########## @@ -0,0 +1,72 @@ +/* + * 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.integration.transaction.cases.savepoint; + +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.apache.shardingsphere.integration.transaction.engine.base.TransactionTestCase; +import org.apache.shardingsphere.integration.transaction.engine.constants.TransactionTestConstants; +import org.junit.Assert; +import org.opengauss.jdbc.PSQLSavepoint; + +import javax.sql.DataSource; +import java.sql.Connection; +import java.sql.SQLException; + +/** + * PostgreSQL auto commit transaction integration test. + */ +@Slf4j +@TransactionTestCase(dbTypes = {TransactionTestConstants.POSTGRESQL}) +public class PostgreSQLSavePointTestCase extends BaseSavePointTestCase { Review Comment: 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
