|
JUnit in Action Vincent Massol with Ted Husted 2003 | 384 pages ISBN: 1930110995 |
|||
![]() |
$39.95 | Softbound print book | |
![]() |
$20.00 | ThoutReader + PDF ebook | |
Table of Contents
| MEAP Subscribers. The entire ebook is now available for download from your account. |
A detailed table of contents is also available.
PART I JUNIT DISTILLED
Chapter 1: JUnit jumpstart
1.1 Proving it works1.2 Starting from scratch
1.3 Understanding unit testing frameworks
1.4 Setting up JUnit
1.5 Testing with JUnit
1.6 Summary
Chapter 2: Exploring JUnit
2.1 Exploring core JUnit2.2 Launching tests with test runners
2.3 Composing tests with TestSuite
2.4 Collecting parameters with TestResult
2.5 Observing results with TestListener
2.6 Working with TestCase
2.7 Stepping through TestCalculator
2.8 Summary
Chapter 3 Sampling JUnit
3.1 Introducing the controller component3.2 Let's test it!
3.3 Testing exception-handling
3.4 Setting up a project for testing
3.5 Summary
Chapter 4 Examining software tests
4.1 Why we need unit tests4.2 Kinds of tests
4.3 Determining how good tests are
4.4 Test-driven development
4.5 Summary
Chapter 5 Automating JUnit
5.1 A day in the life5.2 Running tests from Ant
5.3 Running tests from Maven
5.4 Running tests from Eclipse
5.5 Summary
PART II TESTING STRATEGIES
Chapter 6 Coarse-grained testing with stubs
6.1 Introducing Stubs6.2 Practicing on an HTTP Connection sample
6.3 Stubbing the web server's resources
6.4 Stubbing the connection
6.5 Summary
Chapter 7 Testing in isolation with mock objects
7.1 Introducing mock objects7.2 Mock tasting's simple example
7.3 Using mock objects as a refactoring technique
7.4 Practicing on a HTTP connection sample
7.5 Using mocks as Trojan horses
7.6 Deciding when to use mock objects
7.7 Summary
Chapter 8 In-container testing with Cactus
8.1 The problem with unit-testing components8.2 Testing components using mock objects
8.3 Integration unit tests
8.4 Introducing Cactus
8.5 Testing components using Cactus
8.6 How Cactus works
8.7 Summary
PART III TESTING COMPONENTS
Chapter 9 Unit-testing servlets and filters
9.1 Presenting the Administration application9.2 Writing servlet tests with Cactus
9.3 Testing servlets with mock objects
9.4 Writing filter tests with Cactus
9.5 When to use Cactus, and when to use mock objects
9.6 Summary
Chapter 10 Unit-testing JSPs and taglibs
10.1 Revisiting the Administration application10.2 JSP unit testing
10.3 Unit-testing a JSP in isolation with Cactus
10.4 Unit-testing taglibs with Cactus
10.5 Unit-testing taglibs with mock objects
10.6 When to use mock objects, and when to use Cactus
10.7 Summary
Chapter 11 Unit-testing database applications
11.1 Database unit testing11.2 Testing business logic in isolation from the database
11.3 Testing persistence code in isolation from the database
11.4 Writing database integration unit tests
11.5 Running the Cactus test using Ant
11.6 Tuning for build performance
11.7 Overall database unit-testing strategy
11.8 Summary
Chapter 12 Unit-testing EJBs
12.1 Defining a sample EJB application12.2 Using a façade strategy
12.3 Unit testing JNDI code using mock objects
12.4 Unit-testing session beans
12.5 Using mock objects to test message-driven beans
12.6 Using mock objects to test entity beans
12.7 Choosing the right mock object strategy
12.8 Using integration unit tests
12.9 Using JUnit and remote calls
12.10 Using Cactus
12.11 Summary
Appendix A The source code
Appendix B Eclipse quick start
DESCRIPTION
Developers in the know are switching to a new testing strategy - unit testing - which interleaves coding and testing in an integrated way. This has proven to be a powerful combination that results in better designed software with fewer defects and faster delivery cycles.
JUnit in Action shows you how to benefit from this strategy using the popular open source testing framework, JUnit. It's a no fluff discussion of unit testing techniques and best practices. It gives examples of tough situations such as how to unit test EJBs, database applications, JSPs and Taglibs. It discusses unit testing of J2EE applications, and shows how to test in automated builds.
What's Inside
- Testing in isolation with mock objects
- In-container testing with Cactus
- Automated builds with Ant and Maven
- Unit testing from within Eclipse
- Test Driven Development principles
- Unit testing
- Java apps
- Servlets
- JSP
- Taglibs
- Filters
- EJB
- DB apps
More Information
If you have questions about JUnit in Action, please use the following mailing lists or forums:- For questions related purely to the book itself or for any other questions, please use the Manning Author Online Forum.
- For questions related to the book's source code, please use the SourceForge forum.
- For questions related to JUnit, please use the JUnit mailing list on YahooGroups.
- For questions related to Cactus, please use the Cactus mailing list.
- For questions related to Maven, please use the Maven mailing list.
WHAT THE READERS SAY ABOUT THIS BOOK...
"There are a lot of poorly written books out there. Some are just plain wrong and others just barely manage to solve the problem, but don't go much further than that. With a number of the Manning books I can see myself start to think differently about the problems and so I end up being a better developer. The JUnit in Action book was like that for me. At first it bothered me that I was changing my code in order to test it, but then I started seeing that the changes made the code better overall. Now my code is littered with factory methods and similar structures.
You guys are doing good stuff."
-- Joshua Smith, a reader
"The book is liberally sprinkled with JUnit best practices that every reader should take to heart. The examples are clear and real world. The author addresses the complex issues of unit testing EJBs, and web apps head on. He does not shy away from the real issues that come with testing these kinds of applications."
-- Wade Matveyenko, A Reader
ABOUT THE AUTHORS...
Vincent Massol is Chief Technology Officer of Pivolis which specializes in agile offshore software development.. Vince is an active member of the Maven, Gump and MockObjects development teams and the creator of the Jakarta Cactus testing framework. He lives in the City of Light, Paris, France.
Ted Husted is the lead author of Struts in Action.

