Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
286 views
in Technique[技术] by (71.8m points)

java - 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 for this project. I kind of lack the vivid community around and really don't want to be bound to dying project.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Unitils seems to be almost abandoned nowadays. Project is available on the GitHub here and you can look at its history and activity.

Anyways my two cents...

Unitils has serious drawbacks:

  • Integrates many third-party libs (easymock, dbunit, spring, dbmaintainer, xmlunit, slf4j etc) and thus forces their versions - it is a really serious drawback
  • Due to being dependent on many 3rd party libraries, it is almost impossible to keep it up to date without any company behind.
  • Unitils 4.0 is developed since 06.2011 and was planned to release at 01.2012, but now (01.2016) after 4 years is still not released.

DbUnit

For database-driven apps it may seem that interesting way to go is a plain DbUnit + Spring-Test or alternatively some 3rd party tools:

  • excilys/spring-dbunit that comes with handy @DataSet annotation and is actively developed on the github, also is constantly updated to use the newest versions of DbUnit and Spring Framework.
  • springtestdbunit/spring-test-dbunit which is also hosted on the github (comes with a @DatabaseSetup annotation).

Both are very similar, but personally I find DbUnit confusing, quite cumbersome and time-consuming. Why? Try to maintain large amount of small xml files and you find out what I mean. Also combining multiple data sets is really hard.

DbSetup

My choice. DbSetup doesn't need external xml/ json files, is extremely convenient and allows you to combine freely multiple data sets using fluent builders. Just look at code below:

 final Operation sql =
         sequenceOf(
                 CommonOperations.DELETE_ALL,
                 CommonOperations.INSERT_REFERENCE_DATA,
                 prepareSpecialData()
         );
 DbSetup dbSetup = new DbSetup(new DataSourceDestination(dataSource), sql);

Everything is java, so you can freely refactor it, extract methods etc.

Hope it helps.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...