Quantcast
Channel: Unit testing – Dark Views
Viewing all articles
Browse latest Browse all 9

Hidden JUnit features: @Rules

$
0
0

@Rules seem a better solution than @RunWith to do some special work before/after a test. The release notes mention a couple of ideas:

  • Notification on tests
  • Setting up or tearing down resources, especially when they are used in multiple test classes
  • Special checks performed after every test, possibly causing a test to fail.
  • Making information about the test available inside the test

Related articles:


Tagged: Development Tools, Java, JUnit, Programming, Tests, Unit testing

Viewing all articles
Browse latest Browse all 9

Trending Articles