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.