Here are the changes I've made to make it run the Arquillian test:
public static Archive<?> createTestArchive() {
String manifest = Descriptors.create(ManifestDescriptor.class).attribute("Dependencies", "org.hibernate.ogm:5.4 services, org.hibernate.ogm.mongodb:5.4 services")
.exportAsString();
return ShrinkWrap.create(WebArchive.class, "test.war") //
.addClasses(Member.class, MemberRegistration.class, Resources.class) //
.addAsResource(new StringAsset(manifest), "META-INF/MANIFEST.MF") //
.addAsResource("META-INF/test-persistence.xml", "META-INF/persistence.xml") //
// doesn't work on this version
// .addAsResource("jboss-deployment-structure.xml", "WEB-INF/jboss-deployment-structure.xml") //
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml") //
// Deploy our test datasource
.addAsWebInfResource("test-ds.xml");
}
Notice that instead of using jboss-deployment-structure file, we use a manifest. Maybe it's a bug in the release.
You can download the complete source code from:
- https://github.com/czetsuya/Hibernate-OGM-MongoDB-Demo
0 nhận xét:
Đăng nhận xét