Skip to content
Browse files

Arquillian update, cleanup, use MavenDependencyResolver, use hibernat…

…e-search 4.0.0.Beta2 on AS7
  • Loading branch information...
1 parent fd01cc7 commit 175c158c00a5edb710f3b9ef7d98ea432015c865 @maschmid maschmid committed Oct 6, 2011
Showing with 135 additions and 237 deletions.
  1. +2 −0 api/pom.xml
  2. +1 −0 impl/pom.xml
  3. +1 −1 pom.xml
  4. +1 −0 settings.xml
  5. +13 −3 tests/base/pom.xml
  6. +10 −3 tests/base/src/main/java/org/jboss/seam/persistence/test/util/ArtifactNames.java
  7. +3 −1 tests/base/src/main/java/org/jboss/seam/persistence/test/util/IndexedHotel.java
  8. +0 −148 tests/base/src/main/java/org/jboss/seam/persistence/test/util/MavenArtifactResolver.java
  9. +16 −31 tests/jbossas-hibernate/pom.xml
  10. +4 −4 tests/jbossas-hibernate/src/test/java/org/jboss/seam/persistence/test/jboss/EntityInjectionTest.java
  11. +16 −7 ...sas-hibernate/src/test/java/org/jboss/seam/persistence/test/jboss/JBossASHibernateSearchTest.java
  12. +3 −3 ...ernate/src/test/java/org/jboss/seam/persistence/test/jboss/JNDIManagedPersistenceContextTest.java
  13. +3 −3 ...rc/test/java/org/jboss/seam/persistence/test/jboss/ManagedPersistenceContextCreatedEventTest.java
  14. +3 −3 ...ibernate/src/test/java/org/jboss/seam/persistence/test/jboss/ManagedPersistenceContextELTest.java
  15. +3 −3 ...-hibernate/src/test/java/org/jboss/seam/persistence/test/jboss/ManagedPersistenceContextTest.java
  16. +29 −5 tests/jbossas-hibernate/src/test/java/org/jboss/seam/persistence/test/util/JBossASTestUtils.java
  17. +1 −1 ...ate/src/test/java/org/jboss/seam/persistence/test/util/JNDIManagedPersistenceContextProvider.java
  18. +3 −3 tests/jbossas-hibernate/src/test/resources-jbossas/jndi.properties
  19. +1 −1 tests/jbossas-hibernate/src/test/resources/META-INF/persistence-orm.xml
  20. +2 −2 tests/jbossas-hibernate/src/test/resources/META-INF/persistence-search.xml
  21. +2 −2 tests/jbossas-hibernate/src/test/resources/META-INF/persistence.xml
  22. +18 −13 tests/jbossas-hibernate/src/test/resources/arquillian.xml
