Book description
Extreme Programming does not mean programming naked while rollerblading down the side of the Grand Canyon. It does mean a new approach to software development that is both radical and common-sense. Unlike many software development methodologies, XP has been accepted quickly because its core practices--particularly code sharing, test-first development, and continuous integration--resonated immediately with software developers everywhere. Instead of impressing developers with a body of theory, XP got programmers to say, "Yeah, that's how I'd like to work." Oddly enough, although most developers turn to Extreme Programming methods in order to code real, hands-on, and extensible projects quickly ("Code comes first"), most books on Extreme Programming insist on focusing on the theory and not the practice. Not the Java Extreme Programming Cookbook. Brimming with over 100 "recipes" for getting down to business and actually doing XP, the Java Extreme Programming Cookbook doesn't try to "sell" you on XP; it succinctly documents the most important features of popular open source tools for XP in Java--including Ant, Junit, HttpUnit, Cactus, Tomcat, XDoclet--and then digs right in, providing recipes for implementing the tools in real-world environments. Each recipe offers solutions that help you put an extreme programming environment together: then provides code for automating the build process and testing. Although the time saved using any one of these solutions will more than pay for the book, Java Extreme Programming Cookbook offers more than just a collection of cut-and-paste code. Each recipe also includes explanations of how and why the approach works, so you can adapt the techniques to similar situations. One of the biggest challenges facing developers today is sorting through the wide variety of tools available form various source and figuring out how to them effectively. The recipes in Java Extreme Programming Cookbook showcase how to use the most important features of these XP tools. Many of these tools are geared towards unit testing, while others are invaluable for continuous integration; with these practical examples, you'll be able to choose the most effective tools to accomplish your goals, then implement them in a cohesive development environment quickly. If you want to set up a test-driven development environment that allows you to focus on writing testable code--now--this book will prove invaluable.
Table of contents
-
Java Extreme Programming Cookbook
- Preface
- 1. XP Tools
- 2. XP Overview
-
3. Ant
- Introduction
- Writing a Basic Buildfile
- Running Ant
- Providing Help
- Using Environment Variables
- Passing Arguments to a Buildfile
- Checking for the Existence of Properties
- Defining a Classpath
- Defining Platform-Independent Paths
- Including and Excluding Files
- Implementing Conditional Logic
- Defining a Consistent Environment
- Preventing Build Breaks
- Building JAR Files
- Installing JUnit
- Running Unit Tests
- Running Specific Tests
- Generating a Test Report
- Checking Out Code from CVS
- Bootstrapping a Build
-
4. JUnit
- Introduction
- Getting Started
- Running JUnit
- assertXXX( ) Methods
- Unit Test Granularity
- Set Up and Tear Down
- One-Time Set Up and Tear Down
- Organizing Tests into Test Suites
- Running a Test Class Directly
- Repeating Tests
- Test Naming Conventions
- Unit Test Organization
- Exception Handling
- Running Tests Concurrently
- Testing Asynchronous Methods
- Writing a Base Class for Your Tests
- Testing Swing Code
- Avoiding Swing Threading Problems
- Testing with the Robot
- Testing Database Logic
- Repeatedly Testing the Same Method
-
5. HttpUnit
- Introduction
- Installing HttpUnit
- Preparing for Test-First Development
- Checking a Static Web Page
- Following Hyperlinks
- Writing Testable HTML
- Testing HTML Tables
- Testing a Form Tag and Refactoring Your Tests
- Testing for Elements on HTML Forms
- Submitting Form Data
- Testing Through a Firewall
- Testing Cookies
- Testing Secure Pages
- 6. Mock Objects
-
7. Cactus
- Introduction
- Configuring Cactus
- Setting Up a Stable Build Environment
- Creating the cactus.properties File
- Generating the cactus.properties File Automatically
- Writing a Cactus Test
- Submitting Form Data
- Testing Cookies
- Testing Session Tracking Using HttpSession
- Testing Servlet Initialization Parameters
- Testing Servlet Filters
- Securing Cactus Tests
- Using HttpUnit to Perform Complex Assertions
- Testing the Output of a JSP
- When Not to Use Cactus
- Designing Testable JSPs
- 8. JUnitPerf
-
9. XDoclet
- Introduction
- Setting Up a Development Environment for Generated Files
- Setting Up Ant to Run XDoclet
- Regenerating Files That Have Changed
- Generating the EJB Deployment Descriptor
- Specifying Different EJB Specifications
- Generating EJB Home and Remote Interfaces
- Creating and Executing a Custom Template
- Extending XDoclet to Generate Custom Files
- Creating an Ant XDoclet Task
- Creating an XDoclet Tag Handler
- Creating a Template File
- Creating an XDoclet xdoclet.xml File
- Creating an XDoclet Module
-
10. Tomcat and JBoss
- Introduction
- Managing Web Applications Deployed to Tomcat
- Hot-Deploying to Tomcat
- Removing a Web Application from Tomcat
- Checking If a Web Application Is Deployed
- Starting Tomcat with Ant
- Stopping Tomcat with Ant
- Setting Up Ant to Use Tomcat’s Manager Web Application
- Hot-Deploying to JBoss
- Hot-Deploying a Web Application to JBoss
- Testing Against Multiple Servers
- 11. Additional Topics
- Index
- Colophon
Product information
- Title: Java Extreme Programming Cookbook
- Author(s):
- Release date: March 2003
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9780596003876
You might also like
book
Java Thread Programming
Java Thread Programming shows you how to take full advantage of Java's thread facilities: when to …
book
Distributed Computing in Java 9
Explore the power of distributed computing to write concurrent, scalable applications in Java About This Book …
book
Java Swing
The Swing classes eliminate Java's biggest weakness: its relatively primitive user interface toolkit. Swing provides many …
book
Java 9: Building Robust Modular Applications
Mastering advanced features of Java and implement them to build amazing projects About This Book Take …