Table of Contents

 

Copyright

Brief Table of Contents

Table of Contents

Praise for the First Edition

Preface

Preface to the First Edition

Acknowledgments

About this Book

About the Authors

About the Cover Illustration

1. JUnit essentials

Chapter 1. JUnit jump-start

1.1. Proving it works

1.2. Starting from scratch

1.3. Understanding unit testing frameworks

1.4. JUnit design goals

1.5. Setting up JUnit

1.6. Testing with JUnit

1.7. Summary

Chapter 2. Exploring core JUnit

2.1. Exploring core JUnit

2.2. Running parameterized tests

2.3. JUnit test runners

2.3.1. Test runner overview

2.3.2. The JUnitCore façade

2.3.3. Custom test runners

2.4. Composing tests with a suite

2.4.1. Composing a suite of test classes

2.4.2. Composing a suite of suites

2.4.3. Suites, IDEs, Ant, and Maven

2.5. Summary

Chapter 3. Mastering JUnit

3.1. Introducing the controller component

3.1.1. Designing the interfaces

3.1.2. Implementing the base class

3.2. Let’s test it!

3.2.1. Testing the DefaultController

3.2.2. Adding a handler

3.2.3. Processing a request

3.2.4. Improving testProcessRequest

3.3. Testing exception handling

3.3.1. Simulating exceptional conditions

3.3.2. Testing for exceptions