@Test
  public void testRunDatabaseConsistencyCheck() throws Exception {
    EasyMockSupport easyMockSupport = new EasyMockSupport();

    final AmbariMetaInfo mockAmbariMetainfo = easyMockSupport.createNiceMock(AmbariMetaInfo.class);
    final DBAccessor mockDBDbAccessor = easyMockSupport.createNiceMock(DBAccessor.class);
    final Connection mockConnection = easyMockSupport.createNiceMock(Connection.class);
    final Statement mockStatement = easyMockSupport.createNiceMock(Statement.class);
    final OsFamily mockOSFamily = easyMockSupport.createNiceMock(OsFamily.class);
    final EntityManager mockEntityManager = easyMockSupport.createNiceMock(EntityManager.class);
    final Clusters mockClusters = easyMockSupport.createNiceMock(Clusters.class);

    AmbariServer ambariServer = new AmbariServer();


    final Configuration mockConfiguration = partialMockBuilder(Configuration.class).withConstructor()
        .addMockedMethod("getDatabaseType").createMock();
    final TypedQuery mockQuery = easyMockSupport.createNiceMock(TypedQuery.class);

    expect(mockConfiguration.getDatabaseType()).andReturn(null).anyTimes();
    expect(mockEntityManager.createNamedQuery(anyString(),anyObject(Class.class))).andReturn(mockQuery);
    expect(mockQuery.getResultList()).andReturn(new ArrayList());

    replay(mockConfiguration);

    final Injector mockInjector = createMockInjector(mockAmbariMetainfo,
        mockDBDbAccessor, mockOSFamily, mockEntityManager, mockClusters, mockConfiguration);

    expect(mockDBDbAccessor.getConnection()).andReturn(mockConnection).atLeastOnce();
    expect(mockConnection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE)).andReturn(mockStatement).atLeastOnce();
    expect(mockStatement.executeQuery(anyString())).andReturn(null).atLeastOnce();

    DatabaseConsistencyCheckHelper.setInjector(mockInjector);

    easyMockSupport.replayAll();

    mockAmbariMetainfo.init();

    ambariServer.runDatabaseConsistencyCheck();

    easyMockSupport.verifyAll();
  }
Tests that Jetty pools are configured with the correct number of
Acceptor/Selector threads.

@throws Exception
ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariServerTest.java