Skip to content

Commit

Permalink
HSEARCH-2029 Making sure only HCANN version is present for integratio…
Browse files Browse the repository at this point in the history
…n tests adding HSEARCH through deployment unit
  • Loading branch information
gunnarmorling authored and Sanne committed Nov 5, 2015
1 parent e56e318 commit 7814354
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
Expand Up @@ -17,10 +17,10 @@

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.search.testsupport.TestConstants;
import org.hibernate.search.test.integration.wildfly.PackagerHelper;
import org.hibernate.search.test.performance.scenario.TestScenario;
import org.hibernate.search.test.performance.scenario.TestScenarioFactory;
import org.hibernate.search.testsupport.TestConstants;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.Archive;
Expand Down Expand Up @@ -54,6 +54,7 @@ public static Archive<?> createTestArchive() throws IOException {
.addPackages( true, TestRunnerArquillian.class.getPackage() )
.addClass( TestConstants.class )
.addAsResource( createPersistenceXml(), "META-INF/persistence.xml" )
.addAsWebInfResource( "jboss-deployment-structure-hcann.xml", "/jboss-deployment-structure.xml" )
.addAsLibraries( PackagerHelper.hibernateSearchLibraries() )
.addAsLibraries( PackagerHelper.hibernateSearchTestingLibraries() )
.addAsWebInfResource( EmptyAsset.INSTANCE, "beans.xml" )
Expand Down
Expand Up @@ -55,6 +55,7 @@ public static Archive<?> createTestArchive() {
EnterpriseArchive ear = ShrinkWrap
.create( EnterpriseArchive.class, MemberRegistrationEarArchiveIT.class.getSimpleName() + ".ear" )
.addAsModules( ejb )
.addAsManifestResource( "jboss-deployment-structure-hcann.xml", "/jboss-deployment-structure.xml" )
.addAsLibraries( PackagerHelper.hibernateSearchLibraries() )
.setApplicationXML( new StringAsset( applicationXml ) );
return ear;
Expand Down
Expand Up @@ -41,11 +41,12 @@
public class MemberRegistrationIT {

@Deployment
public static Archive<?> createTestArchive() {
public static Archive<?> createTestArchive() throws Exception {
WebArchive archive = ShrinkWrap
.create( WebArchive.class, MemberRegistrationIT.class.getSimpleName() + ".war" )
.addClasses( Member.class, MemberRegistration.class, Resources.class )
.addAsResource( persistenceXml(), "META-INF/persistence.xml" )
.addAsWebInfResource( "jboss-deployment-structure-hcann.xml", "/jboss-deployment-structure.xml" )
.addAsLibraries( PackagerHelper.hibernateSearchLibraries() )
.addAsWebInfResource( EmptyAsset.INSTANCE, "beans.xml" );
return archive;
Expand Down
Expand Up @@ -31,6 +31,7 @@ private PackagerHelper() {
*/
private static String[] exclusions = new String[] {
"org.hibernate:hibernate-core",
"org.hibernate.common:hibernate-commons-annotations",
"org.hibernate.javax.persistence:hibernate-jpa-2.1-api",
"org.jboss.logging:jboss-logging",
"org.jboss.logging:jboss-logging-processor",
Expand Down
@@ -0,0 +1,8 @@
<?xml version='1.0' encoding='UTF-8'?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
<deployment>
<dependencies>
<module name="org.hibernate.commons-annotations" slot="main"/>
</dependencies>
</deployment>
</jboss-deployment-structure>

0 comments on commit 7814354

Please sign in to comment.