/**
   * Test that we can retrieve a database configuration and that it clones its configuration
   * appropriately.
   */
  @Test
  public void testConfig() throws Throwable {

    try {
      EnvironmentConfig envConfig = TestUtils.initEnvConfig();
      envConfig.setAllowCreate(true);
      env = create(envHome, envConfig);

      /*
       * Make sure that the database keeps its own copy of the
       * configuration object.
       */
      DatabaseConfig dbConfigA = new DatabaseConfig();
      dbConfigA.setAllowCreate(true);
      Database dbA = env.openDatabase(null, "foo", dbConfigA);

      /* Change the original dbConfig */
      dbConfigA.setAllowCreate(false);
      DatabaseConfig getConfig1 = dbA.getConfig();
      assertEquals(true, getConfig1.getAllowCreate());
      assertEquals(false, getConfig1.getSortedDuplicates());

      /*
       * Change the retrieved config, ought to have no effect on what the
       * Database is storing.
       */
      getConfig1.setSortedDuplicates(true);
      DatabaseConfig getConfig2 = dbA.getConfig();
      assertEquals(false, getConfig2.getSortedDuplicates());

      dbA.close();
      close(env);
    } catch (Throwable t) {
      t.printStackTrace();
      throw t;
    }
  }