0

I want to run some tests against Java EE 7 components. I read a bit about Arquillian it seems to be well suited for this kind of problems. I have a problem with configuration though. I managed to get it running on embeded GlassFish, managed WildFly and remote WildFly. Ideally I'd like to use the later option for the tests as WildFly is the app server of my choice for the application and the remote mode will use the running server instead of starting it each time I want to run the tests. I suffer attaching the debugger to the WildFly 9 though.

I uncommented the line in standalone.conf.bat:

set "JAVA_OPTS=%JAVA_OPTS% -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n"

and added below part to the arquillian.xml:

<engine>
    <property name="deploymentExportPath">target/</property>
</engine>
<container qualifier="wildfly" default="true">
    <protocol type="jmx-as7">
        <property name="executionType">REMOTE</property>
    </protocol>
    <configuration>
        <property name="javaVmArguments">-Xmx512m -XX:MaxPermSize=128m -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8787</property>
    </configuration>
</container>

The test itself is executed correctly (I can see correct test results and WildFly console shows the deployment and console output as expected). However the debugger still doesn't stop at the breakpoint. I start it from Intellij Idea as a regular JUnit test. Here's the warning I get upon start of each test:

WARNING: Configuration contain properties not supported by the backing object org.jboss.as.arquillian.container.remote.RemoteContainerConfiguration
Unused property entries: {javaVmArguments=-Xmx512m -XX:MaxPermSize=128m -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8787}
Supported property names: [managementAddress, password, managementPort, managementProtocol, username]
    enter code here

What am I doing wrong here?

Sevan
  • 669
  • 1
  • 5
  • 18
vers
  • 29
  • 5

1 Answers1

2

You'll need to connect to wildfly as a remote service to execute the debugger. The debug test option will only debug the client side of the test, not the server side execution.

These instructions should help you get connected. https://www.jetbrains.com/idea/help/run-debug-configuration-remote.html

I find it best to use a remote server in this setup, since you can connect the debugger on start up and not have to time it as a part of the test execution.

John Ament
  • 11,595
  • 1
  • 36
  • 45
  • Thanks that works. I made a remote configuration to first connect to the debugger and then when i run my tests in debug mode the debugger stops on the breakpoints. Many thanks for that – vers Nov 22 '15 at 21:42