Questions tagged [spring-test-dbunit]

Spring DBUnit provides integration between the Spring testing framework and the popular DBUnit project.

Spring DBUnit provides integration between the Spring testing framework and the popular DBUnit project. It allows you to setup and teardown database tables using simple annotations as well as checking expected table contents once a test completes.

91 questions
0
votes
1 answer

org.postgresql.util.PSQLException: ERROR: syntax error at or near "user"

xml above gives me error. The problem is i have reserved word for user. how can I solve this. any links? updated I am using spring boot, spring data…
roki
  • 348
  • 3
  • 15
0
votes
1 answer

DBunit data is not visible in Oracle

In my project we are using xml files to insert data into Database(oracle).But, I am not getting where this data is inserted in DB.I am seeing insert statements while executing query. But data is not visible in DB. While retrieving, the data is…
0
votes
1 answer

Why am I receiving DbUnit ComparsionFailure Exception?

I am stuck with update test for my DAO. Update method works just fine, but at the end I get an exception: junit.framework.ComparisonFailure: value (table=theme, row=0, col=Id) expected:<[1]> but was:<[97]> Here is my…
Alexander Tolkachev
  • 227
  • 1
  • 4
  • 15
0
votes
1 answer

Constraint identification with DBUnit / Constraint names

When some database constraint fails during the run of dbunit tests, its name is printed out with the exception, e.g. Caused by: org.hsqldb.HsqlException: integrity constraint violation: foreign key no parent; FK_AJRY4L84JDA0RY0XHP3A71CQ9 table:…
Ewgenij Sokolovski
  • 897
  • 1
  • 12
  • 31
0
votes
1 answer

Writing DB Unit Tests with Spring : java.lang.IllegalStateException: Failed to load ApplicationContext

I have been really stuck at trying to get Spring DBUnit test to work for testing my dao functionality. However, after so many attempts now I am stuck at this weird saying unable to load application context : Dao which I want to test: public…
OneMoreError
  • 7,518
  • 20
  • 73
  • 112
0
votes
2 answers

spring+hibernate clear database after tests

I am trying to test adding Entity classes into database. But currently I can do it only once((( The second time I launch test, it fails((( Also I noticed that data is not cleared after test finished((( So next test just crashes because previuos data…
ovod
  • 1,118
  • 4
  • 18
  • 33
0
votes
1 answer

DBUnit NoSuchColumnException in parent class

So I'm getting this error: org.dbunit.dataset.NoSuchColumnException: TOYOTA.CAR_MAKE - (Non-uppercase input column: CRTE_DT_TM) in ColumnNameToIndexes cache map. Note that the map's column names are NOT case sensitive. when trying to populate a H2…
CodeClimber
  • 4,584
  • 8
  • 46
  • 55
0
votes
1 answer

Are JPA annotations required when using Spring test DBUnit @DatabaseSetup annotation?

I am playing with Spring test dbunit library, I have a question about datasets. I have a POJO representing an entity I want to persist into in-memory database in my tests. This POJO is not annotated by any JPA annotations like @Entity, @Table or…
bbelovic
  • 61
  • 4
0
votes
3 answers

Spring / DbUnit closes connection after one test

So, we need to write integration tests for our Java-configurated Spring Application (3.2.3) with an Oracle data base. There's a separate schema which gets populated by Spring-test-DbUnit and the first test runs without any problems. All the other…
actc
  • 672
  • 1
  • 9
  • 23
0
votes
1 answer

org.dbunit.dataset.NoSuchTableException: While loading dataset to view

I'm looking forward to integrate dbUnit to a project. The project has Spring and has no ORM. While loading the XML dataSet to the db i'm getting org.dbunit.dataset.NoSuchTableException: XXX_VW "XXX_VW" is a db view. However, I'm able to load the…
0
votes
1 answer

Commiting transaction within test with Spring test

I am testing my repository for update operation @Test public void updateStatusByEmailWithEmailCustomer() { customerQuickRegisterRepository.save(standardEmailCustomer()); …
0
votes
1 answer

DBunit NoSuchTableException

I'm trying to include dbunit and spring dbunit to my project for testing. I have 2 folders: "src/test/java/dao" and "src/test/resources/dao". In resources dao
stacy
  • 11
  • 1
  • 10
0
votes
1 answer

JUnit, DBUnit with HSQLDB for JUnit test cases. How to create tables ? before any test starts..No Hibernate or other ORM I am using

I am using DBUnit with HSQLDB for JUnit test cases. I am not able to create tables using @DatabaseSetup.. How to create table when a test case starts using DBUnit + HSQL without ORM provider
0
votes
1 answer

spring-mvc-test auto rollback transactions configured with AOP xml on Service layer

I have the following Spring MVC app stack: Controller -> Service -> DAO (Repository) -> Entity -> MySql InnoDB Transactions are configured to start from the Service layer using AOP xml config, and the app works perfectly:
0
votes
1 answer

Issues with MySQL increment column and DBunit datasets

I'm trying to write an integration test with dbUnit for a table in MySQL that has a column with autoincrement. The integration test looks like: @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes={ …