Java 2EE and XML Development

Скачать в pdf «Java 2EE and XML Development»


J2EE


log messages


Logging


Components


-►


Interface


(vendor independent)


(vendor independent)

Interfaces



Logging


Subsystem


(vendor)


Figure 1.8 Logging adapter mechanism


Rather than creating your own logging infrastructure from scratch or using your vendor’s logging API, you may decide to standardize on an open source logging API such as Log4j from the Apache Software Foundation. Information on Log4j can be found at http://jakarta.apache.org.


If you are already using JDK version 1.4 or later as you read this, your logging can be done via the standard Java API classes in the package java.util.logging. Support for JDK 1.4 in J2EE server products should minimize logging implementation issues in the future.


The second phase of EJB testing is deploying the bean and thoroughly exercising its local or remote interface against some predictable results (perhaps a prepopulated test database). Apache’s Cactus framework or JUnitEE are alternatives in this area, although both require a healthy amount of configuration


Getting started


and test code development. The JProbe software suite also integrates with many J2EE servers for more automated EJB testing of remote interfaces.

Testing local EJBs and dependent objects


Since EJBs accessed via a remote interface should be coarse-grained components, many rely on the functionality provided by other local EJBs or dependent objects for tasks like data persistence, remote system interactions, and service interfaces. Testing an EJB that is only available locally requires testing code to be running in the same JVM as the EJB. Fortunately, this can be accomplished using Cactus or JUnitEE in most circumstances.

Скачать в pdf «Java 2EE and XML Development»