@Before public void setup() throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException { CushyDBUtils.initLoj4J(); Class.forName("com.mysql.jdbc.Driver").newInstance(); String connectionAddress = "jdbc:mysql://localhost:3306/cushydb_test?user=root&password=123456"; databaseConnection = DriverManager.getConnection(connectionAddress); databaseConnection.setAutoCommit(false); cushyDBConnection = new CushyDBConnection(); cushyDBConnection.setJDBCConnection(databaseConnection); TestDBGenerator.createTables(databaseConnection); TestDBGenerator.insertTestData(databaseConnection); }
@After public void clean() throws SQLException { cushyDBConnection.rollbackTransaction(); cushyDBConnection.close(); }