rent-now

Rent More, Save More! Use code: ECRENTAL

5% off 1 book, 7% off 2 books, 10% off 3+ books

9781930110991

Junit in Action

by
  • ISBN13:

    9781930110991

  • ISBN10:

    1930110995

  • Format: Paperback
  • Copyright: 2003-10-01
  • Publisher: Manning Pubns Co
  • Purchase Benefits
  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $39.95

Summary

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.

Author Biography

Vincent Massol is the creator of the Jakarta Cactus framework and an active member of the Maven, Gump, Struts, and MockObjects development teams. He is the cofounder and CTO of Pivolis, a company that specializes in applying agile methodologies to offshore software development. Ted Husted is an active member of the Struts development team and the manager of the JGuru Struts Forum. His most recent development project uses test-driven design throughout and is available as open source [wqdata]. He is the author of Struts in Action. He lives in Fairport, New York

Table of Contents

Prefacep. xiii
Acknowledgmentsp. xv
About this bookp. xvii
About the authorsp. xxi
About the titlep. xxii
About the cover illustrationp. xxiii
JUnit distilledp. 1
JUnit jumpstartp. 3
Proving it worksp. 4
Starting from scratchp. 6
Understanding unit testing frameworksp. 10
Setting up JUnitp. 11
Testing with JUnitp. 13
Summaryp. 16
Exploring JUnitp. 17
Exploring core JUnitp. 18
Launching tests with test runnersp. 20
Composing tests with TestSuitep. 21
Collecting parameters with TestResultp. 25
Observing results with TestListenerp. 27
Working with TestCasep. 28
Stepping through TestCalculatorp. 32
Summaryp. 38
Sampling JUnitp. 39
Introducing the controller componentp. 40
Let's test it!p. 45
Testing exception-handlingp. 55
Setting up a project for testingp. 62
Summaryp. 64
Examining software testsp. 65
The need for unit testsp. 66
Different kinds of testsp. 71
Determining how good tests arep. 77
Test-Driven Developmentp. 81
Testing in the development cyclep. 84
Summaryp. 87
Automating JUnitp. 88
A day in the lifep. 89
Running tests from Antp. 90
Running tests from Mavenp. 102
Running tests from Eclipsep. 112
Summaryp. 116
Testing strategiesp. 117
Coarse-grained testing with stubsp. 119
Introducing stubsp. 120
Practicing on an HTTP connection samplep. 121
Stubbing the web server's resourcesp. 126
Stubbing the connectionp. 134
Summaryp. 138
Testing in isolation with mock objectsp. 139
Introducing mock objectsp. 140
Mock tasting: a simple examplep. 141
Using mock objects as a refactoring techniquep. 146
Practicing on an HTTP connection samplep. 150
Using mocks as Trojan horsesp. 159
Deciding when to use mock objectsp. 163
Summaryp. 164
In-container testing with Cactusp. 165
The problem with unit-testing componentsp. 166
Testing components using mock objectsp. 167
What are integration unit tests?p. 172
Introducing Cactusp. 173
Testing components using Cactusp. 173
How Cactus worksp. 179
Summaryp. 182
Testing Componentsp. 185
Unit-testing servlets and filtersp. 187
Presenting the Administration applicationp. 188
Writing servlet tests with Cactusp. 189
Testing servlets with mock objectsp. 204
Writing filter tests with Cactusp. 208
When to use Cactus, and when to use mock objectsp. 213
Summaryp. 214
Unit-testing JSPs and taglibsp. 215
Revisiting the Administration applicationp. 216
What is JSP unit testing?p. 217
Unit-testing a JSP in isolation with Cactusp. 217
Unit-testing taglibs with Cactusp. 224
Unit-testing taglibs with mock objectsp. 233
When to use mock objects and when to use Cactusp. 237
Summaryp. 237
Unit-testing database applicationsp. 239
Introduction to unit-testing databasesp. 240
Testing business logic in isolation from the databasep. 242
Testing persistence code in isolation from the databasep. 247
Writing database integration unit testsp. 260
Running the Cactus test using Antp. 265
Tuning for build performancep. 275
Overall database unit-testing strategyp. 278
Summaryp. 280
Unit-testing EJBsp. 281
Defining a sample EJB applicationp. 282
Using a facade strategyp. 283
Unit-testing JNDI code using mock objectsp. 284
Unit-testing session beansp. 285
Using mock objects to test message-driven beansp. 307
Using mock objects to test entity beansp. 310
Choosing the right mock-objects strategyp. 312
Using integration unit testsp. 313
Using JUnit and remote callsp. 314
Using Cactusp. 328
Summaryp. 334
The source codep. 335
Getting the source codep. 336
Source code overviewp. 336
External librariesp. 338
Jar versionsp. 339
Directory structure conventionsp. 340
Eclipse quick startp. 341
Installing Eclipsep. 342
Setting up Eclipse projects from the sourcesp. 342
Running JUnit tests from Eclipsep. 343
Running Ant scripts from Eclipsep. 344
Running Cactus tests from Eclipsep. 345
Referencesp. 346
Indexp. 351
Table of Contents provided by Ingram. All Rights Reserved.

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Rewards Program