sebastianbergmann / dbunit

DbUnit port for PHP/PHPUnit.
https://phpunit.de/
Other
225 stars 186 forks source link

Misleading error message NoSuchTableException when column name is "PRIMARY" #134

Closed Spencerooni closed 10 years ago

Spencerooni commented 10 years ago

In a java class with hibernate annotations I have one annotation like so:

@Column(name = "PRIMARY") private Boolean isPrimary;

When a unit test using this class is initializing I receive an error:

org.dbunit.dataset.NoSuchTableException: CAPD.PARTY_PHONE_CONTACT at org.dbunit.database.DatabaseDataSet.getTableMetaData(DatabaseDataSet.java:288) at org.dbunit.operation.DeleteAllOperation.execute(DeleteAllOperation.java:109) at org.dbunit.operation.CompositeOperation.execute(CompositeOperation.java:79) at com.github.springtestdbunit.DbUnitRunner.setupOrTeardown(DbUnitRunner.java:146) at com.github.springtestdbunit.DbUnitRunner.afterTestMethod(DbUnitRunner.java:70) at com.github.springtestdbunit.DbUnitTestExecutionListener.afterTestMethod(DbUnitTestExecutionListener.java:158)

The error message is misleading. I eventually tracked it down to the column name. Changing the annotation name to something other than "PRIMARY" worked fine so I assume it is a keyword.

mlively commented 10 years ago

This is a PHP port of dbunit. You probably want to open this with the main dbunit project: http://sourceforge.net/p/dbunit/bugs/