Author: pete.muir(a)jboss.org
Date: 2010-09-02 14:39:53 -0400 (Thu, 02 Sep 2010)
New Revision: 13709
Modified:
modules/persistence/trunk/impl/pom.xml
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextExtension.java
Log:
don't run any incontainer tests by default
Modified: modules/persistence/trunk/impl/pom.xml
===================================================================
--- modules/persistence/trunk/impl/pom.xml 2010-09-02 17:43:39 UTC (rev 13708)
+++ modules/persistence/trunk/impl/pom.xml 2010-09-02 18:39:53 UTC (rev 13709)
@@ -35,6 +35,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
@@ -58,6 +59,7 @@
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
+ <scope>provided</scope>
</dependency>
<dependency>
@@ -69,6 +71,7 @@
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
+ <scope>provided</scope>
</dependency>
<dependency>
@@ -153,10 +156,7 @@
<profiles>
<profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
+ <id>jbossas-managed-60</id>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
@@ -168,6 +168,7 @@
<groupId>org.jboss.jbossas</groupId>
<artifactId>jboss-server-manager</artifactId>
<version>1.0.3.GA</version>
+ <scope>test</scope>
</dependency>
<!-- need for org.jnp.interfaces.NamingContextFactory -->
Modified:
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextExtension.java
===================================================================
---
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextExtension.java 2010-09-02
17:43:39 UTC (rev 13708)
+++
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextExtension.java 2010-09-02
18:39:53 UTC (rev 13709)
@@ -29,6 +29,7 @@
import javax.enterprise.context.Dependent;
import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Alternative;
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.AfterBeanDiscovery;
import javax.enterprise.inject.spi.AnnotatedField;
@@ -125,7 +126,7 @@
{
modifiedType.removeFromField(f.getJavaMember(), scope);
}
- registerManagedPersistenceContext(qualifiers, scope, manager,
event.getAnnotatedType().getJavaClass().getClassLoader(), f);
+ registerManagedPersistenceContext(qualifiers, scope,
f.isAnnotationPresent(Alternative.class), manager,
event.getAnnotatedType().getJavaClass().getClassLoader(), f);
}
// now look for producer methods that produce an EntityManagerFactory.
// This allows the user to manually configure an EntityManagerFactory
@@ -165,7 +166,7 @@
// we need to change the scope to application scoped
modifiedType.removeFromMethod(m.getJavaMember(), scope);
modifiedType.addToMethod(m.getJavaMember(),
ApplicationScopedLiteral.INSTANCE);
- registerManagedPersistenceContext(qualifiers, scope, manager,
event.getAnnotatedType().getJavaClass().getClassLoader(), m);
+ registerManagedPersistenceContext(qualifiers, scope,
m.isAnnotationPresent(Alternative.class), manager,
event.getAnnotatedType().getJavaClass().getClassLoader(), m);
}
}
@@ -175,7 +176,7 @@
}
}
- private void registerManagedPersistenceContext(Set<Annotation> qualifiers,
Class<? extends Annotation> scope, BeanManager manager, ClassLoader loader,
AnnotatedMember<?> member)
+ private void registerManagedPersistenceContext(Set<Annotation> qualifiers,
Class<? extends Annotation> scope, boolean alternative, BeanManager manager,
ClassLoader loader, AnnotatedMember<?> member)
{
// we need to add all additional interfaces from our
// SeamPersistenceProvider to the bean as at this stage we have no way of
@@ -198,6 +199,7 @@
builder.getTypes().addAll(additionalInterfaces);
builder.getTypes().add(Object.class);
builder.setBeanLifecycle(lifecycle);
+ builder.setAlternative(alternative);
builder.setToString("Seam Managed Persistence Context with qualifiers ["
+ qualifiers + "] with configured by [" + member + "]");
beans.add(builder.create());
}