Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
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
 Appel Appel
Author Profile Icon Appel
Appel
Arrow right icon
View More author details
Toc

Writing dataset tests


The last section of this chapter will cover one of the most important usage scenarios for runners. It'll explain the sense and purpose of tests that run against specific data records and presents the advantages and disadvantages of the available approaches.

Using parameterized tests

Given all this new and fancy knowledge about pluggable processors, it's about time to advance our TimelineTest. One of the main functionalities our component provides is the ability to fetch items page-wise. But there are quite a few preconditions that determine the behavior of item fetching. This leads to just as many tests, which barely differ in their structure. Instead of rewriting the same pattern over and over again, wouldn't it be nice to reuse a common test and simply provide behavior defining pre- and post-conditions as a set of data beans?

In fact, there is more than one canned solution based on runner extensions. Let's start with the built-in mechanism of JUnit, the Parameterized...

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 ₹800/month. Cancel anytime
Visually different images