Proposal to merge [parts of] DbUnit Express directly into DbUnit

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Proposal to merge [parts of] DbUnit Express directly into DbUnit

maly.velky
Hello,

I'm the author of DbUnit Express, a thin wrapper around DbUnit intended to make starting with DB testing as quick as possible by introducing
(1) Convention over configuration - automatically loads data set file of name derived from the test name if it exists, ...
(2) Sensible defaults - comes pre-configured for an embedded Derby database
(3) Convenience methods - such as getDataSource() - extremely useful for testing code using Spring JDBC
(4) Utilities - RowComparator for easy verification of data in a select, DatabaseCreator for DB initialization from a DDL, replaceDatabase(dataSet), clearTable(name) , JUnit 4 @Rule automatically invoking onSetup(), ...
(5) Improved error reporting
(6) The configuration of DbUnit that proved to be most flexible and error-proof - fully qualified table names, XML data set,...

The project is already pretty mature and I believe firmly that some parts of it could be useful to all users of DbUnit and would therefore like to propose to merge them into DbUnit.

The project is at GitHub https://github.com/jakubholynet/dbunit-express, a descriptive page about it at http://sourceforge.net/apps/mediawiki/jeeutils/index.php?title=DbUnit_Express.

What is your opinion on this proposal? How should we proceed?

Of course it would need to be discussed what could or should be merged into DbUnit. My believe is that actually most of the project is suitable for all DbUnit users:

(1) Convention over configuration
 - "convention over configuration" is becoming the standard approach (even Java EE having adopted it) so DbUnit users could profit from it too
 - namely I bet all users would appreciate the ability to automatically detect and load the data set XML related to the current test (or even detect its type, e.g. xml if named -data, flat xml if named -flatdata; similarly we could do it for other formats such as -csv, if they are used often)
 - it would be perhaps also good for DbUnit to support configuration via a properties file to make it easy to apply the same settings to all tests (such as which DB to use, whether to use fully qualified table names, ...) 

(2) Sensible defaults
 - DbUnit is database neutral and that is a good thing but still I think it would be reasonable to come preconfigured with a simple option that can satisfy many users, such as a pure in-memory database like Derby (a.k.a. JavaDB) or HSQL. According to my experience such a database is perfectly suitable many/most cases and much easier to manage (than an external DB). Those who want to use database of their own will have the same amount of work as before while all the others will get rid of that work


(3) Convenience methods
 - I'm sure everybody would profit from these - check them at 
https://github.com/jakubholynet/dbunit-express/blob/f51876a62cc9b4388ba320bd9259c9972e89f161/src/main/java/net/jakubholy/dbunitexpress/IEnhancedDatabaseTester.java

(4) Utilities
 - RowComparator for easy verification of data in a select makes this magic possible: new RowComparator(dbTester, "select id,text from my_table").assertRowCount(1).assertNext("1", "some text #1");
 - DatabaseCreator can automatically create (Derby) DB and create tables etc. by applying a DDL to the DB (of any type), the DDL is obtained via conv.over config. from a default location/file
 - JUnit 4 @Rule - DbUnit Express works both with JUnit 3 and 4 but if you use 4, you can use its special @Rule version of the main class, that automatically invokes its onSetup operation before each test and thus you don't need to implement setUp just because of that 

Best regards, Jakub Holy

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: Proposal to merge [parts of] DbUnit Express directly into DbUnit

John Hurst-2
Jakob,

That sounds like some awesome work! I hadn't come across it before, but I will check it out!

The problem we have is that none of use (as far as I know!) is doing active development on the DbUnit mainline. We intended to revamp DbUnit to a "modern" DbUnit 3.0 with a number of changes and updates. But I don't think that the work has really started. We have set up new infrastructure on Codehaus but the repo is still SVN. 

I will have a look at your project and see whether it looks like a good fit for DbUnit 2.x or better for 3.0. At the very least we should probably link it from our web page.

Regards

John Hurst

On Sun, Sep 4, 2011 at 10:57 PM, <[hidden email]> wrote:
Hello,

I'm the author of DbUnit Express, a thin wrapper around DbUnit intended to make starting with DB testing as quick as possible by introducing
(1) Convention over configuration - automatically loads data set file of name derived from the test name if it exists, ...
(2) Sensible defaults - comes pre-configured for an embedded Derby database
(3) Convenience methods - such as getDataSource() - extremely useful for testing code using Spring JDBC
(4) Utilities - RowComparator for easy verification of data in a select, DatabaseCreator for DB initialization from a DDL, replaceDatabase(dataSet), clearTable(name) , JUnit 4 @Rule automatically invoking onSetup(), ...
(5) Improved error reporting
(6) The configuration of DbUnit that proved to be most flexible and error-proof - fully qualified table names, XML data set,...

The project is already pretty mature and I believe firmly that some parts of it could be useful to all users of DbUnit and would therefore like to propose to merge them into DbUnit.


What is your opinion on this proposal? How should we proceed?

Of course it would need to be discussed what could or should be merged into DbUnit. My believe is that actually most of the project is suitable for all DbUnit users:

(1) Convention over configuration
 - "convention over configuration" is becoming the standard approach (even Java EE having adopted it) so DbUnit users could profit from it too
 - namely I bet all users would appreciate the ability to automatically detect and load the data set XML related to the current test (or even detect its type, e.g. xml if named -data, flat xml if named -flatdata; similarly we could do it for other formats such as -csv, if they are used often)
 - it would be perhaps also good for DbUnit to support configuration via a properties file to make it easy to apply the same settings to all tests (such as which DB to use, whether to use fully qualified table names, ...) 

