test_class.declarator: herdThreadHelper
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private HerdThreadHelper herdThreadHelper;
test_class.type: HerdThreadHelper
test_class.var_name: herdThreadHelper
test_class.file: herd-code/herd-core/src/test/java/org/finra/herd/core/helper/HerdThreadHelperTest.java
test_class.identifier: HerdThreadHelperTest
test_class.superclass: extends AbstractCoreTest
test_case.body: @Test
      public void testExecuteAsync() throws Exception
      {
          // The "token" queue
          final BlockingQueue<String> queue = new LinkedBlockingQueue<>(1);
  
          // Schedule an asynchronous task
          herdThreadHelper.executeAsync(new Runnable()
          {
              public void run()
              {
                  try
                  {
                      Thread.sleep(500);
                      queue.offer("testToken");
                  }
                  catch (InterruptedException e)
                  {
                      throw new RuntimeException(e);
                  }
              }
          });
  
          /*
           * Poll the queue, which blocks this thread.
           * For safety, a short timeout of 1 second is added, so in case of deadlock or other threading nightmares, this test doesn't block the rest of test
           * execution.
           * The token will be null if the timeout is reached, otherwise
           */
          String token = queue.poll(1000, TimeUnit.MILLISECONDS);
  
          Assert.assertNotNull("Expected the async task to have put a token in the queue, but none was found after a timeout. Ensure that the async task "
              + "actually ran and pushed a token into queue.", token);
      }
test_case.class_method_signature: HerdThreadHelperTest.testExecuteAsync()
test_case.full_signature: @Test public void testExecuteAsync()
test_case.identifier: testExecuteAsync
test_case.invocations: executeAsync sleep offer poll assertNotNull
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testExecuteAsync()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(HerdThreadHelper.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(HerdThreadHelper.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.file: herd-code/herd-core/src/main/java/org/finra/herd/core/helper/HerdThreadHelper.java
focal_class.identifier: HerdThreadHelper
focal_class.class_method_signature: HerdThreadHelper.sleep(Long millis)
focal_class.full_signature: public void sleep(Long millis)
focal_class.identifier: sleep
focal_class.modifiers: public
focal_class.parameters: (Long millis)
focal_class.return: void
focal_class.signature: void sleep(Long millis)
focal_class.class_method_signature: HerdThreadHelper.executeAsync(Runnable runnable)
focal_class.full_signature: @Async public void executeAsync(Runnable runnable)
focal_class.identifier: executeAsync
focal_class.modifiers: @Async public
focal_class.parameters: (Runnable runnable)
focal_class.return: void
focal_class.signature: void executeAsync(Runnable runnable)
focal_method.body: @Async
      public void executeAsync(Runnable runnable)
      {
          runnable.run();
      }
focal_method.class_method_signature: HerdThreadHelper.executeAsync(Runnable runnable)
focal_method.full_signature: @Async public void executeAsync(Runnable runnable)
focal_method.identifier: executeAsync
focal_method.invocations: run
focal_method.modifiers: @Async public
focal_method.parameters: (Runnable runnable)
focal_method.return: void
focal_method.signature: void executeAsync(Runnable runnable)