예제 #1
0
  @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);
  }
예제 #2
0
 @After
 public void clean() throws SQLException {
   cushyDBConnection.rollbackTransaction();
   cushyDBConnection.close();
 }