Questions tagged [dbunit]

DbUnit is a JUnit extension targeted at database-driven projects that, among other things, puts your database into a known state between test runs.

DbUnit is a JUnit extension targeted at database-driven projects that, among other things, puts your database into a known state between test runs.

614 questions
0
votes
2 answers

junit.framework.ComparisonFailure: value but value is equal

junit.framework.ComparisonFailure: value (table=XXX, row=XXX, col=XXX) expected:<2013-01-18 18:17:13.233099> but was:<2013-01-18 18:17:13.233099> at…
burtsevyg
  • 3,851
  • 2
  • 29
  • 44
0
votes
2 answers

Create a date, insert it into database, compare, it's different

The goal I've got a really strange problem. My goal is to compare a dynamic date in database using dbunit (the database is an Oracle one). This dynamic date is the today date (comparing static date works...) The experimentation To compare date, I…
Jerome Cance
  • 8,103
  • 12
  • 53
  • 106
0
votes
2 answers

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: …
theomega
  • 31,591
  • 21
  • 89
  • 127
0
votes
1 answer

Spring Controller Integration Testing with DB Unit

I am working on creating Integration test cases for my rest controller. I want to use dbunit to test the database layer. Here is my test class skeleton setup @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes=…
Fahad Rauf
  • 705
  • 2
  • 8
  • 17
0
votes
0 answers

getDataSet Does not bind data to database

I'm having a problem doing some testing using JUnit 4, HSQLDB_2.2.9 and DBUnit_2.4.8. I'm consuming the following input file (input.xml):
Mouhammed Soueidane
  • 1,056
  • 2
  • 24
  • 42
0
votes
1 answer

How to compare Excel files in Java with DBUnit

I need to compare two Excel files to find any kind of content difference. Format/Color/Font differences are not to be considered. I followed the solution found at this post but it's based on the DBUnit XlsDataSet class. This class works on the…
MoZZoZoZZo
  • 233
  • 1
  • 10
0
votes
3 answers

Managing static data

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…
Dónal
  • 185,044
  • 174
  • 569
  • 824
0
votes
1 answer

Is it possible to skip validation column names in dbunit

Is it possible to skip validation of columns in DBUnit? I prefer to use FlatXmlDataSet because it is easier to maintain. But for comparing the result I have to use XmlDataSet which has always all columns behind the table tag. The Assertion method…
0
votes
1 answer

Spring Transactions not rolling back

I have been using spring transactional management in a project dealing with JUnit Testing. I have gotten this to work fine for my JUnit tests but I cannot get it to work outside of that. Here is my basic scenario: I have a class which handles DbUnit…
Matt
  • 177
  • 2
  • 13
0
votes
3 answers

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…
CodingWithSpike
  • 42,906
  • 18
  • 101
  • 138
0
votes
1 answer

DbUnit Assertion floating-point numbers

I'm testing my DAO layer using DbUnit. I'm prefilling database from XML dataset, doing some actions and then asserting against known result. Assertion.assertEquals(expectedDataSet, actualDataSet); Dataset contains column with floating point number.…
Robertas
  • 3
  • 4
0
votes
1 answer

dbunit maven plugin ordered set to true seemingly ignores tables

I am trying to export a portion of my db using the db-unit-maven plugin. I set the ordered flag set to true in my configuration so that I can re-import it avoiding integrity constraint violation. I also specify what tables to export using the…
Luigi
  • 99
  • 5
0
votes
1 answer

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()…
brisssou
  • 499
  • 6
  • 12
0
votes
2 answers

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…
Nik Reiman
  • 39,067
  • 29
  • 104
  • 160
0
votes
2 answers

Using DB unit to load DEMO data

I'm using the Maven DBUnit plugin to load test data for unit tests. I'd also like to use it for loading a different set of data to a different db for demo purposes. The dbunit plugin only allows for a single execution. Should I just create a…
MTR
  • 1,411
  • 4
  • 14
  • 23
1 2 3
40
41