{
File nonExistentStoreLocation = new File(TMP_FOLDER, getName());
deleteDirectoryIfExists(nonExistentStoreLocation);
nonExistentStoreLocation.mkdir();
Environment emptyEnvironment = createEnvironment(nonExistentStoreLocation);
try
{
_upgrader = new Upgrader(emptyEnvironment, getVirtualHostName());
_upgrader.upgradeIfNecessary();
List<String> databaseNames = emptyEnvironment.getDatabaseNames();
List<String> expectedDatabases = new ArrayList<String>();
expectedDatabases.add(Upgrader.VERSION_DB_NAME);
assertEquals("Expectedonly VERSION table in initially empty store after upgrade: ", expectedDatabases, databaseNames);
assertEquals("Unexpected store version", BDBMessageStore.VERSION, getStoreVersion(emptyEnvironment));
}
finally
{
emptyEnvironment.close();
nonExistentStoreLocation.delete();
}
}