@Test public void testEnvRecovery() { Logger logger = LoggerUtils.getLoggerFixedPrefix(this.getClass(), "test"); try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream p = new PrintStream(baos); EnvironmentConfig envConfig = TestUtils.initEnvConfig(); envConfig.setAllowCreate(true); envConfig.setConfigParam("je.env.startupThreshold", "0"); env = new Environment(envHome, envConfig); env.printStartupInfo(p); DatabaseConfig dbConfig = new DatabaseConfig(); dbConfig.setAllowCreate(true); Database db = env.openDatabase(null, "foo", dbConfig); DatabaseEntry key = new DatabaseEntry(new byte[1000]); DatabaseEntry data = new DatabaseEntry(new byte[1000]); for (int i = 0; i < 10; i += 1) { db.put(null, key, data); } db.close(); env.close(); env = new Environment(envHome, envConfig); env.printStartupInfo(p); logger.fine(baos.toString()); env.close(); env = null; } catch (Exception e) { fail( "This test succeeds as long as the printing of the report " + "does not cause a problem. Any exception is a failure. "); } }