test_class.declarator: xaShardingTransactionManager = new XAShardingTransactionManager()
test_class.modifier: private final
test_class.original_string: private final XAShardingTransactionManager xaShardingTransactionManager = new XAShardingTransactionManager();
test_class.type: XAShardingTransactionManager
test_class.var_name: xaShardingTransactionManager
test_class.declarator: xaTransactionManager = XATransactionManagerLoader.getInstance().getTransactionManager()
test_class.modifier: @Spy
      private final
test_class.original_string: @Spy
      private final XATransactionManager xaTransactionManager = XATransactionManagerLoader.getInstance().getTransactionManager();
test_class.type: XATransactionManager
test_class.var_name: xaTransactionManager
test_class.file: shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/XAShardingTransactionManagerTest.java
test_class.identifier: XAShardingTransactionManagerTest
test_case.body: @Test
      public void assertClose() throws Exception {
          xaShardingTransactionManager.close();
          Map<String, XATransactionDataSource> cachedSingleXADataSourceMap = getCachedDataSources();
          verify(xaTransactionManager, times(2)).removeRecoveryResource(anyString(), any(XADataSource.class));
          assertThat(cachedSingleXADataSourceMap.size(), is(0));
      }
test_case.class_method_signature: XAShardingTransactionManagerTest.assertClose()
test_case.full_signature: @Test public void assertClose()
test_case.identifier: assertClose
test_case.invocations: close getCachedDataSources removeRecoveryResource verify times anyString any assertThat size is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertClose()
focal_class.declarator: cachedDataSources = new HashMap<>()
focal_class.modifier: private final
focal_class.original_string: private final Map<String, XATransactionDataSource> cachedDataSources = new HashMap<>();
focal_class.type: Map<String, XATransactionDataSource>
focal_class.var_name: cachedDataSources
focal_class.declarator: xaTransactionManager = XATransactionManagerLoader.getInstance().getTransactionManager()
focal_class.modifier: private final
focal_class.original_string: private final XATransactionManager xaTransactionManager = XATransactionManagerLoader.getInstance().getTransactionManager();
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/XAShardingTransactionManager.java
focal_class.identifier: XAShardingTransactionManager
focal_class.interfaces: implements ShardingTransactionManager
focal_class.class_method_signature: XAShardingTransactionManager.init(final DatabaseType databaseType, final Collection<ResourceDataSource> resourceDataSources)
focal_class.full_signature: @Override public void init(final DatabaseType databaseType, final Collection<ResourceDataSource> resourceDataSources)
focal_class.identifier: init
focal_class.modifiers: @Override public
focal_class.parameters: (final DatabaseType databaseType, final Collection<ResourceDataSource> resourceDataSources)
focal_class.return: void
focal_class.signature: void init(final DatabaseType databaseType, final Collection<ResourceDataSource> resourceDataSources)
focal_class.class_method_signature: XAShardingTransactionManager.getTransactionType()
focal_class.full_signature: @Override public TransactionType getTransactionType()
focal_class.identifier: getTransactionType
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: TransactionType
focal_class.signature: TransactionType getTransactionType()
focal_class.class_method_signature: XAShardingTransactionManager.isInTransaction()
focal_class.full_signature: @SneakyThrows(SystemException.class) @Override public boolean isInTransaction()
focal_class.identifier: isInTransaction
focal_class.modifiers: @SneakyThrows(SystemException.class) @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isInTransaction()
focal_class.class_method_signature: XAShardingTransactionManager.getConnection(final String dataSourceName)
focal_class.full_signature: @Override public Connection getConnection(final String dataSourceName)
focal_class.identifier: getConnection
focal_class.modifiers: @Override public
focal_class.parameters: (final String dataSourceName)
focal_class.return: Connection
focal_class.signature: Connection getConnection(final String dataSourceName)
focal_class.class_method_signature: XAShardingTransactionManager.begin()
focal_class.full_signature: @SneakyThrows({SystemException.class, NotSupportedException.class}) @Override public void begin()
focal_class.identifier: begin
focal_class.modifiers: @SneakyThrows({SystemException.class, NotSupportedException.class}) @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void begin()
focal_class.class_method_signature: XAShardingTransactionManager.commit()
focal_class.full_signature: @SneakyThrows({SystemException.class, RollbackException.class, HeuristicMixedException.class, HeuristicRollbackException.class}) @Override public void commit()
focal_class.identifier: commit
focal_class.modifiers: @SneakyThrows({SystemException.class, RollbackException.class, HeuristicMixedException.class, HeuristicRollbackException.class}) @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void commit()
focal_class.class_method_signature: XAShardingTransactionManager.rollback()
focal_class.full_signature: @SneakyThrows(SystemException.class) @Override public void rollback()
focal_class.identifier: rollback
focal_class.modifiers: @SneakyThrows(SystemException.class) @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void rollback()
focal_class.class_method_signature: XAShardingTransactionManager.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_method.body: @Override
      public void close() throws Exception {
          for (XATransactionDataSource each : cachedDataSources.values()) {
              each.close();
          }
          cachedDataSources.clear();
          xaTransactionManager.close();
      }
focal_method.class_method_signature: XAShardingTransactionManager.close()
focal_method.full_signature: @Override public void close()
focal_method.identifier: close
focal_method.invocations: values close clear close
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void close()