/**
   * Test that we can dynamically change the thread pool size
   *
   * @throws Exception
   */
  public void testDynamicHouseKeepingPoolSizeChange() throws Exception {
    int initialPoolSize = 10;

    getConfigXml()
        .addProperty(
            "virtualhosts.virtualhost.testDynamicHouseKeepingPoolSizeChange.housekeeping.poolSize",
            initialPoolSize);

    // Start the broker now.
    super.createBroker();

    VirtualHost vhost =
        ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost(getName());

    assertEquals(
        "HouseKeeping PoolSize not set correctly.",
        initialPoolSize,
        vhost.getHouseKeepingPoolSize());

    vhost.setHouseKeepingPoolSize(1);

    assertEquals("HouseKeeping PoolSize not correctly change.", 1, vhost.getHouseKeepingPoolSize());
  }