Enterprise Java Development@TOPIC@
Deploy artifacts to server
Run IT tests in IDE
Connect with Debugger
Figure 93.1. Deploy Artifacts
$mvn clean pre-integration-test ... 22:51:43,460 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named GreeterEJB in deployment unit subdeployment "ejb-basic-ejb.jar" of deployment "ejb-basic-ear-4.0.0-SNAPSHOT.ear" are as follows: java:global/ejb-basic-ear/ejb-basic-ejb/GreeterEJB!info.ejava.examples.ejb.basic.ejb.GreeterRemote java:app/ejb-basic-ejb/GreeterEJB!info.ejava.examples.ejb.basic.ejb.GreeterRemote java:module/GreeterEJB!info.ejava.examples.ejb.basic.ejb.GreeterRemote java:jboss/exported/ejb-basic-ear/ejb-basic-ejb/GreeterEJB!info.ejava.examples.ejb.basic.ejb.GreeterRemote java:global/ejb-basic-ear/ejb-basic-ejb/GreeterEJB java:app/ejb-basic-ejb/GreeterEJB java:module/GreeterEJB 22:51:43,563 INFO [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016005: Starting Services for CDI deployment: ejb-basic-ear-4.0.0-SNAPSHOT.ear
Deploy artifacts using Maven command from either module parent or IT test module
Build from parent will re-build, deploy, and leave deployed the artifacts
Can select a specific test or package of tests
Leverage reasonable hard-coded defaults and filtered resource files to make JUnit tests IDE friendly so that much of heavyweight Maven setup and teardown can be skipped when focusing on specific tests.
The following information is for remote debugging a standalone server. If you are using the IDE embedded mode, just re-start your server using the debug option and add source references as needed.
Figure 93.4. Enable Remote Debugging in Server
# wildfly-8.1.0.Final/bin/standalone.conf # Sample JPDA settings for remote socket debugging JAVA_OPTS="$JAVA_OPTS -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n"
Not required when using embedded server (just use debug-as)
Standalone server must be restarted after making this edit
Figure 93.6. Standalone Server Debugger Listen Port
========================================================================= Listening for transport dt_socket at address: 8787 22:51:31,542 INFO [org.jboss.modules] (main) JBoss Modules version 1.3.3.Final 22:51:32,276 INFO [org.jboss.msc] (main) JBoss MSC version 1.2.2.Final 22:51:32,526 INFO [org.jboss.as] (MSC service thread 1-2) JBAS015899: WildFly 8.1.0.Final "Kenny" starting
Debugger Client port must match what JBoss debugger listen port
You can optionally add modules now to resolve source code references
Execution will stop at server breakpoint
No sourcecode will show up if not yet in search path
Add as many projects as you wish
You may have to stop and re-run your test for the source code path to take effect.
Notice we are seeing variables as well as line of execution