
Junit in Action
by Massol, VincentRent Book
New Book
We're Sorry
Sold Out
Used Book
We're Sorry
Sold Out
eBook
We're Sorry
Not Available
How Marketplace Works:
- This item is offered by an independent seller and not shipped from our warehouse
- Item details like edition and cover design may differ from our description; see seller's comments before ordering.
- Sellers much confirm and ship within two business days; otherwise, the order will be cancelled and refunded.
- Marketplace purchases cannot be returned to eCampus.com. Contact the seller directly for inquiries; if no response within two days, contact customer service.
- Additional shipping costs apply to Marketplace purchases. Review shipping costs at checkout.
Summary
Author Biography
Table of Contents
Preface | p. xiii |
Acknowledgments | p. xv |
About this book | p. xvii |
About the authors | p. xxi |
About the title | p. xxii |
About the cover illustration | p. xxiii |
JUnit distilled | p. 1 |
JUnit jumpstart | p. 3 |
Proving it works | p. 4 |
Starting from scratch | p. 6 |
Understanding unit testing frameworks | p. 10 |
Setting up JUnit | p. 11 |
Testing with JUnit | p. 13 |
Summary | p. 16 |
Exploring JUnit | p. 17 |
Exploring core JUnit | p. 18 |
Launching tests with test runners | p. 20 |
Composing tests with TestSuite | p. 21 |
Collecting parameters with TestResult | p. 25 |
Observing results with TestListener | p. 27 |
Working with TestCase | p. 28 |
Stepping through TestCalculator | p. 32 |
Summary | p. 38 |
Sampling JUnit | p. 39 |
Introducing the controller component | p. 40 |
Let's test it! | p. 45 |
Testing exception-handling | p. 55 |
Setting up a project for testing | p. 62 |
Summary | p. 64 |
Examining software tests | p. 65 |
The need for unit tests | p. 66 |
Different kinds of tests | p. 71 |
Determining how good tests are | p. 77 |
Test-Driven Development | p. 81 |
Testing in the development cycle | p. 84 |
Summary | p. 87 |
Automating JUnit | p. 88 |
A day in the life | p. 89 |
Running tests from Ant | p. 90 |
Running tests from Maven | p. 102 |
Running tests from Eclipse | p. 112 |
Summary | p. 116 |
Testing strategies | p. 117 |
Coarse-grained testing with stubs | p. 119 |
Introducing stubs | p. 120 |
Practicing on an HTTP connection sample | p. 121 |
Stubbing the web server's resources | p. 126 |
Stubbing the connection | p. 134 |
Summary | p. 138 |
Testing in isolation with mock objects | p. 139 |
Introducing mock objects | p. 140 |
Mock tasting: a simple example | p. 141 |
Using mock objects as a refactoring technique | p. 146 |
Practicing on an HTTP connection sample | p. 150 |
Using mocks as Trojan horses | p. 159 |
Deciding when to use mock objects | p. 163 |
Summary | p. 164 |
In-container testing with Cactus | p. 165 |
The problem with unit-testing components | p. 166 |
Testing components using mock objects | p. 167 |
What are integration unit tests? | p. 172 |
Introducing Cactus | p. 173 |
Testing components using Cactus | p. 173 |
How Cactus works | p. 179 |
Summary | p. 182 |
Testing Components | p. 185 |
Unit-testing servlets and filters | p. 187 |
Presenting the Administration application | p. 188 |
Writing servlet tests with Cactus | p. 189 |
Testing servlets with mock objects | p. 204 |
Writing filter tests with Cactus | p. 208 |
When to use Cactus, and when to use mock objects | p. 213 |
Summary | p. 214 |
Unit-testing JSPs and taglibs | p. 215 |
Revisiting the Administration application | p. 216 |
What is JSP unit testing? | p. 217 |
Unit-testing a JSP in isolation with Cactus | p. 217 |
Unit-testing taglibs with Cactus | p. 224 |
Unit-testing taglibs with mock objects | p. 233 |
When to use mock objects and when to use Cactus | p. 237 |
Summary | p. 237 |
Unit-testing database applications | p. 239 |
Introduction to unit-testing databases | p. 240 |
Testing business logic in isolation from the database | p. 242 |
Testing persistence code in isolation from the database | p. 247 |
Writing database integration unit tests | p. 260 |
Running the Cactus test using Ant | p. 265 |
Tuning for build performance | p. 275 |
Overall database unit-testing strategy | p. 278 |
Summary | p. 280 |
Unit-testing EJBs | p. 281 |
Defining a sample EJB application | p. 282 |
Using a facade strategy | p. 283 |
Unit-testing JNDI code using mock objects | p. 284 |
Unit-testing session beans | p. 285 |
Using mock objects to test message-driven beans | p. 307 |
Using mock objects to test entity beans | p. 310 |
Choosing the right mock-objects strategy | p. 312 |
Using integration unit tests | p. 313 |
Using JUnit and remote calls | p. 314 |
Using Cactus | p. 328 |
Summary | p. 334 |
The source code | p. 335 |
Getting the source code | p. 336 |
Source code overview | p. 336 |
External libraries | p. 338 |
Jar versions | p. 339 |
Directory structure conventions | p. 340 |
Eclipse quick start | p. 341 |
Installing Eclipse | p. 342 |
Setting up Eclipse projects from the sources | p. 342 |
Running JUnit tests from Eclipse | p. 343 |
Running Ant scripts from Eclipse | p. 344 |
Running Cactus tests from Eclipse | p. 345 |
References | p. 346 |
Index | p. 351 |
Table of Contents provided by Ingram. All Rights Reserved. |
An electronic version of this book is available through VitalSource.
This book is viewable on PC, Mac, iPhone, iPad, iPod Touch, and most smartphones.
By purchasing, you will be able to view this book online, as well as download it, for the chosen number of days.
Digital License
You are licensing a digital product for a set duration. Durations are set forth in the product description, with "Lifetime" typically meaning five (5) years of online access and permanent download to a supported device. All licenses are non-transferable.
More details can be found here.
A downloadable version of this book is available through the eCampus Reader or compatible Adobe readers.
Applications are available on iOS, Android, PC, Mac, and Windows Mobile platforms.
Please view the compatibility matrix prior to purchase.