Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Testing with JUnit

You're reading from   Testing with JUnit Master high quality software development driven by unit tests

Arrow left icon
Product type Paperback
Published in Aug 2015
Publisher
ISBN-13 9781782166603
Length 200 pages
Edition 1st Edition
Tools
Arrow right icon
Authors (2):
Arrow left icon
Leonard Przybylski Leonard Przybylski
Author Profile Icon Leonard Przybylski
Leonard Przybylski
Frank Appel Frank Appel
Author Profile Icon Frank Appel
Frank Appel
Arrow right icon
View More author details
Toc

Using custom runners

This section will introduce different extensions that are helpful for structuring your test universe. Further, we'll shed some light on the consequences of overdone runner usage.

Furnishing a suite with test cases

Probably one of the best known runners is Suite. Its purpose is to compose several test cases and/or other suites into a single entity that is processable by JUnit, which allows an example to combine all test cases of a subsystem. This might be an appropriate excerpt with respect to the overall test execution duration on your local machine—if you're about to enhance some of the subsystem's capabilities.

The suite-defining class has normally no body implementation. The composition is accomplished by means of the @SuiteClasses annotation, which is used to specify a list of test cases or nested suites:

@RunWith( Suite.class )
@SuiteClasses( {
  TimelineTest.class,
  UiITest.class,
  [...]
} )
public class AllTestSuite {}

The AllTestSuite example...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image