dbunit

Weird DB2 issue with DBUnit

I am having a strange DB2 issue when I run DBUnit tests. My DBUnit tests are highly customized, but I don't think it is the issue. When I run the tests, I get a failure SQLCODE: -1084, SQLSTATE: 57019, which translates to "SQL1084C Shared memory segments cannot be allocated." It sounds like a weird memory issue, though here's the big ...

DBUnit dataset generation

I am looking for a simple tool to generate a DBUnit dataset from existing data in a database. Namely I need to be able to construct a query of a limited amount of that data, and just use these results for the dataset. Eclipse has a tool, but as far as I can tell, it only lets you pull all data out of a given table, but that is much too...

DBUnit Data Export

Hi, Does anyone know if dbunit has the power to export specific data from multiple tables at once based on a sql statement, as can be done by using dbunit's QueryDataSet class to export data from a single table based on a sql statement, as can been seen here. James ...

Converting between oracle.sql.TIMESTAMPTZ and standard JDBC classes for DbUnit

I'm running Oracle 10g and have columns with Type_Name TIMESTAMP(6) WITH TIME ZONE When inflated into java classes they come out as oracle.sql.TIMESTAMPTZ But DbUnit can't handle converting Oracle specific classes to Strings for writing to XML. I'm wondering if there's any easy way for me to convert (say, in my SELECT statement so...

NoSuchTableException being thrown from dbunit test cases

I'm trying to fix the test suite on an project which I've inherited from another programmer for some java database code. The project itself is using hibernate and MySQL for the DB stuff, but for the purposes of the test cases dbunit is being used. I can correctly load and initialize hibernate's session factory, but I keep getting excep...

SQL query throws "not in aggregate function or group by clause" exception

I'm working on repairing the test suite for a project of ours, which is being tested through Hibernate/DBUnit. There are several test cases which all throw a similar exception from Hibernate, which looks something like this: java.sql.SQLException: Not in aggregate function or group by clause: org.hsqldb.Expression@109062e in statement ...

DbUnit for C++?

We're developing in C++ under Linux and about to set up automated tests. We intend to use a testing framework like CppUnit oder CxxTest. We're using Ant to build the software and we will also use it to run the tests. As some tests are going to involve database access, we are looking for a tool or framework which facilitates the tasks of...

How do I get dbunit to play nice with MySQL enum data types?

I'm trying to use dbunit to test some our database access code and I'm running into a problem. We are using MySQL 5 something or other as the database itself. I exported a small set of data to a FlatXmlDataSet and when I setup the test case, it throws an exception which says "Data truncated for column 'FHEIGHT_FLAG' at row 1". The colu...

DBUnit - Creating parital datasets of dependent tables

Hi, Is there a way to create a partial dataset of the dependent tables in DBUnit? For example I need to create a dataset of the primary table as well as the dependent tables each with say, 25 rows (As the data in the tables is huge). Thanks, R ...

Dbunit ant task export: Exclude tables

Is it possible to say dbunit export all tables except the list (I'm using ant for the purpose)? ...

DBUnit: Did not find column 'MYCOL' for <schema.table> 'MYSCHEMA .MYTABLE' in catalog 'MYDB' because names do not exactly match.

I am having trouble creating an export of my database using an org.dbunit.database.QueryDataSet. When I call org.dbunit.dataset.xml.FlatXmlDataSet.write(IDataSet, OutputStream), I get the following stack trace: java.lang.IllegalStateException: Did not find column 'MYCOL' for <schema.table> 'MYSCHEMA .MYTABLE' in catalog 'MYDB' because...

Why are my DBUnit tests consuming so much memory?

I've got a hibernate-based application which uses DBUnit for unit testing. We have an XML test database, which gets loaded up with dummy data in the setUp() of each test and deleted during the tearDown(). The problem is that I can no longer run the entire suite in an IDE (in this case, Intellij), because after about 300 tests, the heap...

DBUnit: How to refresh only on failure ?

I am using DBUnit to test a Spring/Hibernate persistence. I created an abstract test: public abstract class AbstractTestCase extends AbstractTransactionalDataSourceSpringContextTests { @Override protected String[] getConfigLocations() { return new String[] { "classpath:/applicationContext.xml", "classpath:/testDataSource...

DbUnit how to guard against multiple tests running at the same time?

I am working on a test environment for a project, and am looking into using DbUnit.NET to do a lot of the database interaction testing. I do have one very big question though: We are running against Oracle, and setting up a seperate test DB instance for every developer really isn't feasible (especially since we only have 1 DBA who is al...

Netbeans 6.7 and DBUnit Configuration

How do I configure Netbeans 6.7 to use DBUnit? Everything works fine for junit but I can't get DBUnit it work. I placed the dbunit.jar file on my local drive and referenced it in Netbeans under Tools > Libraries and added it in the classpath and the import still will not resolve. ...

dbUnit data types

I'm using dBUnit and am trying to assert a row of my pre-defined FlatXmlDataSet with the actual DB dataset. The problem is the getValue for my Verification Code field returns a string when that data originates from the FlatXmlDataSet and as an Integer when its from the actual live database. This is true with any data type that isn't a St...

Managing static data

Hi, I'm looking for a Java (or Groovy) solution for managing static data i.e. data in infrequently changing tables such as a list of countries. I would like to keep the list of countries in a text file and have the tables automatically updated when the server starts. I can't simply delete all the tables, then re-insert the data in the ...

DBUnit and SQL Server getting a socket closed

I keep getting this exception with DBUnit in the same place: org.dbunit.dataset.DataSetException: com.microsoft.sqlserver.jdbc.SQLServerException: Socket closed at org.dbunit.database.DatabaseTableMetaData.getColumns(DatabaseTableMetaData.java:359) etc. Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Socket closed at co...

Changing Database schemas & unit tests

Hello all,      Before we start I know a fair few people consider tests that hit the database not "unit tests". Maybe "integration tests" would be a better name. Either way developer tests that hit the database.      To enable unit-testing I have a developer local database which I clear and the populate with a know set of data at the st...

Java: DBunitils + Spring: Different Hibernate-Dialect

I currently use spring for depency injection. Hibernate uses a postgres dialect for the normal run, but I want to use HSQL for the DBUnitils Databank-Testing. My Spring-Configuration contains this: <!-- Hibernate session factory --> <bean id="sessionFactory" class="org.springfram...