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
1
vote
2 answers

Unitils dataset - insert into sybase datetime column

I have a unitils dataset attempting to enter data into a sybase datetime column, but it errors when I try and run the unit tests. I cannot find anything online about inserting dates, so I tried declaring it as a String in the same way as the other…
m0rv4i
  • 425
  • 2
  • 8
  • 20
1
vote
2 answers

unit testing with unitils, dbunit and spring

I'm new to unitils(built in dbunit) and spring. At the new place I'm working I can see that some of the testing is with spring and others using unitils/dbunit without spring. There is a push to use spring so I've been trying to merge the following…
sapatos
  • 1,292
  • 3
  • 21
  • 44
1
vote
1 answer

Change TestListener for Unitils DbUnitModule

I am attempting to use Unitils to assist me in Database testing. I would like to use the Unitils/DBMaintain functionality for disabling constraints. However there is a few problems with this. I do not wish to use DBMaintain to create my databases…
Matt
  • 177
  • 2
  • 13
1
vote
1 answer

How to assert no other methods are invoked on a Unitils Mock

I am aware of MockUnitils.assertNoMoreInvocations();, but how to achieve a similar effect only for one Mock object? I am doing kind-of black box testing on some methods. I know a list of methods they may call on the mocks, but what I have to make…
billc.cn
  • 7,187
  • 3
  • 39
  • 79
0
votes
1 answer

Unitils - Dbunit ExpectedDataSet fail / blocked

I'm creating a web application with Spring 3.1.0.RELEASE and JPA 2 with Hibernate Provider. I'm doing the test with junit 4.10 , dbunit 2.4.8, unitils 3.3, hsqldb 2.2.8. I try to test the service layer, a create operation. In my DAO i have this…
La Chamelle
  • 2,927
  • 4
  • 36
  • 54
0
votes
1 answer

Configuring Unitils properties dynamically

I am testing EJB 3.1. I have a situation where I need to start a transaction manually in my test, perform some CRUD operations within it (to create some test data which is still not committed) and then call a method in my bean to which the…
Bala
  • 1,193
  • 2
  • 12
  • 34
0
votes
2 answers

Unitils @InjectInto - How is it processed?

Could anyone please share with me how Unitils @InjectInto or @InjectIntoByType annotations are being processed? I have checked UnitilsJUnit4.class, which is required for processing this annotation. That in turn needs…
Bala
  • 1,193
  • 2
  • 12
  • 34
0
votes
1 answer

Using unitils/dbMaintain to maintain database, how to exclude scripts from being run?

I am using unitils (and its dbMaintain module) to maintain the state of my local database. dbMaintain has an option to exclude/include scripts based on a qualifier. See http://www.dbmaintain.org/tutorial.html#Qualifier_inclusion__exclusion. In my…
Ryan Walls
  • 6,962
  • 1
  • 39
  • 42
0
votes
1 answer

Seam Component.getInstance() and unit testing

I'm calling Component.getInstance(Needed.class) in the constructor of one of my classes, which is not a seam component. That works just fine, but I'm trying to cover it with unit tests and what I'm getting is IllegalStateException on the above…
Andrew
  • 2,663
  • 6
  • 28
  • 50
0
votes
1 answer

Configure Unitils Log

I want to configure the log level of Unitils because I don't want to show Information traces when I run my tests. The tests run with Unitils through…
Víctor Gómez
  • 724
  • 6
  • 23
0
votes
0 answers

Unitils EasyMock and JUnit @Rule from JUnit 4.10 to 4.11

I have the Problem that when I use the @RuleAnnotation from JUnit for my TemporaryFolder and want to use Mocks from unitils.easymock at the same time I get an IlleagalStateException in JUnit 4.11, whereas in JUnit 4.10 it still works. So the…
DEX
  • 95
  • 1
  • 7
0
votes
3 answers

Unitils database exception

In my project I am using JDBC, MySQL, Servlets, JSP. To test my dao's i made some unit tests and i am trying to use JUnit and Unitils. I am getting this exception: org.unitils.core.UnitilsException: Error inserting test data from DbUnit dataset…
Alexey Shabramov
  • 730
  • 1
  • 16
  • 37
0
votes
1 answer

Unable to unit test - Unitils, Hibernate

I'm trying to setup some unit test for my application, I'd like to test with Unitils datasets, but so far I'm encountered many problems. I'm convinced I have wrong setup can anybody review it for problems. I have hibernate.cfg.xml
Zveratko
  • 2,663
  • 6
  • 35
  • 64
0
votes
1 answer

dbunit/unitils: how to export a multi-schema dataset?

The official tutorial of dbunit already give a good example for exporting dataset from a single database schema. Is there any way to export different tables from different schemas into one single dataset (say Table_A from schema_A, Table_B from…
user2432405
  • 1,406
  • 2
  • 14
  • 29
0
votes
1 answer

How to customize the Mapping of a column of an Entity with DbUnit 2.4.8

In my project, to make tests, DbUnit 2.4.8 and org.unitils 3.3 are used with openjpa 1.2.2 When i want to execute test, i have a problem for the creation of one table. This is the error i receive : org.unitils.core.UnitilsException: Error inserting…
PianEdd
  • 1
  • 4