JBoss Trading – Multi Module JBoss EAP 5 Project

This is a modular project developed for Java EE 5 performance testing JBoss Enterprise Application Platform 5 hosted on GitHub.

The Java EE 5 version of the project is configured for JBoss EAP 5 deployment.

https://github.com/shane-k-j/jboss-trading/tree/1.x

Implementations

  • EJB3 – Local / Remote SLSB
  • Messaging – JMS (JBoss Messaging)
  • Persistence – JPA ( Hibernate)
  • REST – JAX-RS (RESTEasy)
  • Web Services – JAX-WS (JBossWS Native)

Arquillian Tests

  • EJB

Integration Tests

  • Remote EJB Client
  • REST Client
  • Web Service Client

Performance Tests

  • JMeter (Remote EJB / REST / Web Service)

Modules

  • JBoss Trading
  • JBoss Trading API
  • JBoss Trading Client Test Distribution
  • JBoss Trading Client Test Perf
  • JBoss Trading EJB Client
  • JBoss Trading EJB Client Test Config
  • JBoss Trading Parent
  • JBoss Trading REST
  • JBoss Trading REST Client
  • JBoss Trading REST Client Test Config
  • JBoss Trading RESTEasy JAX-RS
  • JBoss Trading Services
  • JBoss Trading Test
  • JBoss Trading Test Config
  • JBoss Trading WS Client
  • JBoss Trading WS Client Test Config

Core Modules

JBoss Trading

This is the root project. It defines the application modules.

JBoss Trading Parent

This is the parent module. It defines the properties, dependencies (e.g. – logging API), build configuration, and repositories that are inherited by the application modules.

JBoss Trading API

This module provides the API for the service.

  • Java
    • POJO Model
    • JAX-RS Annotations (e.g. – @Path)
    • JAX-RS Exception Mappers (e.g. – @Provider)

JBoss Trading Services

This module provides an implementation of the service interface and uses standard Java EE 5 annotations to deploy it as both an EJB, stateless session bean (SLSB), and a web service. The EJB local and remote interfaces inherit the JAX-RS annotations from the service interface in the JBoss Trading API module so that RESTEasy can register the EJB as a REST resource.

  • Java
    • EJB Annotations (e.g. – @Stateless)
    • EJB Transactions (e.g. – @TransactionAttribute)
    • JAX-WS Annotations (e.g. – @WebService)
    • Java EE 5 Annotations – @PersistentContext & @Resource
    • JMS Message Listener / Message Drive Bean (MDB) – @MessageDriven
    • JMS Message Producer
    • JPA Model (e.g. – @Entity) and Queries
  • JBoss
    • Annotations – @WebContext & @Depends
    • Arquillian + JUnit
    • JMS Queue (trading-queue-service.xml)
    • Hibernate Second Level Cache (persistence.xml)
  • Maven
    • Generated EJB Client JAR
    • Resource Filtering (persistence.xml)
    • Arquillian and JBoss dependencies are added to a profile for integration testing.

JBoss Trading REST

The build artifact for this module is a WAR. The web.xml file contains RESTEasy configuration to register the EJB in the JBoss Trading Services module as a resource and to register the exception mappers in the JBoss Trading API module.

  • ‘Skinny’ WAR
    • No libraries.
    • No classes.

JBoss Trading RESTEasy JAX-RS

This module builds a replacement RESTEasy dependency with an updated AnnotationResolver. The update resolver can detect the JAX-RS annotations on the service interface in the JBoss Trading API module that are inherited by the EJB local and remote interfaces in the JBoss Trading API module.

  • Maven
    • The Dependency plugin is configured to unpack RESTEasy excluding the AnnotationResolver class.

JBoss Trading App

The build artifact for this module is an EAR containing the JBoss Trading Services EJB JAR, the JBoss Trading REST WAR, and required dependencies.

  • Maven
    • JBoss Trading RESTEasy JAX-RS and required RESTEasy dependencies are added to this module rather than the JBoss Trading REST module (documentation).
    • The Ear plugin is configured to copy the dependencies to the ‘lib‘ directory of the archive as noted here.

Client / Configuration & Integration Test / Configuration Modules

JBoss Trading Test

This module provides a class for parsing a client agnostic configuration properties file. However, it does not provide a test configuration properties file itself. That file is provided by a separate module. By separating the properties file from the parser, the test configuration properties file for a project can be substituted by changing the test configuration dependency.

JBoss Trading Test Config

This module provides a client agnostic test configuration properties file for the class provided by the JBoss Trading Test module.

  • Maven
    • Resource Filtering (test.properties)

JBoss Trading EJB Client

This module provides a remote EJB client. The build artifacts are a client JAR and a test JAR. While this module provides a class to parse an EJB client test configuration properties file , it does not provide a file itself. That file is provided by a separate module. By separating the properties file from the parser, the EJB client test configuration properties file for a project can be substituted by changing the EJB client test configuration dependency.

  • Java
    • Implements the service interface in the JBoss Trading API module.
    • Looks up the EJB via JNDI.
  • Maven
    • The Dependenc plugin is configured to copy the JBoss Trading App EAR from the repository.
    • Integration testing is configured in the Surefire plugin.
    • The Codehaus Cargo plugin is configured in a profile to deploy and undeploy the copied JBoss Trading App EAR before and after integration testing.
    • Profile (Integration Testing)