View
2 api/pom.xml
@@ -43,6 +43,8 @@
</dependencies>
<build>
+ <finalName>seam-persistence-api</finalName>
+
<plugins>
<!-- no test phase for API module -->
<plugin>
View
1 impl/pom.xml
@@ -117,6 +117,7 @@
</profiles>
<build>
+ <finalName>seam-persistence</finalName>
<plugins>
<!-- tests run in seperate modules -->
<plugin>
View
2 pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.jboss.seam</groupId>
<artifactId>seam-parent</artifactId>
- <version>14</version>
+ <version>15</version>
</parent>
<artifactId>seam-persistence-parent</artifactId>
View
1 settings.xml
@@ -3,6 +3,7 @@
<profile>
<id>jboss-public-repository</id>
<activation>
+ <activeByDefault>true</activeByDefault>
<property>
<name>jboss-public-repository</name>
<value>!false</value>
View
16 tests/base/pom.xml
@@ -65,6 +65,7 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search</artifactId>
+ <version>4.0.0.Beta2</version>
<optional>true</optional>
<scope>provided</scope>
</dependency>
@@ -76,9 +77,18 @@
</dependency>
<dependency>
- <groupId>org.jboss.arquillian</groupId>
- <artifactId>arquillian-junit</artifactId>
- <version>1.0.0.Alpha5</version>
+ <groupId>org.jboss.arquillian.junit</groupId>
+ <artifactId>arquillian-junit-container</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.shrinkwrap.resolver</groupId>
+ <artifactId>shrinkwrap-resolver-api-maven</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.shrinkwrap.resolver</groupId>
+ <artifactId>shrinkwrap-resolver-impl-maven</artifactId>
</dependency>
</dependencies>
View
13 tests/base/src/main/java/org/jboss/seam/persistence/test/util/ArtifactNames.java
@@ -17,9 +17,16 @@
package org.jboss.seam.persistence.test.util;
public class ArtifactNames {
- public static final String SEAM_SOLDER = "org.jboss.solder:seam-solder";
- public static final String SEAM_PERSISTENCE_API = "org.jboss.seam.persistence:seam-persistence-api";
- public static final String SEAM_PERSISTENCE_IMPL = "org.jboss.seam.persistence:seam-persistence-impl";
+
+ public static final String SEAM_PERSISTENCE_API_JAR = "../../api/target/seam-persistence-api.jar";
+ public static final String SEAM_PERSISTENCE_IMPL_JAR = "../../impl/target/seam-persistence.jar";
+
+ public static final String SOLDER = "org.jboss.solder:solder-impl";
+ public static final String SOLDER_API = "org.jboss.solder:solder-api";
+ public static final String SOLDER_LOGGING = "org.jboss.solder:solder-logging";
+
+ public static final String SEAM_TRANSACTION = "org.jboss.seam.transaction:seam-transaction";
+
public static final String HIBERNATE_SEARCH = "org.hibernate:hibernate-search";
public static final String LUCENE_CORE = "org.apache.lucene:lucene-core";
public static final String LUCENE_ANALYZERS = "org.apache.lucene:lucene-analyzers";
View
4 tests/base/src/main/java/org/jboss/seam/persistence/test/util/IndexedHotel.java
@@ -31,9 +31,11 @@
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
+import org.hibernate.search.annotations.Analyze;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Index;
import org.hibernate.search.annotations.Indexed;
+import org.hibernate.search.annotations.Norms;
import org.hibernate.search.annotations.Store;
import org.jboss.solder.core.Veto;
@@ -109,7 +111,7 @@ public void setId(final Long id) {
@Size(max = 50)
@NotNull
- @Field(index = Index.TOKENIZED, store = Store.NO)
+ @Field(index = Index.YES, analyze=Analyze.YES, store = Store.NO)
public String getName() {
return name;
}
View
148 tests/base/src/main/java/org/jboss/seam/persistence/test/util/MavenArtifactResolver.java
@@ -1,148 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.seam.persistence.test.util;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Resolves a maven artifact present on the test classpath.
- *
- * @author Stuart Douglas
- */
-public class MavenArtifactResolver {
-
- public static File resolve(String groupId, String artifactId) {
- if (groupId == null) {
- throw new IllegalArgumentException("groupId cannot be null");
- }
- if (artifactId == null) {
- throw new IllegalArgumentException("artifactId cannot be null");
- }
- String path = new MavenArtifactResolver(groupId.trim(), artifactId.trim(), System.getProperty("java.class.path"), File.pathSeparatorChar, File.separatorChar).resolve();
- if (path == null) {
- throw new IllegalArgumentException("Cannot locate artifact for " + groupId + ":" + artifactId);
- }
- return new File(path);
- }
-
- public static File resolve(String qualifiedArtifactId) {
- String[] segments = qualifiedArtifactId.split(":");
- if (segments.length == 2) {
- return resolve(segments[0], segments[1]);
- } else {
- throw new IllegalArgumentException("Unable to parse " + qualifiedArtifactId + " as a groupId:artifactId");
- }
- }
-
- private final String classPathSeparatorRegex;
- private final char fileSeparator;
- private final String groupId;
- private final String artifactId;
- private final String classPath;
-
- MavenArtifactResolver(String groupId, String artifactId, String classPath, char pathSeparator, char fileSeparator) {
- this.groupId = groupId;
- this.artifactId = artifactId;
- this.classPath = classPath;
- this.classPathSeparatorRegex = "[^" + pathSeparator + "]*";
- this.fileSeparator = fileSeparator;
- }
-
- String resolve() {
- Matcher matches = createFullyQualifiedMatcher();
- if (!matches.find()) {
- matches = createUnqualifiedMatcher();
- if (!matches.find()) {
- matches = createTargetClassesMatcher();
- if (!matches.find()) {
- return null;
- } else {
- String fileName = scanForArtifact(matches);
- if (fileName == null) {
- return null;
- } else {
- return fileName;
- }
- }
- }
- }
- return matches.group(0);
- }
-
- private String scanForArtifact(Matcher targetClassesMatcher) {
- // Locate all target/classes in classpath and store the path to all files target/
- List<String> paths = new ArrayList<String>();
- do {
- String path = targetClassesMatcher.group();
- File target = new File(path.substring(0, path.length() - 8));
- if (target.exists()) {
- if (!target.isDirectory()) {
- throw new IllegalStateException("Found ${project.dir}/target/ but it is not a directory!");
- }
- for (File file : target.listFiles()) {
- paths.add(file.getPath());
- }
- }
- }
- while (targetClassesMatcher.find());
- return scanForArtifact(paths);
- }
-
- String scanForArtifact(List<String> paths) {
- Pattern pattern = Pattern.compile(artifactId + "-[\\d+\\.]+(?:[\\-\\.]\\p{Alpha}*)?.jar$");
- for (String path : paths) {
- if (pattern.matcher(path).find()) {
- return path;
- }
- }
- return null;
- }
-
- /**
- * Creates a matcher that returns any fully qualified matches of the form
- * <code>com/acme/acme-core/1.0/acme-core-1.0.jar</code>. This will match
- * artifacts on the classpath from the Maven repo.
- */
- private Matcher createFullyQualifiedMatcher() {
- String pathString = groupId.replace('.', fileSeparator) + fileSeparator + artifactId;
- Pattern p = Pattern.compile(classPathSeparatorRegex + Pattern.quote(pathString) + classPathSeparatorRegex, Pattern.CASE_INSENSITIVE);
- return p.matcher(classPath);
- }
-
- /**
- * Creates a matcher that returns any unqualified matches of the form
- * <code>target/acme-foo-1.0.jar</code>. This will match artifacts on the
- * classpath from the reactor.
- */
- private Matcher createUnqualifiedMatcher() {
- Pattern p = Pattern.compile(classPathSeparatorRegex + Pattern.quote("target" + fileSeparator + artifactId) + classPathSeparatorRegex, Pattern.CASE_INSENSITIVE);
- return p.matcher(classPath);
- }
-
- /**
- * Creates a matcher that returns any unqualified matches of the form
- * <code>target/acme-foo-1.0.jar</code>. This locates all
- */
- private Matcher createTargetClassesMatcher() {
- Pattern p = Pattern.compile(classPathSeparatorRegex + Pattern.quote("target" + fileSeparator + "classes") + classPathSeparatorRegex, Pattern.CASE_INSENSITIVE);
- return p.matcher(classPath);
- }
-}
View
47 tests/jbossas-hibernate/pom.xml
@@ -36,7 +36,6 @@
<scope>provided</scope>
</dependency>
-->
-
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
@@ -84,6 +83,11 @@
</dependency>
<dependency>
+ <groupId>org.jboss.seam.transaction</groupId>
+ <artifactId>seam-transaction</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
@@ -96,21 +100,17 @@
</dependency>
<dependency>
- <groupId>org.jboss.seam.solder</groupId>
- <artifactId>seam-solder</artifactId>
+ <groupId>org.jboss.solder</groupId>
+ <artifactId>solder-impl</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search</artifactId>
+ <version>4.0.0.Beta2</version>
<optional>true</optional>
</dependency>
- <!--dependency>
- <groupId>org.jboss.arquillian</groupId>
- <artifactId>arquillian-junit</artifactId>
- </dependency-->
-
<dependency>
<groupId>org.jboss.seam.persistence</groupId>
<artifactId>seam-persistence-tests-base</artifactId>
@@ -143,21 +143,10 @@
<dependencies>
<dependency>
- <groupId>org.jboss.as</groupId>
- <artifactId>jboss-as-arquillian-container-managed</artifactId>
- <version>7.0.0.Final</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.jbossas</groupId>
- <artifactId>jboss-server-manager</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.jbossas</groupId>
- <artifactId>jboss-as-client</artifactId>
+ <groupId>org.jboss.seam.test</groupId>
+ <artifactId>jbossas-managed-7</artifactId>
<type>pom</type>
+ <scope>test</scope>
</dependency>
</dependencies>
@@ -217,18 +206,14 @@
<profile>
<id>jbossas-remote-7</id>
<dependencies>
+
<dependency>
- <groupId>org.jboss.as</groupId>
- <artifactId>jboss-as-arquillian-container-remote</artifactId>
- <version>7.0.0.Final</version>
- <scope>test</scope>
- </dependency>
- <!-- need for org.jnp.interfaces.NamingContextFactory -->
- <dependency>
- <groupId>org.jboss.jbossas</groupId>
- <artifactId>jboss-as-client</artifactId>
+ <groupId>org.jboss.seam.test</groupId>
+ <artifactId>jbossas-remote-7</artifactId>
<type>pom</type>
+ <scope>test</scope>
</dependency>
+
</dependencies>
<build>
<testResources>
View
8 ...as-hibernate/src/test/java/org/jboss/seam/persistence/test/jboss/EntityInjectionTest.java
@@ -16,7 +16,7 @@
*/
package org.jboss.seam.persistence.test.jboss;
-import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.seam.persistence.test.EntityInjectionTestBase;
import org.jboss.seam.persistence.test.util.JBossASTestUtils;
@@ -31,13 +31,13 @@
*/
@RunWith(Arquillian.class)
public class EntityInjectionTest extends EntityInjectionTestBase {
- @Deployment
+ @Deployment(name="EntityInjection")
public static Archive<?> createTestArchive() {
WebArchive war = JBossASTestUtils.createTestArchive();
war.addClasses(getTestClasses());
- war.addAsWebResource("META-INF/persistence-orm.xml", "classes/META-INF/persistence.xml");
- war.addAsWebResource("META-INF/orm.xml", "classes/META-INF/orm.xml");
+ war.addAsWebInfResource("META-INF/persistence-orm.xml", "classes/META-INF/persistence.xml");
+ war.addAsWebInfResource("META-INF/orm.xml", "classes/META-INF/orm.xml");
return war;
}
View
23 ...rnate/src/test/java/org/jboss/seam/persistence/test/jboss/JBossASHibernateSearchTest.java
@@ -16,26 +16,35 @@
*/
package org.jboss.seam.persistence.test.jboss;
-import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.seam.persistence.test.HibernateSearchTestBase;
import org.jboss.seam.persistence.test.util.ArtifactNames;
-import org.jboss.seam.persistence.test.util.MavenArtifactResolver;
import org.jboss.seam.persistence.test.util.JBossASTestUtils;
import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.api.importer.ZipImporter;
+import org.jboss.shrinkwrap.resolver.api.DependencyResolvers;
+import org.jboss.shrinkwrap.resolver.api.maven.MavenDependencyResolver;
import org.junit.runner.RunWith;
@RunWith(Arquillian.class)
public class JBossASHibernateSearchTest extends HibernateSearchTestBase {
- @Deployment
+ @Deployment(name="HibernateSearch")
public static Archive<?> createTestArchive() {
WebArchive war = JBossASTestUtils.createTestArchive();
- war.addAsLibraries(MavenArtifactResolver.resolve(ArtifactNames.HIBERNATE_SEARCH));
- war.addAsLibraries(MavenArtifactResolver.resolve(ArtifactNames.LUCENE_ANALYZERS));
- war.addAsLibraries(MavenArtifactResolver.resolve(ArtifactNames.LUCENE_CORE));
+
+ war.addAsLibraries(
+ DependencyResolvers.use(MavenDependencyResolver.class)
+ .configureFrom("../../settings.xml")
+ .loadReposFromPom("pom.xml")
+ .artifact(ArtifactNames.HIBERNATE_SEARCH)
+ .resolveAs(JavaArchive.class)
+ );
+
war.addClasses(getTestClasses());
- war.addAsWebResource("META-INF/persistence-search.xml", "classes/META-INF/persistence.xml");
+ war.addAsWebInfResource("META-INF/persistence-search.xml", "classes/META-INF/persistence.xml");
return war;
}
View
6 ...rc/test/java/org/jboss/seam/persistence/test/jboss/JNDIManagedPersistenceContextTest.java
@@ -16,7 +16,7 @@
*/
package org.jboss.seam.persistence.test.jboss;
-import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.seam.persistence.test.ManagedPersistenceContextTestBase;
import org.jboss.seam.persistence.test.util.HelloService;
@@ -29,11 +29,11 @@
@RunWith(Arquillian.class)
public class JNDIManagedPersistenceContextTest extends ManagedPersistenceContextTestBase {
- @Deployment
+ @Deployment(name="JNDIManagedPersistenceContext")
public static Archive<?> createTestArchive() {
WebArchive war = JBossASTestUtils.createTestArchive();
war.addClasses(new Class[]{ManagedPersistenceContextTestBase.class, Hotel.class, JNDIManagedPersistenceContextProvider.class, HelloService.class});
- war.addAsWebResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml");
+ war.addAsWebInfResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml");
return war;
}
}
View
6 ...java/org/jboss/seam/persistence/test/jboss/ManagedPersistenceContextCreatedEventTest.java
@@ -16,7 +16,7 @@
*/
package org.jboss.seam.persistence.test.jboss;
-import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.seam.persistence.test.ManagedPersistenceContextCreatedEventTestBase;
import org.jboss.seam.persistence.test.util.JBossASTestUtils;
@@ -26,11 +26,11 @@
@RunWith(Arquillian.class)
public class ManagedPersistenceContextCreatedEventTest extends ManagedPersistenceContextCreatedEventTestBase {
- @Deployment
+ @Deployment(name="ManagedPersistenceContextCreatedEvent")
public static Archive<?> createTestArchive() {
WebArchive war = JBossASTestUtils.createTestArchive();
war.addClasses(getTestClasses());
- war.addAsWebResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml");
+ war.addAsWebInfResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml");
return war;
}
View
6 .../src/test/java/org/jboss/seam/persistence/test/jboss/ManagedPersistenceContextELTest.java
@@ -16,7 +16,7 @@
*/
package org.jboss.seam.persistence.test.jboss;
-import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.seam.persistence.test.ManagedPersistenceContextELTestBase;
import org.jboss.seam.persistence.test.util.JBossASTestUtils;
@@ -26,11 +26,11 @@
@RunWith(Arquillian.class)
public class ManagedPersistenceContextELTest extends ManagedPersistenceContextELTestBase {
- @Deployment
+ @Deployment(name="ManagedPersistenceContextEL")
public static Archive<?> createTestArchive() {
WebArchive war = JBossASTestUtils.createTestArchive();
war.addClasses(getTestClasses());
- war.addAsWebResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml");
+ war.addAsWebInfResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml");
return war;
}
View
6 ...te/src/test/java/org/jboss/seam/persistence/test/jboss/ManagedPersistenceContextTest.java
@@ -16,7 +16,7 @@
*/
package org.jboss.seam.persistence.test.jboss;
-import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.seam.persistence.test.ManagedPersistenceContextTestBase;
import org.jboss.seam.persistence.test.util.JBossASTestUtils;
@@ -26,11 +26,11 @@
@RunWith(Arquillian.class)
public class ManagedPersistenceContextTest extends ManagedPersistenceContextTestBase {
- @Deployment
+ @Deployment(name="ManagedPersistenceContext")
public static Archive<?> createTestArchive() {
WebArchive war = JBossASTestUtils.createTestArchive();
war.addClasses(getTestClasses());
- war.addAsWebResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml");
+ war.addAsWebInfResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml");
return war;
}
View
34 ...bossas-hibernate/src/test/java/org/jboss/seam/persistence/test/util/JBossASTestUtils.java
@@ -16,11 +16,17 @@
*/
package org.jboss.seam.persistence.test.util;
+import java.io.File;
+
import org.jboss.seam.persistence.test.util.ArtifactNames;
-import org.jboss.seam.persistence.test.util.MavenArtifactResolver;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.ByteArrayAsset;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.api.importer.ZipImporter;
+import org.jboss.shrinkwrap.resolver.api.DependencyResolvers;
+import org.jboss.shrinkwrap.resolver.api.maven.MavenDependencyResolver;
+
/**
* @author Stuart Douglas
@@ -37,11 +43,29 @@ public static WebArchive createTestArchive() {
public static WebArchive createTestArchive(boolean includeEmptyBeansXml) {
WebArchive war = ShrinkWrap.createDomain().getArchiveFactory().create(WebArchive.class, "test.war");
- war.addAsLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_SOLDER));
- war.addAsLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_API));
- war.addAsLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_IMPL));
+
+ war.addAsLibraries(
+ DependencyResolvers.use(MavenDependencyResolver.class)
+ .configureFrom("../../settings.xml")
+ .loadReposFromPom("pom.xml")
+ .artifact(ArtifactNames.SOLDER)
+ .artifact(ArtifactNames.SEAM_TRANSACTION)
+ .resolveAs(JavaArchive.class)
+ );
+
+ war.addAsLibraries(
+ ShrinkWrap.create(
+ ZipImporter.class, "seam-persistence-api.jar")
+ .importFrom(new File(ArtifactNames.SEAM_PERSISTENCE_API_JAR))
+ .as(JavaArchive.class),
+ ShrinkWrap.create(
+ ZipImporter.class, "seam-persistence.jar")
+ .importFrom(new File(ArtifactNames.SEAM_PERSISTENCE_IMPL_JAR))
+ .as(JavaArchive.class)
+ );
+
if (includeEmptyBeansXml) {
- war.addAsWebResource(new ByteArrayAsset(new byte[0]), "beans.xml");
+ war.addAsWebInfResource(new ByteArrayAsset(new byte[0]), "beans.xml");
}
return war;
}
View
2 ...test/java/org/jboss/seam/persistence/test/util/JNDIManagedPersistenceContextProvider.java
@@ -24,7 +24,7 @@
import org.jboss.solder.core.ExtensionManaged;
public class JNDIManagedPersistenceContextProvider {
- @Resource(mappedName = "java:EntityManagerFactory")
+ @Resource(mappedName = "java:/EntityManagerFactory")
@RequestScoped
@Produces
@ExtensionManaged
View
6 tests/jbossas-hibernate/src/test/resources-jbossas/jndi.properties
@@ -1,3 +1,3 @@
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
-java.naming.provider.url=jnp://localhost:1099
+#java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+#java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+#java.naming.provider.url=jnp://localhost:1099
View
2 tests/jbossas-hibernate/src/test/resources/META-INF/persistence-orm.xml
@@ -8,7 +8,7 @@
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
-->
<provider>org.hibernate.ejb.HibernatePersistence</provider>
- <jta-data-source>java:/DefaultDS</jta-data-source>
+ <jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
<mapping-file>META-INF/orm.xml</mapping-file>
<class>org.jboss.seam.persistence.test.util.Hotel</class>
<exclude-unlisted-classes/>
View
4 tests/jbossas-hibernate/src/test/resources/META-INF/persistence-search.xml
@@ -5,7 +5,7 @@
version="2.0">
<persistence-unit name="seamPersistencePu">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
- <jta-data-source>java:/DefaultDS</jta-data-source>
+ <jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
<class>org.jboss.seam.persistence.test.util.IndexedHotel</class>
<exclude-unlisted-classes/>
<properties>
@@ -15,7 +15,7 @@
<!-- Only format when you need to debug, because it slows things down -->
<property name="hibernate.format_sql" value="false"/>
<property name="hibernate.search.default.directory_provider"
- value="org.hibernate.search.store.RAMDirectoryProvider"/>
+ value="org.hibernate.search.store.impl.RAMDirectoryProvider"/>
</properties>
</persistence-unit>
View
4 tests/jbossas-hibernate/src/test/resources/META-INF/persistence.xml
@@ -8,7 +8,7 @@
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
-->
<provider>org.hibernate.ejb.HibernatePersistence</provider>
- <jta-data-source>java:/DefaultDS</jta-data-source>
+ <jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
<class>org.jboss.seam.persistence.test.util.Hotel</class>
<exclude-unlisted-classes/>
<properties>
@@ -21,7 +21,7 @@
<!-- Properties for EclipseLink (default provider for GlassFish) -->
<property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
<property name="eclipselink.logging.level" value="FINE"/>
- <property name="jboss.entity.manager.factory.jndi.name" value="java:EntityManagerFactory"/>
+ <property name="jboss.entity.manager.factory.jndi.name" value="java:/EntityManagerFactory"/>
</properties>
</persistence-unit>
</persistence>
View
31 tests/jbossas-hibernate/src/test/resources/arquillian.xml
@@ -1,15 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
-<arquillian xmlns="http://jboss.com/arquillian"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gfembedded="urn:arq:org.jboss.arquillian.glassfish.embedded30"
- xmlns:gfremote="urn:arq:org.jboss.arquillian.container.glassfish.remote30"
- xmlns:jbossmanaged="urn:arq:org.jboss.arquillian.container.jbossas.managed_6">
-
- <engine>
- <deploymentExportPath>/tmp/</deploymentExportPath>
- </engine>
-
- <jbossmanaged:container>
- <javaVmArguments>-Xmx512m -XX:MaxPermSize=256m</javaVmArguments>
- </jbossmanaged:container>
+<arquillian xmlns="http://jboss.org/schema/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
+
+ <!--Uncomment to have test archives exported to the file system for inspection -->
+ <!-- engine>
+ <property name="deploymentExportPath">target/</property>
+ </engine -->
+
+ <container qualifier="jbossas-managed-7">
+ <protocol type="jmx-as7">
+ <property name="executionType">REMOTE</property>
+ </protocol>
+ <configuration>
+ <property name="javaVmArguments">-client -noverify -XX:+UseFastAccessorMethods -Xms64m -Xmx1024m -XX:MaxPermSize=512m</property>
+ </configuration>
+ </container>
+
</arquillian>
+

0 comments on commit 175c158

Please sign in to comment.
Something went wrong with that request. Please try again.