(2) Sensible defaults
 - DbUnit is database neutral and that is a good thing but still I think it would be reasonable to come preconfigured with a simple option that can satisfy many users, such as a pure in-memory database like Derby (a.k.a. JavaDB) or HSQL. According to my experience such a database is perfectly suitable many/most cases and much easier to manage (than an external DB). Those who want to use database of their own will have the same amount of work as before while all the others will get rid of that work


(3) Convenience methods
 - I'm sure everybody would profit from these - check them at 
https://github.com/jakubholynet/dbunit-express/blob/f51876a62cc9b4388ba320bd9259c9972e89f161/src/main/java/net/jakubholy/dbunitexpress/IEnhancedDatabaseTester.java

(4) Utilities
 - RowComparator for easy verification of data in a select makes this magic possible: new RowComparator(dbTester, "select id,text from my_table").assertRowCount(1).assertNext("1", "some text #1");
 - DatabaseCreator can automatically create (Derby) DB and create tables etc. by applying a DDL to the DB (of any type), the DDL is obtained via conv.over config. from a default location/file
 - JUnit 4 @Rule - DbUnit Express works both with JUnit 3 and 4 but if you use 4, you can use its special @Rule version of the main class, that automatically invokes its onSetup operation before each test and thus you don't need to implement setUp just because of that 

Best regards, Jakub Holy

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user




--
Life is interfering with my game

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: Proposal to merge [parts of] DbUnit Express directly into DbUnit

Jeff Jensen-2

Jakob, have you done further evaluation and have thoughts on what you would like to see added directly to dbUnit, and the order to do so?

On Sep 4, 2011 12:23 PM, "John Hurst" <[hidden email]> wrote:
Jakob,

That sounds like some awesome work! I hadn't come across it before, but I will check it out!

The problem we have is that none of use (as far as I know!) is doing active development on the DbUnit mainline. We intended to revamp DbUnit to a "modern" DbUnit 3.0 with a number of changes and updates. But I don't think that the work has really started. We have set up new infrastructure on Codehaus but the repo is still SVN. 

I will have a look at your project and see whether it looks like a good fit for DbUnit 2.x or better for 3.0. At the very least we should probably link it from our web page.

Regards

John Hurst

On Sun, Sep 4, 2011 at 10:57 PM, <[hidden email]> wrote:
Hello,

I'm the author of DbUnit Express, a thin wrapper around DbUnit intended to make starting with DB testing as quick as possible by introducing
(1) Convention over configuration - automatically loads data set file of name derived from the test name if it exists, ...
(2) Sensible defaults - comes pre-configured for an embedded Derby database
(3) Convenience methods - such as getDataSource() - extremely useful for testing code using Spring JDBC
(4) Utilities - RowComparator for easy verification of data in a select, DatabaseCreator for DB initialization from a DDL, replaceDatabase(dataSet), clearTable(name) , JUnit 4 @Rule automatically invoking onSetup(), ...
(5) Improved error reporting
(6) The configuration of DbUnit that proved to be most flexible and error-proof - fully qualified table names, XML data set,...

The project is already pretty mature and I believe firmly that some parts of it could be useful to all users of DbUnit and would therefore like to propose to merge them into DbUnit.


What is your opinion on this proposal? How should we proceed?

Of course it would need to be discussed what could or should be merged into DbUnit. My believe is that actually most of the project is suitable for all DbUnit users:

(1) Convention over configuration
 - "convention over configuration" is becoming the standard approach (even Java EE having adopted it) so DbUnit users could profit from it too
 - namely I bet all users would appreciate the ability to automatically detect and load the data set XML related to the current test (or even detect its type, e.g. xml if named -data, flat xml if named -flatdata; similarly we could do it for other formats such as -csv, if they are used often)
 - it would be perhaps also good for DbUnit to support configuration via a properties file to make it easy to apply the same settings to all tests (such as which DB to use, whether to use fully qualified table names, ...) 

(2) Sensible defaults
 - DbUnit is database neutral and that is a good thing but still I think it would be reasonable to come preconfigured with a simple option that can satisfy many users, such as a pure in-memory database like Derby (a.k.a. JavaDB) or HSQL. According to my experience such a database is perfectly suitable many/most cases and much easier to manage (than an external DB). Those who want to use database of their own will have the same amount of work as before while all the others will get rid of that work


(3) Convenience methods
 - I'm sure everybody would profit from these - check them at 
https://github.com/jakubholynet/dbunit-express/blob/f51876a62cc9b4388ba320bd9259c9972e89f161/src/main/java/net/jakubholy/dbunitexpress/IEnhancedDatabaseTester.java

(4) Utilities
 - RowComparator for easy verification of data in a select makes this magic possible: new RowComparator(dbTester, "select id,text from my_table").assertRowCount(1).assertNext("1", "some text #1");
 - DatabaseCreator can automatically create (Derby) DB and create tables etc. by applying a DDL to the DB (of any type), the DDL is obtained via conv.over config. from a default location/file
 - JUnit 4 @Rule - DbUnit Express works both with JUnit 3 and 4 but if you use 4, you can use its special @Rule version of the main class, that automatically invokes its onSetup operation before each test and thus you don't need to implement setUp just because of that 

Best regards, Jakub Holy

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user




--
Life is interfering with my game

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user


------------------------------------------------------------------------------
Get your Android app more play: Bring it to the BlackBerry PlayBook
in minutes. BlackBerry App World&#153; now supports Android&#153; Apps
for the BlackBerry&reg; PlayBook&#153;. Discover just how easy and simple
it is! http://p.sf.net/sfu/android-dev2dev

_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user