Regarding the console msg i first thoughts this was a dbunit
DatabaseFactory issue. I used the MySqlDataTypeFactory with no success.
org.dbunit.dataset.NoSuchColumnException: weibulldataset.id
at
org.dbunit.operation.AbstractOperation.getOperationMetaData(AbstractOperation.java:71)
at
org.dbunit.operation.AbstractBatchOperation.execute(AbstractBatchOperation.java:129)
at
org.dbunit.operation.CompositeOperation.execute(CompositeOperation.java:67)
at org.dbunit.DatabaseTestCase.executeOperation(DatabaseTestCase.java:87)
at org.dbunit.DatabaseTestCase.setUp(DatabaseTestCase.java:104)
at junit.framework.TestCase.runBare(TestCase.java:125)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)
Any help really appreciate:!
Console:
WARNING - weibulldataset.id data type (1111, ‘int unsigned’) not
recognized and will be ignored. See FAQ for more information.
WARNING - weibulldataset.alpha data type (1111, ‘double unsigned
zerofill unsigned’) not recognized and will be ignored. See FAQ for more
information.
WARNING - weibulldataset.beta data type (1111, ‘double unsigned zerofill
unsigned’) not recognized and will be ignored. See FAQ for more information.
WARNING - weibulldataset.gamma data type (1111, ‘double unsigned
zerofill unsigned’) not recognized and will be ignored. See FAQ for more
information.
config:
Win 2000 pro
junit 3.8.1
dbunit 2.1
mysql 4.0.20a-net-max
jvm 1.4.2
database schema:
#
# weibulldataset
#
CREATE TABLE `weibulldataset` (
`id` int(7) unsigned NOT NULL auto_increment,
`name` varchar(128) NOT NULL default '',
`alpha` double unsigned zerofill NOT NULL default
'0000000000000000000000',
`beta` double unsigned zerofill NOT NULL default
'0000000000000000000000',
`gamma` double unsigned zerofill NOT NULL default
'0000000000000000000000',
PRIMARY KEY (`id`,`name`)
) TYPE=InnoDB COMMENT='Weibull data set storage space';
testcase code:
public class WeibullSampleTest extends DatabaseTestCase {
private WeiBullDataSetService s = WeiBullDataSetService.getInstance();
public WeibullSampleTest(String name){
super(name);
}
/* (non-Javadoc)
* @see org.dbunit.DatabaseTestCase#getConnection()
*/
protected IDatabaseConnection getConnection() throws Exception {
Class driverClass =
Class.forName(Messages.getString("hibernate.connection.driver_class"));
//$NON-NLS-1$
Connection jdbcConnection =
DriverManager.getConnection(Messages.getString("hibernate.connection.url"),
Messages.getString("hibernate.connection.username"),
Messages.getString("hibernate.connection.password")); //$NON-NLS-1$
//$NON-NLS-2$ //$NON-NLS-3$
IDatabaseConnection conn= new DatabaseConnection(jdbcConnection);
DatabaseConfig config = conn.getConfig();
config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new
MySqlDataTypeFactory()); // here i specify MySql
config.setFeature(DatabaseConfig.FEATURE_BATCHED_STATEMENTS, false);
return conn;
}
/* (non-Javadoc)
* @see org.dbunit.DatabaseTestCase#getDataSet()
*/
protected IDataSet getDataSet() throws Exception {
return new FlatXmlDataSet(new
FileInputStream(DbUnitMessages.getString("dbunit.weibull.dataset.ref")));
//$NON-NLS-1$
}
the file used here
FileInputStream(DbUnitMessages.getString("dbunit.weibull.dataset.ref")));
is :
<?xml version='1.0' encoding='UTF-8'?>
<dataset>
<weibulldataset id="1" name="test1" alpha="10.0" beta="12.0"
gamma="14.0"/>
<weibulldataset id="2" name="test2" alpha="20.0" beta="22.0"
gamma="24.0"/>
<weibulldataset id="3" name="test3" alpha="30.0" beta="32.0"
gamma="34.0"/>
</dataset>
#
# weibulldataset
#
CREATE TABLE `weibulldataset` (
`id` bigint(20) NOT NULL auto_increment,
`name` varchar(128) NOT NULL default '',
`alpha` double NOT NULL default '0',
`beta` double NOT NULL default '0',
`gamma` double NOT NULL default '0',
PRIMARY KEY (`id`,`name`)
) TYPE=InnoDB COMMENT='Weibull data Knowledge Base';
cheers