Question

I've created a Junit Suite Tests with Embeddable EJB using the following dependency:

<dependency>
    <groupId>org.jboss.ejb3.embedded</groupId>
    <artifactId>jboss-ejb3-embedded-standalone</artifactId>
    <version>1.0.0-alpha-2</version>
</dependency>

However, when the container (JBoss) is started through of "EJBContainer.createEJBContainer();", I don't know how to pass the options as any of these:

usage: run.sh [options]
-h, --help                  Show this help message
-V, --version               Show version information
--                          Stop processing options
-D<name>[=<value>]          Set a system property
-d, --bootdir=<dir>         Set the boot patch directory; Must be absolute or url
-p, --patchdir=<dir>        Set the patch directory; Must be absolute or url
-n, --netboot=<url>         Boot from net with the given url as base
-c, --configuration=<name>  Set the server configuration name
-B, --bootlib=<filename>    Add an extra library to the front bootclasspath
-L, --library=<filename>    Add an extra library to the loaders classpath
-C, --classpath=<url>       Add an extra url to the loaders classpath
-P, --properties=<url>      Load system properties from the given url
-b, --host=<host or ip>     Bind address for all JBoss services
-g, --partition=<name>      HA Partition name (default=DefaultDomain)
-u, --udp=<ip>              UDP multicast address
-l, --log=<log4j|jdk>       Specify the logger plugin type

More specifically the option "-c" to change the default server node to a custom server node created specially for tests.

I have tried to add this option on "argLine" of Surfire's configuration, but it's just for JVM arguments, such as permgen size.

EDIT:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.15</version>
    <configuration>
        <argLine>
            -Djboss.home=${JBOSS_HOME} 
            -Xmx512m 
            -XX:MaxPermSize=256m 
            -Djava.endorsed.dirs=${JBOSS_HOME}/lib/endorsed  
            -Djboss.messaging.ServerPeerID=1 
            -Djboss.service.binding.set=ports-01

            -c=tests-node ******This does not works!******

        </argLine>
        <includes> 
            <include>**/AllTests.java</include>
        </includes>
    </configuration>
</plugin>

Any idea?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top