O'Reilly logo

Spring Persistence with Hibernate by Ahmad Seddighi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Unit testing with JUnit

JUnit is a Java framework for unit testing. The benefits of using JUnit, rather than implementing unit tests on your own code, can be summarized as follows:

  • Create simple and effective test programs.
  • Create test programs in a public and standard structure.
  • Receive a report of the test's results.
  • Execute the tests automatically with Ant.

JUnit is the foundation for more specialized unit-testing tools, such as Cactus, mocks, JMeter, Jester, JUnitPerf, DbUnit, and HttpUnit.

JUnit can be found at http://www.junit.org, along with sample usages and documentation.

The structure of test classes with JUnit

New releases of JUnit support annotation-based unit tests. Therefore, we can develop unit test in a different style of old releases ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required