Continuous Enterprise Development in Java

Book description

Learn a use-case approach for developing Java enterprise applications in a continuously test-driven fashion. With this hands-on guide, authors and JBoss project leaders Andrew Lee Rubinger and Aslak Knutsen show you how to build high-level components, from persistent storage to the user interface, using the Arquillian testing platform and several other JBoss projects and tools.

Through the course of the book, you’ll build a production-ready software conference tracker called GeekSeek, using source code from GitHub. Rubinger and Knutsen demonstrate why testing is the very foundation of development—essential for ensuring that code is consumable, complete, and correct.

  • Bootstrap an elementary Java EE project from start to finish before diving into the full-example application, GeekSeek
  • Use both relational and NoSQL storage models to build and test GeekSeek’s data persistence layers
  • Tackle testable business logic development and asynchronous messaging with an SMTP service
  • Expose enterprise services as a RESTful interface, using Java EE’s JAX-RS framework
  • Implement OAuth authentication with JBoss’s PicketLink identity management service
  • Validate the UI by automating interaction in the browser and reading the rendered page
  • Perform full-scale integration testing on the final deployable archive

Publisher resources

View/Submit Errata

Table of contents

  1. Foreword
  2. Preface
    1. Conventions Used in This Book
    2. Using Code Examples
    3. Safari® Books Online
    4. How to Contact Us
    5. Acknowledgments
  3. 1. Continuity
    1. The Zen of Prevention
      1. Reactive Error Handling
      2. Proactive Quality Policies
    2. Software Development Processes
      1. Serial Models
      2. Iterative Models
        1. Extreme Programming
    3. Testing Is Development
    4. Levels of Testing
      1. Unit
      2. Integration
    5. Foundation Test Frameworks
      1. JUnit
      2. TestNG
    6. Continuous Development
  4. 2. Enabling Technologies
    1. Bootstrapping
      1. Apache Maven
      2. JBoss Forge
    2. Version Control
      1. Git
    3. A Test Platform for Java EE
      1. Arquillian
      2. ShrinkWrap
      3. ShrinkWrap Resolvers
        1. Adding ShrinkWrap Resolvers to your project
        2. Resolution of artifacts specified by Maven coordinates
        3. Resolution of artifacts defined in POM files
        4. System properties
      4. Experimental Features
        1. ShrinkWrap Resolvers Maven plug-in
        2. MavenImporter
    4. Runtime
      1. WildFly
      2. OpenShift
    5. On to the Code
  5. 3. Scratch to Production
    1. The Development Environment
    2. A New Project
    3. Writing Our First Integration Test with Arquillian
    4. Running the Application Locally
    5. Running the Arquillian Integration Test
    6. Deploying to OpenShift via JBoss Developer Studio
  6. 4. Requirements and the Example Application
    1. Introducing GeekSeek
      1. Featureset
      2. Conceptual Data Model
        1. User
        2. Conference
        3. Session
        4. Attachment
        5. Venue
        6. Room
      3. Logical Data Model
        1. Relationships
        2. Intended use
      4. Obtaining, Building, Testing, and Running GeekSeek
        1. Obtaining the source
        2. Building and testing GeekSeek
        3. Running GeekSeek
    2. Use Cases and Chapter Guide
      1. Chapter 5: Java Persistence and Relational Data
      2. Chapter 6: NoSQL: Data Grids and Graph Databases
      3. Chapter 7: Business Logic and the Services Layer
      4. Chapter 8: REST and Addressable Services
      5. Chapter 9: Security
      6. Chapter 10: UI
      7. Chapter 11: Assembly and Deployment
  7. 5. Java Persistence and Relational Data
    1. The Relational Database Model
    2. The Java Persistence API
      1. POJO Entities
    3. Use Cases and Requirements
      1. User Perspective
      2. Technical Concerns
    4. Implementation
      1. Entity Objects
      2. Repository EJBs
    5. Requirement Test Scenarios
      1. Test Setup
      2. CRUD Tests
  8. 6. NoSQL: Data Grids and Graph Databases
    1. RDBMS: Bad at Binary Data
      1. Data Grids
        1. Infinispan
    2. RDBMS: Bad at Relationships
      1. Graph Theory
        1. Neo4j
    3. Use Cases and Requirements
    4. Implementation
      1. Attachment
      2. Relation
    5. Requirement Test Scenarios
      1. Attachment CRUD Tests
      2. Transactional Integrity of Attachment Persistence
      3. Validating Relationships
  9. 7. Business Logic and the Services Layer
    1. Use Cases and Requirements
      1. Send Email on New User Signup
    2. Implementation
    3. Requirement Test Scenarios
      1. A Test-Only SMTP Server
      2. The Test
  10. 8. REST and Addressable Services
    1. REST in Enterprise Java: The JAX-RS Specification
    2. Use Cases and Requirements
    3. Implementation
      1. Repository Resources
      2. The Representation Converter
      3. The @ResourceModel
      4. LinkableRepresentation
      5. ResourceLink
    4. Requirement Test Scenarios
      1. A Black-Box Test
      2. Validating the HTTP Contracts with Warp
      3. Arquillian Warp
        1. Gray-box testing
        2. Integration testing
        3. Technology independence
        4. Use cases
        5. Deploying Warp
        6. Supported tools and frameworks
          1. Cross-protocol
          2. Client-side testing tools
        7. Frameworks
      4. Test Harness Setup
      5. The HTTP Contracts Test
  11. 9. Security
    1. Use Cases and Requirements
    2. Implementation
      1. Supporting Software
        1. PicketLink: application-level security
        2. Agorava and social authentication
    3. Requirement Test Scenarios
      1. Overview
      2. Setup
      3. Security Tests
        1. Secured options
        2. Testing the current user
        3. OAuth
  12. 10. The User Interface
    1. Use Cases and Requirements
    2. Implementation
    3. Requirement Test Scenarios
      1. Pure JavaScript
      2. Functional Behavior
  13. 11. Assembly and Deployment
    1. Obtaining JBoss EAP
    2. Running Against JBoss EAP
      1. Using the EAP Remote Container
      2. Using the EAP Managed Container
    3. Continuous Integration and the Authoritative Build Server
      1. Configuring the GeekSeek Build on CloudBees
      2. Populating CloudBees Jenkins with the EAP Repository
      3. Automatic Building on Git Push Events
    4. Pushing to Staging and Production
      1. Setting Up the OpenShift Application
      2. Removing the Default OpenShift Application
      3. Pushing from the CI Build Job to OpenShift
  14. 12. Epilogue
  15. Index
  16. Colophon
  17. Copyright

Product information

  • Title: Continuous Enterprise Development in Java
  • Author(s): Andrew Lee Rubinger, Aslak Knutsen
  • Release date: March 2014
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781449332105