test_class.file: shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/transaction/TransactionBackendHandlerFactoryTest.java
test_class.identifier: TransactionBackendHandlerFactoryTest
test_case.body: @Test
      public void assertTransactionBackendHandlerReturnedWhenTCLStatementInstanceOfCommitStatement() {
          BackendConnection backendConnection = mock(BackendConnection.class, Answers.RETURNS_DEEP_STUBS);
          TextProtocolBackendHandler textProtocolBackendHandler = TransactionBackendHandlerFactory.newInstance(null, mock(CommitStatement.class), backendConnection);
          assertThat(textProtocolBackendHandler, instanceOf(TransactionBackendHandler.class));
          TransactionBackendHandler transactionBackendHandler = (TransactionBackendHandler) textProtocolBackendHandler;
          assertFieldOfInstance(transactionBackendHandler, "operationType", is(TransactionOperationType.COMMIT));
          assertFieldOfInstance(getBackendTransactionManager(transactionBackendHandler), "connection", is(backendConnection));
      }
test_case.class_method_signature: TransactionBackendHandlerFactoryTest.assertTransactionBackendHandlerReturnedWhenTCLStatementInstanceOfCommitStatement()
test_case.full_signature: @Test public void assertTransactionBackendHandlerReturnedWhenTCLStatementInstanceOfCommitStatement()
test_case.identifier: assertTransactionBackendHandlerReturnedWhenTCLStatementInstanceOfCommitStatement
test_case.invocations: mock newInstance mock assertThat instanceOf assertFieldOfInstance is assertFieldOfInstance getBackendTransactionManager is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertTransactionBackendHandlerReturnedWhenTCLStatementInstanceOfCommitStatement()
focal_class.file: shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/transaction/TransactionBackendHandlerFactory.java
focal_class.identifier: TransactionBackendHandlerFactory
focal_class.class_method_signature: TransactionBackendHandlerFactory.newInstance(final String sql, final TCLStatement tclStatement, final BackendConnection backendConnection)
focal_class.full_signature: public static TextProtocolBackendHandler newInstance(final String sql, final TCLStatement tclStatement, final BackendConnection backendConnection)
focal_class.identifier: newInstance
focal_class.modifiers: public static
focal_class.parameters: (final String sql, final TCLStatement tclStatement, final BackendConnection backendConnection)
focal_class.return: TextProtocolBackendHandler
focal_class.signature: TextProtocolBackendHandler newInstance(final String sql, final TCLStatement tclStatement, final BackendConnection backendConnection)
focal_method.body: public static TextProtocolBackendHandler newInstance(final String sql, final TCLStatement tclStatement, final BackendConnection backendConnection) {
          if (tclStatement instanceof BeginTransactionStatement) {
              return new TransactionBackendHandler(TransactionOperationType.BEGIN, backendConnection);
          }
          if (tclStatement instanceof SetAutoCommitStatement) {
              if (((SetAutoCommitStatement) tclStatement).isAutoCommit()) {
                  return backendConnection.getTransactionStatus().isInTransaction() ? new TransactionBackendHandler(TransactionOperationType.COMMIT, backendConnection) : new SkipBackendHandler();
              }
              return new TransactionBackendHandler(TransactionOperationType.BEGIN, backendConnection);
          }
          if (tclStatement instanceof CommitStatement) {
              return new TransactionBackendHandler(TransactionOperationType.COMMIT, backendConnection);
          }
          if (tclStatement instanceof RollbackStatement) {
              return new TransactionBackendHandler(TransactionOperationType.ROLLBACK, backendConnection);
          }
          return new BroadcastBackendHandler(sql, tclStatement, backendConnection);
      }
focal_method.class_method_signature: TransactionBackendHandlerFactory.newInstance(final String sql, final TCLStatement tclStatement, final BackendConnection backendConnection)
focal_method.full_signature: public static TextProtocolBackendHandler newInstance(final String sql, final TCLStatement tclStatement, final BackendConnection backendConnection)
focal_method.identifier: newInstance
focal_method.invocations: isAutoCommit isInTransaction getTransactionStatus
focal_method.modifiers: public static
focal_method.parameters: (final String sql, final TCLStatement tclStatement, final BackendConnection backendConnection)
focal_method.return: TextProtocolBackendHandler
focal_method.signature: TextProtocolBackendHandler newInstance(final String sql, final TCLStatement tclStatement, final BackendConnection backendConnection)