Questions tagged [unitils]

Unitils is an framework that makes unit testing with JUnit and DbUnit smoother and more pleasant. It offers lenient comparison, generation of xsd schemas from database tables, and most important, enhances DbUnit shortcomings.

Unitils is an open source library that makes unit and integration testing with JUnit smoother and more pleasant.

It supports different aspects of testing with different modules:

  • Reflection asserts
  • Mocking
  • Injection
  • IO
  • Database testing support for DbUnit
  • Hibernate support
  • Spring support
  • EasyMock support
54 questions
2
votes
1 answer

H2 database with unitils

I used the extension unitils to initialize my database with one of the data sets. With Mysql, HsqlDB and PostgreSql, I didn't have any problem, but with H2 I foudn problem. Is what somebody already tested H2 with unitils? If so, thank you to provide…
andolsi zied
  • 3,553
  • 2
  • 32
  • 43
2
votes
1 answer

Unitils doesn't work

I have a big problem my…
user812612
  • 379
  • 4
  • 7
  • 15
2
votes
1 answer

Unitils dataset and modified dates

Any ideas how this can be done with Unitils dbunit? Date relative to current in the DBUnit dataset The problem is that the [create_date]-placeholder is not recognized in @Dataset.
mjgirl
  • 1,214
  • 7
  • 24
  • 42
2
votes
1 answer

Unitils/DbUnit: How to test in a multi-database environment?

I'm using Unitils (with DbUnit) for my data access layer unit testing, but the need has arisen to test multiple databases. What's the best way to do it? The databases are different so some DAOs are for one database, another DAOs are for another. I…
machinery
  • 3,793
  • 4
  • 41
  • 52
1
vote
3 answers

Unitils: How can it obtain database properties from Spring

I am using Unitils with Spring for unit testing. I've configured Spring with datasource using a properties file. My question is how can I use the same datasource or the same properties for Unitils? Unitils expects a file in the classpath…
adi
  • 1,711
  • 3
  • 29
  • 50
1
vote
1 answer

Newbie can't run a basic unitils test

I'm trying to run a basic test: import org.junit.Test; import org.unitils.UnitilsJUnit4; public class SampleUnitilsTest extends UnitilsJUnit4 { @Test public void testTest() { assertTrue(true); } } But I am getting the…
Kevin Pauli
  • 8,577
  • 15
  • 49
  • 70
1
vote
0 answers

Why does unitils-dbunit have different records?

I need to access 2 dbs, so I have to use the version 3.4. I defined 2 xml files to stored the test data, and put the @Dateset on class, likes: @Test @DataSets({ @DataSet(value = "testdb1.xml", databaseName="db1"), @DataSet(value =…
lwang
  • 11
  • 2
1
vote
1 answer

How to compare two complex object and ignore both null and empty string?

I need to assert two complex objects which may contains both primitive and n levels of objects within. so i googled and chose a library unitils. But i have condition that i need to consider both the null and empty string as equal.But here it only…
Obuli Sundar
  • 566
  • 7
  • 26
1
vote
1 answer

Problems with testing JdbcDao by DBUnit

I have AuthorJDBCDAO class with basic CRUD methods which extends AbstractJDBCDAO class and implements AuthorDAO interface. I tested all methods via psv main() method and everything was fine. But Now I have to test it's methods using DBUnit. And here…
1
vote
0 answers

java.lang.IllegalStateException: no last call on a mock available

Hi im doing some unit testing using unitils and I always get this Exception java.lang.IllegalStateException: no last call on a mock available at org.easymock.EasyMock.getControlForLastCall(EasyMock.java:175) at…
Secondo
  • 129
  • 1
  • 8
1
vote
1 answer

How execute UTF-8 scripts in unitils / DBunit

I wrote all SQL scripts for tests using UTF-8. All my java code uses UTF-8 charset. When I tried execute the tests, the unitils/DBunit read them as other encoding (maybe ISO 8859-1). My database is ORACLE. I tried set…
1
vote
0 answers

Unitils breaks standard EasyMock behavior?

In a project at work I came across a real annoying bug/feature. I found a sollution however I'm really curious to the why it is happening. It all has to do that the project has some legacy tests written with unitils instead of plain old EasyMock. …
kenny
  • 1,157
  • 1
  • 16
  • 41
1
vote
1 answer

An attempt to place a null value in a non-nullable datatype

I'm using dbunit and unitils trying to get test sensitive dates on my dataset files. public void setUp() { String dataSetFile = "/Dataset.xml"; IDataSet dataSet; try { dataSet = new FlatXmlDataSetBuilder().build(new…
mjgirl
  • 1,214
  • 7
  • 24
  • 42
1
vote
1 answer

UnitilsException: File cannot be found

What can cause this error org.unitils.core.UnitilsException: Error inserting test data from DbUnit dataset for method public void fi.utu.nettiopsu.selenium.student.function.ExamRegistrationTest.examRegistrationTest() at…
mjgirl
  • 1,214
  • 7
  • 24
  • 42
1
vote
1 answer

Unitils with @SpringApplicationContext - The matching wildcard is strict, but no declaration can be found for element 'context:annotation-config'

I have using maven and i have following dependency to my project. org.unitils unitils-spring 3.3 test
Rhum1
  • 13
  • 1
  • 3