JBoss Trading EJB Client Test Config

This module provides an EJB client test configuration properties file for the class provided by the JBoss Trading EJB Client module.

Maven

  • Resource Filtering (ejb-client-test.properties)

JBoss Trading REST Client

This modules provides a REST client. The build artifacts are a client JAR and a test JAR. While this module provides a class to parse a REST client test configuration properties file , it does not provide a file itself. That file is provided by a separate module. By separating the properties file from the parser, the REST client test configuration properties file for a project can be substituted by changing the REST client test configuration dependency.

  • Java
    • Implements the service interface in the JBoss Trading API module.
  • JBoss
    • RESTEasy generates the proxy at runtime using the JAX-RS annotated service interface in the JBoss Trading API module.
  • Maven
    • The Dependency plugin is configured to copy the JBoss Trading App EAR from the repository.
    • Integration testing is configured in the Surefire plugin.
    • The Codehaus Cargo plugin is configured in a profile to deploy and undeploy the copied JBoss Trading App EAR before and after integration testing.
    • Profile (Integration Testing)

JBoss Trading REST Client Test Config

This module provides a REST client test configuration properties file for the class provided by the JBoss Trading REST Client module.

  • Maven
    • Resource Filtering (rest-client-test.properties)

JBoss Trading WS Client

This modules provides a web service client. The build artifacts are a client JAR and a test JAR. While this module provides a class to parse a web service client test configuration properties file , it does not provide a file itself. That file is provided by a separate module. By separating the properties file from the parser, the web service client test configuration properties file for a project can be substituted by changing the web service client test configuration dependency.

  • Maven
    • The Apache CXF Java2WS plugin is configured to generate a WSDL using the JAX-WS annotated EJB interface in the JBoss Trading Services module.
    • The Apache CXF Code Generation plugin generates the client classes using the generated WSDL.
    • The Dependency plugin is configured to copy the JBoss Trading App EAR from the repository.
    • Integration testing is configured in the Surefire plugin.
    • The Codehaus Cargo plugin is configured in a profile to deploy and undeploy the copied JBoss Trading App EAR before and after integration testing.
    • Profile (Integration Testing)

JBoss Trading WS Client Test Config

This module provides a web service client test configuration properties file for the class provided by the JBoss Trading WS Client module.

  • Maven
    • Resource Filtering (ws-client-test.properties)

Performance Testing Modules

JBoss Trading Client Test Perf

This module executes performance tests using JMeter and generates an HTML report.

  • Maven
    • The Dependency plugin is configured to copy the JBoss Trading App EAR from the repository.
    • The Codehaus Cargo plugin is configured in a profile to deploy and undeploy the copied JBoss Trading App EAR before and after performance testing.
    • The Codehaus Chronos JMeter plugin is configured to download / unpack Apache JMeter and execute the test plan (trading-all.jmx).
    • The CodeHaus Report plugin is configured to generate an HTML report.

JBoss Trading Client Test Distribution

The build artifact for this module is a ZIP archive containing all of the dependencies necessary to execute all of the client (EJB / REST /WS) integration tests from an Apache JMeter installation outside of Maven. This archive does not include the JBoss Trading Test Config module or any of the JBoss Trading (EJB | REST | WS) Client Test Config modules. As a result, separate test configuration and client test configuration properties files can be supplied.

  • Maven
    • The Assembly plugin is configured to build the ZIP archive using a descriptor (client-test-config.xml).

</post>

JBoss EAP 5 & Maven

  • JBoss Maven Java EE 5 Dependencies (link)
  • Configuring the Maven Ear Plugin for JBoss EAP 5 (link)
  • Integration Testing w/ Maven, Cargo, & JBoss EAP 5 (link)
  • Integration Testing w/ Maven, Arquillian, & JBoss EAP 5 (link)
  • JBoss EAP 5 Multi-Module Maven Project Structures (link)
  • JBoss Trading – Multi Module JBoss EAP 5 Project
, , ,

About Shane K Johnson

Technical Marketing Manager, Red Hat Inc.

View all posts by Shane K Johnson

2 Comments on “JBoss Trading – Multi Module JBoss EAP 5 Project”

  1. Shane K Johnson Says:

    FYI

    I use Maven 3 (Linux).

    A colleague was unable to successfully build the project with Maven 2 (Windows). The project failed to compile because Maven did not download all of the dependencies. After switching to Maven 3, all of the dependencies were downloaded and he was able to successfully build the project.

    Another colleague was able to successfully build the project with Maven in JBDS 4.1 (OS X).

    Reply

  2. Shane K Johnson Says:

    The project has been updated.

    When using the localhost-remote profile, Maven will attempt to download transitive dependencies from the old JBoss Maven repository instead of the new JBoss Nexus repository.

    The JBoss Deprecated Repository has been removed from the parent POM. Instead, a mirror should be configured in the settings.xml file as noted in the README.txt file.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: