Java Power Tools - Helion
ISBN: 978-14-919-5454-6
stron: 912, Format: ebook
Data wydania: 2008-04-22
Księgarnia: Helion
Cena książki: 177,65 zł (poprzednio: 206,57 zł)
Oszczędzasz: 14% (-28,92 zł)
All true craftsmen need the best tools to do their finest work, and programmers are no different. Java Power Tools delivers 30 open source tools designed to improve the development practices of Java developers in any size team or organization. Each chapter includes a series of short articles about one particular tool -- whether it's for build systems, version control, or other aspects of the development process -- giving you the equivalent of 30 short reference books in one package.
No matter which development method your team chooses, whether it's Agile, RUP, XP, SCRUM, or one of many others available, Java Power Tools provides practical techniques and tools to help you optimize the process. The book discusses key Java development problem areas and best practices, and focuses on open source tools that can help increase productivity in each area of the development cycle, including:
- Build tools including Ant and Maven 2
- Version control tools such as CVS and Subversion, the two most prominent open source tools
- Quality metrics tools that measure different aspects of code quality, including CheckStyle, PMD, FindBugs and Jupiter
- Technical documentation tools that can help you generate good technical documentation without spending too much effort writing and maintaining it
- Unit Testing tools including JUnit 4, TestNG, and the open source coverage tool Cobertura
- Integration, Load and Performance Testing to integrate performance tests into unit tests, load-test your application, and automatically test web services, Swing interfaces and web interfaces
- Issue management tools including Bugzilla and Trac
- Continuous Integration tools such as Continuum, Cruise Control, LuntBuild and Hudson
Osoby które kupowały "Java Power Tools", wybierały także:
- Metoda dziel i zwyci 89,00 zł, (26,70 zł -70%)
- Język C. Kurs video. Praktyczne wprowadzenie do programowania 99,00 zł, (29,70 zł -70%)
- Wprowadzenie do Javy. Programowanie i struktury danych. Wydanie XII 193,23 zł, (59,90 zł -69%)
- Spring i Spring Boot. Kurs video. Testowanie aplikacji i bezpiecze 125,42 zł, (45,15 zł -64%)
- Maven. Kurs video. Automatyzacja tworzenia aplikacji w Javie 98,98 zł, (39,59 zł -60%)
Spis treści
Java Power Tools eBook -- spis treści
- Java Power Tools
- Dedication
- Foreword
- Preface
- How This Book Is Organized
- Build Tools
- Version Control Tools
- Unit Testing
- Integration, Load, and Performance Testing
- Quality Metrics Tools
- Technical Documentation Tools
- Issue Management Tools
- Continuous Integration Tools
- Who Should Read This Book
- What This Book Doesnt Cover
- Contributing Authors
- Technical Reviewers
- Conventions
- Source Code
- About the Title
- Acknowledgments
- Using Code Examples
- Safari Enabled
- How to Contact Us
- How This Book Is Organized
- Introduction
- I. Build Tools
- 1. Setting Up a Project Using Ant
- Ant in the Build Process
- Installing Ant
- Installing Ant on a Unix Machine
- Installing Ant on Windows
- ANT_OPTS and ANT_ARGS: Some Other Useful Environment Variables
- A Gentle Introduction to Ant
- Basic Ant Concepts
- A Simple Ant Build File
- Running Ant
- Dependencies Between Targets
- Documenting Your Project
- Compiling Your Java Code in Ant
- Customizing Your Build Script Using Properties
- Running Unit Tests in Ant
- Using JUnit in Ant
- Preparing Your Build for Automated Tests
- Using the <junit> Task
- Running Multiple Tests
- Running Tests in a Separate JVM
- Generating HTML Test Reports
- Using Asserts in Your Test Cases
- Generating Documentation with Javadoc
- Packaging Your Application
- Generating a JAR File
- Generating a WAR File or an EAR File
- Deploying Your Application
- Copying Files
- Other Deployment Techniques
- Bootstrapping Your Build Scripts
- Using Maven Dependencies in Ant with the Maven Tasks
- The Maven 2.0 Ant Tasks
- Installing the Maven Ant Tasks
- Declaring and Using Maven Dependencies in Ant
- Packaging the Dependencies
- Choosing Your Repositories
- Using an Existing Maven POM File
- Using Ant in Eclipse
- Using Ant in NetBeans
- Manipulating XML with XMLTask
- Examples
- DTDs and XMLTask
- Driving Ant via XMLTask
- Other Tricks
- Changing encodings
- Maintaining documents with comments
- Conclusion
- 2. Setting Up a Project Using Maven 2
- Maven and the Development Build Process
- Maven and Ant
- Installing Maven
- Installing Maven on a Unix Machine
- Installing Maven on a Windows Machine
- Declarative Builds and the Maven Project Object Model
- An Introduction to Declarative Build Management
- Project Context and Artifacts
- A Human-Readable Project Description
- Declaring your Continuous Integration Server
- Defining the Development Team
- Managing Dependencies
- Customizing Your Build Process
- Setting Up Reporting
- Defining Build Profiles
- Understanding the Maven 2 Lifecycle
- The Maven Directory Structure
- Configuring Maven to Your Environment
- Using a Proxy
- Using a Local Mirror
- Changing Your Maven Cache Location
- Defining Arbitrary Environment-Specific Variables
- Dependency Management in Maven 2
- Declaring Dependencies
- Managing Transitive Dependencies
- Dependency Scope
- Handling Proprietary Dependencies
- Refactoring Your Dependencies Using Properties
- Looking for Dependencies with MvnRepository
- Project Inheritance and Aggregation
- Creating a Project Template with Archetypes
- Compiling Code
- Testing Your Code
- Packaging and Deploying Your Application
- Deploying an Application Using Cargo
- Using Maven in Eclipse
- Using Maven in NetBeans
- Using Plug-Ins to Customize the Build Process
- Creating a Plug-In
- Manipulating the Build Lifecycle
- Hooking into Maven
- Using Plexus Components
- Setting Up an Enterprise Repository with Archiva
- Installing Archiva
- Configuring Repositories in Archiva
- User Management
- Browsing the Repository
- Running Archiva on Another Port
- Archiva Proxy Connectors
- Setting Up Remote Repositories
- Configuring Archiva Behind a Proxy
- Using Maven with Archiva
- Manually Deploying a File to an Archiva Repository
- Setting Up an Enterprise Repository Using Artifactory
- Setting Up the Maven Repository Using Artifactory
- The Artifactory directory structure
- Deploy in Tomcat 6
- Set up the Maven repositories
- Configuring Maven to Use the New Repository
- Configure Maven using project pom.xml
- Configure Maven using settings.xml
- Building using the new Maven repository
- Installing Artifacts to the Repository
- Installing artifacts using the web UI
- Installing artifacts from Maven command line
- Running Artifactory Through a Proxy
- Adding Other Remote Repositories
- Backing Up the Repository
- Setting Up the Maven Repository Using Artifactory
- Using Ant in Maven
- Using Existing build.xml Files
- Embedding Ant Code in the POM
- External Dependencies
- Making Ant Plug-Ins
- Using Maven in Ant
- Generating Ant Script from a POM
- Advanced Archetypes
- Creating Your Own Archetypes
- Using Assemblies
- Creating Assemblies
- Built-in Descriptors
- Assemblies with Profiles
- 1. Setting Up a Project Using Ant
- II. Version Control Tools
- 3. Setting Up Version Control Using CVS
- An Introduction to CVS
- Setting Up a CVS Repository
- Creating a New Project in CVS
- Checking Out a Project
- Working with Your FilesUpdating and Committing
- Resolving a Locked Repository
- Working with Keyword Substitution
- Working with Binary Files
- Tags in CVS
- Creating Branches in CVS
- Merging Changes from a Branch
- Viewing Change History
- Reverting Changes
- Using CVS in Windows
- 4. Setting Up Version Control Using Subversion
- An Introduction to Subversion
- Revision Numbers and Atomic Updates
- Fast Branching and Tagging
- Lightweight Network Transactions
- Handling Binary Files
- Installing Subversion
- Subversion Repository Types
- Setting Up a Subversion Repository
- Setting Up a New Subversion Project
- Checking Out Your Working Copy
- Importing Existing Files into Subversion
- Understanding Subversion Repository URLs
- Working with Your Files
- Updating Your Work Directory
- Working with Your Local Copy
- Committing Your Work
- Seeing Where Youre At: The Status Command
- Resolving Conflicts
- Using Tags, Branches, and Merges
- Rolling Back to a Previous Revision
- Using File Locking with Binary Files
- Breaking and Stealing Locks
- Making Locked Files Read-Only with the svn:needs-lock Property
- Using Properties
- Preserving the Executable Flag using svn:executable
- Forcing the File Type with svn:mime-type
- Making Subversion Ignore Files with svn:ignore
- Handling OS-Specific End-of-Lines with svn:eol-style
- Change History in Subversion: Logging and Blaming
- Setting Up a Subversion Server with svnserve
- Setting Up a Secure svnserve Server
- Setting Up a WebDAV/DeltaV Enabled Subversion Server
- Setting Up a Secure WebDAV/DeltaV Server
- Customizing Subversion with Hook Scripts
- Installing Subversion As a Windows Service
- Backing Up and Restoring a Subversion Repository
- Using Subversion in Eclipse
- Installing Subclipse
- Defining a Repository
- Adding a New Project to the Repository
- Creating a Project from the Subversion Repository
- Working with Files
- Keeping Track of Changes
- Branching and Merging
- Using Subversion in NetBeans
- Installing Subversion Support
- Creating a Subversion-Based Project
- Working with Your Files
- Keeping Track of Changes
- Branching and Merging
- Using Subversion in Windows
- Using TortoiseSVN in Windows Explorer
- Importing a New Project into the Repository
- Obtaining a Working Copy
- Committing Your Changes with TortoiseSVN
- Updating Your Working Copy
- Exploring the Repository
- Defect Tracking and Change Control
- Using Subversion in Ant
- Installing the <svn> Task
- Checking Out a Project
- Updating Code from the Repository
- Exporting a Directory Structure
- Creating a New Tag
- Conclusion
- An Introduction to Subversion
- 3. Setting Up Version Control Using CVS
- III. Continuous Integration
- 5. Setting Up a Continuous Integration Server with Continuum
- An Introduction to Continuum
- Installing a Continuum Server
- Manually Starting and Stopping the Server
- Checking the Status of the Server
- Running the Continuum Server in Verbose Mode
- Adding a Project Group
- Adding a Maven Project
- Adding an Ant Project
- Adding a Shell Project
- Managing Your Project Builds
- Managing Users
- Setting Up Notifiers
- Configuring and Scheduling Builds
- Debugging Your Builds
- Configuring the Continuum Mail Server
- Configuring the Continuum Web Site Ports
- Automatically Generating a Maven Site with Continuum
- Configuring a Manual Build Task
- Conclusion
- 6. Setting Up a Continuous Integration Server with CruiseControl
- An Introduction to CruiseControl
- Installing CruiseControl
- Configuring an Ant Project
- Keeping People Notified with Publishers
- Setting Up a Maven 2 Project in CruiseControl
- The CruiseControl Dashboard
- Third-Party Tools
- CruiseControl Configuration Tool
- Firefox and Thunderbird Integration
- Conclusion
- 7. LuntBuildA Web-Based Continuous Integration Server
- An Introduction to LuntBuild
- Installing LuntBuild
- Configuring the LuntBuild Server
- Adding a Project
- Configuring the Project Basics
- VCS Adaptors
- Builders
- Scheduling
- Login Mapping
- Using Project Variables for Version Numbering
- Build Results Diagnostics
- Using LuntBuild with Eclipse
- Reporting on Test Coverage in Luntbuild Using Cobertura
- Introduction
- Extending Luntbuild with Extension Points
- Creating a Cobertura Luntbuild Extension
- Using the Extension
- Running Cobertura with Ant
- Integrating Luntbuild with Maven
- Introduction
- Extending Maven to Support LuntBuild
- Setting up your project
- Creating the Mojo
- Integrating the Mojo with Maven
- Luntbuild Configuration
- Conclusion
- 8. Continuous Integration with Hudson
- An Introduction to Hudson
- Installing Hudson
- Managing the Hudson Home Directory
- Installing Upgrades
- Configuring Hudson
- Adding a New Build Job
- Building a Freestyle Project
- Building a Maven Project
- Organizing Your Jobs
- Monitoring Your Builds
- Viewing and Promoting a Particular Build
- Managing Users
- Authentication and Security
- Viewing Changes
- Hudson Plug-Ins
- Keeping Track of Test Results
- Keeping Track of Code Metrics
- Reporting on Code Coverage
- 9. Setting Up an Instant Messaging Platform with Openfire
- Instant Messaging in a Development Project
- Installing Openfire
- Setting Up Users and Accounts on Openfire
- Authenticating Users in an External Database
- Authenticating Users Against a POP3 Server
- Virtual Team Meetings with the Group Chat
- Extended Functionality with Openfire Plug-Ins
- Using Openfire with Continuum
- Using Openfire with CruiseControl
- Using Openfire with Luntbuild
- Sending Jabber Messages from a Java Application Using the Smack API
- Detecting Presence Using the Smack API
- Receiving Messages Using the Smack API
- 5. Setting Up a Continuous Integration Server with Continuum
- IV. Unit Testing
- 10. Testing Your Code with JUnit
- JUnit 3.8 and JUnit 4
- Unit Testing with JUnit 4
- Setting Up and Optimizing Your Unit Test Cases
- Simple Performance Testing Using Timeouts
- Checking for Exceptions the Easy Way
- Using Parameterized Tests
- Using assertThat and the Hamcrest Library
- JUnit 4 Theories
- Using JUnit 4 with Maven 2
- Using JUnit 4 with Ant
- Selectively Running JUnit 4 Tests in Ant
- Running Individual Tests
- Running Tests Conditionally
- Integration Tests
- Using JUnit 4 in Eclipse
- 11. Next-Generation Testing with TestNG
- Introducing TestNG
- Creating Simple Unit Tests with TestNG
- Defining TestNG Test Suites
- The TestNG Eclipse Plug-In
- Installing the TestNG Plug-In
- Running TestNG Tests
- Using TestNG in Ant
- Using TestNG with Maven 2
- Managing the Test Lifecycle
- Using Test Groups
- Managing Dependencies
- Parallel Testing
- Test Parameters and Data-Driven Testing
- Checking for Exceptions
- Handling Partial Failures
- Rerunning Failed Tests
- 12. Maximizing Test Coverage with Cobertura
- Test Coverage
- Running Cobertura from Ant
- Checking the Code Coverage of TestNG Tests
- Interpreting the Cobertura Report
- Enforcing High Code Coverage
- Generating Cobertura Reports in Maven
- Integrating Coverage Tests into the Maven Build Process
- Code Coverage in Eclipse
- Conclusion
- 10. Testing Your Code with JUnit
- V. Integration, Functional, Load, and Performance Testing
- 13. Testing a Struts Application with StrutsTestCase
- Introduction
- Testing a Struts Application
- Introducing StrutsTestCase
- Mock Tests Using StrutsTestCase
- Testing Struts Error Handling
- Customizing the Test Environment
- First-Level Performance Testing
- Conclusion
- 14. Integration Testing Databases with DbUnit
- Introduction
- Overview
- Purpose of DbUnit
- Setting Up DbUnit
- Running with DbUnit
- DbUnit Structure
- DatabaseTestCase
- IDatabaseConnection
- IDataSet
- ITable
- ITableMetaData
- Example Application
- Priming the Database
- Verifying Querying a Single Row
- Verifying Querying Multiple Rows
- Specifying NULLs by Omission
- Specifying NULLs by DTD
- Verifying the Database
- Verifying an UPDATE
- Verifying a DELETE
- Verifying an INSERT, Ignoring the Key
- Verifying an INSERT, with the Key
- Replacing Values
- Using NULL with a ReplacementDataSet
- Using NULL with a ValueReplacer
- Using an Image ValueReplacer
- Alternative Dataset Formats
- Using an XLS Dataset
- Using a CSV Dataset
- Using an InlineDataSet
- Dealing with Custom Data Types
- Specifying an INTERVALDS Data Type
- Other Applications
- Injecting the Test Fixture
- Using Transaction Rollback Teardown
- Testing a Stored Procedure
- Testing a View
- Exporting a Dataset with Ant
- Importing a Dataset with Ant
- 15. Performance Testing with JUnitPerf
- Introducing JUnitPerf
- Measuring Performance with TimedTests
- SimulatingLoad with LoadTests
- Load-Testing Tests That Are Not Thread-Safe
- Separating Performance Tests from Unit Tests in Ant
- Separating Performance Tests from Unit Tests in Maven
- 16. Load and Performance Testing with JMeter
- Introduction
- Installing JMeter
- Testing a Simple Web Application
- Setting Up a Thread Group
- Scheduling Your Tests
- Setting Up the HTTP Request Configuration Elements
- Adding an HTTP Request
- Structuring Your Test Case
- Recording and Displaying Test Results
- Visualizing Performance with the Graph Listener
- Getting More Details with the View Results Tree Listener
- Getting the Executive Summary
- Using the JMeter Proxy to Record a Test Case
- Testing Using Variables
- Testing on Multiple Machines
- 17. Testing Web Services with SoapUI
- Introduction
- An Introduction to SoapUI
- Web Service Testing
- Web Service Development
- When Is SoapUI Appropriate?
- Installing SoapUI
- Installing a Local Web Service
- Testing Web Services with SoapUI
- Load-Testing with SoapUI
- Running SoapUI from the Command Line
- Running SoapUI from Ant
- Running SoapUI from Maven
- Continuous Testing
- Conclusion
- 18. Profiling and Monitoring Java Applications Using the Sun JDK Tools
- The Sun JDK Profiling and Monitoring Tools
- Connecting To and Monitoring a Java Application with jConsole
- Monitoring a Remote Tomcat Application with jConsole
- Detecting and Identifying Memory Leaks with the JDK Tools
- Diagnosing Memory Leaks Using Heap Dumps, jmap, and jhat
- Detecting Deadlocks
- 19. Profiling Java Applications in Eclipse
- Profiling Applications from Within an IDE
- The Eclipse Test & Performance Tools Platform
- Installing TPTP
- TPTP and Java 6
- Basic Profiling with TPTP
- Studying Memory Use with the Basic Memory Analysis Results
- Analyzing Execution Time
- Displaying Coverage Statistics
- Using Filters to Refine Your Results
- Profiling a Web Application
- Conclusion
- 20. Testing Your User Interfaces
- Introduction
- Testing Your Web Application with Selenium
- Introduction
- Using the Selenium IDE
- Writing Selenium Test Scripts
- An introduction to Selenese
- Referring to objects on the web page
- Using variables
- Using assertions
- Running a Selenium Test Suite with Selenium Core
- Writing JUnit Tests with Selenium
- Using Selenium with Ant
- Using Selenium with Maven
- Testing Swing GUIs with FEST
- Introduction
- Testing GUIs Is Hard
- Introducing FEST
- Testing GUIs with FEST
- Following Windows with FEST
- Verifying Test Failures
- Testing Legacy Applications
- Tips for Writing Testable GUIs
- Conclusion
- 13. Testing a Struts Application with StrutsTestCase
- VI. Quality Metrics Tools
- 21. Detecting and Enforcing Coding Standards with Checkstyle
- Using Checkstyle to Enforce Coding Standards
- Using Checkstyle in Eclipse
- Customizing Checkstyle Rules in Eclipse
- Customizing Checkstyle Rules Using the XML Configuration Files
- Customizing Checkstyle: Common Rules That You Can Do Without, and Some That You Could Use
- Defining Rules for Source Code Headers with Checkstyle
- Suppressing Checkstyle Tests
- Using Checkstyle with Ant
- Using Checkstyle with Maven
- 22. Preemptive Error Detection with PMD
- PMD and Static Code Analysis
- Using PMD in Eclipse
- Installing the PMD Plug-In
- Detecting and Displaying Errors
- Configuring PMD Rules in Eclipse
- More on the PMD Rulesets
- Writing Your Own PMD Ruleset
- Generating a PMD Report in Eclipse
- Suppressing PMD Rules
- Detecting Cut-and-Paste with CPD
- Using PMD in Ant
- Using PMD in Maven
- 23. Preemptive Error Detection with FindBugs
- FindBugs: A Specialized Bug Killer
- Using FindBugs in Eclipse
- Installing the FindBugs Plug-In
- Detecting and Displaying Errors
- Selectively Suppressing Rules with FindBug Filters
- Using FindBugs Annotations
- Using FindBugs in Ant
- Using FindBugs in Maven
- Conclusion
- 24. Inspecting the ResultsSemiautomated Code Review with Jupiter
- Introducing JupiterA Code Review Tool for Eclipse
- Installing Jupiter in Eclipse
- Understanding the Jupiter Code Review Process
- Conducting Personal Code Reviews
- Configuration
- Setting Up Default Configuration Values
- Individual Reviews
- Team Review
- Rework Phase
- Jupiter Behind the Scenes
- Conclusion
- 25. Sharpen Your Focus with Mylyn
- Introduction to Mylyn
- Installing Mylyn
- Tracking Tasks and Issues
- Interacting with Task Repositories
- Focusing on a Task with Context Management
- Using the Eclipse Change Sets
- Sharing Context with Other Developers
- Conclusion
- 26. Monitoring Build Statistics
- Introduction
- QALab
- Using QALab in Ant
- Using QALab in Maven
- Source Code Management Metrics with StatSCM
- Statistics in Ant with StatSVN
- Installing StatSVN
- Extracting the Subversion Logfiles
- Generating the StatSVN Reports
- 21. Detecting and Enforcing Coding Standards with Checkstyle
- VII. Issue Management Tools
- 27. Bugzilla
- An Introduction to Bugzilla
- Installing Bugzilla
- System Prerequisites
- Installing the Bugzilla Application
- Installing the Perl Modules
- Installing the Bugzilla Application
- Configuring the Web Server
- Setting Up Your Bugzilla Environment
- Managing User Accounts
- Restricting Access Using User Groups
- Configuring a Product
- Tracking Progress with Milestones
- Managing Groups of Products with Classifications
- Searching for Bugs
- Creating a New Bug
- The Lifecycle of a Bugzilla Bug
- Scheduling Notifications (Whining)
- Customizing Fields in Bugzilla
- Conclusion
- 28. TracLightweight Project Management
- An Introduction to Trac
- Installing Trac
- Setting Up a Trac Project
- Running Trac on the Standalone Server
- Setting Up Tracd As a Windows Service
- Installing Trac on an Apache Server
- Administrating the Trac Site
- Managing User Accounts
- Tailoring the Trac Web Site: Using the Wiki Function
- Using the Trac Ticket Management System
- Creating a New Ticket
- The Lifecycle of a Trac Ticket
- Updating Trac Issues from Subversion
- Customizing Trac Ticket Fields
- Setting Up Email Notifications
- Reporting Using Trac Queries and Reports
- Managing Progress with Trac Roadmaps and Timelines
- Trac Milestones
- The Timeline View
- Browsing the Source Code Repository
- Using RSS and ICalendar
- Customizing a Wiki Page with Python
- Conclusion
- 27. Bugzilla
- VIII. Technical Documentation Tools
- 29. Team Communication with the Maven 2 Project Web Site
- The Maven 2 Project Web Site As a Communication Tool
- Setting Up a Maven Site Project
- Describing the Project
- Linking into the Issue Tracking System
- The Continuous Integration System
- The Project Team
- Mailing Lists
- The Source Repository
- Generating the Site
- Integrating Reports into Your Site
- Javadocs
- Unit Test Reports
- Test Coverage Reports
- Code Analysis Reports
- Change and Configuration Management
- Creating a Dedicated Maven Site Project
- Defining the Site Outline
- The Maven Site Generation Architecture
- Doxia
- APT
- FML
- XDoc
- Using Snippets
- Customizing the Look and Feel of Your Site
- Changing Skins
- Creating Your Own Style
- Velocity Manipulation
- Distributing Your Site
- 30. Automatically Generating Technical Documentation
- Introduction
- Visualizing a Database Structure with SchemaSpy
- Introduction
- An Overview of SchemaSpy
- Installing SchemaSpy
- Using SchemaSpy
- Using SchemaSpy in Ant
- Using SchemaSpy in Maven
- Generating Source Code Documentation with Doxygen
- Introduction
- The Doxygen Reports
- Installing Doxygen
- Configuring Doxygen
- Running Doxygen from the Command Line
- Using Doxygen with Ant
- How to Make Your Java Classes Doxygen-Friendly
- Using the brief descriptions
- Lists
- Links and references
- Documenting packages
- Documenting the home page
- Embedding UML Diagrams in Your Javadoc with UmlGraph
- Using UmlGraph in Ant
- Using UmlGraph in Maven
- Conclusion
- 29. Team Communication with the Maven 2 Project Web Site
- Bibliography
- Index
- About the Author
- Colophon
- Copyright