@Test
public void testNewSingleThreadExecutor() throws InterruptedException {

  String reason = "(can be ignored in Tests)NewSingleThreadExecutor";
  Thread.UncaughtExceptionHandler handler = new TestExceptionHandler(reason);
  int threadCount = 2;
  latch = new CountDownLatch(threadCount);
  ExecutorService exec = IoTDBThreadPoolFactory.newSingleThreadExecutor(POOL_NAME, handler);
  for (int i = 0; i < threadCount; i++) {
    Runnable task = new TestThread(reason);
    exec.execute(task);
  }
  try {
    latch.await();
    assertEquals(count.get(), threadCount);
  } catch (InterruptedException E) {
    fail();
  }
}