aspose file tools*
The moose likes Testing and the fly likes Testing database-heavy using TestNG Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Testing database-heavy using TestNG" Watch "Testing database-heavy using TestNG" New topic
Author

Testing database-heavy using TestNG

Yavor Nikolov
Greenhorn

Joined: Sep 13, 2011
Posts: 3
Does TestNG provide any support for testing database-heavy applications? (Including testing of database stored procedures).
Tomek Kaczanowski
author
Ranch Hand

Joined: Oct 26, 2005
Posts: 40

Hi Yavor,

no, database-testing is outside the scope of TestNG, which is a general purpose testing framework.

However, it gives you a little bit more than JUnit in terms of support for integration/end-to-end tests in general, so you can organize your tests better. Thanks to features like groups, dependent test methods or timeouts, you can make your tests fail fast and have a more precise information about the real bug. TestNG also supports running test methods with many threads which you might find useful.


Tomek Kaczanowski
Book author: Practical Unit Testing with TestNG and Mockito
http://practicalunittesting.com
Raj Java Raj
Greenhorn

Joined: May 14, 2012
Posts: 5

Hi, Tomek Kaczanowski

Does TestNG provide memory related bugs while testing using TestNG?
-----------------
Raj.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16145
    
  21

TestNG itself doesn't support database-related testing, but there's a facility called dbUnit that does. I use dbUnit extensively with jUnit - among other things it allows me to ensure that I have valid JPA QL statements in my DAOs, since QL is interpreted and cannot be validated at compile-time. I also use it at a higher level for testing table interactions.

If I haven't crossed my wires, TestNG is especially popular in conjunction with dbUnit.


Customer surveys are for companies who didn't pay proper attention to begin with.
Tomek Kaczanowski
author
Ranch Hand

Joined: Oct 26, 2005
Posts: 40

Hi Raj,

Raj [surl='http://www.javaranch.com' class='faq' title='JavaRanch wrote:Java[/surl] Raj]
Does TestNG provide memory related bugs while testing using TestNG?

I'm not sure what do you mean by "memory related bugs"... Could you rephrase your question, please?
Tomek Kaczanowski
author
Ranch Hand

Joined: Oct 26, 2005
Posts: 40

Hi Tim,

Tim Holloway wrote:If I haven't crossed my wires, TestNG is especially popular in conjunction with dbUnit.

In fact dbUnit is closely related to JUnit, however it is possible to use it with TestNG as well. And BTW. you could also try Unitils which, among other impressive stuff, gives some support for database testing.
 
 
subject: Testing database-heavy using TestNG