0%

Book Description

When JUnit was first introduced a decade ago by Kent Beck and Erich Gamma, the Agile movement was in its infancy, "Test Driven Development" was unknown, and unit testing was just starting to move into the typical developer's vocabulary. Today, most developers acknowledge the benefits of unit testing and rely on the increasingly sophisticated tools now available. The recently released JUnit 4.5 represents the state of the art in unit testing frameworks, and provides significant new features to improve the Java development process. JUnit in Action, Second Edition is an up-to-date guide to unit testing Java applications (including Java EE applications) using the JUnit framework and its extensions. This book provides techniques for solving real-world problems such as testing AJAX applications, using mocks to achieve testing isolation, in-container testing for Java EE and database applications, and test automation. Written to help readers exploit JUnit 4.5, the book covers recent innovations such as the new annotations that simplify test writing, improved exception handling, and the new assertion methods. You'll also discover how to use JUnit extensions to test new application styles and frameworks including Ajax, OSGi, and HTML-based presentation layers. Using a sample-driven approach, various unit testing strategies are covered, such as how to unit test EJBs, database applications, and web applications. Also addressed are testing strategies using freely available open source frameworks and tools, and how to unit test in isolation with Mock Objects. The book will also bring you up to speed on the latest thinking in TDD, BDD, Continuous Integration, and other practices related to unit testing.

Table of Contents

  1. Copyright
  2. Dedication
  3. Brief Table of Contents
  4. Table of Contents
  5. Praise for the First Edition
  6. Preface
  7. Preface to the First Edition
  8. Acknowledgments
  9. About this Book
  10. About the Authors
  11. About the Cover Illustration
  12. Part 1. JUnit essentials
  13. Chapter 1. JUnit jump-start
  14. Chapter 2. Exploring core JUnit
  15. Chapter 3. Mastering JUnit
  16. Chapter 4. Software testing principles
  17. Part 2. Different testing strategies
  18. Chapter 5. Test coverage and development
  19. Chapter 6. Coarse-grained testing with stubs
  20. Chapter 7. Testing with mock objects
  21. Chapter 8. In-container testing
  22. Part 3. JUnit and the build process
  23. Chapter 9. Running JUnit tests from Ant
  24. Chapter 10. Running JUnit tests from Maven2
  25. Chapter 11. Continuous integration tools
  26. Part 4. JUnit extensions
  27. Chapter 12. Presentation-layer testing
  28. Chapter 13. Ajax testing
  29. Chapter 14. Server-side Java testing with Cactus
  30. Chapter 15. Testing JSF applications
  31. Chapter 16. Testing OSGi components
  32. Chapter 17. Testing database access
  33. Chapter 18. Testing JPA-based applications
  34. Chapter 19. JUnit on steroids
  35. Appendix A. Differences between JUnit 3 and JUnit 4
  36. Appendix B. Extending the JUnit API with custom runners and matchers
  37. Appendix C. The source code for the book
  38. Appendix D. JUnit IDE integration
  39. Appendix E. Installing software
  40. Index
  41. List of Figures
  42. List of Tables
  43. List of Listings
18.188.151.107