@@ -0,0 +1,1870 @@
+package Test;%0A%0Aimport java.io.FileInputStream;%0Aimport java.sql.Connection;%0Aimport java.sql.DriverManager;%0A%0Aimport org.dbunit.database.DatabaseConnection;%0Aimport org.dbunit.database.IDatabaseConnection;%0Aimport org.dbunit.dataset.IDataSet;%0Aimport org.dbunit.dataset.xml.FlatXmlDataSetBuilder;%0Aimport org.dbunit.operation.DatabaseOperation;%0A%0Aimport Database.DatabaseManager;%0A%0Apublic class TestHelper %7B%0A%09public static Connection getJDBCConnection() throws Exception %7B%0A//%09%09Class.forName(%22com.mysql.jdbc.Driver%22).newInstance();%0A//        Connection jdbcConnection = DriverManager.getConnection(%0A//                %22jdbc:mysql://localhost:3306/fixcache%22, %22root%22, %22jacjac%22);     %0A//%09%09return jdbcConnection;%0A%09%09DatabaseManager dbManager = DatabaseManager.getInstance();%0A%09%09Connection conn = dbManager.getConnection();%0A%09%09return conn;%0A%09%7D%0A%0A%09public static IDatabaseConnection getDBUnitConnection() throws Exception %7B%0A%09%09return new DatabaseConnection(getJDBCConnection());%0A%09%7D%0A%0A%09public static IDataSet getDataSet() throws Exception %7B%0A%09%09return new FlatXmlDataSetBuilder().build(new FileInputStream(%22fixcache.xml%22));%0A%09%7D%0A    %0A    protected DatabaseOperation getSetUpOperation() throws Exception%0A    %7B%0A        return DatabaseOperation.REFRESH;%0A    %7D%0A%0A    protected DatabaseOperation getTearDownOperation() throws Exception%0A    %7B%0A        return DatabaseOperation.NONE;%0A    %7D%0A%09%0A%09public static void handleSetUpOperation() throws Exception %7B%0A%09%09final IDatabaseConnection conn = getDBUnitConnection();%0A%09%09final IDataSet data = getDataSet();%0A%09%09try %7B%0A%09%09%09DatabaseOperation.CLEAN_INSERT.execute(conn, data);%0A%09%09%7D finally %7B%0A//%09%09%09conn.close();%0A%09%09%7D%0A%09%7D%0A%09%0A%09public static void cleanDatabase() throws Exception %7B%0A%09%09final IDatabaseConnection conn = getDBUnitConnection();%0A%09%09final IDataSet data = getDataSet();%0A%09%09try %7B%0A%09%09%09DatabaseOperation.DELETE_ALL.execute(conn, data);%0A%09%09%7D finally %7B%0A%09%09%09conn.close();%0A%09%09%7D%0A%09%09%0A%09%7D%0A%7D

add TestHelper.java