我使用以下依赖项创建了一个使用Embeddable EJB的Junit Suite测试:
<dependency>
<groupId>org.jboss.ejb3.embedded</groupId>
<artifactId>jboss-ejb3-embedded-standalone</artifactId>
<version>1.0.0-alpha-2</version>
</dependency>
但是,当容器(JBoss)通过“EJBContainer.createEJBContainer();”启动时,我不知道如何将选项传递给其中任何一个:
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
更具体地说,选项“-c”将默认服务器节点更改为专门为测试创建的自定义服务器节点。
我试图在Surfire配置的“argLine”上添加此选项,但它只适用于JVM参数,例如permgen大小。
修改
<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>
有什么想法吗?