• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Testing database-heavy using TestNG

 
Yavor Nikolov
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does TestNG provide any support for testing database-heavy applications? (Including testing of database stored procedures).
 
Tomek Kaczanowski
author
Ranch Hand
Posts: 40
IntelliJ IDE Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Raj Java Raj
Greenhorn
Posts: 5
IBM DB2 Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Tomek Kaczanowski

Does TestNG provide memory related bugs while testing using TestNG?
-----------------
Raj.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17616
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Tomek Kaczanowski
author
Ranch Hand
Posts: 40
IntelliJ IDE Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Raj,

Raj Java Raj wrote:
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
Posts: 40
IntelliJ IDE Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic