test_class.declarator: numberOfThreads = 10
test_class.modifier: private
test_class.original_string: private int numberOfThreads = 10;
test_class.type: int
test_class.var_name: numberOfThreads
test_class.declarator: service
test_class.modifier: private
test_class.original_string: private ExecutorService service;
test_class.type: ExecutorService
test_class.var_name: service
test_class.declarator: connectionStatus
test_class.modifier: private
test_class.original_string: private ConnectionStatus connectionStatus;
test_class.type: ConnectionStatus
test_class.var_name: connectionStatus
test_class.declarator: latch
test_class.modifier: private
test_class.original_string: private CountDownLatch latch;
test_class.type: CountDownLatch
test_class.var_name: latch
test_class.declarator: usingField
test_class.modifier: private
test_class.original_string: private Field usingField;
test_class.type: Field
test_class.var_name: usingField
test_class.file: shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/connection/ConnectionStatusTest.java
test_class.identifier: ConnectionStatusTest
test_case.body: @Test
      public void assertSwitchToUsing() throws InterruptedException, IllegalAccessException {
          AtomicInteger counter = new AtomicInteger();
          for (int i = 0; i < numberOfThreads; i++) {
              service.submit(() -> {
                  connectionStatus.switchToUsing();
                  counter.incrementAndGet();
                  latch.countDown();
              });
          }
          latch.await();
          assertThat(numberOfThreads, is(counter.get()));
          assertThat(usingField.getBoolean(connectionStatus), is(true));
      }
test_case.class_method_signature: ConnectionStatusTest.assertSwitchToUsing()
test_case.full_signature: @Test public void assertSwitchToUsing()
test_case.identifier: assertSwitchToUsing
test_case.invocations: submit switchToUsing incrementAndGet countDown await assertThat is get assertThat getBoolean is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertSwitchToUsing()
focal_class.declarator: resourceLock = new ResourceLock()
focal_class.modifier: private final
focal_class.original_string: private final ResourceLock resourceLock = new ResourceLock();
focal_class.type: ResourceLock
focal_class.var_name: resourceLock
focal_class.declarator: isUsing
focal_class.modifier: private volatile
focal_class.original_string: private volatile boolean isUsing;
focal_class.type: boolean
focal_class.var_name: isUsing
focal_class.file: shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/connection/ConnectionStatus.java
focal_class.identifier: ConnectionStatus
focal_class.class_method_signature: ConnectionStatus.switchToUsing()
focal_class.full_signature: public void switchToUsing()
focal_class.identifier: switchToUsing
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void switchToUsing()
focal_class.class_method_signature: ConnectionStatus.switchToReleased()
focal_class.full_signature: public void switchToReleased()
focal_class.identifier: switchToReleased
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void switchToReleased()
focal_class.class_method_signature: ConnectionStatus.waitUntilConnectionRelease()
focal_class.full_signature: public void waitUntilConnectionRelease()
focal_class.identifier: waitUntilConnectionRelease
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void waitUntilConnectionRelease()
focal_method.body: public void switchToUsing() {
          isUsing = true;
      }
focal_method.class_method_signature: ConnectionStatus.switchToUsing()
focal_method.full_signature: public void switchToUsing()
focal_method.identifier: switchToUsing
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void switchToUsing()