-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
513 additions
and
486 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 46 additions & 40 deletions
86
core/src/main/java/com/github/dbunit/rules/api/dataset/DataSetExecutor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,46 @@ | ||
package com.github.dbunit.rules.api.dataset; | ||
|
||
import com.github.dbunit.rules.api.connection.ConnectionHolder; | ||
import org.dbunit.DatabaseUnitException; | ||
import org.dbunit.dataset.DataSetException; | ||
import org.dbunit.dataset.IDataSet; | ||
|
||
import java.io.IOException; | ||
import java.sql.SQLException; | ||
|
||
/** | ||
* Created by pestano on 01/08/15. | ||
*/ | ||
public interface DataSetExecutor{ | ||
|
||
/** | ||
* creates a dataset into executor's database connection using given dataSetModel | ||
* @param dataSetModel | ||
*/ | ||
void createDataSet(DataSetModel dataSetModel); | ||
|
||
IDataSet loadDataSet(String name) throws DataSetException, IOException; | ||
|
||
ConnectionHolder getConnectionHolder(); | ||
|
||
void clearDatabase(DataSetModel dataset) throws SQLException; | ||
|
||
void executeStatements(String[] statements); | ||
|
||
void executeScript(String scriptPath); | ||
|
||
String getId(); | ||
|
||
/** | ||
* compares dataset from executor's databse connection with a given dataset | ||
* @param expected | ||
* @throws DatabaseUnitException if current dataset is not equal current dataset | ||
*/ | ||
void compareCurrentDataSetWith(DataSetModel expected, String[] ignoreCols) throws DatabaseUnitException; | ||
} | ||
package com.github.dbunit.rules.api.dataset; | ||
|
||
import com.github.dbunit.rules.api.connection.ConnectionHolder; | ||
import org.dbunit.DatabaseUnitException; | ||
import org.dbunit.dataset.DataSetException; | ||
import org.dbunit.dataset.IDataSet; | ||
|
||
import java.io.IOException; | ||
import java.sql.SQLException; | ||
|
||
/** | ||
* Created by pestano on 01/08/15. | ||
*/ | ||
public interface DataSetExecutor{ | ||
|
||
/** | ||
* creates a dataset into executor's database connection using given dataSetModel | ||
* @param dataSetModel | ||
*/ | ||
void createDataSet(DataSetModel dataSetModel); | ||
|
||
IDataSet loadDataSet(String name) throws DataSetException, IOException; | ||
|
||
ConnectionHolder getConnectionHolder(); | ||
|
||
void clearDatabase(DataSetModel dataset) throws SQLException; | ||
|
||
void executeStatements(String[] statements); | ||
|
||
void executeScript(String scriptPath); | ||
|
||
String getId(); | ||
|
||
/** | ||
* compares dataset from executor's databse connection with a given dataset | ||
* @param expected | ||
* @throws DatabaseUnitException if current dataset is not equal current dataset | ||
*/ | ||
void compareCurrentDataSetWith(DataSetModel expected, String[] ignoreCols) throws DatabaseUnitException; | ||
|
||
|
||
/** | ||
* @param cacheConnection if true database connection will be reused among multiple executions of same executor. | ||
*/ | ||
DataSetExecutor cacheConnection(boolean cacheConnection); | ||
} |
Oops, something went wrong.