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
9
votes
2 answers

NullPointerException while running unit test against Postgres database with Unitils

I have the following table (migration): databaseChangeLog: - changeSet: id: 1 author: me changes: - createTable: tableName: person columns: - column: name: id …
dopatraman
  • 13,416
  • 29
  • 90
  • 154
5
votes
4 answers

EasyMock and Unitils equivalent to Mockito @ InjectMocks

Is there any techniques available in EasyMock or Unitils Mock (Not Unitils supported EasyMock) to inject the mocks directly into the Class Under Test? For eg. in Mockito it is possible to inject mocks directly into member variables of a…
Bala
  • 1,193
  • 2
  • 12
  • 34
4
votes
4 answers

Unitils/DBunit and database test

I want to try to make unit test with DBUnit but I have a problem with my dataset. Here is my persistence object: @Entity @Table(name = "personnes") public class Personne implements Serializable { @Id @GeneratedValue(strategy =…
Kiva
  • 9,193
  • 17
  • 62
  • 94
4
votes
1 answer

Is Unitils project alive?

anybody knows whether unitils project is still alive. On there pages last version is 3.3 in maven repository it is 3.4.2.(Actually there is google cached version of their pages where the version is said to be 3.4.2) Anyway is there any replacement…
Zveratko
  • 2,663
  • 6
  • 35
  • 64
3
votes
2 answers

Unitils vs Spring TestContext Framework

I'm thinking about which testing framework to use for my spring+hibernate web application. Initially I spotted and got pretty interested in Unitils, but then I saw the standard Spring TestContext Framework and started having some doubts. I'm pretty…
machinery
  • 3,793
  • 4
  • 41
  • 52
3
votes
1 answer

Unitils / DBunit / Oracle - how to insert dataset in oracle views?

It seems to be a simple question. I have some unitils tests in a spring application. The database contains some oracle views and i just want to insert dataset into these views. I know that it is possible to set options to DBunit (Table Type…
Samuel
  • 61
  • 6
3
votes
1 answer

Using Specs with unitils

I am trying to get scala specs and unitils-dbunit to work. To use unitils you have to annotate your test class with @RunWith(classOf[UnitilsJUnit4TestClassRunner]) or extend from a class and you can set DataSet's to load…
Christian
  • 4,543
  • 1
  • 22
  • 31
3
votes
1 answer

DBUnit cannot import data into HSQLDB

I use Hibernate in create-drop mode to create tables at startup. (tables are created in the public schema in hsqlDB). For some reason, DBunit is not able to add data into my table: ERROR org.dbunit.database.DatabaseDataSet - Table 'MY_TABLE' not…
chamaster
  • 135
  • 2
  • 7
2
votes
1 answer

EasyMock deep stubs

I have to mock the following security step using EasyMock or UnitilsMock. Could you please suggest a way to achieve this? String id = context.getCallerPrincipal().getName(); This step is related to security. So I will not be able to create a…
Bala
  • 1,193
  • 2
  • 12
  • 34
2
votes
4 answers

Unitils and DBMaintainer - how to make them work with multiple users/schemas?

I am working on a new Oracle ADF project, that is using Oragle 10g Database, and I am using Unitils and DBMaintainer in our project for: updating the db structure unittesting read in seed data read in test data List item In our project, we have 2…
themathmagician
  • 467
  • 5
  • 16
2
votes
1 answer

unitils-orm-hibernate not working with Hibernate 5

I'm using unitils for hibernate orm testing. I took the hibernate version 5.0.10-Final and the latest unitils version 3.4.3. I'm always getting the following error: "org.unitils.core.UnitilsException: An exception occured during the loading of core…
2
votes
2 answers

Ignoring case in strings with unitils ReflectionComparator

I'm using unitils tool for deep objects comparing, via ReflectionComparator: ReflectionComparatorMode[] modes = {ReflectionComparatorMode.LENIENT_ORDER, ReflectionComparatorMode.IGNORE_DEFAULTS}; ReflectionComparator comparator =…
Andremoniy
  • 34,031
  • 20
  • 135
  • 241
2
votes
1 answer

CLOB representation in Unitils dbunit dataset

I have a clob column in my table. How do I represent it in the dbunit dataset xml, so that I can use it in my integration test?
EmeraldTablet
  • 812
  • 3
  • 12
  • 30
2
votes
1 answer

Evicted object still issues updates to the database in Hibernate

I have a problem where I evict an entity, but changes made to it will still change the database. This is part of the method in my DAO. @Entity public class Profile { @Id @GeneratedValue private Long id; @OneToMany(cascade =…
Merchuk Hul
  • 245
  • 1
  • 2
  • 11
2
votes
1 answer

Db unit tests. Constraints disabling

I have a set of unit tests which test my DAO layer. I have following requirements: - For one subset of tests I need to disable constraints(foreign key, unique, not null). - For other subset I need to remain their (I check data integrity here). So…
mvb13
  • 1,514
  • 3
  • 18
  • 33
1
2 3 4