I read some of the documentation of DbUnit and i can not understand why i must set the current data base url "jdbc:mysql://127.0.0.1/hr", "hr", "hr"); and after that i set up a "fake" data base in hr-seed.xml. I know that dbunit uses for data base only the xml file but for what is the setup connection to the real data base.
protected IDatabaseConnection getConnection()
throws Exception {
Class driverClass =
Class.forName("org.gjt.mm.mysql.Driver");
Connection jdbcConnection =
DriverManager.getConnection(
"jdbc:mysql://127.0.0.1/hr", "hr", "hr");
return new DatabaseConnection(jdbcConnection);
}
protected IDataSet getDataSet() throws Exception {
return new FlatXmlDataSet(
new FileInputStream("hr-seed.xml"));
}
<?xml version='1.0' encoding='UTF-8'?>
<dataset>
<EMPLOYEE employee_uid='1'
start_date='2001-01-01'
first_name='Drew' ssn='333-29-9999'
last_name='Smith' />
<EMPLOYEE employee_uid='2'
start_date='2002-04-04'
first_name='Nick' ssn='222-90-1111'
last_name='Marquiss' />
<EMPLOYEE employee_uid='3'
start_date='2003-06-03'
first_name='Jose' ssn='111-67-2222'
last_name='Whitson' />
</dataset>