test_class.file: dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/eager/EagerThreadPoolTest.java
test_class.identifier: EagerThreadPoolTest
test_case.body: @Test
      public void getExecutor1() throws Exception {
          URL url = URL.valueOf("dubbo://10.20.130.230:20880/context/path?" +
                  THREAD_NAME_KEY + "=demo&" +
                  CORE_THREADS_KEY + "=1&" +
                  THREADS_KEY + "=2&" +
                  ALIVE_KEY + "=1000&" +
                  QUEUES_KEY + "=0");
          ThreadPool threadPool = new EagerThreadPool();
          ThreadPoolExecutor executor = (ThreadPoolExecutor) threadPool.getExecutor(url);
          assertThat(executor, instanceOf(EagerThreadPoolExecutor.class));
          assertThat(executor.getCorePoolSize(), is(1));
          assertThat(executor.getMaximumPoolSize(), is(2));
          assertThat(executor.getKeepAliveTime(TimeUnit.MILLISECONDS), is(1000L));
          assertThat(executor.getQueue().remainingCapacity(), is(1));
          assertThat(executor.getQueue(), Matchers.<BlockingQueue<Runnable>>instanceOf(TaskQueue.class));
          assertThat(executor.getRejectedExecutionHandler(),
                  Matchers.<RejectedExecutionHandler>instanceOf(AbortPolicyWithReport.class));
  
          final CountDownLatch latch = new CountDownLatch(1);
          executor.execute(new Runnable() {
              @Override
              public void run() {
                  Thread thread = Thread.currentThread();
                  assertThat(thread, instanceOf(InternalThread.class));
                  assertThat(thread.getName(), startsWith("demo"));
                  latch.countDown();
              }
          });
  
          latch.await();
          assertThat(latch.getCount(), is(0L));
      }
test_case.class_method_signature: EagerThreadPoolTest.getExecutor1()
test_case.full_signature: @Test public void getExecutor1()
test_case.identifier: getExecutor1
test_case.invocations: valueOf getExecutor assertThat instanceOf assertThat getCorePoolSize is assertThat getMaximumPoolSize is assertThat getKeepAliveTime is assertThat remainingCapacity getQueue is assertThat getQueue instanceOf assertThat getRejectedExecutionHandler instanceOf execute currentThread assertThat instanceOf assertThat getName startsWith countDown await assertThat getCount is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void getExecutor1()
focal_class.file: dubbo-common/src/main/java/org/apache/dubbo/common/threadpool/support/eager/EagerThreadPool.java
focal_class.identifier: EagerThreadPool
focal_class.interfaces: implements ThreadPool
focal_class.class_method_signature: EagerThreadPool.getExecutor(URL url)
focal_class.full_signature: @Override public Executor getExecutor(URL url)
focal_class.identifier: getExecutor
focal_class.modifiers: @Override public
focal_class.parameters: (URL url)
focal_class.return: Executor
focal_class.signature: Executor getExecutor(URL url)
focal_method.body: @Override
      public Executor getExecutor(URL url) {
          String name = url.getParameter(THREAD_NAME_KEY, DEFAULT_THREAD_NAME);
          int cores = url.getParameter(CORE_THREADS_KEY, DEFAULT_CORE_THREADS);
          int threads = url.getParameter(THREADS_KEY, Integer.MAX_VALUE);
          int queues = url.getParameter(QUEUES_KEY, DEFAULT_QUEUES);
          int alive = url.getParameter(ALIVE_KEY, DEFAULT_ALIVE);
  
          // init queue and executor
          TaskQueue<Runnable> taskQueue = new TaskQueue<Runnable>(queues <= 0 ? 1 : queues);
          EagerThreadPoolExecutor executor = new EagerThreadPoolExecutor(cores,
                  threads,
                  alive,
                  TimeUnit.MILLISECONDS,
                  taskQueue,
                  new NamedInternalThreadFactory(name, true),
                  new AbortPolicyWithReport(name, url));
          taskQueue.setExecutor(executor);
          return executor;
      }
focal_method.class_method_signature: EagerThreadPool.getExecutor(URL url)
focal_method.full_signature: @Override public Executor getExecutor(URL url)
focal_method.identifier: getExecutor
focal_method.invocations: getParameter getParameter getParameter getParameter getParameter setExecutor
focal_method.modifiers: @Override public
focal_method.parameters: (URL url)
focal_method.return: Executor
focal_method.signature: Executor getExecutor(URL url)