13.07.2015 Views

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

13.6 Running Test Suites311Figure 13.4 The CoreTest running a suite of testsOne last example is the SAM<strong>on</strong>eyTest.java file that was used in theCoreTest example (Figure 13.4). Did you notice the names displayed in thetest hierarchy? They d<strong>on</strong>’t match the method names used to run the tests inSAM<strong>on</strong>eyTest.java because we c<strong>on</strong>structed the suite “by hand” instead ofletting the JUnit introspecti<strong>on</strong> and reflecti<strong>on</strong> find the methods dynamically.Such manual approach has some advantages. You can restrict the currentset of tests being executed to a subset of the entire set of tests. You can also, asthis example shows, give other names to the tests. The biggest drawback,though, is the maintenance cost of having to add the test by hand to thesuite() method whenever you add another test method.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!