test_class.declarator: xaTransactionManager
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private XATransactionManager xaTransactionManager;
test_class.type: XATransactionManager
test_class.var_name: xaTransactionManager
test_class.declarator: transactionManager
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private TransactionManager transactionManager;
test_class.type: TransactionManager
test_class.var_name: transactionManager
test_class.declarator: transaction
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Transaction transaction;
test_class.type: Transaction
test_class.var_name: transaction
test_class.file: shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/XATransactionDataSourceTest.java
test_class.identifier: XATransactionDataSourceTest
test_case.body: @Test
      public void assertCloseAtomikosDataSourceBean() {
          DataSource dataSource = DataSourceUtils.build(AtomikosDataSourceBean.class, DatabaseTypes.getActualDatabaseType("H2"), "ds11");
          XATransactionDataSource transactionDataSource = new XATransactionDataSource(DatabaseTypes.getActualDatabaseType("H2"), "ds11", dataSource, xaTransactionManager);
          transactionDataSource.close();
          verify(xaTransactionManager, times(0)).removeRecoveryResource(anyString(), any(XADataSource.class));
         
      }
test_case.class_method_signature: XATransactionDataSourceTest.assertCloseAtomikosDataSourceBean()
test_case.full_signature: @Test public void assertCloseAtomikosDataSourceBean()
test_case.identifier: assertCloseAtomikosDataSourceBean
test_case.invocations: build getActualDatabaseType getActualDatabaseType close removeRecoveryResource verify times anyString any
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertCloseAtomikosDataSourceBean()
focal_class.declarator: CONTAINER_DATASOURCE_NAMES = Sets.newHashSet("AtomikosDataSourceBean", "BasicManagedDataSource")
focal_class.modifier: private static final
focal_class.original_string: private static final Set<String> CONTAINER_DATASOURCE_NAMES = Sets.newHashSet("AtomikosDataSourceBean", "BasicManagedDataSource");
focal_class.type: Set<String>
focal_class.var_name: CONTAINER_DATASOURCE_NAMES
focal_class.declarator: enlistedTransactions = ThreadLocal.withInitial(HashSet::new)
focal_class.modifier: private final
focal_class.original_string: private final ThreadLocal<Set<Transaction>> enlistedTransactions = ThreadLocal.withInitial(HashSet::new);
focal_class.type: ThreadLocal<Set<Transaction>>
focal_class.var_name: enlistedTransactions
focal_class.declarator: databaseType
focal_class.modifier: private final
focal_class.original_string: private final DatabaseType databaseType;
focal_class.type: DatabaseType
focal_class.var_name: databaseType
focal_class.declarator: resourceName
focal_class.modifier: private final
focal_class.original_string: private final String resourceName;
focal_class.type: String
focal_class.var_name: resourceName
focal_class.declarator: dataSource
focal_class.modifier: private final
focal_class.original_string: private final DataSource dataSource;
focal_class.type: DataSource
focal_class.var_name: dataSource
focal_class.declarator: xaDataSource
focal_class.modifier: private
focal_class.original_string: private XADataSource xaDataSource;
focal_class.type: XADataSource
focal_class.var_name: xaDataSource
focal_class.declarator: xaTransactionManager
focal_class.modifier: private
focal_class.original_string: private XATransactionManager xaTransactionManager;
focal_class.type: XATransactionManager
focal_class.var_name: xaTransactionManager
focal_class.file: shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/main/java/org/apache/shardingsphere/transaction/xa/jta/datasource/XATransactionDataSource.java
focal_class.identifier: XATransactionDataSource
focal_class.interfaces: implements AutoCloseable
focal_class.class_method_signature: XATransactionDataSource.XATransactionDataSource(final DatabaseType databaseType, final String resourceName, final DataSource dataSource, final XATransactionManager xaTransactionManager)
focal_class.full_signature: public  XATransactionDataSource(final DatabaseType databaseType, final String resourceName, final DataSource dataSource, final XATransactionManager xaTransactionManager)
focal_class.identifier: XATransactionDataSource
focal_class.modifiers: public
focal_class.parameters: (final DatabaseType databaseType, final String resourceName, final DataSource dataSource, final XATransactionManager xaTransactionManager)
focal_class.signature:  XATransactionDataSource(final DatabaseType databaseType, final String resourceName, final DataSource dataSource, final XATransactionManager xaTransactionManager)
focal_class.class_method_signature: XATransactionDataSource.getConnection()
focal_class.full_signature: public Connection getConnection()
focal_class.identifier: getConnection
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Connection
focal_class.signature: Connection getConnection()
focal_class.class_method_signature: XATransactionDataSource.close()
focal_class.full_signature: @Override public void close()
focal_class.identifier: close
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_class.class_method_signature: XATransactionDataSource.close(final DataSource dataSource)
focal_class.full_signature: private void close(final DataSource dataSource)
focal_class.identifier: close
focal_class.modifiers: private
focal_class.parameters: (final DataSource dataSource)
focal_class.return: void
focal_class.signature: void close(final DataSource dataSource)
focal_method.body: @Override
      public void close() {
          if (!CONTAINER_DATASOURCE_NAMES.contains(dataSource.getClass().getSimpleName())) {
              xaTransactionManager.removeRecoveryResource(resourceName, xaDataSource);
          } else {
              close(dataSource);
          }
      }
focal_method.class_method_signature: XATransactionDataSource.close()
focal_method.full_signature: @Override public void close()
focal_method.identifier: close
focal_method.invocations: contains getSimpleName getClass removeRecoveryResource close
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void close()