package dynamo.tests;

import java.nio.file.Paths;
import java.sql.Connection;
import java.util.ResourceBundle;

import org.junit.BeforeClass;

import dynamo.core.manager.ConfigurationManager;
import dynamo.core.manager.DAOManager;
import dynamo.core.manager.ErrorManager;
import dynamo.manager.LocalImageCache;
import liquibase.Liquibase;
import liquibase.database.DatabaseConnection;
import liquibase.database.jvm.JdbcConnection;
import liquibase.resource.ClassLoaderResourceAccessor;

public abstract class AbstractDynamoTest {
	
	protected static ResourceBundle privateData = ResourceBundle.getBundle("private-data-do-not-commit");

	@BeforeClass
	public static void init() {
		try (Connection conn = DAOManager.getInstance().getDatasource("dynamo").getConnection()) {
			DatabaseConnection connection = new JdbcConnection( conn );
			Liquibase liquibase = new Liquibase("databases/dynamo.xml", new ClassLoaderResourceAccessor( AbstractDynamoTest.class.getClassLoader()), connection );
			liquibase.update( "" );
		} catch (Exception e) {
			ErrorManager.getInstance().reportThrowable( e );
		}		
		ConfigurationManager.mockConfiguration("test", "test");
		LocalImageCache.getInstance().setCacheTempFolder(Paths.get("temp"));
	}

}

@@ -68,24 +68,67 @@
 Connection;%0A
+import java.util.MissingResourceException;%0A
 import java.
@@ -148,16 +148,16 @@
 Bundle;%0A
-
 %0Aimport 
@@ -617,67 +617,11 @@
 Data
- = ResourceBundle.getBundle(%22private-data-do-not-commit%22)
 ;%0A
+%09
 %0A%09@B
@@ -1078,18 +1078,194 @@
 e );%0A%09%09%7D
-%09%09
+%0A%09%09try %7B%0A%09%09%09privateData = ResourceBundle.getBundle(%22private-data-do-not-commit%22);%0A%09%09%7D catch (MissingResourceException e) %7B%0A%09%09%09ErrorManager.getInstance().reportThrowable( e );%0A%09%09%7D
 %0A%09%09Confi

Fix regression