@Test
  public void testThreadPoolEnabledPropertyProviderDefaults() throws Exception {
    final int SMALLEST_COMPLETION_SERIVCE_TIMEOUT_MS = 1000;
    final int LARGEST_COMPLETION_SERIVCE_TIMEOUT_MS = 5000;

    int processorCount = Runtime.getRuntime().availableProcessors();
    final Properties ambariProperties = new Properties();
    final Configuration configuration = new Configuration(ambariProperties);

    long completionServiceTimeout = configuration.getPropertyProvidersCompletionServiceTimeout();
    int corePoolSize = configuration.getPropertyProvidersThreadPoolCoreSize();
    int maxPoolSize = configuration.getPropertyProvidersThreadPoolMaxSize();
    int workerQueueSize = configuration.getPropertyProvidersWorkerQueueSize();

    // test defaults
    Assert.assertEquals(5000, completionServiceTimeout);
    Assert.assertEquals(Configuration.PROCESSOR_BASED_THREADPOOL_CORE_SIZE_DEFAULT, corePoolSize);
    Assert.assertEquals(Configuration.PROCESSOR_BASED_THREADPOOL_MAX_SIZE_DEFAULT, maxPoolSize);
    Assert.assertEquals(Integer.MAX_VALUE, workerQueueSize);

    // now let's test to make sure these all make sense
    Assert.assertTrue(completionServiceTimeout >= SMALLEST_COMPLETION_SERIVCE_TIMEOUT_MS);
    Assert.assertTrue(completionServiceTimeout <= LARGEST_COMPLETION_SERIVCE_TIMEOUT_MS);
    Assert.assertTrue(corePoolSize <= maxPoolSize);
    Assert.assertTrue(corePoolSize > 2 && corePoolSize <= 128);
    Assert.assertTrue(maxPoolSize > 2 && maxPoolSize <= processorCount * 4);
    Assert.assertTrue(workerQueueSize > processorCount * 10);
  }
Tests the default values for the {@link ThreadPoolEnabledPropertyProvider}.

@throws Exception
ambari-server/src/test/java/org/apache/ambari/server/configuration/ConfigurationTest.java