我有一个seam 2.2.2应用程序,我正在将其迁移到jboss EAP6 (AS7)。由于测试是在旧的jboss嵌入式容器中进行的,所以我开始使用arquillian,但我无法发现hot来创建部署包。
这是我的一个尝试:
@Deployment
@OverProtocol("Servlet 3.0")
public static Archive<?> createDeployment() throws IOException {
// Build the ear with Maven by hand before run the test!
final EnterpriseArchive ear = ShrinkWrap.createFromZipFile(
EnterpriseArchive.class, new File("../Sin-ear/target/Sin.ear"));
final JavaArchive testjar = ShrinkWrap.createFromZipFile(
JavaArchive.class, new File("./target/test.jar"));
//final JavaArchive testjar = ShrinkWrap.create(JavaArchive.class, "test.jar") //other attempt
// .addPackages(true, "com.miles.knowledge.test");
ear.addAsModule(testjar);
return ear;
}当我将测试类作为JUnit测试运行时,它会失败(我可以看到没有错误的应用程序部署):
java.lang.ClassNotFoundException: com.miles.knowledge.test.GreeterTest from [Module "deployment.Sin.ear.Sin.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213)
...看起来我不得不把测试类打包成一个war包,但是我有点迷路了,我需要一些帮助。
https://stackoverflow.com/questions/38107095
复制相似问题