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

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "As a result, a test case was a compound of various methods called testFoo, testBar, and so on."

A block of code is set as follows:

private final static int NEW_FETCH_COUNT
  = Timeline.DEFAULT_FETCH_COUNT + 1;

@Test
public void setFetchCount() {
  // (1) setup (arrange, build)
  Timeline timeline = new Timeline();

  // (2) exercise (act, operate)
  timeline.setFetchCount( NEW_FETCH_COUNT );

  // (3) verify (assert, check)
  assertEquals( NEW_FETCH_COUNT, timeline.getFetchCount() );
}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

private ItemProvider itemProvider;
private Timeline timeline;

@Before
public void setUp() {
  itemProvider = ???
  timeline = new Timeline( itemProvider );
}

Any command-line input or output is written as follows:

mvn clean test

New terms and important words are shown in bold like this: "Changing code without changing its behavior is called refactoring."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

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