Weld SVN: r3909 - core/trunk/cdi-api/src/main/java/javax/enterprise/inject/spi and 6 other directories.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-10-09 09:47:55 -0400 (Fri, 09 Oct 2009)
New Revision: 3909
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/CheckableInjectionTarget.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Cow.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/CowProducer.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractProcessBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessInjectionTargetImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessManagedBeanImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessSessionBeanImpl.java
Removed:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/BirdCageInjectionTarget.java
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Cat.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/ProducerProcessor.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/ProducerTest.java
core/trunk/cdi-api/src/main/java/javax/enterprise/inject/spi/ProcessSessionBean.java
core/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractReceiverBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/InterceptorImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/ee/PersistenceContextProducerField.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessProducerImpl.java
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/manager/EjbDescriptorLookupTest.java
Log:
Support for ProcessProducer.set and ProcessInjectionTarget
Deleted: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/BirdCageInjectionTarget.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/BirdCageInjectionTarget.java 2009-10-09 13:42:39 UTC (rev 3908)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/BirdCageInjectionTarget.java 2009-10-09 13:47:55 UTC (rev 3909)
@@ -1,60 +0,0 @@
-package org.jboss.jsr299.tck.tests.extensions.producer;
-
-import java.util.Set;
-
-import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.inject.spi.InjectionPoint;
-import javax.enterprise.inject.spi.InjectionTarget;
-
-class BirdCageInjectionTarget implements InjectionTarget<BirdCage>
-{
- private InjectionTarget<BirdCage> wrappedInjectionTarget;
- private static boolean injectCalled;
-
- public BirdCageInjectionTarget(InjectionTarget<BirdCage> originalInjectionTarget)
- {
- this.wrappedInjectionTarget = originalInjectionTarget;
- }
-
- public void inject(BirdCage instance, CreationalContext<BirdCage> ctx)
- {
- injectCalled = true;
- wrappedInjectionTarget.inject(instance, ctx);
- }
-
- public void postConstruct(BirdCage instance)
- {
- wrappedInjectionTarget.postConstruct(instance);
- }
-
- public void preDestroy(BirdCage instance)
- {
- wrappedInjectionTarget.preDestroy(instance);
- }
-
- public void dispose(BirdCage instance)
- {
- wrappedInjectionTarget.dispose(instance);
- }
-
- public Set<InjectionPoint> getInjectionPoints()
- {
- return wrappedInjectionTarget.getInjectionPoints();
- }
-
- public BirdCage produce(CreationalContext<BirdCage> ctx)
- {
- return wrappedInjectionTarget.produce(ctx);
- }
-
- public static boolean isInjectCalled()
- {
- return injectCalled;
- }
-
- public static void setInjectCalled(boolean injectCalled)
- {
- BirdCageInjectionTarget.injectCalled = injectCalled;
- }
-
-}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Cat.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Cat.java 2009-10-09 13:42:39 UTC (rev 3908)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Cat.java 2009-10-09 13:47:55 UTC (rev 3909)
@@ -15,8 +15,8 @@
@Inject
public Cat(LitterBox litterBox)
{
+ assert litterBox != null;
constructorCalled = true;
- assert litterBox != null;
}
@Inject
Copied: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/CheckableInjectionTarget.java (from rev 3904, cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/BirdCageInjectionTarget.java)
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/CheckableInjectionTarget.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/CheckableInjectionTarget.java 2009-10-09 13:47:55 UTC (rev 3909)
@@ -0,0 +1,60 @@
+package org.jboss.jsr299.tck.tests.extensions.producer;
+
+import java.util.Set;
+
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.InjectionPoint;
+import javax.enterprise.inject.spi.InjectionTarget;
+
+class CheckableInjectionTarget<T> implements InjectionTarget<T>
+{
+ private InjectionTarget<T> wrappedInjectionTarget;
+ private static boolean injectCalled;
+
+ public CheckableInjectionTarget(InjectionTarget<T> originalInjectionTarget)
+ {
+ this.wrappedInjectionTarget = originalInjectionTarget;
+ }
+
+ public void inject(T instance, CreationalContext<T> ctx)
+ {
+ injectCalled = true;
+ wrappedInjectionTarget.inject(instance, ctx);
+ }
+
+ public void postConstruct(T instance)
+ {
+ wrappedInjectionTarget.postConstruct(instance);
+ }
+
+ public void preDestroy(T instance)
+ {
+ wrappedInjectionTarget.preDestroy(instance);
+ }
+
+ public void dispose(T instance)
+ {
+ wrappedInjectionTarget.dispose(instance);
+ }
+
+ public Set<InjectionPoint> getInjectionPoints()
+ {
+ return wrappedInjectionTarget.getInjectionPoints();
+ }
+
+ public T produce(CreationalContext<T> ctx)
+ {
+ return wrappedInjectionTarget.produce(ctx);
+ }
+
+ public static boolean isInjectCalled()
+ {
+ return injectCalled;
+ }
+
+ public static void setInjectCalled(boolean injectCalled)
+ {
+ CheckableInjectionTarget.injectCalled = injectCalled;
+ }
+
+}
Property changes on: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/CheckableInjectionTarget.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Cow.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Cow.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Cow.java 2009-10-09 13:47:55 UTC (rev 3909)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.extensions.producer;
+
+public class Cow
+{
+
+}
Property changes on: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Cow.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/CowProducer.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/CowProducer.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/CowProducer.java 2009-10-09 13:47:55 UTC (rev 3909)
@@ -0,0 +1,15 @@
+package org.jboss.jsr299.tck.tests.extensions.producer;
+
+import javax.enterprise.inject.Produces;
+
+public class CowProducer
+{
+
+ @Produces @Noisy
+ public Cow produceNoisyCow()
+ {
+ return new Cow();
+ }
+
+
+}
Property changes on: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/CowProducer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/ProducerProcessor.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/ProducerProcessor.java 2009-10-09 13:42:39 UTC (rev 3908)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/ProducerProcessor.java 2009-10-09 13:47:55 UTC (rev 3909)
@@ -1,10 +1,14 @@
package org.jboss.jsr299.tck.tests.extensions.producer;
+import java.util.Set;
+
+import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.event.Observes;
import javax.enterprise.inject.spi.AnnotatedField;
import javax.enterprise.inject.spi.AnnotatedMethod;
import javax.enterprise.inject.spi.AnnotatedType;
import javax.enterprise.inject.spi.Extension;
+import javax.enterprise.inject.spi.InjectionPoint;
import javax.enterprise.inject.spi.InjectionTarget;
import javax.enterprise.inject.spi.ProcessInjectionTarget;
import javax.enterprise.inject.spi.ProcessProducer;
@@ -17,6 +21,7 @@
private static Producer<Dog> quietDogProducer;
private static InjectionTarget<Dog> dogInjectionTarget;
private static AnnotatedType<Dog> dogAnnotatedType;
+ private static boolean overriddenCowProducerCalled;
public void processDogProducerProducer(@Observes ProcessProducer<DogProducer, Dog> producerEvent)
{
@@ -32,9 +37,9 @@
}
}
- public void processCatProducer(@Observes ProcessInjectionTarget<Cat> producerEvent)
+ public void processCatProducer(@Observes ProcessInjectionTarget<Cat> event)
{
- catInjectionTarget = producerEvent.getInjectionTarget();
+ catInjectionTarget = event.getInjectionTarget();
}
public void processDogInjectionTarget(@Observes ProcessInjectionTarget<Dog> injectionTargetEvent)
@@ -43,7 +48,36 @@
dogInjectionTarget = injectionTargetEvent.getInjectionTarget();
dogAnnotatedType = injectionTargetEvent.getAnnotatedType();
}
+
+ public void processCowProducer(@Observes ProcessProducer<CowProducer, Cow> event)
+ {
+ final Producer<Cow> producer = event.getProducer();
+ event.setProducer(new Producer<Cow>()
+ {
+ public void dispose(Cow instance)
+ {
+ producer.dispose(instance);
+ }
+
+ public Set<InjectionPoint> getInjectionPoints()
+ {
+ return producer.getInjectionPoints();
+ }
+
+ public Cow produce(CreationalContext<Cow> ctx)
+ {
+ overriddenCowProducerCalled = true;
+ return producer.produce(ctx);
+ }
+ });
+ }
+
+ public void processBirdCage(@Observes ProcessInjectionTarget<BirdCage> event)
+ {
+ event.setInjectionTarget(new CheckableInjectionTarget(event.getInjectionTarget()));
+ }
+
public static Producer<Dog> getNoisyDogProducer()
{
return noisyDogProducer;
@@ -68,4 +102,14 @@
{
return dogAnnotatedType;
}
+
+ public static void reset()
+ {
+ overriddenCowProducerCalled = false;
+ }
+
+ public static boolean isOverriddenCowProducerCalled()
+ {
+ return overriddenCowProducerCalled;
+ }
}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/ProducerTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/ProducerTest.java 2009-10-09 13:42:39 UTC (rev 3908)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/ProducerTest.java 2009-10-09 13:47:55 UTC (rev 3909)
@@ -30,24 +30,25 @@
// Must be an integration test as it needs a resource copied to a folder
@IntegrationTest
@SpecVersion(spec="cdi", version="PFD2")
-// TODO All tests fall under WBRI-345 for now, please create new issues for any failing tests after WBRI-345 is done
public class ProducerTest extends AbstractJSR299Test
{
- @Test(groups = "ri-broken")
+ @Test
@SpecAssertions({
@SpecAssertion(section = "11.2", id = "ba")
})
- public void testProduceCallsInitializerAndConstructor()
+ public void testProduceAndInjectCallsInitializerAndConstructor()
{
InjectionTarget<Cat> injectionTarget = ProducerProcessor.getCatInjectionTarget();
Bean<Cat> catBean = getUniqueBean(Cat.class);
Cat.reset();
- injectionTarget.produce(getCurrentManager().createCreationalContext(catBean));
+ CreationalContext<Cat> ctx = getCurrentManager().createCreationalContext(catBean);
+ Cat instance = injectionTarget.produce(ctx);
assert Cat.isConstructorCalled();
+ injectionTarget.inject(instance, ctx);
assert Cat.isInitializerCalled();
}
- @Test(groups = "ri-broken")
+ @Test
@SpecAssertions({
@SpecAssertion(section = "11.2", id = "c")
})
@@ -61,7 +62,7 @@
cat.ping();
}
- @Test(groups = "ri-broken")
+ @Test
@SpecAssertions({
@SpecAssertion(section = "11.2", id = "da")
})
@@ -80,42 +81,30 @@
assert injectionPointPresent;
}
- @Test(groups = "ri-broken")
+ @Test
@SpecAssertions({
- @SpecAssertion(section = "11.2", id = "db")
+ @SpecAssertion(section = "11.2", id = "db"),
+ @SpecAssertion(section = "11.2", id = "dc")
})
public void testGetInjectionPointsForConstructorAndInitializer()
{
InjectionTarget<Cat> injectionTarget = ProducerProcessor.getCatInjectionTarget();
assert injectionTarget.getInjectionPoints().size() == 3;
- boolean dogIPPresent = false;
+ boolean constructorIPPresent = false;
+ boolean initializerMethodIPPresent = false;
for (InjectionPoint injectionPoint : injectionTarget.getInjectionPoints())
{
- if (injectionPoint.getType().equals(Dog.class))
+ if (injectionPoint.getType().equals(LitterBox.class))
{
- dogIPPresent = true;
+ constructorIPPresent = true;
}
- }
- assert dogIPPresent;
- }
-
- @Test(groups = "ri-broken")
- @SpecAssertions({
- @SpecAssertion(section = "11.2", id = "dc")
- })
- public void testGetInjectionPointsForInitializer()
- {
- InjectionTarget<Cat> injectionTarget = ProducerProcessor.getCatInjectionTarget();
- assert injectionTarget.getInjectionPoints().size() == 3;
- boolean injectionPointPresent = false;
- for (InjectionPoint injectionPoint : injectionTarget.getInjectionPoints())
- {
if (injectionPoint.getType().equals(Bird.class))
{
- injectionPointPresent = true;
+ initializerMethodIPPresent = true;
}
}
- assert injectionPointPresent;
+ assert initializerMethodIPPresent;
+ assert constructorIPPresent;
}
@Test
@@ -136,6 +125,17 @@
assert DogProducer.isNoisyDogProducerCalled();
assert dog.getColor().equals(DogProducer.NOISY_DOG_COLOR);
}
+
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section = "11.5.7", id="e")
+ })
+ public void testSetProducerOverridesProducer()
+ {
+ ProducerProcessor.reset();
+ assert getInstanceByType(Cow.class, new AnnotationLiteral<Noisy>() {}) instanceof Cow;
+ assert ProducerProcessor.isOverriddenCowProducerCalled();
+ }
@Test
@SpecAssertions({
@@ -184,7 +184,7 @@
}
@SuppressWarnings("unchecked")
- @Test(groups = "ri-broken")
+ @Test
@SpecAssertions({
@SpecAssertion(section = "11.2", id = "i"),
@SpecAssertion(section = "11.5.6", id = "ba"),
@@ -201,7 +201,7 @@
assert dog.getDogBone() != null;
}
- @Test(groups = "ri-broken")
+ @Test
@SpecAssertions({
@SpecAssertion(section = "11.2", id = "j")
})
@@ -214,7 +214,7 @@
assert Dog.isPostConstructCalled();
}
- @Test(groups = "ri-broken")
+ @Test
@SpecAssertions({
@SpecAssertion(section = "11.2", id = "k")
})
@@ -227,19 +227,19 @@
assert Dog.isPreDestroyCalled();
}
- @Test(groups = "ri-broken")
+ @Test
@SpecAssertions({
@SpecAssertion(section = "11.5.6", id = "bb"),
@SpecAssertion(section = "11.5.6", id = "ea")
})
public void testSettingInjectionTargetReplacesIt()
{
- BirdCageInjectionTarget.setInjectCalled(false);
+ CheckableInjectionTarget.setInjectCalled(false);
getInstanceByType(BirdCage.class);
- assert BirdCageInjectionTarget.isInjectCalled();
+ assert CheckableInjectionTarget.isInjectCalled();
}
- @Test(groups = "ri-broken")
+ @Test
@SpecAssertions({
@SpecAssertion(section = "11.5.6", id = "aba")
})
Modified: core/trunk/cdi-api/src/main/java/javax/enterprise/inject/spi/ProcessSessionBean.java
===================================================================
--- core/trunk/cdi-api/src/main/java/javax/enterprise/inject/spi/ProcessSessionBean.java 2009-10-09 13:42:39 UTC (rev 3908)
+++ core/trunk/cdi-api/src/main/java/javax/enterprise/inject/spi/ProcessSessionBean.java 2009-10-09 13:47:55 UTC (rev 3909)
@@ -17,9 +17,9 @@
package javax.enterprise.inject.spi;
-public interface ProcessSessionBean<X> extends ProcessBean<Object>
+public interface ProcessSessionBean<X> extends ProcessManagedBean<Object>
{
- public AnnotatedType<X> getAnnotatedBeanClass();
+ public AnnotatedType<X> getAnnotatedSessionBeanClass();
public String getEjbName();
Modified: core/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java 2009-10-09 13:42:39 UTC (rev 3908)
+++ core/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java 2009-10-09 13:47:55 UTC (rev 3909)
@@ -1271,7 +1271,7 @@
public <T> InjectionTarget<T> createInjectionTarget(EjbDescriptor<T> descriptor)
{
- return getBean(descriptor);
+ return getBean(descriptor).getInjectionTarget();
}
public <X> Bean<? extends X> getMostSpecializedBean(Bean<X> bean)
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractBean.java 2009-10-09 13:42:39 UTC (rev 3908)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractBean.java 2009-10-09 13:47:55 UTC (rev 3909)
@@ -331,7 +331,7 @@
*
* @return The annotated item
*/
- protected abstract WeldAnnotated<T, E> getAnnotatedItem();
+ public abstract WeldAnnotated<T, E> getAnnotatedItem();
/**
* Gets the binding types
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java 2009-10-09 13:42:39 UTC (rev 3908)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java 2009-10-09 13:47:55 UTC (rev 3909)
@@ -25,6 +25,9 @@
import java.util.List;
import java.util.Set;
+import javassist.util.proxy.ProxyFactory;
+import javassist.util.proxy.ProxyObject;
+
import javax.enterprise.context.Dependent;
import javax.enterprise.context.NormalScope;
import javax.enterprise.context.spi.CreationalContext;
@@ -53,9 +56,6 @@
import org.jboss.weld.util.Proxies;
import org.jboss.weld.util.Strings;
-import javassist.util.proxy.ProxyFactory;
-import javassist.util.proxy.ProxyObject;
-
/**
* An abstract bean representation common for class-based beans
*
@@ -64,7 +64,7 @@
* @param <T>
* @param <E>
*/
-public abstract class AbstractClassBean<T> extends AbstractBean<T, Class<T>> implements InjectionTarget<T>
+public abstract class AbstractClassBean<T> extends AbstractBean<T, Class<T>>
{
// Logger
private static final LogProvider log = Logging.getLogProvider(AbstractClassBean.class);
@@ -83,6 +83,8 @@
private final ThreadLocal<Integer> decoratorStackPosition;
private WeldMethod<?, ?> postConstruct;
private WeldMethod<?, ?> preDestroy;
+
+ private InjectionTarget<T> injectionTarget;
/**
* Constructor
@@ -209,12 +211,6 @@
{
return Collections.unmodifiableList(decorators);
}
-
- public void dispose(T instance)
- {
- // No-op for class beans
- }
-
/**
* Initializes the bean type
@@ -348,39 +344,7 @@
return dependencies;
}
- public void postConstruct(T instance)
- {
- WeldMethod<?, ?> postConstruct = getPostConstruct();
- if (postConstruct != null)
- {
- try
- {
- postConstruct.invoke(instance);
- }
- catch (Exception e)
- {
- throw new RuntimeException("Unable to invoke " + postConstruct + " on " + instance, e);
- }
- }
- }
- public void preDestroy(T instance)
- {
- WeldMethod<?, ?> preDestroy = getPreDestroy();
- if (preDestroy != null)
- {
- try
- {
- // note: RI supports injection into @PreDestroy
- preDestroy.invoke(instance);
- }
- catch (Exception e)
- {
- throw new RuntimeException("Unable to invoke " + preDestroy + " on " + instance, e);
- }
- }
- }
-
/**
* Initializes the post-construct method
*/
@@ -466,4 +430,54 @@
manager.getBoundInterceptorsRegistry().registerInterceptionModel(getType(), builder.build());
}
}
+
+ public void setInjectionTarget(InjectionTarget<T> injectionTarget)
+ {
+ this.injectionTarget = injectionTarget;
+ }
+
+ public InjectionTarget<T> getInjectionTarget()
+ {
+ return injectionTarget;
+ }
+
+ @Override
+ public Set<InjectionPoint> getInjectionPoints()
+ {
+ return getInjectionTarget().getInjectionPoints();
+ }
+
+ protected void defaultPreDestroy(T instance)
+ {
+ WeldMethod<?, ?> preDestroy = getPreDestroy();
+ if (preDestroy != null)
+ {
+ try
+ {
+ // note: RI supports injection into @PreDestroy
+ preDestroy.invoke(instance);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Unable to invoke " + preDestroy + " on " + instance, e);
+ }
+ }
+ }
+
+ protected void defaultPostConstruct(T instance)
+ {
+ WeldMethod<?, ?> postConstruct = getPostConstruct();
+ if (postConstruct != null)
+ {
+ try
+ {
+ postConstruct.invoke(instance);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Unable to invoke " + postConstruct + " on " + instance, e);
+ }
+ }
+ }
+
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java 2009-10-09 13:42:39 UTC (rev 3908)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java 2009-10-09 13:47:55 UTC (rev 3909)
@@ -56,9 +56,11 @@
* @param <T>
* @param <S>
*/
-public abstract class AbstractProducerBean<X, T, S extends Member> extends AbstractReceiverBean<X, T, S> implements Producer<T>
+public abstract class AbstractProducerBean<X, T, S extends Member> extends AbstractReceiverBean<X, T, S>
{
private static final LogProvider log = Logging.getLogProvider(AbstractProducerBean.class);
+
+ private Producer<T> producer;
/**
* Constructor
@@ -154,6 +156,12 @@
super.initialize(environment);
checkProducerReturnType();
}
+
+ @Override
+ public Set<InjectionPoint> getInjectionPoints()
+ {
+ return getProducer().getInjectionPoints();
+ }
/**
* Validates the return value
@@ -244,6 +252,21 @@
{
return true;
}
+
+ /**
+ * This operation is *not* threadsafe, and should not be called outside bootstrap
+ *
+ * @param producer
+ */
+ public void setProducer(Producer<T> producer)
+ {
+ this.producer = producer;
+ }
+
+ public Producer<T> getProducer()
+ {
+ return producer;
+ }
/**
* Creates an instance of the bean
@@ -254,7 +277,7 @@
{
try
{
- T instance = produce(creationalContext);
+ T instance = getProducer().produce(creationalContext);
checkReturnValue(instance);
return instance;
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractReceiverBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractReceiverBean.java 2009-10-09 13:42:39 UTC (rev 3908)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractReceiverBean.java 2009-10-09 13:47:55 UTC (rev 3909)
@@ -119,6 +119,6 @@
}
@Override
- protected abstract WeldMember<T, ?, S> getAnnotatedItem();
+ public abstract WeldMember<T, ?, S> getAnnotatedItem();
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/InterceptorImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/InterceptorImpl.java 2009-10-09 13:42:39 UTC (rev 3908)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/InterceptorImpl.java 2009-10-09 13:47:55 UTC (rev 3909)
@@ -17,20 +17,19 @@
package org.jboss.weld.bean;
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.InterceptionType;
+import javax.enterprise.inject.spi.Interceptor;
+import javax.interceptor.InvocationContext;
+
import org.jboss.interceptor.model.InterceptorClassMetadata;
+import org.jboss.interceptor.proxy.DirectClassInterceptionHandler;
import org.jboss.interceptor.registry.InterceptorClassMetadataRegistry;
-import org.jboss.interceptor.proxy.DirectClassInterceptionHandler;
import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.introspector.WeldClass;
-import org.jboss.weld.metadata.cache.MetaAnnotationStore;
-import javax.enterprise.inject.spi.InterceptionType;
-import javax.enterprise.inject.spi.Interceptor;
-import javax.interceptor.InvocationContext;
-import java.lang.annotation.Annotation;
-import java.util.HashSet;
-import java.util.Set;
-
/**
* @author Marius Bogoevici
*/
@@ -74,14 +73,15 @@
}
@Override
- public void postConstruct(T instance)
+ protected void defaultPostConstruct(T instance)
{
- // do nothing on PostConstruct
+ // Lifecycle callbacks not supported
}
-
+
@Override
- public void preDestroy(T instance)
+ protected void defaultPreDestroy(T instance)
{
- // do nothing on PreDestroy
+ // Lifecycle callbacks not supported
}
+
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java 2009-10-09 13:42:39 UTC (rev 3908)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java 2009-10-09 13:47:55 UTC (rev 3909)
@@ -16,23 +16,24 @@
*/
package org.jboss.weld.bean;
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.List;
import java.util.Set;
-import java.util.List;
-import java.util.ArrayList;
-import java.lang.annotation.Annotation;
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.event.Observes;
import javax.enterprise.inject.Disposes;
+import javax.enterprise.inject.spi.AnnotatedMethod;
import javax.enterprise.inject.spi.Decorator;
import javax.enterprise.inject.spi.InjectionPoint;
-import javax.enterprise.inject.spi.AnnotatedMethod;
+import javax.enterprise.inject.spi.InjectionTarget;
+import org.jboss.interceptor.model.InterceptionModelBuilder;
+import org.jboss.interceptor.proxy.InterceptionHandlerFactory;
import org.jboss.interceptor.proxy.InterceptorProxyCreatorImpl;
-import org.jboss.interceptor.proxy.InterceptionHandlerFactory;
+import org.jboss.interceptor.registry.InterceptorRegistry;
import org.jboss.interceptor.util.InterceptionUtils;
-import org.jboss.interceptor.model.InterceptionModelBuilder;
-import org.jboss.interceptor.registry.InterceptorRegistry;
import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.DefinitionException;
import org.jboss.weld.DeploymentException;
@@ -113,8 +114,8 @@
{
originalInjectionPoint = attachCorrectInjectionPoint();
}
- T instance = produce(creationalContext);
- inject(instance, creationalContext);
+ T instance = getInjectionTarget().produce(creationalContext);
+ getInjectionTarget().inject(instance, creationalContext);
if (hasDecorators())
{
instance = applyDecorators(instance, creationalContext, originalInjectionPoint);
@@ -123,40 +124,14 @@
{
instance = applyInterceptors(instance, creationalContext);
InterceptionUtils.executePostConstruct(instance);
- } else
+ }
+ else
{
- postConstruct(instance);
+ getInjectionTarget().postConstruct(instance);
}
return instance;
}
- public T produce(CreationalContext<T> ctx)
- {
- T instance = constructor.newInstance(manager, ctx);
- if (!hasDecorators())
- {
- // This should be safe, but needs verification PLM
- // Without this, the chaining of decorators will fail as the incomplete instance will be resolved
- ctx.push(instance);
- }
- return instance;
- }
-
- public void inject(final T instance, final CreationalContext<T> ctx)
- {
- new InjectionContextImpl<T>(getManager(), this, instance)
- {
-
- public void proceed()
- {
- Beans.injectEEFields(instance, getManager(), ejbInjectionPoints, persistenceContextInjectionPoints, persistenceUnitInjectionPoints, resourceInjectionPoints);
- Beans.injectFieldsAndInitializers(instance, ctx, getManager(), getInjectableFields(), getInitializerMethods());
- }
-
- }.run();
-
- }
-
protected InjectionPoint attachCorrectInjectionPoint()
{
Decorator<?> decorator = getDecorators().get(getDecorators().size() - 1);
@@ -181,7 +156,9 @@
try
{
if (!isInterceptionCandidate() || !hasBoundInterceptors())
- preDestroy(instance);
+ {
+ getInjectionTarget().preDestroy(instance);
+ }
else
{
InterceptionUtils.executePredestroy(instance);
@@ -209,7 +186,58 @@
initPreDestroy();
initEEInjectionPoints();
if (isInterceptionCandidate())
+ {
initDeclaredInterceptors();
+ }
+ setInjectionTarget(new InjectionTarget<T>()
+ {
+
+ public void inject(final T instance, final CreationalContext<T> ctx)
+ {
+ new InjectionContextImpl<T>(getManager(), this, instance)
+ {
+
+ public void proceed()
+ {
+ Beans.injectEEFields(instance, getManager(), ejbInjectionPoints, persistenceContextInjectionPoints, persistenceUnitInjectionPoints, resourceInjectionPoints);
+ Beans.injectFieldsAndInitializers(instance, ctx, getManager(), getInjectableFields(), getInitializerMethods());
+ }
+
+ }.run();
+ }
+
+ public void postConstruct(T instance)
+ {
+ defaultPostConstruct(instance);
+ }
+
+ public void preDestroy(T instance)
+ {
+ defaultPreDestroy(instance);
+ }
+
+ public void dispose(T instance)
+ {
+ // No-op
+ }
+
+ public Set<InjectionPoint> getInjectionPoints()
+ {
+ return (Set) getAnnotatedInjectionPoints();
+ }
+
+ public T produce(CreationalContext<T> ctx)
+ {
+ T instance = constructor.newInstance(manager, ctx);
+ if (!hasDecorators())
+ {
+ // This should be safe, but needs verification PLM
+ // Without this, the chaining of decorators will fail as the incomplete instance will be resolved
+ ctx.push(instance);
+ }
+ return instance;
+ }
+ });
}
}
@@ -379,6 +407,7 @@
return specializedBean;
}
+ @Override
protected boolean isInterceptionCandidate()
{
return !Beans.isInterceptor(getAnnotatedItem()) && !Beans.isDecorator(getAnnotatedItem());
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java 2009-10-09 13:42:39 UTC (rev 3908)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java 2009-10-09 13:47:55 UTC (rev 3909)
@@ -22,6 +22,8 @@
import java.util.Set;
import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.InjectionPoint;
+import javax.enterprise.inject.spi.Producer;
import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
@@ -79,25 +81,38 @@
if (!isInitialized())
{
super.initialize(environment);
+ setProducer(new Producer<T>()
+ {
+
+ public void dispose(T instance)
+ {
+ defaultDispose(instance);
+ }
+
+ public Set<InjectionPoint> getInjectionPoints()
+ {
+ return (Set) getAnnotatedInjectionPoints();
+ }
+
+ public T produce(CreationalContext<T> creationalContext)
+ {
+ return field.get(getReceiver(creationalContext));
+ }
+
+ });
}
}
-
- public void destroy(T instance, CreationalContext<T> creationalContext)
+
+ protected void defaultDispose(T instance)
{
- dispose(instance);
+ // No disposal by default
}
- public void dispose(T instance)
+ public void destroy(T instance, CreationalContext<T> creationalContext)
{
- // No clean up required
+ getProducer().dispose(instance);
}
- public T produce(CreationalContext<T> ctx)
- {
- return field.get(getReceiver(ctx));
- }
-
-
/**
* Gets the annotated item representing the field
*
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java 2009-10-09 13:42:39 UTC (rev 3908)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java 2009-10-09 13:47:55 UTC (rev 3909)
@@ -26,6 +26,8 @@
import javax.enterprise.event.Observes;
import javax.enterprise.inject.CreationException;
import javax.enterprise.inject.Disposes;
+import javax.enterprise.inject.spi.InjectionPoint;
+import javax.enterprise.inject.spi.Producer;
import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.DefinitionException;
@@ -79,19 +81,6 @@
initPolicy();
}
- public T produce(CreationalContext<T> creationalContext)
- {
- Object receiver = getReceiver(creationalContext);
- if (receiver != null)
- {
- return method.invokeOnInstance(receiver, manager, creationalContext, CreationException.class);
- }
- else
- {
- return method.invoke(receiver, manager, creationalContext, CreationException.class);
- }
- }
-
/**
* Initializes the bean and its metadata
*/
@@ -104,6 +93,38 @@
super.initialize(environment);
checkProducerMethod();
initDisposalMethod(environment);
+ setProducer(new Producer<T>()
+ {
+
+ public void dispose(T instance)
+ {
+ if (disposalMethodBean != null)
+ {
+ disposalMethodBean.invokeDisposeMethod(instance);
+ }
+ }
+
+ public Set<InjectionPoint> getInjectionPoints()
+ {
+ return (Set) getAnnotatedInjectionPoints();
+ }
+
+ public T produce(CreationalContext<T> creationalContext)
+ {
+ Object receiver = getReceiver(creationalContext);
+ if (receiver != null)
+ {
+ return method.invokeOnInstance(receiver, manager, creationalContext, CreationException.class);
+ }
+ else
+ {
+ return method.invoke(receiver, manager, creationalContext, CreationException.class);
+ }
+ }
+
+
+
+ });
}
}
@@ -180,7 +201,7 @@
{
try
{
- dispose(instance);
+ getProducer().dispose(instance);
}
finally
{
@@ -190,14 +211,6 @@
}
}
}
-
- public void dispose(T instance)
- {
- if (disposalMethodBean != null)
- {
- disposalMethodBean.invokeDisposeMethod(instance);
- }
- }
/**
* Gets the annotated item representing the method
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java 2009-10-09 13:42:39 UTC (rev 3908)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java 2009-10-09 13:47:55 UTC (rev 3909)
@@ -33,8 +33,11 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.event.Observes;
import javax.enterprise.inject.CreationException;
+import javax.enterprise.inject.spi.InjectionPoint;
+import javax.enterprise.inject.spi.InjectionTarget;
import javax.interceptor.Interceptor;
+import org.jboss.interceptor.model.InterceptionModel;
import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.DefinitionException;
import org.jboss.weld.bean.interceptor.InterceptorBindingsAdapter;
@@ -54,7 +57,6 @@
import org.jboss.weld.resources.ClassTransformer;
import org.jboss.weld.util.Beans;
import org.jboss.weld.util.Proxies;
-import org.jboss.interceptor.model.InterceptionModel;
/**
* An enterprise bean representation
@@ -118,6 +120,67 @@
checkObserverMethods();
checkScopeAllowed();
registerInterceptors();
+ setInjectionTarget(new InjectionTarget<T>()
+ {
+
+ public void inject(final T instance, final CreationalContext<T> ctx)
+ {
+ new InjectionContextImpl<T>(getManager(), this, instance)
+ {
+
+ public void proceed()
+ {
+ Beans.injectFieldsAndInitializers(instance, ctx, getManager(), getInjectableFields(), getInitializerMethods());
+ }
+
+ }.run();
+ }
+
+ public void postConstruct(T instance)
+ {
+ defaultPostConstruct(instance);
+ }
+
+ public void preDestroy(T instance)
+ {
+
+ }
+
+ public void dispose(T instance)
+ {
+ // No-op
+ }
+
+ public Set<InjectionPoint> getInjectionPoints()
+ {
+ return (Set) getAnnotatedInjectionPoints();
+ }
+
+ public T produce(CreationalContext<T> ctx)
+ {
+ try
+ {
+ T instance = proxyClass.newInstance();
+ ctx.push(instance);
+ ((ProxyObject) instance).setHandler(new EnterpriseBeanProxyMethodHandler<T>(SessionBean.this, ctx));
+ log.trace("Enterprise bean instance created for bean {0}", this);
+ return instance;
+ }
+ catch (InstantiationException e)
+ {
+ throw new RuntimeException("Could not instantiate enterprise proxy for " + toString(), e);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new RuntimeException("Could not access bean correctly when creating enterprise proxy for " + toString(), e);
+ }
+ catch (Exception e)
+ {
+ throw new CreationException("could not find the EJB in JNDI " + proxyClass, e);
+ }
+ }
+
+ });
}
}
@@ -216,52 +279,14 @@
*/
public T create(final CreationalContext<T> creationalContext)
{
- T instance = produce(creationalContext);
+ T instance = getInjectionTarget().produce(creationalContext);
if (hasDecorators())
{
instance = applyDecorators(instance, creationalContext, null);
}
return instance;
}
-
- public void inject(final T instance, final CreationalContext<T> ctx)
- {
- new InjectionContextImpl<T>(getManager(), this, instance)
- {
-
- public void proceed()
- {
- Beans.injectFieldsAndInitializers(instance, ctx, getManager(), getInjectableFields(), getInitializerMethods());
- }
-
- }.run();
-
- }
- public T produce(CreationalContext<T> ctx)
- {
- try
- {
- T instance = proxyClass.newInstance();
- ctx.push(instance);
- ((ProxyObject) instance).setHandler(new EnterpriseBeanProxyMethodHandler<T>(this, ctx));
- log.trace("Enterprise bean instance created for bean {0}", this);
- return instance;
- }
- catch (InstantiationException e)
- {
- throw new RuntimeException("Could not instantiate enterprise proxy for " + toString(), e);
- }
- catch (IllegalAccessException e)
- {
- throw new RuntimeException("Could not access bean correctly when creating enterprise proxy for " + toString(), e);
- }
- catch (Exception e)
- {
- throw new CreationException("could not find the EJB in JNDI " + proxyClass, e);
- }
- }
-
public void destroy(T instance, CreationalContext<T> creationalContext)
{
if (instance == null)
@@ -311,11 +336,6 @@
buffer.append("API types " + getTypes() + ", binding types " + getQualifiers());
return buffer.toString();
}
-
- public void preDestroy(CreationalContext<T> creationalContext)
- {
- creationalContext.release();
- }
@Override
protected void initSerializable()
@@ -393,6 +413,7 @@
return Collections.emptySet();
}
+ @Override
protected boolean isInterceptionCandidate()
{
return true;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/ee/PersistenceContextProducerField.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/ee/PersistenceContextProducerField.java 2009-10-09 13:42:39 UTC (rev 3908)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/ee/PersistenceContextProducerField.java 2009-10-09 13:47:55 UTC (rev 3909)
@@ -53,7 +53,7 @@
}
@Override
- public void dispose(T instance)
+ protected void defaultDispose(T instance)
{
instance.close();
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java 2009-10-09 13:42:39 UTC (rev 3908)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java 2009-10-09 13:47:55 UTC (rev 3909)
@@ -16,16 +16,18 @@
*/
package org.jboss.weld.bootstrap;
-import java.util.Set;
import java.lang.reflect.Member;
import java.lang.reflect.Type;
+import java.util.Set;
import javax.enterprise.event.Observes;
import javax.enterprise.inject.Disposes;
import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.spi.ProcessInjectionTarget;
+import javax.enterprise.inject.spi.ProcessManagedBean;
import javax.enterprise.inject.spi.ProcessObserverMethod;
import javax.enterprise.inject.spi.ProcessProducer;
-import javax.enterprise.inject.spi.Interceptor;
+import javax.enterprise.inject.spi.ProcessSessionBean;
import javax.inject.Inject;
import org.jboss.weld.BeanManagerImpl;
@@ -36,6 +38,7 @@
import org.jboss.weld.bean.DisposalMethod;
import org.jboss.weld.bean.InterceptorImpl;
import org.jboss.weld.bean.ManagedBean;
+import org.jboss.weld.bean.NewBean;
import org.jboss.weld.bean.NewManagedBean;
import org.jboss.weld.bean.NewSessionBean;
import org.jboss.weld.bean.ProducerField;
@@ -44,11 +47,13 @@
import org.jboss.weld.bean.SessionBean;
import org.jboss.weld.bean.ee.EEResourceProducerField;
import org.jboss.weld.bean.ee.PersistenceContextProducerField;
+import org.jboss.weld.bootstrap.events.ProcessInjectionTargetImpl;
+import org.jboss.weld.bootstrap.events.ProcessManagedBeanImpl;
import org.jboss.weld.bootstrap.events.ProcessObserverMethodImpl;
import org.jboss.weld.bootstrap.events.ProcessProducerImpl;
+import org.jboss.weld.bootstrap.events.ProcessSessionBeanImpl;
import org.jboss.weld.ejb.EJBApiAbstraction;
import org.jboss.weld.ejb.InternalEjbDescriptor;
-import org.jboss.weld.ejb.spi.EjbServices;
import org.jboss.weld.event.ObserverFactory;
import org.jboss.weld.event.ObserverMethodImpl;
import org.jboss.weld.introspector.WeldClass;
@@ -62,7 +67,6 @@
import org.jboss.weld.util.Reflections;
import org.jboss.weld.util.reflection.ParameterizedTypeImpl;
import org.jboss.weld.ws.WSApiAbstraction;
-import org.jboss.interceptor.model.InterceptionModel;
public class AbstractBeanDeployer<E extends BeanDeployerEnvironment>
{
@@ -103,10 +107,24 @@
for (RIBean<?> bean : beans)
{
bean.initialize(getEnvironment());
- if (bean instanceof AbstractProducerBean<?, ?, ?>)
+ if (!(bean instanceof NewBean))
{
- AbstractProducerBean<?, ?, Member> producer = (AbstractProducerBean<?, ?, Member>) bean;
- createAndFireProcessProducerEvent(producer);
+ if (bean instanceof AbstractProducerBean<?, ?, ?>)
+ {
+ fireProcessProducerEvent((AbstractProducerBean<?, ?, Member>) bean);
+ }
+ if (bean instanceof AbstractClassBean<?>)
+ {
+ fireProcessInjectionTargetEvent((AbstractClassBean<?>) bean);
+ }
+ if (bean instanceof ManagedBean<?>)
+ {
+ fireProcessManagedBeanEvent((ManagedBean<?>) bean);
+ }
+ if (bean instanceof SessionBean<?>)
+ {
+ fireProcessSessionBeanEvent((SessionBean<Object>) bean);
+ }
}
manager.addBean(bean);
log.debug("Bean: " + bean);
@@ -183,7 +201,7 @@
getEnvironment().addBean(bean);
}
- private <X, T> void createAndFireProcessProducerEvent(AbstractProducerBean<X, T, Member> producer)
+ private <X, T> void fireProcessProducerEvent(AbstractProducerBean<X, T, Member> producer)
{
ProcessProducerImpl<X, T> payload = new ProcessProducerImpl<X, T>(producer.getAnnotatedItem(), producer) {};
fireEvent(payload, ProcessProducer.class, producer.getAnnotatedItem().getDeclaringType().getBaseType(), producer.getAnnotatedItem().getBaseType());
@@ -194,6 +212,39 @@
}
}
+ private <X> void fireProcessInjectionTargetEvent(AbstractClassBean<X> classBean)
+ {
+ ProcessInjectionTargetImpl<X> payload = new ProcessInjectionTargetImpl<X>(classBean.getAnnotatedItem(), classBean) {};
+ fireEvent(payload, ProcessInjectionTarget.class, classBean.getAnnotatedItem().getBaseType());
+ if (!payload.getDefinitionErrors().isEmpty())
+ {
+ // FIXME communicate all the captured definition errors in this exception
+ throw new DefinitionException(payload.getDefinitionErrors().get(0));
+ }
+ }
+
+ private <X> void fireProcessManagedBeanEvent(ManagedBean<X> bean)
+ {
+ ProcessManagedBeanImpl<X> payload = new ProcessManagedBeanImpl<X>(bean) {};
+ fireEvent(payload, ProcessManagedBean.class, bean.getAnnotatedItem().getBaseType());
+ if (!payload.getDefinitionErrors().isEmpty())
+ {
+ // FIXME communicate all the captured definition errors in this exception
+ throw new DefinitionException(payload.getDefinitionErrors().get(0));
+ }
+ }
+
+ private <X> void fireProcessSessionBeanEvent(SessionBean<Object> bean)
+ {
+ ProcessSessionBeanImpl<X> payload = new ProcessSessionBeanImpl<X>(bean) {};
+ fireEvent(payload, ProcessSessionBean.class, bean.getAnnotatedItem().getBaseType());
+ if (!payload.getDefinitionErrors().isEmpty())
+ {
+ // FIXME communicate all the captured definition errors in this exception
+ throw new DefinitionException(payload.getDefinitionErrors().get(0));
+ }
+ }
+
private void fireEvent(Object payload, Type rawType, Type... actualTypeArguments)
{
Type eventType = new ParameterizedTypeImpl(rawType, actualTypeArguments, null);
Added: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractProcessBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractProcessBean.java (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractProcessBean.java 2009-10-09 13:47:55 UTC (rev 3909)
@@ -0,0 +1,40 @@
+package org.jboss.weld.bootstrap.events;
+
+import java.util.List;
+
+import javax.enterprise.inject.spi.Annotated;
+import javax.enterprise.inject.spi.ProcessBean;
+
+import org.jboss.weld.bean.AbstractBean;
+
+public abstract class AbstractProcessBean<X, B extends AbstractBean<X, ?>> extends AbstractContainerEvent implements ProcessBean<X>
+{
+
+ private final B bean;
+
+ public AbstractProcessBean(B bean)
+ {
+ this.bean = bean;
+ }
+
+ public void addDefinitionError(Throwable t)
+ {
+ getErrors().add(t);
+ }
+
+ public List<Throwable> getDefinitionErrors()
+ {
+ return super.getErrors();
+ }
+
+ public Annotated getAnnotated()
+ {
+ return bean.getAnnotatedItem();
+ }
+
+ public B getBean()
+ {
+ return bean;
+ }
+
+}
Property changes on: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractProcessBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessInjectionTargetImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessInjectionTargetImpl.java (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessInjectionTargetImpl.java 2009-10-09 13:47:55 UTC (rev 3909)
@@ -0,0 +1,49 @@
+package org.jboss.weld.bootstrap.events;
+
+import java.util.List;
+
+import javax.enterprise.inject.spi.AnnotatedType;
+import javax.enterprise.inject.spi.InjectionTarget;
+import javax.enterprise.inject.spi.ProcessInjectionTarget;
+
+import org.jboss.weld.bean.AbstractClassBean;
+
+
+public class ProcessInjectionTargetImpl<T> extends AbstractContainerEvent implements ProcessInjectionTarget<T>
+{
+
+ private final AnnotatedType<T> annotatedType;
+ private AbstractClassBean<T> classBean;
+
+ public ProcessInjectionTargetImpl(AnnotatedType<T> annotatedType, AbstractClassBean<T> classBean)
+ {
+ this.classBean = classBean;
+ this.annotatedType = annotatedType;
+ }
+
+ public void addDefinitionError(Throwable t)
+ {
+ getErrors().add(t);
+ }
+
+ public List<Throwable> getDefinitionErrors()
+ {
+ return super.getErrors();
+ }
+
+ public AnnotatedType<T> getAnnotatedType()
+ {
+ return annotatedType;
+ }
+
+ public InjectionTarget<T> getInjectionTarget()
+ {
+ return classBean.getInjectionTarget();
+ }
+
+ public void setInjectionTarget(InjectionTarget<T> injectionTarget)
+ {
+ classBean.setInjectionTarget(injectionTarget);
+ }
+
+}
Property changes on: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessInjectionTargetImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessManagedBeanImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessManagedBeanImpl.java (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessManagedBeanImpl.java 2009-10-09 13:47:55 UTC (rev 3909)
@@ -0,0 +1,21 @@
+package org.jboss.weld.bootstrap.events;
+
+import javax.enterprise.inject.spi.AnnotatedType;
+import javax.enterprise.inject.spi.ProcessManagedBean;
+
+import org.jboss.weld.bean.ManagedBean;
+
+public class ProcessManagedBeanImpl<X> extends AbstractProcessBean<X, ManagedBean<X>> implements ProcessManagedBean<X>
+{
+
+ public ProcessManagedBeanImpl(ManagedBean<X> bean)
+ {
+ super(bean);
+ }
+
+ public AnnotatedType<X> getAnnotatedBeanClass()
+ {
+ return getBean().getAnnotatedItem();
+ }
+
+}
Property changes on: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessManagedBeanImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessProducerImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessProducerImpl.java 2009-10-09 13:42:39 UTC (rev 3908)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessProducerImpl.java 2009-10-09 13:47:55 UTC (rev 3909)
@@ -6,16 +6,18 @@
import javax.enterprise.inject.spi.ProcessProducer;
import javax.enterprise.inject.spi.Producer;
+import org.jboss.weld.bean.AbstractProducerBean;
+
public class ProcessProducerImpl<X, T> extends AbstractContainerEvent implements ProcessProducer<X, T>
{
private final AnnotatedMember<X> annotatedMember;
- private Producer<T> producer;
+ private AbstractProducerBean<X, T, ?> bean;
- public ProcessProducerImpl(AnnotatedMember<X> annotatedMember, Producer<T> producer)
+ public ProcessProducerImpl(AnnotatedMember<X> annotatedMember, AbstractProducerBean<X, T, ?> bean)
{
- this.producer = producer;
+ this.bean = bean;
this.annotatedMember = annotatedMember;
}
@@ -36,12 +38,12 @@
public Producer<T> getProducer()
{
- return producer;
+ return bean.getProducer();
}
public void setProducer(Producer<T> producer)
{
- throw new UnsupportedOperationException();
+ this.bean.setProducer(producer);
}
}
Added: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessSessionBeanImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessSessionBeanImpl.java (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessSessionBeanImpl.java 2009-10-09 13:47:55 UTC (rev 3909)
@@ -0,0 +1,52 @@
+package org.jboss.weld.bootstrap.events;
+
+import javax.enterprise.inject.spi.AnnotatedType;
+import javax.enterprise.inject.spi.ProcessSessionBean;
+import javax.enterprise.inject.spi.SessionBeanType;
+
+import org.jboss.weld.bean.SessionBean;
+
+public class ProcessSessionBeanImpl<X> extends AbstractProcessBean<Object, SessionBean<Object>> implements ProcessSessionBean<X>
+{
+
+ public ProcessSessionBeanImpl(SessionBean<Object> bean)
+ {
+ super(bean);
+ }
+
+ public AnnotatedType<X> getAnnotatedSessionBeanClass()
+ {
+ return (AnnotatedType<X>) getBean().getAnnotatedItem();
+ }
+
+ public String getEjbName()
+ {
+ return getBean().getEjbDescriptor().getEjbName();
+ }
+
+ public SessionBeanType getSessionBeanType()
+ {
+ if (getBean().getEjbDescriptor().isStateless())
+ {
+ return SessionBeanType.STATELESS;
+ }
+ else if (getBean().getEjbDescriptor().isStateful())
+ {
+ return SessionBeanType.STATEFUL;
+ }
+ else if (getBean().getEjbDescriptor().isSingleton())
+ {
+ return SessionBeanType.SINGLETON;
+ }
+ else
+ {
+ throw new IllegalStateException("Bean type is not STATELESS, STATEFUL or SINGELTON " + getBean());
+ }
+ }
+
+ public AnnotatedType<Object> getAnnotatedBeanClass()
+ {
+ return getBean().getAnnotatedItem();
+ }
+
+}
Property changes on: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessSessionBeanImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: core/trunk/tests/src/test/java/org/jboss/weld/test/unit/manager/EjbDescriptorLookupTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/test/unit/manager/EjbDescriptorLookupTest.java 2009-10-09 13:42:39 UTC (rev 3908)
+++ core/trunk/tests/src/test/java/org/jboss/weld/test/unit/manager/EjbDescriptorLookupTest.java 2009-10-09 13:47:55 UTC (rev 3909)
@@ -48,8 +48,8 @@
assert bean.getBeanClass().equals(Cat.class);
InjectionTarget<CatLocal> it = getCurrentManager().createInjectionTarget(descriptor);
assert it != null;
- assert it instanceof SessionBean;
- assert it == bean;
+ assert it.getInjectionPoints().equals(bean.getInjectionPoints());
+ assert it.produce(getCurrentManager().createCreationalContext(bean)) instanceof CatLocal;
}
}
15 years, 1 month
Weld SVN: r3908 - in core/trunk: parent and 1 other directories.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-10-09 09:42:39 -0400 (Fri, 09 Oct 2009)
New Revision: 3908
Modified:
core/trunk/parent/pom.xml
core/trunk/pom.xml
core/trunk/version-matrix/pom.xml
Log:
update distributionManagement for sonatype
Modified: core/trunk/parent/pom.xml
===================================================================
--- core/trunk/parent/pom.xml 2009-10-09 13:18:41 UTC (rev 3907)
+++ core/trunk/parent/pom.xml 2009-10-09 13:42:39 UTC (rev 3908)
@@ -233,19 +233,6 @@
<url>http://fisheye.jboss.org/browse/Weld/ri</url>
</scm>
- <distributionManagement>
- <repository>
- <id>oss.sonatype.org</id>
- <name>Sonatype Nexus Maven Repository</name>
- <url>dav:https://oss.sonatype.org/content/repositories/jboss-releases/</url>
- </repository>
- <snapshotRepository>
- <id>oss.sonatype.org</id>
- <name>Sonatype Nexus Snapshot Repository</name>
- <url>dav:https://oss.sonatype.org/content/repositories/jboss-snapshots/</url>
- </snapshotRepository>
- </distributionManagement>
-
<reporting>
<plugins>
<plugin>
Modified: core/trunk/pom.xml
===================================================================
--- core/trunk/pom.xml 2009-10-09 13:18:41 UTC (rev 3907)
+++ core/trunk/pom.xml 2009-10-09 13:42:39 UTC (rev 3908)
@@ -16,14 +16,14 @@
<distributionManagement>
<repository>
- <id>oss.sonatype.org</id>
+ <id>jboss-releases</id>
<name>Sonatype Nexus Maven Repository</name>
- <url>dav:http://oss.sonatype.org/content/repositories/jboss-releases/</url>
+ <url>http://oss.sonatype.org/service/local/staging/deploy/maven2</url>
</repository>
<snapshotRepository>
- <id>snapshots.jboss.org</id>
+ <id>jboss-snapshots</id>
<name>Sonatype Nexus Snapshot Repository</name>
- <url>dav:http://oss.sonatype.org/content/repositories/jboss-snapshots/</url>
+ <url>http://oss.sonatype.org/content/repositories/jboss-snapshots</url>
</snapshotRepository>
</distributionManagement>
Modified: core/trunk/version-matrix/pom.xml
===================================================================
--- core/trunk/version-matrix/pom.xml 2009-10-09 13:18:41 UTC (rev 3907)
+++ core/trunk/version-matrix/pom.xml 2009-10-09 13:42:39 UTC (rev 3908)
@@ -8,9 +8,7 @@
<name>Weld Version Matrix</name>
<url>http://www.seamframework.org/Weld</url>
- <description>
- A version matrix for Weld projects
- </description>
+ <description>Version Matrix for Weld. JSR-299: Contexts and Dependency Injection for Java EE is an elegant set of new services for Java that draws upon ideas from JBoss Seam and Google Guice. While many of the features provided (dependency injection, contextual lifecycle, configuration, interception, event notification) are familiar, the innovative use of meta-annotations is uniquely expressive and typesafe. Weld is the Reference Implementation of CDI.</description>
<repositories>
<repository>
@@ -628,23 +626,23 @@
</pluginManagement>
</build>
- <distributionManagement>
- <repository>
- <id>oss.sonatype.org</id>
- <name>Sonatype Nexus Releases Repository</name>
- <url>dav:http://oss.sonatype.org/content/repositories/jboss-releases/</url>
- </repository>
- <snapshotRepository>
- <id>oss.sonatype.org</id>
- <name>Sonatype Nexus Snapshots Repository</name>
- <url>dav:https://oss.sonatype.org/content/repositories/jboss-snapshots/</url>
- </snapshotRepository>
- </distributionManagement>
-
<scm>
<connection>scm:svn:http://anonsvn.jboss.org/repos/weld/ri/trunk/version-matrix</connection>
<developerConnection>scm:svn:https://svn.jboss.org/repos/weld/ri/trunk/version-matrix</developerConnection>
<url>http://fisheye.jboss.org/browse/Weld/ri</url>
</scm>
+ <distributionManagement>
+ <repository>
+ <id>jboss-releases</id>
+ <name>Sonatype Nexus Maven Repository</name>
+ <url>http://oss.sonatype.org/service/local/staging/deploy/maven2</url>
+ </repository>
+ <snapshotRepository>
+ <id>jboss-snapshots</id>
+ <name>Sonatype Nexus Snapshot Repository</name>
+ <url>http://oss.sonatype.org/content/repositories/jboss-snapshots</url>
+ </snapshotRepository>
+ </distributionManagement>
+
</project>
15 years, 1 month
Weld SVN: r3907 - core/trunk/osgi-bundle.
by weld-commits@lists.jboss.org
Author: rogerk
Date: 2009-10-09 09:18:41 -0400 (Fri, 09 Oct 2009)
New Revision: 3907
Modified:
core/trunk/osgi-bundle/pom.xml
Log:
fix pom file
Modified: core/trunk/osgi-bundle/pom.xml
===================================================================
--- core/trunk/osgi-bundle/pom.xml 2009-10-09 04:49:23 UTC (rev 3906)
+++ core/trunk/osgi-bundle/pom.xml 2009-10-09 13:18:41 UTC (rev 3907)
@@ -93,9 +93,9 @@
</build>
<dependencies>
<dependency>
- <groupId>org.jboss.weld</groupId>
+ <groupId>javax.enterprise</groupId>
- <artifactId>jsr299-api</artifactId>
+ <artifactId>cdi-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
15 years, 1 month
Weld SVN: r3906 - in cdi-tck/trunk: api and 10 other directories.
by weld-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-10-09 00:49:23 -0400 (Fri, 09 Oct 2009)
New Revision: 3906
Modified:
cdi-tck/trunk/api/pom.xml
cdi-tck/trunk/dist/readme.txt
cdi-tck/trunk/doc/reference/en-US/eclipse-debugging.xml
cdi-tck/trunk/doc/reference/en-US/eclipse-running.xml
cdi-tck/trunk/doc/reference/en-US/executing.xml
cdi-tck/trunk/doc/reference/en-US/installation.xml
cdi-tck/trunk/doc/reference/pom.xml
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/ScopeDefinitionTest.java
cdi-tck/trunk/impl/src/main/resources/META-INF/test-unit.properties
cdi-tck/trunk/impl/src/main/resources/README.TXT
cdi-tck/trunk/impl/src/main/resources/tck-audit-cdi.xml
cdi-tck/trunk/impl/src/main/resources/tck-audit-int.xml
cdi-tck/trunk/impl/src/main/resources/tck-audit-mb.xml
cdi-tck/trunk/interceptor/src/main/resources/META-INF/tck-unit.properties
cdi-tck/trunk/interceptor/src/main/resources/tck-audit.xml
cdi-tck/trunk/pom.xml
cdi-tck/trunk/xml/src/main/resources/META-INF/tck-unit.properties
cdi-tck/trunk/xml/src/main/resources/README.TXT
cdi-tck/trunk/xml/src/main/resources/tck-audit.xml
Log:
rename webbeans -> weld
Modified: cdi-tck/trunk/api/pom.xml
===================================================================
--- cdi-tck/trunk/api/pom.xml 2009-10-09 01:24:59 UTC (rev 3905)
+++ cdi-tck/trunk/api/pom.xml 2009-10-09 04:49:23 UTC (rev 3906)
@@ -30,7 +30,7 @@
<artifactId>jsr299-tck-api</artifactId>
<packaging>jar</packaging>
<name>JSR-299 TCK API</name>
- <url>http://www.seamframework.org/WebBeans</url>
+ <url>http://www.seamframework.org/Weld</url>
<dependencies>
Modified: cdi-tck/trunk/dist/readme.txt
===================================================================
--- cdi-tck/trunk/dist/readme.txt 2009-10-09 01:24:59 UTC (rev 3905)
+++ cdi-tck/trunk/dist/readme.txt 2009-10-09 04:49:23 UTC (rev 3906)
@@ -8,7 +8,8 @@
This distribution, as a whole, is licensed under the terms of the Apache Public
License (see apl.txt).
-Documentation can be found at http://seamframework.org/WebBeans/JSR299TCK
+Documentation can be found at
+http://seamframework.org/Weld/WeldDevelopmentOverview
This distribution consists of:
@@ -26,4 +27,4 @@
----------------------------------------
Run the following command to generate the TCK audit report:
- mvn clean install -Dtck-audit
\ No newline at end of file
+ mvn clean install -Dtck-audit
Modified: cdi-tck/trunk/doc/reference/en-US/eclipse-debugging.xml
===================================================================
--- cdi-tck/trunk/doc/reference/en-US/eclipse-debugging.xml 2009-10-09 01:24:59 UTC (rev 3905)
+++ cdi-tck/trunk/doc/reference/en-US/eclipse-debugging.xml 2009-10-09 04:49:23 UTC (rev 3906)
@@ -52,7 +52,7 @@
<listitem>
<para>
Check the project the contains the class you want to debug
- (e.g., webbeans-core)
+ (e.g., weld-core)
</para>
</listitem>
<listitem>
Modified: cdi-tck/trunk/doc/reference/en-US/eclipse-running.xml
===================================================================
--- cdi-tck/trunk/doc/reference/en-US/eclipse-running.xml 2009-10-09 01:24:59 UTC (rev 3905)
+++ cdi-tck/trunk/doc/reference/en-US/eclipse-running.xml 2009-10-09 04:49:23 UTC (rev 3906)
@@ -45,11 +45,11 @@
<para>
If you choose to use the Maven 2 Eclipse plugin
(<literal>maven-eclipse-plugin</literal>), you should execute the
- plugin in both the tck and webbeans projects:
+ plugin in both the tck and weld projects:
</para>
<programlisting><![CDATA[cd tck
mvn clean eclipse:clean eclipse:eclipse -DdownloadSources -DdownloadJavadocs
-cd ../webbeans
+cd ../weld
mvn clean eclipse:clean eclipse:eclipse -DdownloadSources -DdownloadJavadocs]]></programlisting>
</tip>
</section>
@@ -89,22 +89,22 @@
<para>
Your workspace should appear as follows:
</para>
- <programlisting><![CDATA[Web Beans
- jsr299-api
- webbeans-api
- webbeans-core
- webbeans-core-test
- webbeans-logging
- webbeans-parent
- webbeans-spi
- webbeans-version-matrix
+ <programlisting><![CDATA[Weld
+ cdi-api
+ weld-api
+ weld-core
+ weld-core-test
+ weld-logging
+ weld-parent
+ weld-spi
+ weld-version-matrix
CDI TCK
jsr299-tck-api
jsr299-tck-impl
jsr299-tck-parent
Web Beans JBoss TCK Runner
- webbeans-jboss-tck-runner
- webbeans-porting-package]]></programlisting>
+ weld-jboss-tck-runner
+ weld-porting-package]]></programlisting>
<para>
The tests in the TCK test suite are located in the jsr299-tck-impl
project. You'll be working within this project in Eclipse when you are
@@ -113,7 +113,7 @@
individual test in Eclipse? The secret is that you need to establish a
link in Eclipse (not in Maven) between the jsr299-tck-impl project and
your TCK runner project, which in this case is
- webbeans-jboss-tck-runner (the project in the jboss-tck-runner
+ weld-jboss-tck-runner (the project in the jboss-tck-runner
directory).
</para>
<para>
@@ -142,7 +142,7 @@
</listitem>
<listitem>
<para>
- Check the TCK runner project (e.g., webbeans-jboss-tck-runner)
+ Check the TCK runner project (e.g., weld-jboss-tck-runner)
</para>
</listitem>
<listitem>
@@ -158,7 +158,7 @@
</listitem>
</orderedlist>
<para>
- Of course, the webbeans-jboss-tck-runner also depends on the
+ Of course, the weld-jboss-tck-runner also depends on the
jsr299-tck-impl at runtime (so it can actually find the tests to
execute). But Eclipse doesn't distinguish between build-time and
runtime dependencies. As a result, we've created a circular dependency
@@ -175,7 +175,7 @@
<orderedlist>
<listitem>
<para>
- Right click on the webbeans-jboss-tck-runner project
+ Right click on the weld-jboss-tck-runner project
</para>
</listitem>
<listitem>
@@ -345,7 +345,7 @@
</listitem>
<listitem>
<para>
- Select the webbeans-jboss-tck-runner/src/test/debug-resources
+ Select the weld-jboss-tck-runner/src/test/debug-resources
folder
</para>
</listitem>
@@ -356,12 +356,12 @@
</listitem>
<listitem>
<para>
- Click on the webbeans-jboss-tck-runner entry
+ Click on the weld-jboss-tck-runner entry
</para>
</listitem>
<listitem>
<para>
- Move the webbeans-jboss-tck-runner to the first entry using
+ Move the weld-jboss-tck-runner to the first entry using
the Up button
</para>
</listitem>
@@ -411,7 +411,7 @@
</listitem>
<listitem>
<para>
- Check the webbeans-jboss-tck-runner/src/test/debug-resources
+ Check the weld-jboss-tck-runner/src/test/debug-resources
folder
</para>
</listitem>
Modified: cdi-tck/trunk/doc/reference/en-US/executing.xml
===================================================================
--- cdi-tck/trunk/doc/reference/en-US/executing.xml 2009-10-09 01:24:59 UTC (rev 3905)
+++ cdi-tck/trunk/doc/reference/en-US/executing.xml 2009-10-09 04:49:23 UTC (rev 3906)
@@ -31,7 +31,7 @@
jboss-tck-runner directory in the extracted Web Beans distribution:
</para>
- <programlisting>cd webbeans/jboss-tck-runner</programlisting>
+ <programlisting>cd weld/jboss-tck-runner</programlisting>
<note>
<para>
These instructions assume you have extracted the CDI-related
Modified: cdi-tck/trunk/doc/reference/en-US/installation.xml
===================================================================
--- cdi-tck/trunk/doc/reference/en-US/installation.xml 2009-10-09 01:24:59 UTC (rev 3905)
+++ cdi-tck/trunk/doc/reference/en-US/installation.xml 2009-10-09 04:49:23 UTC (rev 3906)
@@ -22,7 +22,7 @@
</para>
<para>
You can also download the currnet source code from
- <ulink url="http://anonsvn.jboss.org/repos/webbeans/tck/trunk">JBoss SVN repository</ulink>.
+ <ulink url="http://anonsvn.jboss.org/repos/weld/cdi-tck/trunk">JBoss SVN repository</ulink>.
</para>
<para>
The TCK project is available in the JBoss Maven 2 repository as
@@ -84,8 +84,8 @@
The rest of the TCK software can simply be extracted. It's
recommended that you create a folder named jsr299 to hold all of the
jsr299-related projects. Then, extract the TCK distribution into a
- subfolder named tck. If you have downloaded the Web Beans distribution,
- extract it into a sibling folder named webbeans. The resulting folder
+ subfolder named tck. If you have downloaded the Weld distribution,
+ extract it into a sibling folder named weld. The resulting folder
structure is shown here:
</para>
<note>
@@ -95,7 +95,7 @@
</para>
</note>
<programlisting><![CDATA[jsr299/
- webbeans/
+ weld/
tck/]]></programlisting>
<para>
@@ -143,7 +143,7 @@
</listitem>
<listitem>
<para>
- Change to the webbeans directory.
+ Change to the weld directory.
</para>
</listitem>
<listitem>
Modified: cdi-tck/trunk/doc/reference/pom.xml
===================================================================
--- cdi-tck/trunk/doc/reference/pom.xml 2009-10-09 01:24:59 UTC (rev 3905)
+++ cdi-tck/trunk/doc/reference/pom.xml 2009-10-09 04:49:23 UTC (rev 3906)
@@ -52,8 +52,8 @@
<extensions>true</extensions>
<dependencies>
<dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-docbook-xslt</artifactId>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-docbook-xslt</artifactId>
<version>1.1.1.BETA2</version>
<exclusions>
<exclusion>
@@ -102,21 +102,21 @@
<format>
<formatName>pdf</formatName>
<stylesheetResource>
- classpath:/xslt/org/jboss/webbeans/pdf.xsl
+ classpath:/xslt/org/jboss/weld/pdf.xsl
</stylesheetResource>
<finalName>jsr299-tck-reference.pdf</finalName>
</format>
<format>
<formatName>html</formatName>
<stylesheetResource>
- classpath:/xslt/org/jboss/webbeans/xhtml.xsl
+ classpath:/xslt/org/jboss/weld/xhtml.xsl
</stylesheetResource>
<finalName>index.html</finalName>
</format>
<format>
<formatName>html_single</formatName>
<stylesheetResource>
- classpath:/xslt/org/jboss/webbeans/xhtml-single.xsl
+ classpath:/xslt/org/jboss/weld/xhtml-single.xsl
</stylesheetResource>
<finalName>index.html</finalName>
</format>
@@ -330,11 +330,11 @@
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/webbeans/tck
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/weld/cdi-tck
</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/webbeans/tck
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/weld/cdi-tck
</developerConnection>
- <url>http://fisheye.jboss.org/browse/WebBeans/tck</url>
+ <url>http://fisheye.jboss.org/browse/Weld/cdi-tck</url>
</scm>
<distributionManagement>
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/ScopeDefinitionTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/ScopeDefinitionTest.java 2009-10-09 01:24:59 UTC (rev 3905)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/ScopeDefinitionTest.java 2009-10-09 04:49:23 UTC (rev 3906)
@@ -102,7 +102,7 @@
@SpecAssertion(section = "2.7.2", id = "db"),
@SpecAssertion(section = "4.1", id = "ab")
})
- public void testWebBeanScopeTypeOverridesStereotype()
+ public void testCDIScopeTypeOverridesStereotype()
{
assert getBeans(RedSnapper.class).size() == 1;
Bean<RedSnapper> bean = getBeans(RedSnapper.class).iterator().next();
Modified: cdi-tck/trunk/impl/src/main/resources/META-INF/test-unit.properties
===================================================================
--- cdi-tck/trunk/impl/src/main/resources/META-INF/test-unit.properties 2009-10-09 01:24:59 UTC (rev 3905)
+++ cdi-tck/trunk/impl/src/main/resources/META-INF/test-unit.properties 2009-10-09 04:49:23 UTC (rev 3906)
@@ -1,8 +1,8 @@
# If fisheye_base_url is specified, it will generate links to the test class in fisheye
-fisheye_base_url=http\://fisheye.jboss.org/browse/Webbeans/tck/trunk/impl/src/main/java
+fisheye_base_url=http\://fisheye.jboss.org/browse/Weld/cdi-tck/trunk/impl/src/main/java
# If svn_base_url is specified, it will generate links to the test class in SVN
-svn_base_url=http\://anonsvn.jboss.org/repos/webbeans/tck/trunk/impl/src/main/java/
+svn_base_url=http\://anonsvn.jboss.org/repos/weld/cdi-tck/trunk/impl/src/main/java/
# The threshold for which the coverage percentage is a pass if it is equal or greater to this value
pass_threshold=75
Modified: cdi-tck/trunk/impl/src/main/resources/README.TXT
===================================================================
--- cdi-tck/trunk/impl/src/main/resources/README.TXT 2009-10-09 01:24:59 UTC (rev 3905)
+++ cdi-tck/trunk/impl/src/main/resources/README.TXT 2009-10-09 04:49:23 UTC (rev 3906)
@@ -8,21 +8,21 @@
===========================
The general command for generating a signature file looks like this:
-java -cp %JAVA_HOME%\jre\lib\rt.jar%;sigtestdev.jar com.sun.tdk.signaturetest.Setup -Package javax.decorator -Package javax.enterprise -Package javax.event -Package javax.inject -Package javax.interceptor -FileName webbeans.sig -Classpath .;%JAVA_HOME%\jre\lib\rt.jar -static
+java -cp %JAVA_HOME%\jre\lib\rt.jar%;sigtestdev.jar com.sun.tdk.signaturetest.Setup -Package javax.decorator -Package javax.enterprise -Package javax.event -Package javax.inject -Package javax.interceptor -FileName weld.sig -Classpath .;%JAVA_HOME%\jre\lib\rt.jar -static
Here's a working example with the classpaths filled out:
-java -cp %JAVA_HOME%\jre\lib\rt.jar;c:/java/sigtest-2.0/lib/sigtestdev.jar com.sun.tdk.signaturetest.Setup -Package javax.decorator -Package javax.enterprise -Package javax.event -Package javax.inject -Package javax.interceptor -FileName webbeans.sig -Classpath .;%JAVA_HOME%\jre\lib\rt.jar;"C:\Documents and Settings\shane\.m2\repository\org\jboss\webbeans\jsr299-api\1.0.0-SNAPSHOT\jsr299-api-1.0.0-SNAPSHOT.jar";"C:\Documents and Settings\shane\.m2\repository\javax\el\el-api\1.2\el-api-1.2.jar" -static
+java -cp %JAVA_HOME%\jre\lib\rt.jar;c:/java/sigtest-2.0/lib/sigtestdev.jar com.sun.tdk.signaturetest.Setup -Package javax.decorator -Package javax.enterprise -Package javax.event -Package javax.inject -Package javax.interceptor -FileName weld.sig -Classpath .;%JAVA_HOME%\jre\lib\rt.jar;"C:\Documents and Settings\shane\.m2\repository\org\jboss\weld\jsr299-api\1.0.0-SNAPSHOT\jsr299-api-1.0.0-SNAPSHOT.jar";"C:\Documents and Settings\shane\.m2\repository\javax\el\el-api\1.2\el-api-1.2.jar" -static
Running the signature test
==========================
To run the signature test simply change the execution class from Setup to SignatureTest:
-java -cp %JAVA_HOME%\jre\lib\rt.jar%;sigtestdev.jar com.sun.tdk.signaturetest.SignatureTest -Package javax.decorator -Package javax.enterprise -Package javax.event -Package javax.inject -Package javax.interceptor -FileName webbeans.sig -Classpath .;%JAVA_HOME%\jre\lib\rt.jar -static
+java -cp %JAVA_HOME%\jre\lib\rt.jar%;sigtestdev.jar com.sun.tdk.signaturetest.SignatureTest -Package javax.decorator -Package javax.enterprise -Package javax.event -Package javax.inject -Package javax.interceptor -FileName weld.sig -Classpath .;%JAVA_HOME%\jre\lib\rt.jar -static
Here's a working example:
-java -cp %JAVA_HOME%\jre\lib\rt.jar;c:/java/sigtest-2.0/lib/sigtestdev.jar com.sun.tdk.signaturetest.SignatureTest -Package javax.decorator -Package javax.enterprise -Package javax.event -Package javax.inject -Package javax.interceptor -FileName webbeans.sig -Classpath .;%JAVA_HOME%\jre\lib\rt.jar;"C:\Documents and Settings\shane\.m2\repository\org\jboss\webbeans\jsr299-api\1.0.0-SNAPSHOT\jsr299-api-1.0.0-SNAPSHOT.jar";"C:\Documents and Settings\shane\.m2\repository\javax\el\el-api\1.2\el-api-1.2.jar" -static
+java -cp %JAVA_HOME%\jre\lib\rt.jar;c:/java/sigtest-2.0/lib/sigtestdev.jar com.sun.tdk.signaturetest.SignatureTest -Package javax.decorator -Package javax.enterprise -Package javax.event -Package javax.inject -Package javax.interceptor -FileName weld.sig -Classpath .;%JAVA_HOME%\jre\lib\rt.jar;"C:\Documents and Settings\shane\.m2\repository\org\jboss\weld\jsr299-api\1.0.0-SNAPSHOT\jsr299-api-1.0.0-SNAPSHOT.jar";"C:\Documents and Settings\shane\.m2\repository\javax\el\el-api\1.2\el-api-1.2.jar" -static
When running the signature test, you may get the following message:
@@ -35,7 +35,7 @@
================================
Just for fun (and to confirm that the signature test is working correctly), you can try the following:
-1) Edit webbeans.sig
+1) Edit weld.sig
2) Modify one of the class signatures - in the following example we change one of the constructors for NullableDependencyException - here's the original:
CLSS public javax.inject.NullableDependencyException
@@ -61,4 +61,4 @@
javax.inject.NullableDependencyException: constructor public javax.inject.NullableDependencyException.NullableDependencyException(java.lang.String)
-STATUS:Failed.2 errors
\ No newline at end of file
+STATUS:Failed.2 errors
Modified: cdi-tck/trunk/impl/src/main/resources/tck-audit-cdi.xml
===================================================================
--- cdi-tck/trunk/impl/src/main/resources/tck-audit-cdi.xml 2009-10-09 01:24:59 UTC (rev 3905)
+++ cdi-tck/trunk/impl/src/main/resources/tck-audit-cdi.xml 2009-10-09 04:49:23 UTC (rev 3906)
@@ -1,642 +1,642 @@
-<specification
- xmlns="http://jboss.com/products/webbeans/tck/audit"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://jboss.com/products/webbeans/tck/audit /Users/pmuir/workspace/jboss-test-audit/api/src/main/resources/tck-audit.xsd"
+<specification
+ xmlns="http://jboss.com/products/weld/tck/audit"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://jboss.com/products/weld/tck/audit /Users/pmuir/workspace/jboss-test-audit/api/src/main/resources/tck-audit.xsd"
name="JSR-299: Contexts and Dependency Injection for Java Enterprise Edition"
- id="cdi"
- version="PFD2">
-
- <section id="2" title="Concepts">
-
- <assertion id="a">
- <text>A bean comprises of a (nonempty) set of bean types.</text>
- </assertion>
-
- <assertion id="b">
- <text>A bean comprises of a (nonempty) set of qualifiers.</text>
- </assertion>
-
- <assertion id="c">
- <text>A bean comprises of a scope.</text>
- </assertion>
-
- <assertion id="e">
- <text>A bean comprises of an optional bean EL name.</text>
- </assertion>
-
- <assertion id="f">
- <text>A bean comprises of a set of interceptor bindings.</text>
- </assertion>
-
- <assertion id="g">
- <text>A bean comprises of a bean implementation.</text>
- </assertion>
+ id="cdi"
+ version="PFD2">
+
+ <section id="2" title="Concepts">
+
+ <assertion id="a">
+ <text>A bean comprises of a (nonempty) set of bean types.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A bean comprises of a (nonempty) set of qualifiers.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A bean comprises of a scope.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>A bean comprises of an optional bean EL name.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A bean comprises of a set of interceptor bindings.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>A bean comprises of a bean implementation.</text>
+ </assertion>
</section>
<section id="2.1" title="Functionality provided by the container to the bean">
- </section>
-
- <section id="2.2" title="Bean types">
-
- <assertion id="a">
- <text>A bean may have multiple bean types.</text>
- </assertion>
-
- <assertion id="l">
- <text>All beans have the bean type java.lang.Object</text>
- </assertion>
-
- </section>
-
- <section id="2.2.1" title="Legal bean types">
- <assertion id="a">
- <text>A bean type may be an interface.</text>
- </assertion>
-
- <assertion id="b">
- <text>A bean type may be a concrete class.</text>
- </assertion>
-
- <assertion id="c">
- <text>A bean type may be an abstract class.</text>
- </assertion>
-
- <assertion id="d">
- <text>A bean type may be declared final.</text>
- </assertion>
-
- <assertion id="e">
- <text>A bean type may have final methods.</text>
- </assertion>
-
- <assertion id="f">
- <text>A bean type may be a parameterized type with actual type parameters.</text>
- </assertion>
-
- <assertion id="g">
- <text>A bean type may be a parameterized type with type variables.</text>
- </assertion>
-
- <assertion id="i">
- <text>A bean type may be an array type. Two array types are considered identical only if the element type is identical.</text>
- </assertion>
-
- <assertion id="j">
- <text>A bean type may be a primitive type. Primitive types are considered to be identical to their corresponding wrapper types in java.lang.</text>
- </assertion>
-
- <assertion id="k">
- <text>A bean type may be a raw type.</text>
- </assertion>
-
- <assertion id="la">
- <text>A type variable is not a legal bean type</text>
- </assertion>
-
- <assertion id="lb">
- <text>A parameterized type that contains a wildcard type parameter is not a legal bean type.</text>
- </assertion>
- </section>
-
- <section id="2.2.2" title="Typecasting between bean types">
- <assertion id="a">
- <text>A client of a bean may typecast its contextual reference to a bean to any bean type of the bean which is a Java interface. However, the client may not in general typecast its contextual reference to an arbitrary concrete bean type of the bean.</text>
- </assertion>
- </section>
-
- <section id="2.3" title="Qualifiers">
-
- </section>
-
- <section id="2.3.1" title="Built-in qualifier types">
-
- <assertion id="a0">
- <text>Every bean has the built-in binding |@Any|, even if it does not explicitly declare this binding, except for beans with the built-in binding |@New| defined in Section 3.11, "Beans with the @New binding".</text>
- </assertion>
-
- <assertion id="aa">
- <text>If a bean does not explicitly declare a qualifier other than |@Named|, the bean has exactly one additional qualifier, of type |@Default|. This is called the default qualifier.</text>
- </assertion>
-
- <assertion id="b">
- <text>The default qualifier is also assumed for any injection point that does not explicitly declare a qualifier.</text>
- </assertion>
- </section>
-
- <section id="2.3.2" title="Defining new qualifier types">
- <assertion id="aa" testable="false">
- <text>A qualifier type is a Java annotation defined as |@Target({METHOD, FIELD, PARAMETER, TYPE})|~ and |@Retention(RUNTIME)|~.</text>
- </assertion>
-
- <assertion id="ab" testable="false">
- <text>A qualifier type is a Java annotation defined as ~|@Target({METHOD, FIELD, PARAMETER, TYPE})| and ~|@Retention(RUNTIME)|.</text>
- <note>Non-runtime retention annotations are discarded by the compiler</note>
- </assertion>
-
- <assertion id="ba">
- <text>A binding type may be declared by specifying the |(a)javax.inject.Qualifier| meta-annotation.</text>
- </assertion>
-
- <assertion id="d" testable="false">
- <text>A qualifier type may define annotation members.</text>
- <note>This is true by default in the JLS</note>
- </assertion>
- </section>
-
+ </section>
+
+ <section id="2.2" title="Bean types">
+
+ <assertion id="a">
+ <text>A bean may have multiple bean types.</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>All beans have the bean type java.lang.Object</text>
+ </assertion>
+
+ </section>
+
+ <section id="2.2.1" title="Legal bean types">
+ <assertion id="a">
+ <text>A bean type may be an interface.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A bean type may be a concrete class.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A bean type may be an abstract class.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>A bean type may be declared final.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>A bean type may have final methods.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A bean type may be a parameterized type with actual type parameters.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>A bean type may be a parameterized type with type variables.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>A bean type may be an array type. Two array types are considered identical only if the element type is identical.</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>A bean type may be a primitive type. Primitive types are considered to be identical to their corresponding wrapper types in java.lang.</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>A bean type may be a raw type.</text>
+ </assertion>
+
+ <assertion id="la">
+ <text>A type variable is not a legal bean type</text>
+ </assertion>
+
+ <assertion id="lb">
+ <text>A parameterized type that contains a wildcard type parameter is not a legal bean type.</text>
+ </assertion>
+ </section>
+
+ <section id="2.2.2" title="Typecasting between bean types">
+ <assertion id="a">
+ <text>A client of a bean may typecast its contextual reference to a bean to any bean type of the bean which is a Java interface. However, the client may not in general typecast its contextual reference to an arbitrary concrete bean type of the bean.</text>
+ </assertion>
+ </section>
+
+ <section id="2.3" title="Qualifiers">
+
+ </section>
+
+ <section id="2.3.1" title="Built-in qualifier types">
+
+ <assertion id="a0">
+ <text>Every bean has the built-in binding |@Any|, even if it does not explicitly declare this binding, except for beans with the built-in binding |@New| defined in Section 3.11, "Beans with the @New binding".</text>
+ </assertion>
+
+ <assertion id="aa">
+ <text>If a bean does not explicitly declare a qualifier other than |@Named|, the bean has exactly one additional qualifier, of type |@Default|. This is called the default qualifier.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The default qualifier is also assumed for any injection point that does not explicitly declare a qualifier.</text>
+ </assertion>
+ </section>
+
+ <section id="2.3.2" title="Defining new qualifier types">
+ <assertion id="aa" testable="false">
+ <text>A qualifier type is a Java annotation defined as |@Target({METHOD, FIELD, PARAMETER, TYPE})|~ and |@Retention(RUNTIME)|~.</text>
+ </assertion>
+
+ <assertion id="ab" testable="false">
+ <text>A qualifier type is a Java annotation defined as ~|@Target({METHOD, FIELD, PARAMETER, TYPE})| and ~|@Retention(RUNTIME)|.</text>
+ <note>Non-runtime retention annotations are discarded by the compiler</note>
+ </assertion>
+
+ <assertion id="ba">
+ <text>A binding type may be declared by specifying the |(a)javax.inject.Qualifier| meta-annotation.</text>
+ </assertion>
+
+ <assertion id="d" testable="false">
+ <text>A qualifier type may define annotation members.</text>
+ <note>This is true by default in the JLS</note>
+ </assertion>
+ </section>
+
<section id="2.3.3" title="Declaring the qualifiers of a bean">
<group>
<text>A bean's qualifiers are declared by annotating the bean class or producer method or field with the qualifier types.</text>
-
- <assertion id="a">
- <text>Test by annotating a bean class.</text>
- </assertion>
-
- <assertion id="b">
- <text>Test by annotating a producer method.</text>
- </assertion>
-
- <assertion id="c">
- <text>Test by annotating a producer field.</text>
+
+ <assertion id="a">
+ <text>Test by annotating a bean class.</text>
</assertion>
- </group>
-
- <assertion id="d">
- <text>Any bean may declare multiple qualifier types.</text>
- </assertion>
- </section>
-
- <section id="2.3.4" title="Specifying qualifiers of an injected field">
- <assertion id="a">
- <text>Qualifier types may be applied to injected fields (see Section 3.8, "Injected fields") to determine the bean that is injected, according to the rules of typesafe resolution defined in Section 5.3, "Typesafe resolution".</text>
- </assertion>
-
- <assertion id="b">
- <text>A bean may only be injected to an injection point if it has all the qualifiers of the injection point.</text>
- </assertion>
- </section>
-
+
+ <assertion id="b">
+ <text>Test by annotating a producer method.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Test by annotating a producer field.</text>
+ </assertion>
+ </group>
+
+ <assertion id="d">
+ <text>Any bean may declare multiple qualifier types.</text>
+ </assertion>
+ </section>
+
+ <section id="2.3.4" title="Specifying qualifiers of an injected field">
+ <assertion id="a">
+ <text>Qualifier types may be applied to injected fields (see Section 3.8, "Injected fields") to determine the bean that is injected, according to the rules of typesafe resolution defined in Section 5.3, "Typesafe resolution".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A bean may only be injected to an injection point if it has all the qualifiers of the injection point.</text>
+ </assertion>
+ </section>
+
<section id="2.3.5" title="Specifying qualifiers of a method or constructor parameter">
<group>
- <text>Qualifier types may be applied to parameters of producer methods, initializer methods, disposer methods, observer methods or bean constructors (see Chapter 3, Bean implementation) to determine the bean instance that is passed when the method is called by the container.</text>
+ <text>Qualifier types may be applied to parameters of producer methods, initializer methods, disposer methods, observer methods or bean constructors (see Chapter 3, Bean implementation) to determine the bean instance that is passed when the method is called by the container.</text>
- <assertion id="a">
- <text>Test producer method.</text>
- </assertion>
-
- <assertion id="b">
- <text>Test initializer method.</text>
- </assertion>
-
- <assertion id="c">
- <text>Test disposer method.</text>
- </assertion>
-
- <assertion id="ca">
- <text>Test observer method.</text>
- </assertion>
-
- <assertion id="d">
- <text>Test bean constructor.</text>
+ <assertion id="a">
+ <text>Test producer method.</text>
</assertion>
- </group>
- </section>
-
- <section id="2.4" title="Scopes">
- <assertion id="a">
- <text>All beans have a scope.</text>
- </assertion>
-
- <assertion id="b" testable="false">
- <text>A scope type is represented by an annotation type.</text>
- <note>This is a statement of intent</note>
- </assertion>
-
- <assertion id="c">
- <text>The set of scope types is extensible.</text>
- </assertion>
- </section>
-
- <section id="2.4.1" title="Built-in scope types">
- <assertion id="aa">
- <text>There are five standard scope types defined by this specification, all defined in the package javax.enterprise.context. The |@RequestScoped|~, |@ApplicationScoped| and |@SessionScoped|~ annotations defined in Section 6.7, "Context management for built-in scopes" represent the standard scopes defined by the Java Servlets specification.</text>
- </assertion>
-
- <assertion id="ab">
- <text>There are five standard scope types defined by this specification, all defined in the package javax.enterprise.context. The ~|@RequestScoped|, ~|@ApplicationScoped|~ and |@SessionScoped|~ annotations defined in Section 6.7, "Context management for built-in scopes" represent the standard scopes defined by the Java Servlets specification.</text>
- </assertion>
-
- <assertion id="ac">
- <text>There are five standard scope types defined by this specification, all defined in the package javax.enterprise.context. The ~|@RequestScoped|, |@ApplicationScoped| and ~|@SessionScoped| annotations defined in Section 6.7, "Context management for built-in scopes" represent the standard scopes defined by the Java Servlets specification.</text>
- </assertion>
-
- <assertion id="ba">
- <text>There are five standard scope types defined by this specification, all defined in the package javax.enterprise.context. The |@ConversationScoped| annotation represents the conversation scope defined in Section 6.7.4, "Conversation context lifecycle".</text>
- </assertion>
-
- <assertion id="ca">
- <text>There are five standard scope types defined by this specification, all defined in the package javax.enterprise.context. The |@Dependent| pseudo-scope is for dependent objects, as defined in Section 6.4, "Dependent pseudo-scope"</text>
- </assertion>
- </section>
-
- <section id="2.4.2" title="Defining new scope types">
- <assertion id="aa">
- <text>A scope type is a Java annotation defined as |@Target({TYPE, METHOD, FIELD})|~ and |@Retention(RUNTIME)|~.</text>
- </assertion>
-
- <assertion id="ab" testable="false">
- <text>A scope type is a Java annotation defined as ~|@Target({TYPE, METHOD, FIELD})| and ~|@Retention(RUNTIME)|.</text>
- <note>Non-runtime retention annotations are discarded by the compiler</note>
- </assertion>
-
- <assertion id="ba">
- <text>All scope types must specify the |(a)javax.inject.Scope| or |(a)javax.enterprise.context.NormalScope| meta-annotation.</text>
- </assertion>
-
- </section>
-
- <section id="2.4.3" title="Declaring the bean scope">
- <assertion id="a">
- <text>The bean's scope is defined by annotating the bean class or producer method or field with a scope type.</text>
- </assertion>
-
- <assertion id="ba">
- <text>A bean class or producer method or field may specify at most one scope type annotation. If a bean class or producer method or field specifies multiple scope type annotations, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="c">
- <text>A scope type may be specified using a stereotype annotation, as defined in Section 2.7.2, "Declaring the stereotypes for a bean"</text>
- </assertion>
- </section>
-
- <section id="2.4.4" title="Default scope">
- <assertion id="aa">
- <text>When no scope is explicitly declared by annotating the bean class or producer method or field the scope of a bean is defaulted.</text>
- </assertion>
-
- <assertion id="b">
- <text>If the bean does not declare any stereotype with a declared default scope, the default scope for the bean is |@Dependent|.</text>
- </assertion>
-
- <assertion id="c">
- <text>If all stereotypes declared by the bean that have some declared default scope have the same default scope, then that scope is the default scope for the bean.</text>
- </assertion>
-
- <assertion id="da">
- <text>If there are two different stereotypes declared by the bean that declare different default scopes, then there is no default scope and the bean must explicitly declare a scope. If it does not explicitly declare a scope, the container automatically
-detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="e">
- <text>If a bean explicitly declares a scope, any default scopes declared by stereotypes are ignored.</text>
- </assertion>
- </section>
-
- <section id="2.5" title="Bean EL names">
-
- <assertion id="a">
- <text>A valid bean EL name is a period-separated list of valid EL identifiers</text>
- </assertion>
- </section>
-
- <section id="2.5.1" title="Declaring the bean EL name">
+ <assertion id="b">
+ <text>Test initializer method.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Test disposer method.</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>Test observer method.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Test bean constructor.</text>
+ </assertion>
+ </group>
+ </section>
+
+ <section id="2.4" title="Scopes">
+ <assertion id="a">
+ <text>All beans have a scope.</text>
+ </assertion>
+
+ <assertion id="b" testable="false">
+ <text>A scope type is represented by an annotation type.</text>
+ <note>This is a statement of intent</note>
+ </assertion>
+
+ <assertion id="c">
+ <text>The set of scope types is extensible.</text>
+ </assertion>
+ </section>
+
+ <section id="2.4.1" title="Built-in scope types">
+ <assertion id="aa">
+ <text>There are five standard scope types defined by this specification, all defined in the package javax.enterprise.context. The |@RequestScoped|~, |@ApplicationScoped| and |@SessionScoped|~ annotations defined in Section 6.7, "Context management for built-in scopes" represent the standard scopes defined by the Java Servlets specification.</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>There are five standard scope types defined by this specification, all defined in the package javax.enterprise.context. The ~|@RequestScoped|, ~|@ApplicationScoped|~ and |@SessionScoped|~ annotations defined in Section 6.7, "Context management for built-in scopes" represent the standard scopes defined by the Java Servlets specification.</text>
+ </assertion>
+
+ <assertion id="ac">
+ <text>There are five standard scope types defined by this specification, all defined in the package javax.enterprise.context. The ~|@RequestScoped|, |@ApplicationScoped| and ~|@SessionScoped| annotations defined in Section 6.7, "Context management for built-in scopes" represent the standard scopes defined by the Java Servlets specification.</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>There are five standard scope types defined by this specification, all defined in the package javax.enterprise.context. The |@ConversationScoped| annotation represents the conversation scope defined in Section 6.7.4, "Conversation context lifecycle".</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>There are five standard scope types defined by this specification, all defined in the package javax.enterprise.context. The |@Dependent| pseudo-scope is for dependent objects, as defined in Section 6.4, "Dependent pseudo-scope"</text>
+ </assertion>
+ </section>
+
+ <section id="2.4.2" title="Defining new scope types">
+ <assertion id="aa">
+ <text>A scope type is a Java annotation defined as |@Target({TYPE, METHOD, FIELD})|~ and |@Retention(RUNTIME)|~.</text>
+ </assertion>
+
+ <assertion id="ab" testable="false">
+ <text>A scope type is a Java annotation defined as ~|@Target({TYPE, METHOD, FIELD})| and ~|@Retention(RUNTIME)|.</text>
+ <note>Non-runtime retention annotations are discarded by the compiler</note>
+ </assertion>
+
+ <assertion id="ba">
+ <text>All scope types must specify the |(a)javax.inject.Scope| or |(a)javax.enterprise.context.NormalScope| meta-annotation.</text>
+ </assertion>
+
+ </section>
+
+ <section id="2.4.3" title="Declaring the bean scope">
+ <assertion id="a">
+ <text>The bean's scope is defined by annotating the bean class or producer method or field with a scope type.</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>A bean class or producer method or field may specify at most one scope type annotation. If a bean class or producer method or field specifies multiple scope type annotations, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A scope type may be specified using a stereotype annotation, as defined in Section 2.7.2, "Declaring the stereotypes for a bean"</text>
+ </assertion>
+ </section>
+
+ <section id="2.4.4" title="Default scope">
+ <assertion id="aa">
+ <text>When no scope is explicitly declared by annotating the bean class or producer method or field the scope of a bean is defaulted.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the bean does not declare any stereotype with a declared default scope, the default scope for the bean is |@Dependent|.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If all stereotypes declared by the bean that have some declared default scope have the same default scope, then that scope is the default scope for the bean.</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>If there are two different stereotypes declared by the bean that declare different default scopes, then there is no default scope and the bean must explicitly declare a scope. If it does not explicitly declare a scope, the container automatically
+detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If a bean explicitly declares a scope, any default scopes declared by stereotypes are ignored.</text>
+ </assertion>
+ </section>
+
+ <section id="2.5" title="Bean EL names">
+
+ <assertion id="a">
+ <text>A valid bean EL name is a period-separated list of valid EL identifiers</text>
+ </assertion>
+ </section>
+
+ <section id="2.5.1" title="Declaring the bean EL name">
+
<group>
<text>To specify the EL name of a bean, the |(a)javax.inject.Named| annotation is applied to the bean class or producer method or field.</text>
-
- <assertion id="a">
- <text>Test with a bean class.</text>
- </assertion>
-
- <assertion id="b">
- <text>Test with a producer method.</text>
- </assertion>
-
- <assertion id="c">
- <text>Test with a producer field.</text>
+
+ <assertion id="a">
+ <text>Test with a bean class.</text>
</assertion>
- </group>
-
- <assertion id="d">
- <text>If the |@Named| annotation does not specify the |value| member, the default EL name is assumed.</text>
- </assertion>
- </section>
-
- <section id="2.5.2" title="Default bean EL names">
+ <assertion id="b">
+ <text>Test with a producer method.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Test with a producer field.</text>
+ </assertion>
+ </group>
+
+ <assertion id="d">
+ <text>If the |@Named| annotation does not specify the |value| member, the default EL name is assumed.</text>
+ </assertion>
+ </section>
+
+ <section id="2.5.2" title="Default bean EL names">
+
<group>
<text>A default EL name must be assigned by the container when a bean class or producer method or field of a bean declares a |@Named| annotation and no EL name is explicitly specified by the value member.</text>
-
- <assertion id="a">
- <text>Test with a bean class.</text>
- </assertion>
-
- <assertion id="b">
- <text>Test with a producer method.</text>
- </assertion>
-
- <assertion id="c">
- <text>Test with a producer field.</text>
+
+ <assertion id="a">
+ <text>Test with a bean class.</text>
</assertion>
- </group>
-
- <assertion id="e">
- <text>A default EL name must be assigned by the container when a bean declares a stereotype that declares an empty |@Named| annotation, and the bean does not explicitly specify an EL name.</text>
- </assertion>
- </section>
-
- <section id="2.5.3" title="Beans with no EL name">
-
- <assertion id="a">
- <text>If |@Named| is not declared by the bean, nor by its stereotypes, a bean has no EL name.</text>
- </assertion>
- </section>
-
- <section id="2.6" title="Alternatives">
- <assertion id="a">
- <text>An alternative is a bean that must be explicitly declared in the |beans.xml| file if it should be available for lookup, injection or EL resolution.</text>
- </assertion>
- </section>
-
- <section id="2.6.1" title="Declaring an alternative">
- <assertion id="a">
- <text>An alternative may be declared by annotating the bean class with the |@Alternative| annotation.</text>
- </assertion>
+ <assertion id="b">
+ <text>Test with a producer method.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Test with a producer field.</text>
+ </assertion>
+ </group>
+
+ <assertion id="e">
+ <text>A default EL name must be assigned by the container when a bean declares a stereotype that declares an empty |@Named| annotation, and the bean does not explicitly specify an EL name.</text>
+ </assertion>
+ </section>
+
+ <section id="2.5.3" title="Beans with no EL name">
+
+ <assertion id="a">
+ <text>If |@Named| is not declared by the bean, nor by its stereotypes, a bean has no EL name.</text>
+ </assertion>
+ </section>
+
+ <section id="2.6" title="Alternatives">
+ <assertion id="a">
+ <text>An alternative is a bean that must be explicitly declared in the |beans.xml| file if it should be available for lookup, injection or EL resolution.</text>
+ </assertion>
+ </section>
+
+ <section id="2.6.1" title="Declaring an alternative">
+ <assertion id="a">
+ <text>An alternative may be declared by annotating the bean class with the |@Alternative| annotation.</text>
+ </assertion>
+
<group>
<text>An alternative may be declared by annotating a bean, producer method or producer field with a stereotype that declares an |@Alternative| annotation.</text>
-
- <assertion id="b">
- <text>Test with a bean.</text>
- </assertion>
-
- <assertion id="c">
- <text>Test with a producer method.</text>
- </assertion>
-
- <assertion id="d">
- <text>Test with a producer field.</text>
+
+ <assertion id="b">
+ <text>Test with a bean.</text>
</assertion>
- </group>
- </section>
-
- <section id="2.7" title="Stereotypes">
-
- <assertion id="a">
- <text>A stereotype may specify that all beans with the stereotype have defaulted bean EL names.</text>
- </assertion>
-
- <assertion id="aa">
- <text>A stereotype may specify that all beans with the stereotype are alternatives.</text>
- </assertion>
+ <assertion id="c">
+ <text>Test with a producer method.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Test with a producer field.</text>
+ </assertion>
+ </group>
+ </section>
+
+ <section id="2.7" title="Stereotypes">
+
+ <assertion id="a">
+ <text>A stereotype may specify that all beans with the stereotype have defaulted bean EL names.</text>
+ </assertion>
+
+ <assertion id="aa">
+ <text>A stereotype may specify that all beans with the stereotype are alternatives.</text>
+ </assertion>
+
<group>
<text>A bean may declare zero, one or multiple stereotypes.</text>
-
- <assertion id="b" testable="false">
- <text>A bean may declare zero stereotypes.</text>
- <note>Not testable through API</note>
- </assertion>
-
- <assertion id="c">
- <text>Test with one stereotype.</text>
- </assertion>
-
- <assertion id="d">
- <text>Test with multiple stereotypes.</text>
+
+ <assertion id="b" testable="false">
+ <text>A bean may declare zero stereotypes.</text>
+ <note>Not testable through API</note>
</assertion>
- </group>
-
- </section>
-
+
+ <assertion id="c">
+ <text>Test with one stereotype.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Test with multiple stereotypes.</text>
+ </assertion>
+ </group>
+
+ </section>
+
<section id="2.7.1" title="Defining new stereotypes">
<group>
<text>A beans stereotype is a Java annotation defined as |@Target({TYPE, METHOD, FIELD})|, |@Target(TYPE)|, |@Target(METHOD)|, |@Target(FIELD)| or |@Target({METHOD, FIELD})| and |@Retention(RUNTIME)|.</text>
-
- <assertion id="aa" testable="false">
- <text>Test |@Target({TYPE, METHOD, FIELD})|.</text>
- </assertion>
-
- <assertion id="ab" testable="false">
- <text>Test |@Target(TYPE)|.</text>
- </assertion>
-
- <assertion id="ac" testable="false">
- <text>Test |@Target(FIELD)|.</text>
- </assertion>
-
- <assertion id="ad" testable="false">
- <text>Test |@Target({METHOD, FIELD})|.</text>
- </assertion>
-
- <assertion id="ae" testable="false">
- <text>|@Retention(RUNTIME)| - untestable.</text>
- <note>Non-runtime retention annotations are discarded by the compiler</note>
+
+ <assertion id="aa" testable="false">
+ <text>Test |@Target({TYPE, METHOD, FIELD})|.</text>
</assertion>
- </group>
-
- <assertion id="b">
- <text>A stereotype may be declared by specifying the |(a)javax.enterprise.inject.Stereotype| meta-annotation.</text>
- </assertion>
- </section>
-
- <section id="2.7.1.1" title="Declaring the default scope for a stereotype">
+ <assertion id="ab" testable="false">
+ <text>Test |@Target(TYPE)|.</text>
+ </assertion>
+
+ <assertion id="ac" testable="false">
+ <text>Test |@Target(FIELD)|.</text>
+ </assertion>
+
+ <assertion id="ad" testable="false">
+ <text>Test |@Target({METHOD, FIELD})|.</text>
+ </assertion>
+
+ <assertion id="ae" testable="false">
+ <text>|@Retention(RUNTIME)| - untestable.</text>
+ <note>Non-runtime retention annotations are discarded by the compiler</note>
+ </assertion>
+ </group>
+
+ <assertion id="b">
+ <text>A stereotype may be declared by specifying the |(a)javax.enterprise.inject.Stereotype| meta-annotation.</text>
+ </assertion>
+ </section>
+
+ <section id="2.7.1.1" title="Declaring the default scope for a stereotype">
+
<group>
- <text>A stereotype may declare at most one scope. If a stereotype declares more than one scope, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ <text>A stereotype may declare at most one scope. If a stereotype declares more than one scope, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- <assertion id="aa">
- <text>Test with one scope.</text>
- </assertion>
-
- <assertion id="ab">
- <text>Test that a stereotype with multiple scopes throws an exception.</text>
+ <assertion id="aa">
+ <text>Test with one scope.</text>
</assertion>
- </group>
-
- </section>
-
- <section id="2.7.1.2" title="Specifying interceptor bindings for a stereotype">
- <assertion id="a">
- <text>A stereotype may declare zero interceptor bindings.</text>
- </assertion>
-
- <assertion id="b">
- <text>A stereotype may declare one interceptor bindings.</text>
- </assertion>
-
- <assertion id="c">
- <text>A stereotype may declare multiple interceptor bindings.</text>
- </assertion>
- </section>
-
- <section id="2.7.1.3" title="Declaring a @Named stereotype">
- <assertion id="aaa">
- <text>A stereotype may declare an empty |@Named| annotation, which specifies that every bean with the stereotype has a defaulted name when a name is not explicitly specified by the bean.</text>
- </assertion>
-
- <assertion id="aab">
- <text>If a stereotype declares a non-empty |@Named| annotation, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+
+ <assertion id="ab">
+ <text>Test that a stereotype with multiple scopes throws an exception.</text>
+ </assertion>
+ </group>
+
+ </section>
+
+ <section id="2.7.1.2" title="Specifying interceptor bindings for a stereotype">
+ <assertion id="a">
+ <text>A stereotype may declare zero interceptor bindings.</text>
</assertion>
+
+ <assertion id="b">
+ <text>A stereotype may declare one interceptor bindings.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A stereotype may declare multiple interceptor bindings.</text>
+ </assertion>
+ </section>
+
+ <section id="2.7.1.3" title="Declaring a @Named stereotype">
+ <assertion id="aaa">
+ <text>A stereotype may declare an empty |@Named| annotation, which specifies that every bean with the stereotype has a defaulted name when a name is not explicitly specified by the bean.</text>
+ </assertion>
+
+ <assertion id="aab">
+ <text>If a stereotype declares a non-empty |@Named| annotation, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
<assertion id="b" testable="false">
<text>A stereotype should not declare any qualifier annotation other than |@Named|. If a stereotype declares any other qualifier annotation, non-portable behavior results.</text>
<note>The behavior here is undefined.</note>
- </assertion>
- </section>
-
- <section id="2.7.1.4" title="Declaring an @Alternative stereotype">
- <assertion id="a">
- <text>A stereotype may declare an |@Alternative| annotation, which specifies that every bean with the stereotype is an alternative.</text>
- </assertion>
- </section>
-
- <section id="2.7.1.5" title="Stereotypes with additional stereotypes">
- <assertion id="a">
- <text>A stereotype may declare other stereotypes.</text>
- </assertion>
-
- <assertion id="b">
- <text>Stereotype declarations are transitive - a stereotype declared by a second stereotype is inherited by all beans and other stereotypes that declare the second stereotype.</text>
- </assertion>
-
- <assertion id="c" testable="false">
- <text>Stereotypes declared |@Target(TYPE)| may not be applied to stereotypes declared |@Target({TYPE, METHOD, FIELD})|, |@Target(METHOD)|, |@Target(FIELD)|, |@Target({METHOD, FIELD})|.</text>
- <note>No definition of what happens if you do this</note>
- </assertion>
-
- </section>
-
+ </assertion>
+ </section>
+
+ <section id="2.7.1.4" title="Declaring an @Alternative stereotype">
+ <assertion id="a">
+ <text>A stereotype may declare an |@Alternative| annotation, which specifies that every bean with the stereotype is an alternative.</text>
+ </assertion>
+ </section>
+
+ <section id="2.7.1.5" title="Stereotypes with additional stereotypes">
+ <assertion id="a">
+ <text>A stereotype may declare other stereotypes.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Stereotype declarations are transitive - a stereotype declared by a second stereotype is inherited by all beans and other stereotypes that declare the second stereotype.</text>
+ </assertion>
+
+ <assertion id="c" testable="false">
+ <text>Stereotypes declared |@Target(TYPE)| may not be applied to stereotypes declared |@Target({TYPE, METHOD, FIELD})|, |@Target(METHOD)|, |@Target(FIELD)|, |@Target({METHOD, FIELD})|.</text>
+ <note>No definition of what happens if you do this</note>
+ </assertion>
+
+ </section>
+
<section id="2.7.2" title="Declaring the stereotypes for a bean">
<group>
<text>Stereotype annotations may be applied to a bean class or producer method or field.</text>
-
- <assertion id="a">
- <text>Test with a bean class.</text>
- </assertion>
-
- <assertion id="b">
- <text>Test with a producer method.</text>
- </assertion>
-
- <assertion id="c">
- <text>Test with a producer field.</text>
+
+ <assertion id="a">
+ <text>Test with a bean class.</text>
</assertion>
- </group>
-
- <assertion id="db">
- <text>The default scope declared by the stereotype may be overridden by the bean.</text>
- </assertion>
-
- <assertion id="e">
- <text>Multiple stereotypes may be applied to the same bean.</text>
- </assertion>
- </section>
-
- <section id="2.7.3" title="Built-in stereotypes">
- <assertion id="aa" testable="false">
- <text>The built-in stereotype |(a)javax.enterprise.inject.Model| is intended for use with beans that define the model layer of an MVC web application architecture such as JSF.</text>
- <note>Tested by API signature test</note>
- </assertion>
- </section>
-
- <section id="3" title="Programming model">
-
- </section>
-
- <section id="3.1" title="Managed beans">
- <assertion id="f0">
- <text>If the bean class of a managed bean is annotated with both the |@Interceptor| and |@Decorator| stereotypes, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="fa">
- <text>If a managed bean has a public field, it must have scope |@Dependent|.</text>
- <note>Check that a dependent scoped bean with a public field does work</note>
- </assertion>
-
- <assertion id="fba">
- <text>If a managed bean with a public field declares any scope other than |@Dependent|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="g">
- <text>If the managed bean class is a generic type, it must have scope |@Dependent|. If a managed bean with a parameterized bean class declares any scope other than |@Dependent|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
- </section>
-
- <section id="3.1.1" title="Which Java classes are managed beans?">
- <assertion id="b">
- <text>A top-level Java class is not a managed bean if it is a non-static inner class.</text>
- </assertion>
-
- <assertion id="ba">
- <text>A top-level Java class that is a static inner class can be a managed bean.</text>
- <note>Implied as the inverse of assertion 3.1.1.b</note>
- </assertion>
-
- <assertion id="ca">
- <text>A top-level Java class is not a managed bean if it is an abstract class, unless it is annotated |@Decorator|.</text>
- </assertion>
-
- <assertion id="cb">
- <text>A top-level Java class is not a managed bean if it is an interface, unless it is annotated |@Decorator|.</text>
- </assertion>
-
- <assertion id="f">
- <text>A top-level Java class is not a managed bean if it is annotated with any of the EJB component-defining annotations</text>
- </assertion>
-
- <assertion id="n">
- <text>A top-level Java class is not a managed bean if it is declared as an EJB bean class in |ejb-jar.xml|</text>
- </assertion>
-
- <assertion id="p">
- <text>A top-level Java class is only a managed bean if it has an appropriate constructor - a constructor with no parameters.</text>
- </assertion>
-
- <assertion id="q">
- <text>A top-level Java class is only a managed bean if it has an appropriate constructor - a constructor annotated |@Inject|.</text>
- </assertion>
- </section>
-
- <section id="3.1.2" title="Bean types of a managed bean">
- <assertion id="a">
- <text>The set of bean types for a managed bean contains the bean class, every superclass and all interfaces it implements directly or indirectly.</text>
- </assertion>
- </section>
-
- <section id="3.1.3" title="Declaring a managed bean">
- <assertion id="a">
- <text>A managed bean with a constructor that takes no parameters does not require any special annotations</text>
+
+ <assertion id="b">
+ <text>Test with a producer method.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Test with a producer field.</text>
+ </assertion>
+ </group>
+
+ <assertion id="db">
+ <text>The default scope declared by the stereotype may be overridden by the bean.</text>
</assertion>
+
+ <assertion id="e">
+ <text>Multiple stereotypes may be applied to the same bean.</text>
+ </assertion>
+ </section>
+
+ <section id="2.7.3" title="Built-in stereotypes">
+ <assertion id="aa" testable="false">
+ <text>The built-in stereotype |(a)javax.enterprise.inject.Model| is intended for use with beans that define the model layer of an MVC web application architecture such as JSF.</text>
+ <note>Tested by API signature test</note>
+ </assertion>
+ </section>
+
+ <section id="3" title="Programming model">
+
+ </section>
+
+ <section id="3.1" title="Managed beans">
+ <assertion id="f0">
+ <text>If the bean class of a managed bean is annotated with both the |@Interceptor| and |@Decorator| stereotypes, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="fa">
+ <text>If a managed bean has a public field, it must have scope |@Dependent|.</text>
+ <note>Check that a dependent scoped bean with a public field does work</note>
+ </assertion>
+
+ <assertion id="fba">
+ <text>If a managed bean with a public field declares any scope other than |@Dependent|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If the managed bean class is a generic type, it must have scope |@Dependent|. If a managed bean with a parameterized bean class declares any scope other than |@Dependent|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="3.1.1" title="Which Java classes are managed beans?">
+ <assertion id="b">
+ <text>A top-level Java class is not a managed bean if it is a non-static inner class.</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>A top-level Java class that is a static inner class can be a managed bean.</text>
+ <note>Implied as the inverse of assertion 3.1.1.b</note>
+ </assertion>
+
+ <assertion id="ca">
+ <text>A top-level Java class is not a managed bean if it is an abstract class, unless it is annotated |@Decorator|.</text>
+ </assertion>
+
+ <assertion id="cb">
+ <text>A top-level Java class is not a managed bean if it is an interface, unless it is annotated |@Decorator|.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A top-level Java class is not a managed bean if it is annotated with any of the EJB component-defining annotations</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>A top-level Java class is not a managed bean if it is declared as an EJB bean class in |ejb-jar.xml|</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>A top-level Java class is only a managed bean if it has an appropriate constructor - a constructor with no parameters.</text>
+ </assertion>
+
+ <assertion id="q">
+ <text>A top-level Java class is only a managed bean if it has an appropriate constructor - a constructor annotated |@Inject|.</text>
+ </assertion>
+ </section>
+
+ <section id="3.1.2" title="Bean types of a managed bean">
+ <assertion id="a">
+ <text>The set of bean types for a managed bean contains the bean class, every superclass and all interfaces it implements directly or indirectly.</text>
+ </assertion>
+ </section>
+
+ <section id="3.1.3" title="Declaring a managed bean">
+ <assertion id="a">
+ <text>A managed bean with a constructor that takes no parameters does not require any special annotations</text>
+ </assertion>
<assertion id="ab">
<text>If the managed bean does not have a constructor that takes no parameters, it must have a constructor annotated |@Inject|. No additional special annotations are required.</text>
- </assertion>
+ </assertion>
<group>
<text>A bean class may also specify a scope, name, stereotypes and/or qualifiers.</text>
-
- <assertion id="ba">
- <text>Test a bean with a scope.</text>
- </assertion>
-
- <assertion id="bb">
- <text>Test a bean with a name.</text>
- </assertion>
-
- <assertion id="bd">
- <text>Test a bean with a stereotype.</text>
- </assertion>
-
- <assertion id="be">
- <text>Test a bean with a qualifier.</text>
+
+ <assertion id="ba">
+ <text>Test a bean with a scope.</text>
</assertion>
- </group>
-
- <assertion id="c">
- <text>A managed bean may extend another managed bean.</text>
- </assertion>
- </section>
-
+
+ <assertion id="bb">
+ <text>Test a bean with a name.</text>
+ </assertion>
+
+ <assertion id="bd">
+ <text>Test a bean with a stereotype.</text>
+ </assertion>
+
+ <assertion id="be">
+ <text>Test a bean with a qualifier.</text>
+ </assertion>
+ </group>
+
+ <assertion id="c">
+ <text>A managed bean may extend another managed bean.</text>
+ </assertion>
+ </section>
+
<section id="3.1.4" title="Specializing a managed bean">
<group>
<text>If a bean class of a managed bean X is annotated @Specializes, then the bean class of X must directly extend the bean class of another managed bean Y. Then X directly specializes Y, as defined in Section 4.3, "Specialization".</text>
@@ -652,13 +652,13 @@
<assertion id="ac">
<text>Test a specialized bean extending a managed bean.</text>
</assertion>
- </group>
+ </group>
<group>
<text>If the bean class of X does not directly extend the bean class of another managed bean, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
-
- <assertion id="da">
- <text>Test a specializing bean extending a non simple bean.</text>
+
+ <assertion id="da">
+ <text>Test a specializing bean extending a non simple bean.</text>
</assertion>
<assertion id="db">
@@ -672,643 +672,643 @@
<assertion id="dd">
<text>Test a specializing bean implementing an interface and extending nothing.</text>
</assertion>
- </group>
+ </group>
</section>
- <section id="3.1.5" title="Default name for a managed bean">
- <assertion id="a">
- <text>The default name for a managed bean is the unqualified class name of the bean class, after converting the first character to lower case</text>
- </assertion>
- </section>
-
- <section id="3.2" title="Session beans">
- <assertion id="aa" testable="false">
- <text>A session bean is a bean that is implemented by a session bean with an EJB 3.x client view. The basic lifecycle and semantics of an EJB session bean are defined by the EJB specification.</text>
- <note>This is a reference to the EJB specification</note>
- </assertion>
-
- <assertion id="b">
- <text>A stateless session bean must belong to the |@Dependent| pseudo-scope</text>
- </assertion>
-
- <assertion id="c">
- <text>A singleton bean must belong to either the |@ApplicationScoped| scope or to the |@Dependent| pseudo-scope</text>
- </assertion>
-
- <assertion id="da">
- <text>If a session bean specifies an illegal scope, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="e">
- <text>A stateful session bean may have any scope.</text>
- <note>No way of testing the real intent of this statement, so we check that a SFSB may be scoped</note>
- </assertion>
-
- <assertion id="f" testable="false">
- <text>When a contextual instance of a session bean is obtained via the dependency injection service, the behavior of |SessionContext.getInvokedBusinessInterface()| is specific to the container implementation. Portable applications should not rely upon the value returned by this method.</text>
- <note>This is describing non-portable behavior</note>
- </assertion>
-
- <assertion id="g">
- <text>If the bean class of a session bean is annotated |@Interceptor|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="h">
- <text>If the bean class of a session bean is annotated |@Decorator|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="i">
- <text>If the session bean class is a generic type, it must have scope |@Dependent|. If a session bean with a parameterized bean class declares any scope other than |@Dependent|, the container automatically detects the problem and treats it as a
-definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
- </section>
-
- <section id="3.2.1" title="EJB remove methods of session beans">
- <assertion id="a">
- <text>If a session bean is a stateful session bean, and the scope is |@Dependent|, the application may call any EJB remove method of an instance of the session bean.</text>
- </assertion>
-
- <assertion id="b">
- <text>If a session bean is a stateful session bean, and the scope is not |@Dependent|, the application may not directly call any EJB remove method of any instance of the session bean. If the application directly calls an EJB remove method of an instance of a session bean that is a stateful session bean and declares any scope other than |@Dependent|, an |UnsupportedOperationException| is thrown</text>
- </assertion>
-
- <assertion id="da">
- <text>If the application directly calls an EJB remove method of an instance of a session bean that is a stateful session bean and has scope |@Dependent| then no parameters are passed to the method by the container.</text>
- </assertion>
-
- <assertion id="dba">
- <text>If the application directly calls an EJB remove method of an instance of a session bean that is a stateful session bean and has scope |@Dependent| then the container ignores the instance instead of destroying it when |Contextual.destroy()| is called, as defined in Section 6.5, "Lifecycle of stateful session beans"</text>
- </assertion>
- </section>
-
- <section id="3.2.2" title="Bean types of a session bean">
- <assertion id="aa">
- <text>The set of bean types for a session bean contains all local interfaces of the bean and their superinterfaces.</text>
- </assertion>
-
- <assertion id="ba">
- <text>If the session bean has a bean class local view, the set of bean types contains the bean class and all superclasses.</text>
- </assertion>
-
- <assertion id="c">
- <text>|java.lang.Object| is a bean type of every session bean</text>
- </assertion>
-
- <assertion id="d">
- <text>Remote interfaces are not included in the set of bean types</text>
- </assertion>
- </section>
-
- <section id="3.2.3" title="Declaring a session bean">
- <assertion id="aa">
- <text>A session bean does not require any special annotations apart from the component-defining annotation (or XML declaration) required by the EJB specification.</text>
- </assertion>
+ <section id="3.1.5" title="Default name for a managed bean">
+ <assertion id="a">
+ <text>The default name for a managed bean is the unqualified class name of the bean class, after converting the first character to lower case</text>
+ </assertion>
+ </section>
+ <section id="3.2" title="Session beans">
+ <assertion id="aa" testable="false">
+ <text>A session bean is a bean that is implemented by a session bean with an EJB 3.x client view. The basic lifecycle and semantics of an EJB session bean are defined by the EJB specification.</text>
+ <note>This is a reference to the EJB specification</note>
+ </assertion>
+
+ <assertion id="b">
+ <text>A stateless session bean must belong to the |@Dependent| pseudo-scope</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A singleton bean must belong to either the |@ApplicationScoped| scope or to the |@Dependent| pseudo-scope</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>If a session bean specifies an illegal scope, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>A stateful session bean may have any scope.</text>
+ <note>No way of testing the real intent of this statement, so we check that a SFSB may be scoped</note>
+ </assertion>
+
+ <assertion id="f" testable="false">
+ <text>When a contextual instance of a session bean is obtained via the dependency injection service, the behavior of |SessionContext.getInvokedBusinessInterface()| is specific to the container implementation. Portable applications should not rely upon the value returned by this method.</text>
+ <note>This is describing non-portable behavior</note>
+ </assertion>
+
+ <assertion id="g">
+ <text>If the bean class of a session bean is annotated |@Interceptor|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If the bean class of a session bean is annotated |@Decorator|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>If the session bean class is a generic type, it must have scope |@Dependent|. If a session bean with a parameterized bean class declares any scope other than |@Dependent|, the container automatically detects the problem and treats it as a
+definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="3.2.1" title="EJB remove methods of session beans">
+ <assertion id="a">
+ <text>If a session bean is a stateful session bean, and the scope is |@Dependent|, the application may call any EJB remove method of an instance of the session bean.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If a session bean is a stateful session bean, and the scope is not |@Dependent|, the application may not directly call any EJB remove method of any instance of the session bean. If the application directly calls an EJB remove method of an instance of a session bean that is a stateful session bean and declares any scope other than |@Dependent|, an |UnsupportedOperationException| is thrown</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>If the application directly calls an EJB remove method of an instance of a session bean that is a stateful session bean and has scope |@Dependent| then no parameters are passed to the method by the container.</text>
+ </assertion>
+
+ <assertion id="dba">
+ <text>If the application directly calls an EJB remove method of an instance of a session bean that is a stateful session bean and has scope |@Dependent| then the container ignores the instance instead of destroying it when |Contextual.destroy()| is called, as defined in Section 6.5, "Lifecycle of stateful session beans"</text>
+ </assertion>
+ </section>
+
+ <section id="3.2.2" title="Bean types of a session bean">
+ <assertion id="aa">
+ <text>The set of bean types for a session bean contains all local interfaces of the bean and their superinterfaces.</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>If the session bean has a bean class local view, the set of bean types contains the bean class and all superclasses.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>|java.lang.Object| is a bean type of every session bean</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Remote interfaces are not included in the set of bean types</text>
+ </assertion>
+ </section>
+
+ <section id="3.2.3" title="Declaring a session bean">
+ <assertion id="aa">
+ <text>A session bean does not require any special annotations apart from the component-defining annotation (or XML declaration) required by the EJB specification.</text>
+ </assertion>
+
<group>
<text>A bean class may also specify a scope, name, stereotypes and/or qualifiers.</text>
-
- <assertion id="ba">
- <text>Test a bean class with a scope.</text>
- </assertion>
-
- <assertion id="bb">
- <text>Test a bean class with a name.</text>
- </assertion>
-
- <assertion id="bd">
- <text>Test a bean class with a stereotype.</text>
- </assertion>
-
- <assertion id="be">
- <text>Test a bean class with a qualifier.</text>
+
+ <assertion id="ba">
+ <text>Test a bean class with a scope.</text>
</assertion>
- </group>
-
- <assertion id="c">
- <text>A session bean class may extend another bean class.</text>
- </assertion>
- </section>
-
- <section id="3.2.4" title="Specializing a session bean">
- <assertion id="aa">
- <text>If a bean class of a session bean X is annotated |@Specializes|, then the bean class of X must directly extend the bean class of another session bean Y. Then X directly specializes Y, as defined in Section 4.3 "Specialization".</text>
- </assertion>
-
- <assertion id="da">
- <text>If the bean class of X does not directly extend the bean class of another session bean, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
- </section>
-
- <section id="3.2.5" title="Default name for a session bean">
- <assertion id="a">
- <text>The default name for a managed bean is the unqualified class name of the session bean class, after converting the first character to lower case.</text>
- </assertion>
- </section>
-
- <section id="3.3" title="Producer methods">
- <assertion id="aa">
- <text>A producer method must be a non-abstract method of a managed bean class or session bean class.</text>
- </assertion>
-
- <assertion id="b">
- <text>A producer method may be static.</text>
- </assertion>
-
- <assertion id="c">
- <text>A producer method may be non-static.</text>
- </assertion>
-
- <assertion id="d">
- <text>If the bean is a session bean, the producer method must be either a business method of the EJB or a static method of the bean class</text>
- </assertion>
-
- <assertion id="e">
- <text>If a producer method sometimes returns a null value, then the producer method must have scope |@Dependent|.</text>
- </assertion>
-
- <assertion id="f">
- <text>If a producer method returns a null value at runtime, and the producer method declares scope other than |@Dependent|, an |IllegalProductException| is thrown by the container. This restriction allows the container to use a client proxy, as defined in Section 5.5, "Client proxies".</text>
- </assertion>
-
- <assertion id="ga">
- <text>If the producer method return type is a parameterized type, it must specify an actual type parameter or type variable for each type parameter.</text>
- </assertion>
-
- <assertion id="ha">
- <text>If a producer method return type contains a wildcard type parameter the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="iaa">
- <text>If the producer method return type is a parameterized type with a type variable, it must have scope |@Dependent|.</text>
- </assertion>
-
- <assertion id="iab">
- <text>If a producer method with a parameterized return type with a type variable declares any scope other than |@Dependent|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="ib">
- <text>If a producer method return type is a type variable the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="j">
- <text>The application may call producer methods directly. However, if the application calls a producer method directly, no parameters will be passed to the producer method by the container; the returned object is not bound to any context; and its lifecycle is not managed by the container.</text>
- </assertion>
-
- <assertion id="k">
- <text>A bean may declare multiple producer methods.</text>
- </assertion>
- </section>
-
- <section id="3.3.1" title="Bean types of a producer method">
- <assertion id="a">
- <text>If the return type of a producer method is an interface, the set of bean types contains the return type, all interfaces it extends directly or indirectly and |java.lang.Object|</text>
- </assertion>
-
- <assertion id="ba">
- <text>If a return type of a producer method is primitive ~or is a Java array type~, the set of bean types contains exactly two types: the method return type and |java.lang.Object|.</text>
- </assertion>
-
- <assertion id="bb">
- <text>If a return type of a producer method is ~primitive or is~ a Java array type, the set of bean types contains exactly two types: the method return type and |java.lang.Object|.</text>
- </assertion>
-
- <assertion id="c">
- <text>If the return type of a producer method is a class, the set of bean types contains the return type, every superclass and all interfaces it implements directly or indirectly.</text>
- </assertion>
- </section>
-
- <section id="3.3.2" title="Declaring a producer method">
- <assertion id="a">
- <text>A producer method may be declared by annotating a method with the |(a)javax.enterprise.inject.Produces| annotation</text>
- </assertion>
-
- <assertion id="ba">
- <text>A producer method may specify a scope</text>
- </assertion>
-
- <assertion id="bb">
- <text>A producer method may specify a name</text>
- </assertion>
-
- <assertion id="bd">
- <text>A producer method may specify stereotypes</text>
- </assertion>
-
- <assertion id="be">
- <text>A producer method may specify a binding type</text>
- </assertion>
+ <assertion id="bb">
+ <text>Test a bean class with a name.</text>
+ </assertion>
+
+ <assertion id="bd">
+ <text>Test a bean class with a stereotype.</text>
+ </assertion>
+
+ <assertion id="be">
+ <text>Test a bean class with a qualifier.</text>
+ </assertion>
+ </group>
+
+ <assertion id="c">
+ <text>A session bean class may extend another bean class.</text>
+ </assertion>
+ </section>
+
+ <section id="3.2.4" title="Specializing a session bean">
+ <assertion id="aa">
+ <text>If a bean class of a session bean X is annotated |@Specializes|, then the bean class of X must directly extend the bean class of another session bean Y. Then X directly specializes Y, as defined in Section 4.3 "Specialization".</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>If the bean class of X does not directly extend the bean class of another session bean, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="3.2.5" title="Default name for a session bean">
+ <assertion id="a">
+ <text>The default name for a managed bean is the unqualified class name of the session bean class, after converting the first character to lower case.</text>
+ </assertion>
+ </section>
+
+ <section id="3.3" title="Producer methods">
+ <assertion id="aa">
+ <text>A producer method must be a non-abstract method of a managed bean class or session bean class.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A producer method may be static.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A producer method may be non-static.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the bean is a session bean, the producer method must be either a business method of the EJB or a static method of the bean class</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If a producer method sometimes returns a null value, then the producer method must have scope |@Dependent|.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If a producer method returns a null value at runtime, and the producer method declares scope other than |@Dependent|, an |IllegalProductException| is thrown by the container. This restriction allows the container to use a client proxy, as defined in Section 5.5, "Client proxies".</text>
+ </assertion>
+
+ <assertion id="ga">
+ <text>If the producer method return type is a parameterized type, it must specify an actual type parameter or type variable for each type parameter.</text>
+ </assertion>
+
+ <assertion id="ha">
+ <text>If a producer method return type contains a wildcard type parameter the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="iaa">
+ <text>If the producer method return type is a parameterized type with a type variable, it must have scope |@Dependent|.</text>
+ </assertion>
+
+ <assertion id="iab">
+ <text>If a producer method with a parameterized return type with a type variable declares any scope other than |@Dependent|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ib">
+ <text>If a producer method return type is a type variable the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>The application may call producer methods directly. However, if the application calls a producer method directly, no parameters will be passed to the producer method by the container; the returned object is not bound to any context; and its lifecycle is not managed by the container.</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>A bean may declare multiple producer methods.</text>
+ </assertion>
+ </section>
+
+ <section id="3.3.1" title="Bean types of a producer method">
+ <assertion id="a">
+ <text>If the return type of a producer method is an interface, the set of bean types contains the return type, all interfaces it extends directly or indirectly and |java.lang.Object|</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>If a return type of a producer method is primitive ~or is a Java array type~, the set of bean types contains exactly two types: the method return type and |java.lang.Object|.</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>If a return type of a producer method is ~primitive or is~ a Java array type, the set of bean types contains exactly two types: the method return type and |java.lang.Object|.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the return type of a producer method is a class, the set of bean types contains the return type, every superclass and all interfaces it implements directly or indirectly.</text>
+ </assertion>
+ </section>
+
+ <section id="3.3.2" title="Declaring a producer method">
+ <assertion id="a">
+ <text>A producer method may be declared by annotating a method with the |(a)javax.enterprise.inject.Produces| annotation</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>A producer method may specify a scope</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>A producer method may specify a name</text>
+ </assertion>
+
+ <assertion id="bd">
+ <text>A producer method may specify stereotypes</text>
+ </assertion>
+
+ <assertion id="be">
+ <text>A producer method may specify a binding type</text>
+ </assertion>
+
<group>
<text>If a producer method is annotated |@Inject|, has a parameter annotated |@Disposes|, or has a parameter annotated |@Observes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
-
- <assertion id="ca">
- <text>Test with a producer method annotated |@Inject|.</text>
- </assertion>
-
- <assertion id="da">
- <text>Test with a producer method annotated |@Disposes|.</text>
- </assertion>
-
- <assertion id="ea">
- <text>Test with a producer method annotated |@Observes|.</text>
+
+ <assertion id="ca">
+ <text>Test with a producer method annotated |@Inject|.</text>
</assertion>
- </group>
-
- <assertion id="fa">
- <text>If a non-static method of a session bean class is annotated |@Produces|, and the method is not a business method of the session bean, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="ga">
- <text>Interceptors ~and decorators~ may not declare producer methods. If an interceptor ~or decorator~ has a method annotated |@Produces|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="gb">
- <text>~Interceptors and~ decorators may not declare producer methods. If an ~interceptor or~ decorator has a method annotated |@Produces|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
- </section>
-
- <section id="3.3.3" title="Producer method parameters">
- <assertion id="b">
- <text>A producer method may have any number of parameters.</text>
- </assertion>
-
- <assertion id="c">
- <text>All producer method parameters are injection points.</text>
- </assertion>
- </section>
-
- <section id="3.3.4" title="Specializing a producer method">
- <assertion id="aa">
- <text>If a producer method X is annotated |@Specializes|, then it must be non-static and directly override another producer method Y. Then X directly specializes Y, as defined in Section 4.3 "Specialization".</text>
- </assertion>
-
- <assertion id="ba">
- <text>If a producer method is static, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4 "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="ca">
- <text>If a producer method does not directly override another producer method, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4 "Problems detected automatically by the container".</text>
- </assertion>
- </section>
-
- <section id="3.3.5" title="Disposer methods">
- <assertion id="aa">
- <text>A disposer method must be a non-abstract method of a managed bean class or session bean class.</text>
- </assertion>
-
- <assertion id="b">
- <text>A disposer method may be static.</text>
- </assertion>
-
- <assertion id="c">
- <text>A disposer method may be non-static.</text>
- </assertion>
-
- <assertion id="d">
- <text>If the bean is a session bean, the disposer method must be a business method of the EJB or a static method of the bean class.</text>
- </assertion>
-
- <assertion id="e">
- <text>A bean may declare multiple disposer methods.</text>
- </assertion>
- </section>
-
- <section id="3.3.6" title="Disposed parameter of a disposer method">
- <assertion id="a">
- <text>Each disposer method must have exactly one disposed parameter, of the same type as the corresponding producer method return type.</text>
- </assertion>
-
- <assertion id="ba">
- <text>When searching for disposer methods for a producer method, the container considers the type and bindings of the disposed parameter. If a disposed parameter resolves to a producer method declared by the same bean class, according to the rules of typesafe resolution defined in Section 5.3 "Typesafe resolution", the container must call this method when destroying an instance returned by that producer method.</text>
- </assertion>
-
- <assertion id="da">
- <text>A disposer method may resolve to multiple producer methods declared by the bean class, in which case the container must call it when destroying any instance returned by any of these producer methods.</text>
- </assertion>
- </section>
-
- <section id="3.3.7" title="Declaring a disposer method">
- <assertion id="a">
- <text>A disposer method may be declared by annotating a parameter |(a)javax.enterprise.inject.Disposes|. That parameter is the disposed parameter</text>
- </assertion>
-
- <assertion id="b0">
- <text>Qualifiers may be declared by annotating the disposed parameter.</text>
- </assertion>
-
- <assertion id="ba">
- <text>If a method has more than one parameter annotated |@Disposes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4 "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="ca">
- <text>If a disposal method is annotated |@Produces|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4 "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="da">
- <text>If a disposal method is annotated |@Inject|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4 "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="ea">
- <text>If a disposal method has a parameter annotated |@Observes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4 "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="fa">
- <text>If a non-static method of a session bean class has a parameter annotated |@Disposes|, and the method is not a business method of the session bean, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4 "Problems detected automatically by the container".</text>
- </assertion>
- </section>
-
- <section id="3.3.8" title="Disposer method parameters">
- <assertion id="a">
- <text>In addition to the disposed parameter, a disposer method may declare additional parameters, which may also specify qualifiers. These additional parameters are injection points.</text>
- </assertion>
- </section>
-
- <section id="3.3.9" title="Disposer method resolution">
- <assertion id="aa">
- <text>When searching for disposer methods for a producer method, the container searches for disposer methods which are declared by the same bean class as the producer method, and for which the disposed parameter resolves to the producer method, according to the typesafe resolution algorithm defined in Section 5.3, "Typesafe resolution".</text>
- </assertion>
-
- <assertion id="ba">
- <text>If there are multiple disposer methods for a single producer method, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="ca">
- <text>If the disposed parameter of a disposer method does not resolve to any producer method declared by the bean class, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
- </section>
-
- <section id="3.3.10" title="Default name for a producer method">
- <assertion id="a">
- <text>The default name for a producer method is the method name, unless the method follows the JavaBeans property getter naming convention, in which case the default name is the JavaBeans property name</text>
- </assertion>
- </section>
-
- <section id="3.4" title="Producer fields">
- <assertion id="aa">
- <text>A producer field must be a field of a managed bean class ~or session bean class~</text>
- <note>Just test that a producer field on these works</note>
- </assertion>
-
- <assertion id="ab">
- <text>A producer field must be a field of a ~managed bean class or~ session bean class</text>
- <note>Just test that a producer field on these works</note>
- </assertion>
-
- <assertion id="b">
- <text>A producer field may be static.</text>
- </assertion>
-
- <assertion id="c">
- <text>A producer field may be non-static.</text>
- </assertion>
-
- <assertion id="ca">
- <text> If the bean is a session bean, the producer field must be a static field of the bean class.</text>
- </assertion>
-
- <assertion id="d">
- <text>If a producer field sometimes contains a null value when accessed, then the producer field must have scope |@Dependent|</text>
- </assertion>
-
- <assertion id="e">
- <text>If a producer method contains a null value at runtime, and the producer field declares any other scope, an |IllegalProductException| is thrown by the container. This restriction allows the container to use a client proxy, as defined in Section 5.5, "Client proxies"</text>
- </assertion>
-
- <assertion id="fa">
- <text>If the producer field type is a parameterized type, it must specify an _actual type parameter_ or type variable for each type parameter</text>
- </assertion>
-
- <assertion id="fb">
- <text>If the producer field type is a parameterized type, it must specify an actual type parameter or _type variable_ for each type parameter</text>
- </assertion>
-
- <assertion id="ga">
- <text>If a producer field type contains a wildcard type parameter the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="gb">
- <text>If the producer field type is a parameterized type with a type variable, it must have scope |@Dependent|. If a producer field with a parameterized type with a type variable declares any scope other than |@Dependent|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="ha">
- <text>If a producer field type is a type variable the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="i" testable="false">
- <text>The application may access producer fields directly. However, if the application accesses a producer field directly, the returned object is not bound to any context; and its lifecycle is not managed by the container</text>
- <note>This is a statement of intent</note>
- </assertion>
-
- <assertion id="j">
- <text>A bean may declare multiple producer fields</text>
- </assertion>
- </section>
-
- <section id="3.4.1" title="Bean types of a producer field">
- <assertion id="a">
- <text>The bean types of a producer field depend upon the field type. If the field type is an interface, the set of bean types contains the field type, all interfaces it extends directly or indirectly and java.lang.Object</text>
- </assertion>
-
- <assertion id="ba">
- <text>The bean types of a producer field depend upon the field type. If a field type is primitive ~or is a Java array type,~ the set of bean types contains exactly two types: the field type and java.lang.Object</text>
- </assertion>
-
- <assertion id="bb">
- <text>The bean types of a producer field depend upon the field type. If a field type is ~primitive or is~ a Java array type, the set of bean types contains exactly two types: the field type and java.lang.Object</text>
- </assertion>
-
- <assertion id="c">
- <text>The bean types of a producer field depend upon the field type. If the field type is a class, the set of bean types contains the field type, every superclass and all interfaces it implements directly or indirectly</text>
- </assertion>
- </section>
-
- <section id="3.4.2" title="Declaring a producer field">
- <assertion id="a">
- <text>A producer field may be declared by annotating a field with the |(a)javax.enterprise.inject.Produces| annotation</text>
- </assertion>
-
- <assertion id="b">
- <text>A producer field may specify a scope.</text>
- </assertion>
-
- <assertion id="c">
- <text>A producer field may specify a name.</text>
- </assertion>
-
- <assertion id="e">
- <text>A producer field may specify stereotypes.</text>
- </assertion>
-
- <assertion id="f">
- <text>A producer field may specify bindings.</text>
- </assertion>
- </section>
-
- <section id="3.4.3" title="Default name for a producer field">
- <assertion id="a">
- <text>The default name for a producer field is the field name</text>
- </assertion>
- </section>
-
- <section id="3.5" title="Resources">
- <assertion id="ka" testable="false">
- <text>The container is not required to support resources with scope other than |@Dependent|.</text>
- <note>Statement about non-portable behavior</note>
- </assertion>
-
- <assertion id="l" testable="false">
- <text>A resource may not declare a bean EL name</text>
- <note>Doesn't mention the consequences of this</note>
- </assertion>
- </section>
-
- <section id="3.5.1" title="Declaring a resource">
- <assertion id="aa" testable="false">
- <text>A resource may be declared by specifying a Java EE component environment injection annotation as part of a producer field declaration.</text>
- <note>Introductory text for the folloiwing assertions</note>
- </assertion>
-
- <assertion id="bb">
- <text>For a Java EE resource, |@Resource| must be specified.</text>
- </assertion>
-
- <assertion id="cc">
- <text>For a persistence context, |@PersistenceContext| must be specified.</text>
- </assertion>
-
- <assertion id="dd">
- <text>For a persistence unit, |@PersistenceUnit| must be specified.</text>
- </assertion>
-
- <assertion id="ee">
- <text>For a remote EJB, |@EJB| must be specified.</text>
- </assertion>
-
- <assertion id="ff">
- <text>For a web service, |@WebServiceRef| must be specified.</text>
- </assertion>
-
- <assertion id="gg" testable="false">
- <text>The injection annotation specifies the metadata needed to obtain the resources, entity manager, entity manager factory, remote EJB instance or web service reference from the component environment.</text>
- <note>This is defined in other specs</note>
- </assertion>
-
- <assertion id="hh">
- <text>The bean type and qualifiers of the resource are determined by the producer field declaration.</text>
- </assertion>
-
- </section>
-
- <section id="3.5.2" title="Bean types of a resource">
- <assertion id="a">
- <text>The bean types of a resource are the declared type of the field declaration, together with |java.lang.Object|.</text>
- </assertion>
- </section>
-
- <section id="3.6" title="Additional built-in beans">
- <assertion id="a">
- <text>A Java EE or embeddable EJB container must provide a bean with binding |@Default| and bean type |javax.transaction.UserTransaction|, allowing injection of a reference to the JTA |UserTransaction|.</text>
- </assertion>
-
- <assertion id="b">
- <text>A Java EE or embeddable EJB container must provide a bean with binding |@Default| and bean type |javax.security.Principal|, allowing injection of a |Principal| representing the current caller identity.</text>
- </assertion>
-
- <assertion id="c">
- <text>A Java EE or embeddable EJB container must provide a bean with binding |@Default| and bean type |javax.validation.ValidationFactory|, allowing injection of the default Bean Validation |ValidationFactory|.</text>
- </assertion>
-
- <assertion id="d">
- <text>A Java EE or embeddable EJB container must provide a bean with binding |@Default| and bean type |javax.validation.Validator|, allowing injection of a |Validator| for the default Bean Validation |ValidationFactory|.</text>
- </assertion>
-
- <assertion id="e">
- <text>If a Java EE component class has an injection point of type |UserTransaction| and binding |@Default|, and may not validly make use of the JTA |UserTransaction| according to the Java EE platform specification, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
+
+ <assertion id="da">
+ <text>Test with a producer method annotated |@Disposes|.</text>
+ </assertion>
+
+ <assertion id="ea">
+ <text>Test with a producer method annotated |@Observes|.</text>
+ </assertion>
+ </group>
+
+ <assertion id="fa">
+ <text>If a non-static method of a session bean class is annotated |@Produces|, and the method is not a business method of the session bean, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ga">
+ <text>Interceptors ~and decorators~ may not declare producer methods. If an interceptor ~or decorator~ has a method annotated |@Produces|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="gb">
+ <text>~Interceptors and~ decorators may not declare producer methods. If an ~interceptor or~ decorator has a method annotated |@Produces|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
</section>
+
+ <section id="3.3.3" title="Producer method parameters">
+ <assertion id="b">
+ <text>A producer method may have any number of parameters.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>All producer method parameters are injection points.</text>
+ </assertion>
+ </section>
+
+ <section id="3.3.4" title="Specializing a producer method">
+ <assertion id="aa">
+ <text>If a producer method X is annotated |@Specializes|, then it must be non-static and directly override another producer method Y. Then X directly specializes Y, as defined in Section 4.3 "Specialization".</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>If a producer method is static, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4 "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>If a producer method does not directly override another producer method, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4 "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="3.3.5" title="Disposer methods">
+ <assertion id="aa">
+ <text>A disposer method must be a non-abstract method of a managed bean class or session bean class.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A disposer method may be static.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A disposer method may be non-static.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the bean is a session bean, the disposer method must be a business method of the EJB or a static method of the bean class.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>A bean may declare multiple disposer methods.</text>
+ </assertion>
+ </section>
+
+ <section id="3.3.6" title="Disposed parameter of a disposer method">
+ <assertion id="a">
+ <text>Each disposer method must have exactly one disposed parameter, of the same type as the corresponding producer method return type.</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>When searching for disposer methods for a producer method, the container considers the type and bindings of the disposed parameter. If a disposed parameter resolves to a producer method declared by the same bean class, according to the rules of typesafe resolution defined in Section 5.3 "Typesafe resolution", the container must call this method when destroying an instance returned by that producer method.</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>A disposer method may resolve to multiple producer methods declared by the bean class, in which case the container must call it when destroying any instance returned by any of these producer methods.</text>
+ </assertion>
+ </section>
+
+ <section id="3.3.7" title="Declaring a disposer method">
+ <assertion id="a">
+ <text>A disposer method may be declared by annotating a parameter |(a)javax.enterprise.inject.Disposes|. That parameter is the disposed parameter</text>
+ </assertion>
+
+ <assertion id="b0">
+ <text>Qualifiers may be declared by annotating the disposed parameter.</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>If a method has more than one parameter annotated |@Disposes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4 "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>If a disposal method is annotated |@Produces|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4 "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>If a disposal method is annotated |@Inject|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4 "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ea">
+ <text>If a disposal method has a parameter annotated |@Observes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4 "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="fa">
+ <text>If a non-static method of a session bean class has a parameter annotated |@Disposes|, and the method is not a business method of the session bean, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4 "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="3.3.8" title="Disposer method parameters">
+ <assertion id="a">
+ <text>In addition to the disposed parameter, a disposer method may declare additional parameters, which may also specify qualifiers. These additional parameters are injection points.</text>
+ </assertion>
+ </section>
+
+ <section id="3.3.9" title="Disposer method resolution">
+ <assertion id="aa">
+ <text>When searching for disposer methods for a producer method, the container searches for disposer methods which are declared by the same bean class as the producer method, and for which the disposed parameter resolves to the producer method, according to the typesafe resolution algorithm defined in Section 5.3, "Typesafe resolution".</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>If there are multiple disposer methods for a single producer method, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>If the disposed parameter of a disposer method does not resolve to any producer method declared by the bean class, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="3.3.10" title="Default name for a producer method">
+ <assertion id="a">
+ <text>The default name for a producer method is the method name, unless the method follows the JavaBeans property getter naming convention, in which case the default name is the JavaBeans property name</text>
+ </assertion>
+ </section>
+
+ <section id="3.4" title="Producer fields">
+ <assertion id="aa">
+ <text>A producer field must be a field of a managed bean class ~or session bean class~</text>
+ <note>Just test that a producer field on these works</note>
+ </assertion>
+
+ <assertion id="ab">
+ <text>A producer field must be a field of a ~managed bean class or~ session bean class</text>
+ <note>Just test that a producer field on these works</note>
+ </assertion>
+
+ <assertion id="b">
+ <text>A producer field may be static.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A producer field may be non-static.</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text> If the bean is a session bean, the producer field must be a static field of the bean class.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If a producer field sometimes contains a null value when accessed, then the producer field must have scope |@Dependent|</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If a producer method contains a null value at runtime, and the producer field declares any other scope, an |IllegalProductException| is thrown by the container. This restriction allows the container to use a client proxy, as defined in Section 5.5, "Client proxies"</text>
+ </assertion>
+
+ <assertion id="fa">
+ <text>If the producer field type is a parameterized type, it must specify an _actual type parameter_ or type variable for each type parameter</text>
+ </assertion>
+
+ <assertion id="fb">
+ <text>If the producer field type is a parameterized type, it must specify an actual type parameter or _type variable_ for each type parameter</text>
+ </assertion>
+
+ <assertion id="ga">
+ <text>If a producer field type contains a wildcard type parameter the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="gb">
+ <text>If the producer field type is a parameterized type with a type variable, it must have scope |@Dependent|. If a producer field with a parameterized type with a type variable declares any scope other than |@Dependent|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ha">
+ <text>If a producer field type is a type variable the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="i" testable="false">
+ <text>The application may access producer fields directly. However, if the application accesses a producer field directly, the returned object is not bound to any context; and its lifecycle is not managed by the container</text>
+ <note>This is a statement of intent</note>
+ </assertion>
+
+ <assertion id="j">
+ <text>A bean may declare multiple producer fields</text>
+ </assertion>
+ </section>
+
+ <section id="3.4.1" title="Bean types of a producer field">
+ <assertion id="a">
+ <text>The bean types of a producer field depend upon the field type. If the field type is an interface, the set of bean types contains the field type, all interfaces it extends directly or indirectly and java.lang.Object</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>The bean types of a producer field depend upon the field type. If a field type is primitive ~or is a Java array type,~ the set of bean types contains exactly two types: the field type and java.lang.Object</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>The bean types of a producer field depend upon the field type. If a field type is ~primitive or is~ a Java array type, the set of bean types contains exactly two types: the field type and java.lang.Object</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The bean types of a producer field depend upon the field type. If the field type is a class, the set of bean types contains the field type, every superclass and all interfaces it implements directly or indirectly</text>
+ </assertion>
+ </section>
+
+ <section id="3.4.2" title="Declaring a producer field">
+ <assertion id="a">
+ <text>A producer field may be declared by annotating a field with the |(a)javax.enterprise.inject.Produces| annotation</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A producer field may specify a scope.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A producer field may specify a name.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>A producer field may specify stereotypes.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A producer field may specify bindings.</text>
+ </assertion>
+ </section>
+
+ <section id="3.4.3" title="Default name for a producer field">
+ <assertion id="a">
+ <text>The default name for a producer field is the field name</text>
+ </assertion>
+ </section>
+
+ <section id="3.5" title="Resources">
+ <assertion id="ka" testable="false">
+ <text>The container is not required to support resources with scope other than |@Dependent|.</text>
+ <note>Statement about non-portable behavior</note>
+ </assertion>
+
+ <assertion id="l" testable="false">
+ <text>A resource may not declare a bean EL name</text>
+ <note>Doesn't mention the consequences of this</note>
+ </assertion>
+ </section>
+
+ <section id="3.5.1" title="Declaring a resource">
+ <assertion id="aa" testable="false">
+ <text>A resource may be declared by specifying a Java EE component environment injection annotation as part of a producer field declaration.</text>
+ <note>Introductory text for the folloiwing assertions</note>
+ </assertion>
+
+ <assertion id="bb">
+ <text>For a Java EE resource, |@Resource| must be specified.</text>
+ </assertion>
+
+ <assertion id="cc">
+ <text>For a persistence context, |@PersistenceContext| must be specified.</text>
+ </assertion>
+
+ <assertion id="dd">
+ <text>For a persistence unit, |@PersistenceUnit| must be specified.</text>
+ </assertion>
+
+ <assertion id="ee">
+ <text>For a remote EJB, |@EJB| must be specified.</text>
+ </assertion>
+
+ <assertion id="ff">
+ <text>For a web service, |@WebServiceRef| must be specified.</text>
+ </assertion>
+
+ <assertion id="gg" testable="false">
+ <text>The injection annotation specifies the metadata needed to obtain the resources, entity manager, entity manager factory, remote EJB instance or web service reference from the component environment.</text>
+ <note>This is defined in other specs</note>
+ </assertion>
+
+ <assertion id="hh">
+ <text>The bean type and qualifiers of the resource are determined by the producer field declaration.</text>
+ </assertion>
+
+ </section>
+
+ <section id="3.5.2" title="Bean types of a resource">
+ <assertion id="a">
+ <text>The bean types of a resource are the declared type of the field declaration, together with |java.lang.Object|.</text>
+ </assertion>
+ </section>
+
+ <section id="3.6" title="Additional built-in beans">
+ <assertion id="a">
+ <text>A Java EE or embeddable EJB container must provide a bean with binding |@Default| and bean type |javax.transaction.UserTransaction|, allowing injection of a reference to the JTA |UserTransaction|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A Java EE or embeddable EJB container must provide a bean with binding |@Default| and bean type |javax.security.Principal|, allowing injection of a |Principal| representing the current caller identity.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A Java EE or embeddable EJB container must provide a bean with binding |@Default| and bean type |javax.validation.ValidationFactory|, allowing injection of the default Bean Validation |ValidationFactory|.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>A Java EE or embeddable EJB container must provide a bean with binding |@Default| and bean type |javax.validation.Validator|, allowing injection of a |Validator| for the default Bean Validation |ValidationFactory|.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If a Java EE component class has an injection point of type |UserTransaction| and binding |@Default|, and may not validly make use of the JTA |UserTransaction| according to the Java EE platform specification, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
- <section id="3.7" title="Bean constructors">
- <assertion id="a">
- <text>When the container instantiates a bean, it calls the bean constructor. The bean constructor is a constructor of the bean class</text>
- </assertion>
- </section>
-
- <section id="3.7.1" title="Declaring a bean constructor">
- <group>
- <text>The bean constructor may be identified by annotating the constructor |@Inject|</text>
- <assertion id="aa">
- <text>Test an @Inject constructor is used on a managed bean</text>
- </assertion>
- <assertion id="ab">
- <text>Test an @Inject constructor is used on a session bean</text>
- </assertion>
- </group>
-
-
- <assertion id="ba">
- <text>If a bean class does not explicitly declare a constructor using |@Inject|, the constructor that accepts no parameters is the bean constructor.</text>
- <note>Can't check implicit constructor</note>
- </assertion>
-
- <assertion id="ca">
- <text>If a bean class has more than one constructor annotated |@Inject|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="da">
- <text>If a bean constructor has a parameter annotated |@Disposes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="ea">
- <text>If a bean constructor has a parameter annotated |@Observes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
- </section>
-
- <section id="3.7.2" title="Bean constructor parameters">
- <assertion id="b">
- <text>A bean constructor may have any number of parameters.</text>
- </assertion>
-
- <assertion id="c">
- <text>All parameters of a bean constructor are injection points.</text>
- </assertion>
+ <section id="3.7" title="Bean constructors">
+ <assertion id="a">
+ <text>When the container instantiates a bean, it calls the bean constructor. The bean constructor is a constructor of the bean class</text>
+ </assertion>
+ </section>
+
+ <section id="3.7.1" title="Declaring a bean constructor">
+ <group>
+ <text>The bean constructor may be identified by annotating the constructor |@Inject|</text>
+ <assertion id="aa">
+ <text>Test an @Inject constructor is used on a managed bean</text>
+ </assertion>
+ <assertion id="ab">
+ <text>Test an @Inject constructor is used on a session bean</text>
+ </assertion>
+ </group>
+
+
+ <assertion id="ba">
+ <text>If a bean class does not explicitly declare a constructor using |@Inject|, the constructor that accepts no parameters is the bean constructor.</text>
+ <note>Can't check implicit constructor</note>
+ </assertion>
+
+ <assertion id="ca">
+ <text>If a bean class has more than one constructor annotated |@Inject|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>If a bean constructor has a parameter annotated |@Disposes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ea">
+ <text>If a bean constructor has a parameter annotated |@Observes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="3.7.2" title="Bean constructor parameters">
+ <assertion id="b">
+ <text>A bean constructor may have any number of parameters.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>All parameters of a bean constructor are injection points.</text>
+ </assertion>
</section>
-
+
<section id="3.8" title="Injected fields">
<group>
<text>An injected field is a non-static, non-final field of a bean class, or of any Java EE component class supporting injection.</text>
-
- <assertion id="aa">
- <text>Test a non-static field in a bean class.</text>
- </assertion>
-
- <assertion id="ab">
- <text>Test a non-final field in a bean class.</text>
- </assertion>
-
- <assertion id="ba">
- <text>Test a non-static field in a Java EE component class.</text>
- </assertion>
-
- <assertion id="bb">
- <text>Test a non-final field in a Java EE component class.</text>
+
+ <assertion id="aa">
+ <text>Test a non-static field in a bean class.</text>
</assertion>
- </group>
-
- <assertion id="ea">
- <text>Injected fields are initialized by the container before initializer methods are called, and before the |@PostConstruct| callback occurs.</text>
- </assertion>
-
- <assertion id="h">
- <text>If a field is a producer field, it is not an injected field</text>
- </assertion>
- </section>
-
- <section id="3.8.1" title="Declaring an injected field">
- <assertion id="aa">
- <text>An injected field may be declared by annotating the field |(a)javax.inject.Inject|.</text>
- </assertion>
- </section>
-
+
+ <assertion id="ab">
+ <text>Test a non-final field in a bean class.</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>Test a non-static field in a Java EE component class.</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>Test a non-final field in a Java EE component class.</text>
+ </assertion>
+ </group>
+
+ <assertion id="ea">
+ <text>Injected fields are initialized by the container before initializer methods are called, and before the |@PostConstruct| callback occurs.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If a field is a producer field, it is not an injected field</text>
+ </assertion>
+ </section>
+
+ <section id="3.8.1" title="Declaring an injected field">
+ <assertion id="aa">
+ <text>An injected field may be declared by annotating the field |(a)javax.inject.Inject|.</text>
+ </assertion>
+ </section>
+
<section id="3.9" title="Initializer methods">
<group>
<text>An initializer method is a non-abstract, non-static method of a bean class, or of any Java EE component class supporting injection.</text>
@@ -1316,84 +1316,84 @@
<assertion id="aaa">
<text>Test with a non-abstract method of a bean-class.</text>
</assertion>
-
- <assertion id="aa">
- <text>Test with a non-static method of a bean class.</text>
+
+ <assertion id="aa">
+ <text>Test with a non-static method of a bean class.</text>
</assertion>
<assertion id="caa">
<text>Test with a non-abstract method of a Java EE component class.</text>
</assertion>
- <assertion id="ca">
- <text>Test with a non-static method of a Java EE component class.</text>
+ <assertion id="ca">
+ <text>Test with a non-static method of a Java EE component class.</text>
</assertion>
- </group>
-
- <assertion id="e">
- <text>If the bean is a session bean, the initializer method is not required to be a business method of the session bean.</text>
+ </group>
+
+ <assertion id="e">
+ <text>If the bean is a session bean, the initializer method is not required to be a business method of the session bean.</text>
</assertion>
<assertion id="ea">
<text>A generic method may not be an initializer method.</text>
- </assertion>
-
- <assertion id="f">
- <text>Method interceptors are never called when the container calls an initializer method</text>
- </assertion>
-
- <assertion id="g">
- <text>A bean class may declare multiple (or zero) initializer methods</text>
- </assertion>
-
- <assertion id="ea">
- <text>Initializer methods are called by the container after injected fields are initialized, and before the |@PostConstruct| callback occurs.</text>
- </assertion>
-
- <assertion id="h" testable="false">
- <text>The application may call initializer methods directly, but then no parameters will be passed to the method by the container</text>
- <note>This is a statement of intent</note>
- </assertion>
- </section>
-
- <section id="3.9.1" title="Declaring an initializer method">
- <assertion id="a">
- <text>An initializer method may be declared by annotating the method |(a)javax.inject.Inject|</text>
- </assertion>
-
- <assertion id="ab">
- <text>If a generic method of a bean is annotated |@Inject|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="ba">
- <text>If an initializer method is annotated |@Produces|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="ca">
- <text>If an initializer method has a parameter annotated |@Disposes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="da">
- <text>If an initializer method has a parameter annotated |@Observes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- </section>
-
- <section id="3.9.2" title="Initializer method parameters">
- <assertion id="aa">
- <text>An initializer method may have any number of parameters.</text>
- </assertion>
-
- <assertion id="b">
- <text>All initializer method parameters are injection points.</text>
- </assertion>
- </section>
-
- <section id="3.10" title="The default qualifier at injection points">
- <assertion id="a">
- <text>If an injection point declares no qualifier, the default binding |@Default| is assumed.</text>
- </assertion>
+ </assertion>
+
+ <assertion id="f">
+ <text>Method interceptors are never called when the container calls an initializer method</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>A bean class may declare multiple (or zero) initializer methods</text>
+ </assertion>
+
+ <assertion id="ea">
+ <text>Initializer methods are called by the container after injected fields are initialized, and before the |@PostConstruct| callback occurs.</text>
+ </assertion>
+
+ <assertion id="h" testable="false">
+ <text>The application may call initializer methods directly, but then no parameters will be passed to the method by the container</text>
+ <note>This is a statement of intent</note>
+ </assertion>
</section>
+
+ <section id="3.9.1" title="Declaring an initializer method">
+ <assertion id="a">
+ <text>An initializer method may be declared by annotating the method |(a)javax.inject.Inject|</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>If a generic method of a bean is annotated |@Inject|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>If an initializer method is annotated |@Produces|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>If an initializer method has a parameter annotated |@Disposes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>If an initializer method has a parameter annotated |@Observes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ </section>
+
+ <section id="3.9.2" title="Initializer method parameters">
+ <assertion id="aa">
+ <text>An initializer method may have any number of parameters.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>All initializer method parameters are injection points.</text>
+ </assertion>
+ </section>
+
+ <section id="3.10" title="The default qualifier at injection points">
+ <assertion id="a">
+ <text>If an injection point declares no qualifier, the default binding |@Default| is assumed.</text>
+ </assertion>
+ </section>
<section id="3.11" title="The qualifier @Named at injection points">
<assertion id="a">
@@ -1403,230 +1403,230 @@
<assertion id="b">
<text>If any other injection point declares a |@Named| annotation that does not specify the value member, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
</assertion>
- </section>
-
- <section id="3.12" title="Beans with the @New qualifier">
- <assertion id="d">
- <text>For each managed bean, a second bean exists which has the same bean class.</text>
- </assertion>
-
- <assertion id="e">
- <text>For each managed bean, a second bean exists which has the same bean types.</text>
- </assertion>
-
- <assertion id="f">
- <text>For each managed bean, a second bean exists which has the same bean constructor.</text>
- </assertion>
-
- <assertion id="g">
- <text>For each managed bean, a second bean exists which has the same initializer methods.</text>
- </assertion>
-
- <assertion id="h">
- <text>For each managed bean, a second bean exists which has the same injected fields.</text>
- </assertion>
-
- <assertion id="i">
- <text>For each managed bean, a second bean exists which has the same interceptor bindings.</text>
- </assertion>
-
- <assertion id="j">
- <text>For each session bean, a second bean exists which has the same bean class.</text>
- </assertion>
-
- <assertion id="k">
- <text>For each session bean, a second bean exists which has the same bean types.</text>
- </assertion>
-
- <assertion id="l">
- <text>For each session bean, a second bean exists which has the same bean constructor.</text>
- </assertion>
-
- <assertion id="m">
- <text>For each session bean, a second bean exists which has the same initializer methods.</text>
- </assertion>
-
- <assertion id="n">
- <text>For each session bean, a second bean exists which has the same injected fields.</text>
- </assertion>
-
- <assertion id="o">
- <text>For each session bean, a second bean exists which has the same interceptor bindings.</text>
- </assertion>
-
- <assertion id="p">
- <text>This second bean has scope |@Dependent|.</text>
- </assertion>
-
- <assertion id="r">
- <text>This second bean has exactly one binding: |(a)javax.enterprise.inject.New(X.class)| where |x| is the bean class.</text>
- </assertion>
-
- <assertion id="s">
- <text>This second bean has no bean EL name.</text>
- </assertion>
-
- <assertion id="t">
- <text>This second bean has no stereotypes.</text>
- </assertion>
-
- <assertion id="u">
- <text>This second bean has no observer methods.</text>
- </assertion>
-
- <assertion id="v">
- <text>This second bean has no producer methods.</text>
- </assertion>
-
- <assertion id="w">
- <text>This second bean has no producer fields.</text>
- </assertion>
-
- <assertion id="x">
- <text>This second bean has no disposer methods.</text>
- </assertion>
-
- <assertion id="xb">
- <text>This second bean is not an alternative.</text>
- </assertion>
-
- <assertion id="z">
- <text>When the binding |@New| is specified at an injection point and no |value| member is explicitly specified, the container defaults the |value| to the declared type of the injection point.</text>
- </assertion>
- </section>
-
- <section id="4" title="Inheritance and specialization">
-
- </section>
-
+ </section>
+
+ <section id="3.12" title="Beans with the @New qualifier">
+ <assertion id="d">
+ <text>For each managed bean, a second bean exists which has the same bean class.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>For each managed bean, a second bean exists which has the same bean types.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>For each managed bean, a second bean exists which has the same bean constructor.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>For each managed bean, a second bean exists which has the same initializer methods.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>For each managed bean, a second bean exists which has the same injected fields.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>For each managed bean, a second bean exists which has the same interceptor bindings.</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>For each session bean, a second bean exists which has the same bean class.</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>For each session bean, a second bean exists which has the same bean types.</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>For each session bean, a second bean exists which has the same bean constructor.</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>For each session bean, a second bean exists which has the same initializer methods.</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>For each session bean, a second bean exists which has the same injected fields.</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>For each session bean, a second bean exists which has the same interceptor bindings.</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>This second bean has scope |@Dependent|.</text>
+ </assertion>
+
+ <assertion id="r">
+ <text>This second bean has exactly one binding: |(a)javax.enterprise.inject.New(X.class)| where |x| is the bean class.</text>
+ </assertion>
+
+ <assertion id="s">
+ <text>This second bean has no bean EL name.</text>
+ </assertion>
+
+ <assertion id="t">
+ <text>This second bean has no stereotypes.</text>
+ </assertion>
+
+ <assertion id="u">
+ <text>This second bean has no observer methods.</text>
+ </assertion>
+
+ <assertion id="v">
+ <text>This second bean has no producer methods.</text>
+ </assertion>
+
+ <assertion id="w">
+ <text>This second bean has no producer fields.</text>
+ </assertion>
+
+ <assertion id="x">
+ <text>This second bean has no disposer methods.</text>
+ </assertion>
+
+ <assertion id="xb">
+ <text>This second bean is not an alternative.</text>
+ </assertion>
+
+ <assertion id="z">
+ <text>When the binding |@New| is specified at an injection point and no |value| member is explicitly specified, the container defaults the |value| to the declared type of the injection point.</text>
+ </assertion>
+ </section>
+
+ <section id="4" title="Inheritance and specialization">
+
+ </section>
+
<section id="4.1" title="Inheritance of type-level metadata">
<group>
<text>Suppose a class X is extended directly or indirectly by the bean class of a managed bean or session bean Y. If X is annotated with a qualifier type, stereotype or interceptor binding type Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
-
+
<assertion id="aa">
- <text>Test qualifier type for directly extended managed bean annotated |@Inherited| is inherited.</text>
+ <text>Test qualifier type for directly extended managed bean annotated |@Inherited| is inherited.</text>
</assertion>
<assertion id="aaa">
<text>Test qualifier type for directly extended managed bean not annotated |@Inherited| is not inherited.</text>
- </assertion>
-
- <assertion id="ab">
- <text>Test stereotype for directly extended managed bean annotated |@Inherited| is inherited.</text>
</assertion>
+
+ <assertion id="ab">
+ <text>Test stereotype for directly extended managed bean annotated |@Inherited| is inherited.</text>
+ </assertion>
<assertion id="aba">
<text>Test stereotype for directly extended managed bean not annotated |@Inherited| is not inherited.</text>
- </assertion>
-
- <assertion id="ad">
- <text>Test interceptor binding type for directly extended managed bean annotated |@Inherited| is inherited.</text>
</assertion>
+
+ <assertion id="ad">
+ <text>Test interceptor binding type for directly extended managed bean annotated |@Inherited| is inherited.</text>
+ </assertion>
- <assertion id="ada">
- <text>Test interceptor binding type for directly extended managed bean not annotated |@Inherited| is not inherited.</text>
+ <assertion id="ada">
+ <text>Test interceptor binding type for directly extended managed bean not annotated |@Inherited| is not inherited.</text>
</assertion>
-
+
<assertion id="ag">
- <text>Test qualifier type for indirectly extended managed bean annotated |@Inherited| is inherited.</text>
+ <text>Test qualifier type for indirectly extended managed bean annotated |@Inherited| is inherited.</text>
</assertion>
<assertion id="aga">
<text>Test qualifier type for indirectly extended managed bean not annotated |@Inherited| is not inherited.</text>
- </assertion>
-
+ </assertion>
+
<assertion id="ah">
- <text>Test stereotype for indirectly extended managed bean annotated |@Inherited| is inherited.</text>
+ <text>Test stereotype for indirectly extended managed bean annotated |@Inherited| is inherited.</text>
</assertion>
<assertion id="aha">
<text>Test stereotype for indirectly extended managed bean not annotated |@Inherited| is not inherited.</text>
- </assertion>
-
+ </assertion>
+
<assertion id="aj">
- <text>Test interceptor binding type for indirectly extended managed bean annotated |@Inherited| is inherited.</text>
+ <text>Test interceptor binding type for indirectly extended managed bean annotated |@Inherited| is inherited.</text>
</assertion>
<assertion id="aja">
- <text>Test interceptor binding type for indirectly extended managed bean not annotated |@Inherited| is not inherited.</text>
- </assertion>
-
- <assertion id="al">
- <text>Test qualifier type for directly extended session bean annotated |@Inherited| is inherited.</text>
+ <text>Test interceptor binding type for indirectly extended managed bean not annotated |@Inherited| is not inherited.</text>
</assertion>
+ <assertion id="al">
+ <text>Test qualifier type for directly extended session bean annotated |@Inherited| is inherited.</text>
+ </assertion>
+
<assertion id="ala">
<text>Test qualifier type for directly extended session bean not annotated |@Inherited| is not inherited.</text>
- </assertion>
-
+ </assertion>
+
<assertion id="am">
- <text>Test stereotype for directly extended session bean annotated |@Inherited| is inherited.</text>
+ <text>Test stereotype for directly extended session bean annotated |@Inherited| is inherited.</text>
</assertion>
<assertion id="ama">
<text>Test stereotype for directly extended session bean not annotated |@Inherited| is not inherited.</text>
- </assertion>
-
+ </assertion>
+
<assertion id="an">
- <text>Test interceptor binding type for directly extended session bean annotated |@Inherited| is inherited.</text>
+ <text>Test interceptor binding type for directly extended session bean annotated |@Inherited| is inherited.</text>
</assertion>
<assertion id="ana">
- <text>Test interceptor binding type for directly extended session bean not annotated |@Inherited| is not inherited.</text>
- </assertion>
-
+ <text>Test interceptor binding type for directly extended session bean not annotated |@Inherited| is not inherited.</text>
+ </assertion>
+
<assertion id="ap">
- <text>Test qualifier type for indirectly extended session bean annotated |@Inherited| is inherited.</text>
+ <text>Test qualifier type for indirectly extended session bean annotated |@Inherited| is inherited.</text>
</assertion>
<assertion id="apa">
- <text>Test qualifier type for indirectly extended session bean not annotated |@Inherited| is not inherited.</text>
- </assertion>
-
+ <text>Test qualifier type for indirectly extended session bean not annotated |@Inherited| is not inherited.</text>
+ </assertion>
+
<assertion id="aq">
<text>Test stereotype for indirectly extended session bean annotated |@Inherited| is inherited.</text>
- </assertion>
+ </assertion>
<assertion id="aqa">
<text>Test stereotype for indirectly extended session bean not annotated |@Inherited| is not inherited.</text>
</assertion>
-
- <assertion id="ar">
+
+ <assertion id="ar">
<text>Test interceptor binding type for indirectly extended session bean annotated |@Inherited| is inherited.</text>
</assertion>
- <assertion id="ara">
+ <assertion id="ara">
<text>Test interceptor binding type for indirectly extended session bean not annotated |@Inherited| is not inherited.</text>
- </assertion>
- </group>
+ </assertion>
+ </group>
<group>
<text>Suppose a class X is extended directly or indirectly by the bean class of a managed bean or session bean Y. If X is annotated with a scope type Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares a scope type.</text>
-
- <assertion id="ba">
+
+ <assertion id="ba">
<text>Test scope type for directly extended managed bean annotated |@Inherited| is inherited.</text>
</assertion>
- <assertion id="baa">
+ <assertion id="baa">
<text>Test scope type for directly extended managed bean not annotated |@Inherited| is not inherited.</text>
- </assertion>
-
- <assertion id="bc">
+ </assertion>
+
+ <assertion id="bc">
<text>Test scope type for indirectly extended managed bean annotated |@Inherited| is inherited.</text>
- </assertion>
+ </assertion>
- <assertion id="bca">
+ <assertion id="bca">
<text>Test scope type for indirectly extended managed bean not annotated |@Inherited| is not inherited.</text>
</assertion>
-
+
<assertion id="be">
- <text>Test scope type for directly extended session bean annotated |@Inherited| is inherited.</text>
+ <text>Test scope type for directly extended session bean annotated |@Inherited| is inherited.</text>
</assertion>
<assertion id="bea">
- <text>Test scope type for directly extended session bean not annotated |@Inherited| is not inherited.</text>
- </assertion>
-
+ <text>Test scope type for directly extended session bean not annotated |@Inherited| is not inherited.</text>
+ </assertion>
+
<assertion id="bh">
<text>Test scope type for indirectly extended session bean annotated |@Inherited| is inherited.</text>
</assertion>
@@ -1634,251 +1634,251 @@
<assertion id="bha">
<text>Test scope type for indirectly extended session bean not annotated |@Inherited| is not inherited.</text>
</assertion>
- </group>
-
- <assertion id="hhh">
- <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, a scope type explicitly declared by X and inherited by Y from X takes precedence over default scopes of stereotypes declared or inherited by Y.</text>
- </assertion>
-
- <assertion id="hhi">
- <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, a scope type explicitly declared by X and inherited by Y from X takes precedence over default scopes of stereotypes declared or inherited by Y.</text>
- </assertion>
-
- <assertion id="hhj">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, a scope type explicitly declared by X and inherited by Y from X takes precedence over default scopes of stereotypes declared or inherited by Y.</text>
- </assertion>
-
- <assertion id="hhk">
- <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, a scope type explicitly declared by X and inherited by Y from X takes precedence over default scopes of stereotypes declared or inherited by Y.</text>
- </assertion>
-
- <assertion id="i" testable="false">
- <text>For annotations defined by the bean specification, all built-in _scope types_ are declared |@Inherited|</text>
- <note>sigtest</note>
- </assertion>
-
- <assertion id="j" testable="false">
- <text>For annotations defined by the bean specification, all built-in _stereotypes_ are declared |@Inherited|</text>
- <note>sigtest</note>
- </assertion>
-
- <assertion id="k" testable="false">
- <text>For annotations defined by the bean specification, _no built-in binding type is declared |@Inherited|_</text>
- <note>sigtest</note>
- </assertion>
-
- <assertion id="m" testable="false">
- <text>The |@Named| annotation is not declared |@Inherited| and bean EL names are not inherited unless specialization is used</text>
- <note>sigtest</note>
- </assertion>
-
- </section>
-
- <section id="4.2" title="Inheritance of member-level metadata">
-
- <assertion id="aa">
- <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares an injected field x then Y inherits x.</text>
- </assertion>
-
- <assertion id="ab">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares an injected field x then Y inherits x.</text>
- </assertion>
-
- <assertion id="ac">
- <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X declares an injected field x then Y inherits x.</text>
- </assertion>
-
- <assertion id="ad">
- <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares an injected field x then Y inherits x.</text>
- </assertion>
-
- <assertion id="baa">
- <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares a _|@PostConstruct|_ method x() then Y inherits x() if and only if Y does not override the method x()</text>
- </assertion>
-
- <assertion id="bab">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _|@PostConstruct|_ method x() then Y inherits x() if and only if Y does not override the method x()</text>
- </assertion>
-
- <assertion id="bac">
- <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X declares a _|@PostConstruct|_ method x() then Y inherits x() if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y overrides the method x()</text>
- </assertion>
-
- <assertion id="bad">
- <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares a _|@PostConstruct|_ method x() then Y inherits x() if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y overrides the method x()</text>
- </assertion>
-
- <assertion id="bba">
- <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares a _|@PreDestroy|_ method x() then Y inherits x() if and only if Y does not override the method x()</text>
- </assertion>
-
- <assertion id="bbb">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _|@PreDestroy|_ method x() then Y inherits x() if and only if Y does not override the method x()</text>
- </assertion>
-
- <assertion id="bbc">
- <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X declares a _|@PreDestroy|_ method x() then Y inherits x() if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y overrides the method x()</text>
- </assertion>
-
- <assertion id="bbd">
- <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares a _|@PreDestroy|_ method x() then Y inherits x() if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y overrides the method x()</text>
- </assertion>
-
- <assertion id="da">
- <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
- </assertion>
-
- <assertion id="db">
- <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares a _non-static disposer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
- </assertion>
-
- <assertion id="dc">
- <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares a _non-static observer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
- </assertion>
-
- <assertion id="dd">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
- </assertion>
-
- <assertion id="de">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _non-static disposer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
- </assertion>
-
- <assertion id="df">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _non-static observer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
- </assertion>
-
- <assertion id="dg">
- <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
- </assertion>
-
- <assertion id="dh">
- <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X declares a _non-static disposer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
- </assertion>
-
- <assertion id="di">
- <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X declares a _non-static observer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
- </assertion>
-
- <assertion id="dj">
- <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
- </assertion>
-
- <assertion id="dk">
- <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares a _non-static disposer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
- </assertion>
-
- <assertion id="dl">
- <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares a _non-static observer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
- </assertion>
-
- <assertion id="ea">
- <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares a _non-static producer field_ x then Y does not inherit this field unless Y is explicitly declared to specialize X.</text>
- <note>We don't test session beans, as they can't have non-static producer fields</note>
- </assertion>
-
- <assertion id="ec">
- <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X declares a _non-static producer field_ x then Y does not inherit this field unless Y is explicitly declared to specialize X.</text>
- <note>We don't test session beans, as they can't have non-static producer fields</note>
- </assertion>
-
- <assertion id="f">
- <text>If X is a generic type, and an injection point declared by X is inherited by Y, and the declared type of the injection point contains type variables declared by X, the type of the injection point inherited in Y is the declared type, after substitution of actual type arguments declared by Y or any intermediate class that is a subclass of X and a superclass of Y.</text>
- </assertion>
-
- <assertion id="g">
- <text>If X is a generic type, and a producer method declared by X is inherited by Y, and the declared type of the producer method contains type variables declared by X, the type of the producer method inherited in Y is the declared type, after substitution of actual type arguments declared by Y or any intermediate class that is a subclass of X and a superclass of Y.</text>
- </assertion>
-
- <assertion id="h">
- <text>If X is a generic type, and a producer field declared by X is inherited by Y, and the declared type of the producer field contains type variables declared by X, the type of the producer field inherited in Y is the declared type, after substitution of actual type arguments declared by Y or any intermediate class that is a subclass of X and a superclass of Y.</text>
- </assertion>
-
- <assertion id="i">
- <text>If X is a generic type, and a disposer method declared by X is inherited by Y, and the declared type of the disposed parameter contains type variables declared by X, the type of the disposed parameter inherited in Y is the declared type, after substitution of actual type arguments declared by Y or any intermediate class that is a subclass of X and a superclass of Y.</text>
- </assertion>
-
- <assertion id="j">
- <text>If X is a generic type, and an observer method declared by X is inherited by Y, and the declared type of the event parameter contains type variables declared by X, the type of the event parameter inherited in Y is the declared type, after substitution of actual type arguments declared by Y or any intermediate class that is a subclass of X and a superclass of Y.</text>
- </assertion>
- </section>
-
- <section id="4.3" title="Specialization">
- <assertion id="a" testable="false">
- <text>If two beans both support a certain bean type, and share at least one qualifier, then they are both eligible for injection to any injection point with that declared type and binding.</text>
- </assertion>
-
- <assertion id="ca">
- <text>When an enabled bean specializes a second bean, we can be certain that the second bean is never instantiated or called by the container.</text>
- </assertion>
-
- <assertion id="cb">
- <text>When an enabled bean specializes a second bean, we can be certain ~that the second bean is never instantiated or called by the container.~ Even if the second bean defines a producer or observer method, the method will be called upon an instance of the first bean. </text>
- </assertion>
-
- </section>
-
- <section id="4.3.1" title="Direct and indirect specialization">
- <assertion id="ia">
- <text>A bean X is said to specialize another bean Y if X directly specializes Y.</text>
- </assertion>
-
- <assertion id="ib">
- <text>A bean X is said to specialize another bean Y if a bean Z exists, such that X directly specializes Z and Z specializes Y.</text>
- </assertion>
-
- <assertion id="j">
- <text>A bean X that specializes bean Y will include all qualifiers of Y, together with all qualifiers declared explicitly by X.</text>
- </assertion>
-
- <assertion id="k">
- <text>A bean X that specializes bean Y will have the same name as Y if Y has a name.</text>
- </assertion>
+ </group>
+ <assertion id="hhh">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, a scope type explicitly declared by X and inherited by Y from X takes precedence over default scopes of stereotypes declared or inherited by Y.</text>
+ </assertion>
+
+ <assertion id="hhi">
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, a scope type explicitly declared by X and inherited by Y from X takes precedence over default scopes of stereotypes declared or inherited by Y.</text>
+ </assertion>
+
+ <assertion id="hhj">
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, a scope type explicitly declared by X and inherited by Y from X takes precedence over default scopes of stereotypes declared or inherited by Y.</text>
+ </assertion>
+
+ <assertion id="hhk">
+ <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, a scope type explicitly declared by X and inherited by Y from X takes precedence over default scopes of stereotypes declared or inherited by Y.</text>
+ </assertion>
+
+ <assertion id="i" testable="false">
+ <text>For annotations defined by the bean specification, all built-in _scope types_ are declared |@Inherited|</text>
+ <note>sigtest</note>
+ </assertion>
+
+ <assertion id="j" testable="false">
+ <text>For annotations defined by the bean specification, all built-in _stereotypes_ are declared |@Inherited|</text>
+ <note>sigtest</note>
+ </assertion>
+
+ <assertion id="k" testable="false">
+ <text>For annotations defined by the bean specification, _no built-in binding type is declared |@Inherited|_</text>
+ <note>sigtest</note>
+ </assertion>
+
+ <assertion id="m" testable="false">
+ <text>The |@Named| annotation is not declared |@Inherited| and bean EL names are not inherited unless specialization is used</text>
+ <note>sigtest</note>
+ </assertion>
+
+ </section>
+
+ <section id="4.2" title="Inheritance of member-level metadata">
+
+ <assertion id="aa">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares an injected field x then Y inherits x.</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares an injected field x then Y inherits x.</text>
+ </assertion>
+
+ <assertion id="ac">
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X declares an injected field x then Y inherits x.</text>
+ </assertion>
+
+ <assertion id="ad">
+ <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares an injected field x then Y inherits x.</text>
+ </assertion>
+
+ <assertion id="baa">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares a _|@PostConstruct|_ method x() then Y inherits x() if and only if Y does not override the method x()</text>
+ </assertion>
+
+ <assertion id="bab">
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _|@PostConstruct|_ method x() then Y inherits x() if and only if Y does not override the method x()</text>
+ </assertion>
+
+ <assertion id="bac">
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X declares a _|@PostConstruct|_ method x() then Y inherits x() if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y overrides the method x()</text>
+ </assertion>
+
+ <assertion id="bad">
+ <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares a _|@PostConstruct|_ method x() then Y inherits x() if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y overrides the method x()</text>
+ </assertion>
+
+ <assertion id="bba">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares a _|@PreDestroy|_ method x() then Y inherits x() if and only if Y does not override the method x()</text>
+ </assertion>
+
+ <assertion id="bbb">
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _|@PreDestroy|_ method x() then Y inherits x() if and only if Y does not override the method x()</text>
+ </assertion>
+
+ <assertion id="bbc">
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X declares a _|@PreDestroy|_ method x() then Y inherits x() if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y overrides the method x()</text>
+ </assertion>
+
+ <assertion id="bbd">
+ <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares a _|@PreDestroy|_ method x() then Y inherits x() if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y overrides the method x()</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
+ </assertion>
+
+ <assertion id="db">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares a _non-static disposer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
+ </assertion>
+
+ <assertion id="dc">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares a _non-static observer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
+ </assertion>
+
+ <assertion id="dd">
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
+ </assertion>
+
+ <assertion id="de">
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _non-static disposer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
+ </assertion>
+
+ <assertion id="df">
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _non-static observer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
+ </assertion>
+
+ <assertion id="dg">
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
+ </assertion>
+
+ <assertion id="dh">
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X declares a _non-static disposer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
+ </assertion>
+
+ <assertion id="di">
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X declares a _non-static observer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
+ </assertion>
+
+ <assertion id="dj">
+ <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
+ </assertion>
+
+ <assertion id="dk">
+ <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares a _non-static disposer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
+ </assertion>
+
+ <assertion id="dl">
+ <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares a _non-static observer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
+ </assertion>
+
+ <assertion id="ea">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares a _non-static producer field_ x then Y does not inherit this field unless Y is explicitly declared to specialize X.</text>
+ <note>We don't test session beans, as they can't have non-static producer fields</note>
+ </assertion>
+
+ <assertion id="ec">
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X declares a _non-static producer field_ x then Y does not inherit this field unless Y is explicitly declared to specialize X.</text>
+ <note>We don't test session beans, as they can't have non-static producer fields</note>
+ </assertion>
+
+ <assertion id="f">
+ <text>If X is a generic type, and an injection point declared by X is inherited by Y, and the declared type of the injection point contains type variables declared by X, the type of the injection point inherited in Y is the declared type, after substitution of actual type arguments declared by Y or any intermediate class that is a subclass of X and a superclass of Y.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If X is a generic type, and a producer method declared by X is inherited by Y, and the declared type of the producer method contains type variables declared by X, the type of the producer method inherited in Y is the declared type, after substitution of actual type arguments declared by Y or any intermediate class that is a subclass of X and a superclass of Y.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If X is a generic type, and a producer field declared by X is inherited by Y, and the declared type of the producer field contains type variables declared by X, the type of the producer field inherited in Y is the declared type, after substitution of actual type arguments declared by Y or any intermediate class that is a subclass of X and a superclass of Y.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>If X is a generic type, and a disposer method declared by X is inherited by Y, and the declared type of the disposed parameter contains type variables declared by X, the type of the disposed parameter inherited in Y is the declared type, after substitution of actual type arguments declared by Y or any intermediate class that is a subclass of X and a superclass of Y.</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>If X is a generic type, and an observer method declared by X is inherited by Y, and the declared type of the event parameter contains type variables declared by X, the type of the event parameter inherited in Y is the declared type, after substitution of actual type arguments declared by Y or any intermediate class that is a subclass of X and a superclass of Y.</text>
+ </assertion>
+ </section>
+
+ <section id="4.3" title="Specialization">
+ <assertion id="a" testable="false">
+ <text>If two beans both support a certain bean type, and share at least one qualifier, then they are both eligible for injection to any injection point with that declared type and binding.</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>When an enabled bean specializes a second bean, we can be certain that the second bean is never instantiated or called by the container.</text>
+ </assertion>
+
+ <assertion id="cb">
+ <text>When an enabled bean specializes a second bean, we can be certain ~that the second bean is never instantiated or called by the container.~ Even if the second bean defines a producer or observer method, the method will be called upon an instance of the first bean. </text>
+ </assertion>
+
+ </section>
+
+ <section id="4.3.1" title="Direct and indirect specialization">
+ <assertion id="ia">
+ <text>A bean X is said to specialize another bean Y if X directly specializes Y.</text>
+ </assertion>
+
+ <assertion id="ib">
+ <text>A bean X is said to specialize another bean Y if a bean Z exists, such that X directly specializes Z and Z specializes Y.</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>A bean X that specializes bean Y will include all qualifiers of Y, together with all qualifiers declared explicitly by X.</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>A bean X that specializes bean Y will have the same name as Y if Y has a name.</text>
+ </assertion>
+
<group>
<text>If X declares a name explicitly, using |@Named|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
-
- <assertion id="la">
- <text>Test that a specializing producer method with a name throws a deployment exception.</text>
+
+ <assertion id="la">
+ <text>Test that a specializing producer method with a name throws a deployment exception.</text>
</assertion>
- <assertion id="lb">
- <text>Test that a specializing managed bean with a name throws a deployment exception.</text>
+ <assertion id="lb">
+ <text>Test that a specializing managed bean with a name throws a deployment exception.</text>
</assertion>
- <assertion id="lc">
- <text>Test that a specializing enterprise bean with a name throws a deployment exception.</text>
+ <assertion id="lc">
+ <text>Test that a specializing enterprise bean with a name throws a deployment exception.</text>
</assertion>
- </group>
-
- <assertion id="m">
- <text>X must have all the bean types of Y. If X does not support some bean type of Y, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
- </section>
-
- <section id="5" title="Dependency injection, lookup, and EL">
-
- <assertion id="b">
- <text>The container is required to support circularities in the bean dependency graph.</text>
- <note>The RI has unit tests for this atm</note>
- </assertion>
- </section>
-
+ </group>
+
+ <assertion id="m">
+ <text>X must have all the bean types of Y. If X does not support some bean type of Y, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="5" title="Dependency injection, lookup, and EL">
+
+ <assertion id="b">
+ <text>The container is required to support circularities in the bean dependency graph.</text>
+ <note>The RI has unit tests for this atm</note>
+ </assertion>
+ </section>
+
<section id="5.1" title="Inter-module accessibility in Java EE">
<group>
<text>Beans packaged in a certain Java EE _module or library are available for injection, lookup and EL resolution to classes and JSP/JSF pages packaged in some other Java EE module or library if and only if the first module or library is required to be accessible to the other module or library by the Java EE platform specification.</text>
-
+
<assertion id="aa">
<text>Test with injection.</text>
- </assertion>
-
- <assertion id="ab">
- <text>Test with lookup.</text>
- </assertion>
-
- <assertion id="ac">
- <text>Test with EL resolution.</text>
</assertion>
+
+ <assertion id="ab">
+ <text>Test with lookup.</text>
+ </assertion>
+
+ <assertion id="ac">
+ <text>Test with EL resolution.</text>
+ </assertion>
</group>
<assertion id="b">
@@ -1892,973 +1892,973 @@
<assertion id="d">
<text>For a custom implementation of |InjectionTarget|, defined in Section 11.2, "The Producer and InjectionTarget interfaces", the container calls |InjectionPoint.getMember()| and then |Member.getDeclaringClass()| to determine the class that declares an injection point.</text>
</assertion>
-
- </section>
-
- <section id="5.2" title="Alternative selection">
- <assertion id="a">
- <text>An alternative is never available for injection, lookup or EL resolution in a Java EE module or library that is not a bean deployment archive (a module or library with no |beans.xml| file).</text>
- </assertion>
-
- <assertion id="b">
- <text>Nor is an alternative available for injection, lookup or EL resolution in every bean deployment archive. An alternative must be explicitly selected in every bean deployment archive in which the alternative should be available for injection, lookup and EL resolution.</text>
- </assertion>
- </section>
+
+ </section>
+
+ <section id="5.2" title="Alternative selection">
+ <assertion id="a">
+ <text>An alternative is never available for injection, lookup or EL resolution in a Java EE module or library that is not a bean deployment archive (a module or library with no |beans.xml| file).</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Nor is an alternative available for injection, lookup or EL resolution in every bean deployment archive. An alternative must be explicitly selected in every bean deployment archive in which the alternative should be available for injection, lookup and EL resolution.</text>
+ </assertion>
+ </section>
<section id="5.2.1" title="Declaring selected alternatives for a bean deployment archive">
- <assertion id="c">
- <text>By default, a bean deployment archive has no selected alternatives. An alternative must be explicitly declared using the <alternatives> element of the |beans.xml| file of the bean deployment archive.</text>
- </assertion>
-
- <assertion id="d" testable="false">
- <text>The <alternatives> element contains a list of bean classes and stereotypes. </text>
- </assertion>
+ <assertion id="c">
+ <text>By default, a bean deployment archive has no selected alternatives. An alternative must be explicitly declared using the <alternatives> element of the |beans.xml| file of the bean deployment archive.</text>
+ </assertion>
+ <assertion id="d" testable="false">
+ <text>The <alternatives> element contains a list of bean classes and stereotypes. </text>
+ </assertion>
+
<group>
<text>An alternative is selected for the bean deployment archive if the alternative is a managed bean or session bean and the bean class of the bean is listed.</text>
-
- <assertion id="ea">
- <text>Test with a managed bean.</text>
- </assertion>
-
- <assertion id="eb">
- <text>Test with a session bean.</text>
+
+ <assertion id="ea">
+ <text>Test with a managed bean.</text>
</assertion>
- </group>
-
- <group>
- <text>An alternative is selected for the bean deployment archive if the policy is a producer method, field or resource, and the bean class that declares the method or field is listed.</text>
-
- <assertion id="fa">
- <text>Test for enablement of a producer method and field.</text>
- </assertion>
-
- <assertion id="fb">
- <text>Test for enablement of a resource.</text>
- </assertion>
- </group>
-
- <assertion id="g">
- <text>An alternative is selected for the bean deployment archive if any |@Alternative| stereotype of the alternative is listed.</text>
- </assertion>
-
- <assertion id="h">
- <text>Each child <class> element must specify the name of a alternative bean class. If there is no class with the specified name, or if the class with the specified name is not an alternative bean class, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="i">
- <text>Each child <stereotype> element must specify the name of a |@Alternative| stereotype annotation. If there is no annotation with the specified name, or the annotation is not a |@Alternative| stereotype, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="j">
- <text>If the same type is listed twice under the <alternatives> element, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="k">
- <text>For a custom implementation of the |Bean| interface defined in Section 11.1, "The Bean interface", the container calls |isAlternative()| to determine whether the bean is an alternative, and |getBeanClass()| and |getStereotypes()| to determine whether an alternative is selected in a certain bean deployment archive.</text>
- </assertion>
+
+ <assertion id="eb">
+ <text>Test with a session bean.</text>
+ </assertion>
+ </group>
+
+ <group>
+ <text>An alternative is selected for the bean deployment archive if the policy is a producer method, field or resource, and the bean class that declares the method or field is listed.</text>
+
+ <assertion id="fa">
+ <text>Test for enablement of a producer method and field.</text>
+ </assertion>
+
+ <assertion id="fb">
+ <text>Test for enablement of a resource.</text>
+ </assertion>
+ </group>
+
+ <assertion id="g">
+ <text>An alternative is selected for the bean deployment archive if any |@Alternative| stereotype of the alternative is listed.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>Each child <class> element must specify the name of a alternative bean class. If there is no class with the specified name, or if the class with the specified name is not an alternative bean class, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>Each child <stereotype> element must specify the name of a |@Alternative| stereotype annotation. If there is no annotation with the specified name, or the annotation is not a |@Alternative| stereotype, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>If the same type is listed twice under the <alternatives> element, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>For a custom implementation of the |Bean| interface defined in Section 11.1, "The Bean interface", the container calls |isAlternative()| to determine whether the bean is an alternative, and |getBeanClass()| and |getStereotypes()| to determine whether an alternative is selected in a certain bean deployment archive.</text>
+ </assertion>
</section>
- <section id="5.2.2" title="Enabled and disabled beans">
- <assertion id="a">
- <text>A bean is said to be enabled if it is not a producer method or field of a disabled bean, and it is not specialized by any other enabled bean, and either it is not an alternative, or it is a selected alternative of at least one bean deployment archive. Otherwise, the bean is said to be disabled.</text>
- </assertion>
+ <section id="5.2.2" title="Enabled and disabled beans">
+ <assertion id="a">
+ <text>A bean is said to be enabled if it is not a producer method or field of a disabled bean, and it is not specialized by any other enabled bean, and either it is not an alternative, or it is a selected alternative of at least one bean deployment archive. Otherwise, the bean is said to be disabled.</text>
+ </assertion>
</section>
<section id="5.2.3" title="Inconsistent specialization">
<assertion id="a">
<text>Suppose an enabled bean X specializes a second bean Y. If there is another enabled bean that specializes Y we say that inconsistent specialization exists. The container automatically detects inconsistent specialization and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
</assertion>
- </section>
-
+ </section>
+
<section id="5.3" title="Typesafe resolution">
<assertion id="a">
<text>A bean is eligible for injection into a given class if the bean is enabled, and the bean is either not an alternative, or is a selected alternative of the bean deployment archive of the given class, and in a Java EE or servlet container, the bean class is required to be accessible to the given class, according to the class loading requirements of the Java EE platform and Java Servlet specifications.</text>
</assertion>
-
- <assertion id="hq">
- <text>When determining the set of beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not _interceptors_ or decorators and which have a bean type that matches the required type.</text>
- </assertion>
-
- <assertion id="hb">
- <text>When determining the set of beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or _decorators_ and which have a bean type that matches the required type.</text>
- </assertion>
-
- <assertion id="hc">
- <text>When determining the set of beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have a _bean type that matches the required type_.</text>
- </assertion>
+
+ <assertion id="hq">
+ <text>When determining the set of beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not _interceptors_ or decorators and which have a bean type that matches the required type.</text>
+ </assertion>
+ <assertion id="hb">
+ <text>When determining the set of beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or _decorators_ and which have a bean type that matches the required type.</text>
+ </assertion>
+
+ <assertion id="hc">
+ <text>When determining the set of beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have a _bean type that matches the required type_.</text>
+ </assertion>
+
<group>
<text>When determining the set of beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have a bean type that matches the required type. For this purpose, primitive types are considered to match their corresponding wrapper types in |java.lang| and array types are considered to match only if their element types are identical. Parameterized and raw types are considered to match if they are identical or if the bean type is assignable to the required type, as defined in Section 5.3.3, "Assignability of raw and parameterized types".</text>
-
- <assertion id="i">
- <text>Test with a primitive type.</text>
- </assertion>
-
- <assertion id="j">
- <text>Test with an array type.</text>
- </assertion>
-
- <assertion id="ka">
- <text>Test with a parameterized type.</text>
- </assertion>
-
- <assertion id="kb">
- <text>Test with a raw type.</text>
+
+ <assertion id="i">
+ <text>Test with a primitive type.</text>
</assertion>
+
+ <assertion id="j">
+ <text>Test with an array type.</text>
+ </assertion>
+
+ <assertion id="ka">
+ <text>Test with a parameterized type.</text>
+ </assertion>
+
+ <assertion id="kb">
+ <text>Test with a raw type.</text>
+ </assertion>
<assertion id="kc">
<text>Test with a |@Named| bean.</text>
</assertion>
- </group>
+ </group>
<group>
<text>When determining the set of beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have the required qualifiers. If no required qualifiers were explicitly specified, the container assumes the required binding |@Default|. The container narrows the set of matching beans to just those where for each required qualifier, the bean declares a matching qualifier with (a) the same type and (b) the same annotation member value for each member which is not annotated |(a)javax.enterprise.inject.NonBinding| (see Section 5.3.5, "Qualifier annotations with members").</text>
-
- <assertion id="la">
- <text>Test with beans with required qualifiers.</text>
- </assertion>
-
- <assertion id="lb">
- <text>Test with beans without required qualifiers.</text>
- </assertion>
-
- <assertion id="lc">
- <text>Test with matching beans with matching qualifier with same type.</text>
- </assertion>
-
- <assertion id="ld">
- <text>Test with matching beans with matching qualifier with same annotation member value for each member which is not annotated |(a)javax.enterprise.inject.NonBinding|.</text>
+
+ <assertion id="la">
+ <text>Test with beans with required qualifiers.</text>
</assertion>
- </group>
-
- <assertion id="n">
- <text>When determining the set of beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are eligible for injection into the class that declares the injection point.</text>
- </assertion>
+
+ <assertion id="lb">
+ <text>Test with beans without required qualifiers.</text>
+ </assertion>
+
+ <assertion id="lc">
+ <text>Test with matching beans with matching qualifier with same type.</text>
+ </assertion>
+
+ <assertion id="ld">
+ <text>Test with matching beans with matching qualifier with same annotation member value for each member which is not annotated |(a)javax.enterprise.inject.NonBinding|.</text>
+ </assertion>
+ </group>
+
+ <assertion id="n">
+ <text>When determining the set of beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are eligible for injection into the class that declares the injection point.</text>
+ </assertion>
<group>
<text>For a custom implementation of the |Bean| interface defined in Section 11.1, "The Bean interface", the container calls |getTypes()| and |getQualifiers()| to determine the bean types and bindings.</text>
-
- <assertion id="na">
- <text>Test |getTypes()| determines bean types.</text>
- </assertion>
-
- <assertion id="nb">
- <text>Test |getQualifiers()| determines qualifiers.</text>
+
+ <assertion id="na">
+ <text>Test |getTypes()| determines bean types.</text>
</assertion>
- </group>
- </section>
-
- <section id="5.3.1" title="Unsatisfied and ambiguous dependencies">
- <assertion id="aa">
- <text>The container must validate all injection points of all enabled beans when the application is initialized to ensure that there are no unsatisfied or ambiguous dependencies. If an unsatisfied or ambiguous dependency exists, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- <note>These need expanding out - one for each assertion that results in an exception in 5.7.1</note>
- </assertion>
-
- <assertion id="b">
- <text>For a custom implementation of the Bean interface defined in Section 11.1, "The Bean interface", the container calls |getInjectionPoints()| to determine the injection points of the bean.</text>
- </assertion>
- </section>
-
- <section id="5.3.2" title="Legal injection point types">
- <assertion id="a">
- <text>Any legal bean type, as defined in Section 2.2.1, "Legal bean types" may be the required type of an injection point.</text>
- </assertion>
-
- <assertion id="b">
- <text>The required type of an injection point may contain a wildcard type parameter. However, a type variable is not a legal injection point type.</text>
- </assertion>
-
- <assertion id="c">
- <text>If an injection point type is a type variable, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
- </section>
-
- <section id="5.3.3" title="Assignability of raw and parameterized types">
- <assertion id="a">
- <text>A parameterized bean type is considered assignable to a raw required type if the raw types are identical and all type parameters of the bean type are either unbounded type variables or |java.lang.Object|.</text>
- </assertion>
-
- <assertion id="b">
- <text>A parameterized bean type is considered assignable to a parameterized required type if they have identical raw type and for each parameter the required type parameter and the bean type parameter are actual types with identical raw type, and, if the type is parameterized, the bean type parameter is assignable to the required type according to these rules.</text>
- </assertion>
-
- <assertion id="c">
- <text>A parameterized bean type is considered assignable to a parameterized required type if they have identical raw type and for each parameter the required type parameter is a wildcard, the bean type parameter is an actual type and the actual type is assignable to the upper bound, if any, of the wildcard and assignable from the lower bound, if any, of the wildcard.</text>
- </assertion>
-
- <assertion id="d">
- <text>A parameterized bean type is considered assignable to a parameterized required type if they have identical raw type and for each parameter the required type parameter is a wildcard, the bean type parameter is a type variable and the upper bound of the type variable is assignable to the upper bound, if any, of the wildcard and assignable from the lower bound, if any, of the wildcard.</text>
- </assertion>
-
- <assertion id="e">
- <text>A parameterized bean type is considered assignable to a parameterized required type if they have identical raw type and for each parameter the required type parameter is an actual type, the bean type parameter is a type variable and the actual type is assignable to the upper bound, if any, of the type variable.</text>
- </assertion>
-
- <assertion id="f">
- <text>A parameterized bean type is considered assignable to a parameterized required type if they have identical raw type and for each parameter the required type parameter and the bean type parameter are both type variables and the upper bound of the required type parameter is assignable to the upper bound, if any, of the bean type parameter.</text>
- </assertion>
- </section>
-
+
+ <assertion id="nb">
+ <text>Test |getQualifiers()| determines qualifiers.</text>
+ </assertion>
+ </group>
+ </section>
+
+ <section id="5.3.1" title="Unsatisfied and ambiguous dependencies">
+ <assertion id="aa">
+ <text>The container must validate all injection points of all enabled beans when the application is initialized to ensure that there are no unsatisfied or ambiguous dependencies. If an unsatisfied or ambiguous dependency exists, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ <note>These need expanding out - one for each assertion that results in an exception in 5.7.1</note>
+ </assertion>
+
+ <assertion id="b">
+ <text>For a custom implementation of the Bean interface defined in Section 11.1, "The Bean interface", the container calls |getInjectionPoints()| to determine the injection points of the bean.</text>
+ </assertion>
+ </section>
+
+ <section id="5.3.2" title="Legal injection point types">
+ <assertion id="a">
+ <text>Any legal bean type, as defined in Section 2.2.1, "Legal bean types" may be the required type of an injection point.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The required type of an injection point may contain a wildcard type parameter. However, a type variable is not a legal injection point type.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If an injection point type is a type variable, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="5.3.3" title="Assignability of raw and parameterized types">
+ <assertion id="a">
+ <text>A parameterized bean type is considered assignable to a raw required type if the raw types are identical and all type parameters of the bean type are either unbounded type variables or |java.lang.Object|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A parameterized bean type is considered assignable to a parameterized required type if they have identical raw type and for each parameter the required type parameter and the bean type parameter are actual types with identical raw type, and, if the type is parameterized, the bean type parameter is assignable to the required type according to these rules.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A parameterized bean type is considered assignable to a parameterized required type if they have identical raw type and for each parameter the required type parameter is a wildcard, the bean type parameter is an actual type and the actual type is assignable to the upper bound, if any, of the wildcard and assignable from the lower bound, if any, of the wildcard.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>A parameterized bean type is considered assignable to a parameterized required type if they have identical raw type and for each parameter the required type parameter is a wildcard, the bean type parameter is a type variable and the upper bound of the type variable is assignable to the upper bound, if any, of the wildcard and assignable from the lower bound, if any, of the wildcard.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>A parameterized bean type is considered assignable to a parameterized required type if they have identical raw type and for each parameter the required type parameter is an actual type, the bean type parameter is a type variable and the actual type is assignable to the upper bound, if any, of the type variable.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A parameterized bean type is considered assignable to a parameterized required type if they have identical raw type and for each parameter the required type parameter and the bean type parameter are both type variables and the upper bound of the required type parameter is assignable to the upper bound, if any, of the bean type parameter.</text>
+ </assertion>
+ </section>
+
<section id="5.3.4" title="Primitive types and null values">
<group>
<text>If necessary, the container performs boxing or unboxing when it injects a value to a field or parameter of primitive or wrapper type.</text>
-
- <assertion id="aa">
- <text>Test boxing.</text>
+
+ <assertion id="aa">
+ <text>Test boxing.</text>
</assertion>
-
- <assertion id="ab">
- <text>Test unboxing.</text>
+
+ <assertion id="ab">
+ <text>Test unboxing.</text>
</assertion>
- </group>
-
- <assertion id="aa">
- <text>If an injection point of primitive type resolves to a bean that may have null values, such as a producer method with a nonprimitive return type or a producer field with a non-primitive type, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4 "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="ba">
- <text>For a custom implementation of the Bean interface defined in Section 11.1, "The Bean interface", the container calls |isNullable()| to determine whether the bean may have null values.</text>
- </assertion>
- </section>
-
- <section id="5.3.5" title="Qualifier annotations with members">
- <assertion id="a" testable="false">
- <text>Qualifier types with members are supported</text>
- <note>A statement of intent</note>
- </assertion>
-
- <assertion id="b">
- <text>An annotation member may be excluded from consideration using the |@NonBinding| annotation.</text>
- </assertion>
+ </group>
+ <assertion id="aa">
+ <text>If an injection point of primitive type resolves to a bean that may have null values, such as a producer method with a nonprimitive return type or a producer field with a non-primitive type, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4 "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>For a custom implementation of the Bean interface defined in Section 11.1, "The Bean interface", the container calls |isNullable()| to determine whether the bean may have null values.</text>
+ </assertion>
+ </section>
+
+ <section id="5.3.5" title="Qualifier annotations with members">
+ <assertion id="a" testable="false">
+ <text>Qualifier types with members are supported</text>
+ <note>A statement of intent</note>
+ </assertion>
+
+ <assertion id="b">
+ <text>An annotation member may be excluded from consideration using the |@NonBinding| annotation.</text>
+ </assertion>
+
<group>
- <text>Array-valued or annotation-valued members of a qualifier type must be annotated |@NonBinding| in a portable application. If an array-valued or annotation-valued member of a binding type is not annotated |@NonBinding|, non-portable behavior results.</text>
-
- <assertion id="d">
- <text>Test with an array-valued member.</text>
- </assertion>
-
- <assertion id="e">
- <text>Test with an annotation-valued member.</text>
+ <text>Array-valued or annotation-valued members of a qualifier type must be annotated |@NonBinding| in a portable application. If an array-valued or annotation-valued member of a binding type is not annotated |@NonBinding|, non-portable behavior results.</text>
+
+ <assertion id="d">
+ <text>Test with an array-valued member.</text>
</assertion>
- </group>
- </section>
-
- <section id="5.3.6" title="Multiple qualifiers">
- <assertion id="a">
- <text>A bean class may declare multiple qualifiers.</text>
- </assertion>
-
- <assertion id="b">
- <text>A producer method may declare multiple qualifiers.</text>
- </assertion>
-
- <assertion id="c">
- <text>A producer field may declare multiple qualifiers.</text>
- </assertion>
-
- <assertion id="d">
- <text>A bean must declare all of the qualifiers that are specified at the injection point to be considered a candidate for injection.</text>
- </assertion>
- </section>
-
- <section id="5.4" title="EL Name resolution">
-
- <assertion id="baa">
- <text>When resolving a bean by name, the container identifies the set of matching beans which have the given EL name, and are enabled, and are either not an alternative, or is a selected alternative of the war containing the JSP or JSF page with the EL expression, and are accessible to classes in the war containing the JSP or JSF page with the EL expression, according to the class loading requirements of the Java EE platform and Java Servlet specifications, and which are not a policy or an enabled policy of the war containing the JSP or JSF page with the EL expression.</text>
- </assertion>
-
- <assertion id="e">
- <text>For a custom implementation of the Bean interface defined in Section 11.1, "The Bean interface", the container calls |getName()| to determine the bean EL name.</text>
- </assertion>
- </section>
-
- <section id="5.4.1" title="Ambiguous EL names">
- <assertion id="ca">
- <text>An ambiguous EL name exists in an EL expression when there are multiple beans which match the given EL name. When an ambiguous EL name exists, the container attempts to resolve the ambiguity - if any matching beans are alternatives, the container eliminates all matching beans that are not alternatives.If there is exactly one bean remaining, the container will select this bean, and the ambiguous name is called resolvable.</text>
- </assertion>
-
- <assertion id="da">
- <text>All unresolvable ambiguous EL names are detected by the container when the application is initialized. Suppose two beans are both accessible to classes in a certain war, according to the class loading requirements of the Java EE platform and Java Servlet specifications. If each bean is either not an alternative, or is a selected alternative of the war, and either _the two beans have the same EL name and the name is not resolvable_, or the EL name of one bean is of the form x.y, where y is a valid bean EL name, and x is the EL name of the other bean, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="db">
- <text>All unresolvable ambiguous EL names are detected by the container when the application is initialized. Suppose two beans are both accessible to classes in a certain war, according to the class loading requirements of the Java EE platform and Java Servlet specifications. If each bean is either not an alternative, or is a selected alternative of the war, and either the two beans have the same EL name and the name is not resolvable, _or the EL name of one bean is of the form x.y, where y is a valid bean EL name, and x is the EL name of the other bean_, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
- </section>
-
- <section id="5.5" title="Client proxies">
- <assertion id="a" testable="false">
- <text>Client proxies are never required for a bean whose scope is a pseudo-scope such as |@Dependent|</text>
- </assertion>
-
- <assertion id="b">
- <text>A contextual reference to a bean with a normal scope, as defined in Section 6.3, “Normal scopes and pseudo-scopes”, is not a direct reference to a contextual instaContextual.create()textual reference is a client proxy object.</text>
- </assertion>
-
- <assertion id="c" implied="true">
- <text>Client proxies are serializable</text>
- <note>For "client proxies are may be passivated, even when the bean itself may not be. Therefore the container must use a client proxy whenever a bean with normal scope is injected into a bean with a passivating scope" to hold true the client proxy must be serializable</note>
- </assertion>
-
- <assertion id="d">
- <text>The container must guarantee that when any valid injected reference to a bean of normal scope is invoked, the invocation is always processed by the current instance of the injected bean.</text>
- </assertion>
- </section>
-
- <section id="5.5.1" title="Unproxyable bean types">
- <assertion id="aa">
- <text>Classes which don't have a non-private constructor with no parameters cannot be proxied by the container. If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="baa">
- <text>Classes which are declared final ~or have final methods~ cannot be proxied by the container. If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="bba">
- <text>Classes which ~are declared final or ~have final methods cannot be proxied by the container. If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="ca">
- <text>Primitive types cannot be proxied by the container. If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="da">
- <text>Array types cannot be proxied by the container. If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
- </section>
-
- <section id="5.5.2" title="Client proxy invocation">
- <assertion id="aa">
- <text>Every time a method of the bean is invoked upon a client proxy, the client proxy must obtain a contextual instance of the bean, as defined in Section 6.5.2, "Contextual instance of a bean", and invoke the method upon this instance.</text>
- </assertion>
-
- <assertion id="ab">
- <text>If the scope is not active, as specified in Section 6.5.1, "The active context object for a scope", the client proxy rethrows |ContextNotActiveException| or |IllegalStateException|.</text>
- </assertion>
-
- <assertion id="b" testable="false">
- <text>The behavior of all methods declared by |java.lang.Object|, except for |toString()|, is undefined for a client proxy</text>
- </assertion>
-
- </section>
-
- <section id="5.6" title="Dependency injection">
- <assertion id="a">
- <text>The container is required to perform dependency injection whenever it creates a contextual instance of a session bean.</text>
- </assertion>
-
- <assertion id="b">
- <text>The container is required to perform dependency injection whenever it creates a contextual instance of a managed bean.</text>
- </assertion>
-
- <assertion id="c">
- <text>The container is required to perform dependency injection whenever it instantiates non-contextual instances of session beans (for example, session beans obtained by the application from JNDI or injected using |@EJB|).</text>
- </assertion>
-
- <assertion id="d">
- <text>The container is required to perform dependency injection whenever it instantiates non-contextual instances of managed beans.</text>
- </assertion>
-
- <group>
- <text>The container is required to perform dependency injection whenever it instantiates instances of any other Java EE component class supporting injection.</text>
- <assertion id="ea">
- <text>Test injection into a servlet listener</text>
- </assertion>
- <assertion id="eb">
- <text>Test injection into a tag handler</text>
- </assertion>
- <assertion id="ec">
- <text>Test injection into a tag library listener</text>
- </assertion>
- <assertion id="ed">
- <text>Test injection into an EJB Interceptor</text>
- </assertion>
- <assertion id="ee">
- <text>Test injection into a WS endpoint</text>
- </assertion>
- <assertion id="ef">
- <text>Test injection into a servlet</text>
- </assertion>
- <assertion id="eg">
- <text>Test injection into a filter</text>
- </assertion>
- </group>
-
- <assertion id="f" testable="false">
- <text>In a Java EE 5 environment, the container is not required to support injection for non-contextual objects.</text>
- </assertion>
-
- <assertion id="g">
- <text>The container interacts with instances of beans and other Java EE component classes supporting injection by calling methods and getting and setting the field values.</text>
- </assertion>
- </section>
-
- <section id="5.6.1" title="Injectable references">
- <assertion id="aa">
- <text>To obtain an injectable reference for an injection point, the container must identify a bean according to the rules defined in Section 5.3, "Typesafe resolution" and resolving ambiguities according to Section 5.3.1, "Unsatisfied and ambiguous dependencies", then obtain a contextual reference for this bean and the type of the injection point according to Section 6.5.3, "Contextual reference for a bean".</text>
- </assertion>
-
- <assertion id="g">
- <text>For certain combinations of scopes, the container is permitted to optimize the above procedure by directly injecting a contextual instance of the bean, as defined in Section 6.5.2, "Contextual instance of a bean". If an incompletely initialized instance of the bean is registered with the current |CreationalContext|, as defined in Section
-6.1, "The Contextual interface", the container is permitted to directly inject this instance. However, in performing these optimizations, the container must respect the rules of injected reference validity.</text>
- </assertion>
- </section>
-
- <section id="5.6.2" title="Injected reference validity">
- <assertion id="d">
- <text>A reference to a bean injected into a field, bean constructor or initializer method is valid until the object into which it was injected is destroyed.</text>
- </assertion>
-
- <assertion id="e">
- <text>A reference to a bean injected into a producer method is valid until the producer method bean instance that is being produced is destroyed.</text>
- </assertion>
-
- <assertion id="f">
- <text>A reference to a bean injected into a disposer method or observer method is valid until the invocation of the method completes.</text>
- </assertion>
-
- <assertion id="g" testable="false">
- <text>The application should not invoke a method of an invalid reference. If the application invokes a method of an invalid injected reference, the behavior is undefined.</text>
- </assertion>
- </section>
-
- <section id="5.6.3" title="Injection using the bean constructor">
- <assertion id="a">
- <text>When the container instantiates a managed bean with a constructor annotated |@Inject|, the container calls this constructor, passing an injectable reference to each parameter. If there is no constructor annotated |@Inject|, the container calls the constructor with no parameters.</text>
- </assertion>
- </section>
-
- <section id="5.6.4" title="Injection of fields and initializer methods">
- <assertion id="a">
- <text>When the container creates a new instance of a managed bean, session bean, or of any other Java EE component class supporting injection, the container must initialize the values of all injected fields after injection of Java EE component environment resources has been performed and before the |@PostConstruct| callback occurs and before the servlet |init()| method is called. The container sets the value of each injected field to an injectable reference.</text>
- </assertion>
-
- <assertion id="b">
- <text>After the container initializes the values of the injected fields, it must call all initializer methods, passing an injectable reference to each parameter.</text>
- </assertion>
- </section>
-
- <section id="5.6.5" title="Destruction of dependent objects">
- <assertion id="a">
- <text>When the container destroys an instance of a bean or of any Java EE component class supporting injection, the container destroys all dependent objects, as defined in Section 6.4.2, "Dependent object destruction", after the |@PreDestroy| callback completes and after the servlet |destroy()| method is called.</text>
- </assertion>
- </section>
-
- <section id="5.6.6" title="Invocation of producer or disposal methods">
- <assertion id="a">
- <text>When the container calls a producer method, if the method is static, the container must invoke the method.</text>
- </assertion>
-
- <assertion id="b">
- <text>When the container calls a disposal method, if the method is static, the container must invoke the method.</text>
- </assertion>
-
- <assertion id="c">
- <text>When the container calls a producer method, if the method is non-static the container must obtain a contextual instance of the most specialized bean, as defined by Section 6.5.2 "Contextual instance of a bean", then invoke the method upon this instance.</text>
- </assertion>
-
- <assertion id="d">
- <text>When the container calls a disposal method, if the method is non-static the container must obtain a contextual instance of the most specialized bean, as defined by Section 6.5.2 "Contextual instance of a bean", then invoke the method upon this instance.</text>
- </assertion>
-
- <assertion id="e">
- <text>The container passes an injectable reference to each injected method parameter. The container is also responsible for destroying dependent objects created during this invocation, as defined in Section 6.4.3 "Dependent object destruction".</text>
- </assertion>
- </section>
-
- <section id="5.6.7" title="Access to producer field values">
- <assertion id="a">
- <text>When the container accesses the value of a producer field, if the producer field is static, the container must access the field value.</text>
- </assertion>
-
- <assertion id="b">
- <text>When the container accesses the value of a producer field, if the producer field is non-static, the container must obtain a contextual instance of the most specialized bean, as defined by Section 6.5.2 "Contextual instance of a bean", then access the field value of this instance.</text>
- </assertion>
- </section>
-
- <section id="5.6.8" title="Invocation of observer methods">
- <assertion id="a">
- <text>When the container calls an observer method (defined in Section 10.4 "Observer methods"), if the observer method is static, the container must invoke the method.</text>
- </assertion>
-
- <assertion id="baa">
- <text>When the container calls an observer method (defined in Section 10.5 "Observer methods"), if the observer method is non-static, the container must obtain a contextual instance of the bean according to Section 6.5.2 "Contextual instance of a bean". If this observer method is a conditional observer method, obtain the contextual instance that already exists, only if the scope of the bean that declares the observer method is currently active, without creating a new contextual instance. Finally, the container must invoke the observer method on the resulting instance, if any, as a business method invocation, as defined in Section 7.2 "Container invocations and interception".</text>
- </assertion>
-
- <assertion id="c">
- <text>The container must pass the event object to the event parameter and an injectable instance to each injected method parameter.</text>
- </assertion>
-
- <assertion id="d">
- <text>The container is also responsible for destroying dependent objects created during this invocation, as defined in Section 6.4.2, "Dependent object destruction".</text>
- </assertion>
- </section>
-
- <section id="5.6.9" title="Injection point metadata">
- <assertion id="aa">
- <text>The |javax.enterprise.inject.spi.InjectionPoint.getBean()| method returns the Bean object representing the bean that defines the injection point. If the injection point does not belong to a bean, |getBean()| returns a null value.</text>
- </assertion>
-
- <assertion id="ba">
- <text>The |javax.enterprise.inject.spi.InjectionPoint.getType()| method returns the declared type of the injection point.</text>
- </assertion>
-
- <assertion id="bc">
- <text>The |javax.enterprise.inject.spi.InjectionPoint.getQualifiers()| method returns the declared qualifiers of the injection point.</text>
- </assertion>
-
- <assertion id="ca">
- <text>The |javax.enterprise.inject.spi.InjectionPoint.getMember()| method returns the |Field| object in the case of field injection.</text>
- </assertion>
-
- <assertion id="cb">
- <text>The |javax.enterprise.inject.spi.InjectionPoint.getMember()| method returns the |Method| object in the case of method parameter injection.</text>
- </assertion>
-
- <assertion id="cc">
- <text>The |javax.enterprise.inject.spi.InjectionPoint.getMember()| method returns the |Constructor| object in the case of constructor parameter injection.</text>
- </assertion>
-
- <assertion id="daa">
- <text>The |getAnnotated()| method returns an instance of |javax.enterprise.inject.spi.AnnotatedField| or |javax.enterprise.inject.spi.AnnotatedParameter|, depending upon whether the injection point is an injected field or a constructor/method parameter.</text>
- </assertion>
-
- <assertion id="dba">
- <text>The |isDelegate()| method returns true if the injection point is a decorator delegate injection point, and false otherwise.</text>
- </assertion>
-
- <assertion id="dca">
- <text>The |isTransient()| method returns true if the injection point is a transient field, and false otherwise.</text>
- </assertion>
-
- <assertion id="ea">
- <text>The container must provide a bean with scope |@Dependent|, bean type |InjectionPoint| and qualifier |@Default|, allowing dependent objects, as defined in Section 6.4.1, "Dependent objects", to obtain information about the injection point to which they belong.</text>
- </assertion>
-
- <assertion id="eb">
- <text>The built-in implementation must be a passivation capable dependency, as defined in Section 6.6.2, "Passivation capable dependencies".</text>
- </assertion>
-
- <assertion id="f">
- <text>If a bean that declares any scope other than |@Dependent| has an injection point of type |InjectionPoint| and binding |@Default|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="ga">
- <text>If a Java EE component class supporting injection that is not a bean has an injection point of type |InjectionPoint| and binding |@Default|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
- </section>
-
- <section id="5.7" title="Programmatic lookup">
- <assertion id="aa">
- <text>An instance of the |javax.enterprise.inject.Instance| interface may be injected.</text>
- </assertion>
-
- <assertion id="ba">
- <text>The method |javax.enterprise.inject.Instance.get()| returns a contextual reference.</text>
- </assertion>
-
- <assertion id="ca">
- <text>Any combination of qualifiers may be specified at the injection point.</text>
- </assertion>
-
- <assertion id="da">
- <text>The |@Any| qualifier may be used to allow the application to specify qualifiers dynamically.</text>
- </assertion>
- </section>
-
- <section id="5.7.1" title="The Instance interface">
- <assertion id="aa">
- <text>The |Instance| interface provides a method for obtaining instances of beans with a specified combination of required type and qualifiers, and inherites the ability to iterate beans with that combination of required type and qualifiers from |java.lang.Iterable|.</text>
- </assertion>
-
- <assertion id="ab">
- <text>For an injected |Instance|, the required type is the type parameter specified at the injection point, and the required qualifiers are the qualifiers specified at the injection point.</text>
- </assertion>
-
- <assertion id="ba">
- <text>The |select()| method returns a child |Instance| for a given required type and additional required qualifiers. If no required type is given, the required type is the same as the parent.</text>
- </assertion>
-
- <assertion id="da">
- <text>If two instances of the same qualifier type are passed to |select()|, an |IllegalArgumentException| is thrown.</text>
- </assertion>
-
- <assertion id="e">
- <text>If an instance of an annotation that is not a qualifier type is passed to |select()|, an |IllegalArgumentException| is thrown.</text>
- </assertion>
-
- <assertion id="fa">
- <text>The |get()| method must identify a bean that matches the required type and required qualifiers and is accessible to the class into which the parent |Instance| was injected, according to the rules of typesafe resolution, as defined in Section 5.3, "Typesafe resolution" and resolving ambiguities according to Section 5.3.1, "Unsatisfied and ambiguous dependencies".</text>
- </assertion>
-
- <assertion id="fba">
- <text>If typesafe resolution results in an unsatisfied dependency, throw an |UnsatisfiedResolutionException|.</text>
- </assertion>
-
- <assertion id="fbb">
- <text>If typesafe resolution results in an unresolvable ambiguous dependency, throw an |AmbiguousResolutionException|.</text>
- </assertion>
-
- <assertion id="fc">
- <text>Otherwise, obtain a contextual reference for the bean and the required type, as defined in Section 6.5.3, "Contextual reference for a bean".</text>
- </assertion>
-
- <assertion id="ja">
- <text>The |iterator()| method must identify the set of beans that match the required type and required qualifiers and are accessible to the class into which the parent |Instance| was injected, according to the rules of typesafe resolution, as defined in Section 5.3, "Typesafe resolution".</text>
- </assertion>
-
- <assertion id="ka">
- <text>The |iterator()| method must return an |Iterator|, that iterates over the set of contextual references for the resulting beans and required type, as defined in Section 6.5.3, "Contextual reference for a bean".</text>
- </assertion>
-
- <assertion id="l">
- <text>The method |isUnsatisfied()| returns true if there is no bean that matches the required type and qualifiers, or false otherwise.</text>
- </assertion>
-
- <assertion id="m">
- <text>The method |isAmbiguous()| returns true if there is more than one bean that matches the required type and qualifiers, or false otherwise.</text>
- </assertion>
- </section>
-
- <section id="5.7.2" title="The built-in Instance">
- <assertion id="a">
- <text>The container must provide a built-in bean with |Instance<X>| and |Provider<X>| for every legal bean type |x| in its set of bean types.</text>
- </assertion>
-
- <assertion id="b">
- <text>The container must provide a built-in bean with every qualifier type in its set of qualifier types.</text>
- </assertion>
-
- <assertion id="d">
- <text>The container must provide a built-in bean with scope @Dependent.</text>
- </assertion>
-
- <assertion id="e">
- <text>The container must provide a built-in bean with no bean EL name.</text>
- </assertion>
-
- <assertion id="f">
- <text>The container must provide a built-in bean with an implementation provided automatically by the container. </text>
- </assertion>
-
- <assertion id="g">
- <text>The built-in implementation must be a passivation capable dependency, as defined in Section 6.6.2, "Passivation capable dependencies".</text>
- </assertion>
- </section>
-
- <section id="5.7.3" title="Using AnnotationLiteral and TypeLiteral">
-
- </section>
-
- <section id="5.8" title="Integration with Unified EL">
- <assertion id="aaa">
- <text>The container must provide a Unified EL ELResolver to the servlet engine ~and JSF implementation~ that resolves bean EL names using the rules of name resolution algorithm defined in Section 5.4 "EL name resolution" and resolving ambiguities according to Section 5.4.1, "Ambiguous EL names".</text>
- <note>This is testable implicitly by trying to resolve using EL from a servlet</note>
- </assertion>
-
- <assertion id="aba">
- <text>The container must provide a Unified EL |ELResolver| to the ~servlet engine~ and JSF implementation that resolves bean EL names using the rules of name resolution algorithm defined in Section 5.4 "EL name resolution" and resolving ambiguities according to Section 5.4.1, "Ambiguous EL names".</text>
- <note>This is testable implicitly by trying to resolve using EL from a JSF view</note>
- </assertion>
-
- <assertion id="bb">
- <text>If a name used in an EL expression does not resolve to any bean, the |ELResolver| must return a null value.</text>
- </assertion>
-
- <assertion id="bc">
- <text>Otherwise, if a name used in an EL expression resolves to exactly one bean, the |ELResolver| must return a contextual instance of the bean, as defined in Section 6.5.2, "Contextual instance of a bean".</text>
- </assertion>
- </section>
-
- <section id="6" title="Scopes and contexts">
-
- </section>
-
- <section id="6.1" title="The Contextual interface">
- <assertion id="a0">
- <text>If an exception occurs while creating an instance, the exception is rethrown by the |create()| method. If the exception is a checked exception, it must be wrapped and rethrown as an (unchecked) |CreationException|.</text>
- </assertion>
-
- <assertion id="a1">
- <text>If an exception occurs while destroying an instance, the exception must be caught by the |destroy()| method.</text>
- </assertion>
-
- <assertion id="a2" testable="false">
- <text>If the application invokes a contextual instance after it has been destroyed, the behavior is undefined.</text>
- <note>A statement about container specific behavior which is not spec defined</note>
- </assertion>
-
- <assertion id="a" testable="false">
- <text>The container and portable extensions may define implementations of the |Contextual| interface that do not extend |Bean|, but it is not recommended that applications directly implement |Contextual|.</text>
- <note>Advice only</note>
- </assertion>
- </section>
-
- <section id="6.1.1" title="The CreationalContext interface">
- <assertion id="ca" testable="false">
- <text>The interface |javax.enterprise.context.spi.CreationalContext| provides operations that are used by the |Contextual| implementation during instance creation and destruction.</text>
- <note>introductory text</note>
- </assertion>
-
- <assertion id="d">
- <text>|push()| registers an incompletely initialized contextual instance with the container. A contextual instance is considered incompletely initialized until it is returned by the |create()| method.</text>
- </assertion>
-
- <assertion id="e">
- <text>|release()| destroys all dependent objects, as defined in Section 6.4.1, "Dependent objects", of the instance which is being destroyed, by passing each dependent object to the |destroy()| method of its |Contextual| object.</text>
- </assertion>
-
- <assertion id="f" testable="false">
- <text>The implementation of |Contextual| is not required to call |push()|. However, for certain bean scopes, invocation of |push()| between instantiation and injection helps the container minimize the use of client proxy objects (which would otherwise be required to allow circular dependencies).</text>
- </assertion>
-
- <assertion id="g">
- <text>If |Contextual.create()| calls |push()|, it must also return the instance passed to |push()|.</text>
- </assertion>
-
- <assertion id="h" testable="false">
- <text>|Contextual.create()| should use the given |CreationalContext| when obtaining contextual references to inject, as defined in Section 6.5.3, "Contextual reference for a bean", in order to ensure that any dependent objects are associated with the contextual instance that is being created.</text>
- <note>Advice</note>
- </assertion>
-
- <assertion id="i" testable="false">
- <text>|Contextual.destroy()| should call |release()| to allow the container to destroy dependent objects of the contextual instance.</text>
- <note>Advice</note>
- </assertion>
- </section>
-
- <section id="6.2" title="The Context interface">
- <assertion id="aa" testable="false">
- <text>The |javax.enterprise.context.spi.Context| interface provides an operation for obtaining contextual instances with a particular scope of any contextual type.</text>
- <note>Introductory text</note>
- </assertion>
-
- <assertion id="ab">
- <text>The method |getScope()| returns the scope type of the context object.</text>
- </assertion>
-
- <assertion id="ha">
- <text>When a context object is active the |isActive()| method returns |true|. Otherwise, we say that the context object is inactive and the |isActive()| method returns false.</text>
- </assertion>
-
- <assertion id="j">
- <text>The |Context.get()| method may either return an existing instance of the given contextual type, ~or if no |CreationalContext| is given, return a null value, or if a |CreationalContext| is given, create a new instance of the given contextual type by calling |Contextual.create()| and return the new instance~.</text>
- </assertion>
-
- <assertion id="k">
- <text>The |Context.get()| method may either ~return an existing instance of the given contextual type~, or if no |CreationalContext| is given, return a null value, ~or if a |CreationalContext| is given, create a new instance of the given contextual type by calling |Contextual.create()| and return the new instance~.</text>
- </assertion>
-
- <assertion id="l">
- <text>The |Context.get()| method may either ~return an existing instance of the given contextual type, or if no |CreationalContext| is given, return a null value~, or if a |CreationalContext| is given, create a new instance of the given contextual type by calling |Contextual.create()| and return the new instance.</text>
- </assertion>
-
- <assertion id="m">
- <text>If the context object is inactive, the |get()| method must throw a |ContextNotActiveException|.</text>
- </assertion>
-
- <assertion id="na">
- <text>The |get()| method may not return a null value _unless no |CreationalContext| is given_, or |Contextual.create()| returns a null value.</text>
- </assertion>
-
- <assertion id="nb">
- <text>The |get()| method may not return a null value unless no |CreationalContext| is given, or _|Contextual.create()| returns a null value_.</text>
- </assertion>
-
- <assertion id="o">
- <text>The |get()| method may not create a new instance of the given contextual type unless a |CreationalContext| is given.</text>
- </assertion>
-
- <assertion id="p">
- <text>The context object is responsible for destroying any contextual instance it creates by passing the instance to the |destroy()| method of the Contextual object representing the contextual type.</text>
- </assertion>
-
- <assertion id="q">
- <text>A destroyed instance must not subsequently be returned by the |get()| method.</text>
- </assertion>
-
- <assertion id="r">
- <text>The context object must pass the same instance of |CreationalContext| to |Contextual.destroy()| that it passed to |Contextual.create()| when it created the instance.</text>
- </assertion>
- </section>
-
- <section id="6.3" title="Normal scopes and pseudo-scopes">
- <assertion id="a" testable="false">
- <text>There may be no more than one mapped instance of a context object per contextual type per thread</text>
- <note>Not testable through API</note>
- </assertion>
-
- <assertion id="b" testable="false">
- <text>A context may be associated with one or more threads</text>
- <note>A statement of intent</note>
- </assertion>
-
- <assertion id="c">
- <text>The |get()| operation of the |Context| object for an active normal scope returns the current instance of the given contextual type.</text>
- </assertion>
-
- <assertion id="d">
- <text>When a context is destroyed, all mapped instances belonging to that context are destroyed by passing them to the |Contextual.destroy()| method.</text>
- </assertion>
-
- <assertion id="e">
- <text>Contexts with normal scopes must obey the following rule: Suppose beans A, B and Z all have normal scopes. Suppose A has an injection point x, and B has an injection point y. Suppose further that both x and y resolve to bean Z according to the typesafe resolution algorithm. If a is the current instance of A, and b is the current instance of B, then both a.x and b.y refer to the same instance of Z. This instance is the current instance of Z.</text>
+
+ <assertion id="e">
+ <text>Test with an annotation-valued member.</text>
+ </assertion>
+ </group>
+ </section>
+
+ <section id="5.3.6" title="Multiple qualifiers">
+ <assertion id="a">
+ <text>A bean class may declare multiple qualifiers.</text>
</assertion>
+
+ <assertion id="b">
+ <text>A producer method may declare multiple qualifiers.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A producer field may declare multiple qualifiers.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>A bean must declare all of the qualifiers that are specified at the injection point to be considered a candidate for injection.</text>
+ </assertion>
+ </section>
+
+ <section id="5.4" title="EL Name resolution">
+
+ <assertion id="baa">
+ <text>When resolving a bean by name, the container identifies the set of matching beans which have the given EL name, and are enabled, and are either not an alternative, or is a selected alternative of the war containing the JSP or JSF page with the EL expression, and are accessible to classes in the war containing the JSP or JSF page with the EL expression, according to the class loading requirements of the Java EE platform and Java Servlet specifications, and which are not a policy or an enabled policy of the war containing the JSP or JSF page with the EL expression.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>For a custom implementation of the Bean interface defined in Section 11.1, "The Bean interface", the container calls |getName()| to determine the bean EL name.</text>
+ </assertion>
+ </section>
+
+ <section id="5.4.1" title="Ambiguous EL names">
+ <assertion id="ca">
+ <text>An ambiguous EL name exists in an EL expression when there are multiple beans which match the given EL name. When an ambiguous EL name exists, the container attempts to resolve the ambiguity - if any matching beans are alternatives, the container eliminates all matching beans that are not alternatives.If there is exactly one bean remaining, the container will select this bean, and the ambiguous name is called resolvable.</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>All unresolvable ambiguous EL names are detected by the container when the application is initialized. Suppose two beans are both accessible to classes in a certain war, according to the class loading requirements of the Java EE platform and Java Servlet specifications. If each bean is either not an alternative, or is a selected alternative of the war, and either _the two beans have the same EL name and the name is not resolvable_, or the EL name of one bean is of the form x.y, where y is a valid bean EL name, and x is the EL name of the other bean, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ <assertion id="db">
+ <text>All unresolvable ambiguous EL names are detected by the container when the application is initialized. Suppose two beans are both accessible to classes in a certain war, according to the class loading requirements of the Java EE platform and Java Servlet specifications. If each bean is either not an alternative, or is a selected alternative of the war, and either the two beans have the same EL name and the name is not resolvable, _or the EL name of one bean is of the form x.y, where y is a valid bean EL name, and x is the EL name of the other bean_, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="5.5" title="Client proxies">
+ <assertion id="a" testable="false">
+ <text>Client proxies are never required for a bean whose scope is a pseudo-scope such as |@Dependent|</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A contextual reference to a bean with a normal scope, as defined in Section 6.3, “Normal scopes and pseudo-scopes”, is not a direct reference to a contextual instaContextual.create()textual reference is a client proxy object.</text>
+ </assertion>
+
+ <assertion id="c" implied="true">
+ <text>Client proxies are serializable</text>
+ <note>For "client proxies are may be passivated, even when the bean itself may not be. Therefore the container must use a client proxy whenever a bean with normal scope is injected into a bean with a passivating scope" to hold true the client proxy must be serializable</note>
+ </assertion>
+
+ <assertion id="d">
+ <text>The container must guarantee that when any valid injected reference to a bean of normal scope is invoked, the invocation is always processed by the current instance of the injected bean.</text>
+ </assertion>
+ </section>
+
+ <section id="5.5.1" title="Unproxyable bean types">
+ <assertion id="aa">
+ <text>Classes which don't have a non-private constructor with no parameters cannot be proxied by the container. If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="baa">
+ <text>Classes which are declared final ~or have final methods~ cannot be proxied by the container. If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="bba">
+ <text>Classes which ~are declared final or ~have final methods cannot be proxied by the container. If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>Primitive types cannot be proxied by the container. If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>Array types cannot be proxied by the container. If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="5.5.2" title="Client proxy invocation">
+ <assertion id="aa">
+ <text>Every time a method of the bean is invoked upon a client proxy, the client proxy must obtain a contextual instance of the bean, as defined in Section 6.5.2, "Contextual instance of a bean", and invoke the method upon this instance.</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>If the scope is not active, as specified in Section 6.5.1, "The active context object for a scope", the client proxy rethrows |ContextNotActiveException| or |IllegalStateException|.</text>
+ </assertion>
+
+ <assertion id="b" testable="false">
+ <text>The behavior of all methods declared by |java.lang.Object|, except for |toString()|, is undefined for a client proxy</text>
+ </assertion>
+
+ </section>
+
+ <section id="5.6" title="Dependency injection">
+ <assertion id="a">
+ <text>The container is required to perform dependency injection whenever it creates a contextual instance of a session bean.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The container is required to perform dependency injection whenever it creates a contextual instance of a managed bean.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The container is required to perform dependency injection whenever it instantiates non-contextual instances of session beans (for example, session beans obtained by the application from JNDI or injected using |@EJB|).</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The container is required to perform dependency injection whenever it instantiates non-contextual instances of managed beans.</text>
+ </assertion>
+
+ <group>
+ <text>The container is required to perform dependency injection whenever it instantiates instances of any other Java EE component class supporting injection.</text>
+ <assertion id="ea">
+ <text>Test injection into a servlet listener</text>
+ </assertion>
+ <assertion id="eb">
+ <text>Test injection into a tag handler</text>
+ </assertion>
+ <assertion id="ec">
+ <text>Test injection into a tag library listener</text>
+ </assertion>
+ <assertion id="ed">
+ <text>Test injection into an EJB Interceptor</text>
+ </assertion>
+ <assertion id="ee">
+ <text>Test injection into a WS endpoint</text>
+ </assertion>
+ <assertion id="ef">
+ <text>Test injection into a servlet</text>
+ </assertion>
+ <assertion id="eg">
+ <text>Test injection into a filter</text>
+ </assertion>
+ </group>
+
+ <assertion id="f" testable="false">
+ <text>In a Java EE 5 environment, the container is not required to support injection for non-contextual objects.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The container interacts with instances of beans and other Java EE component classes supporting injection by calling methods and getting and setting the field values.</text>
+ </assertion>
+ </section>
+
+ <section id="5.6.1" title="Injectable references">
+ <assertion id="aa">
+ <text>To obtain an injectable reference for an injection point, the container must identify a bean according to the rules defined in Section 5.3, "Typesafe resolution" and resolving ambiguities according to Section 5.3.1, "Unsatisfied and ambiguous dependencies", then obtain a contextual reference for this bean and the type of the injection point according to Section 6.5.3, "Contextual reference for a bean".</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>For certain combinations of scopes, the container is permitted to optimize the above procedure by directly injecting a contextual instance of the bean, as defined in Section 6.5.2, "Contextual instance of a bean". If an incompletely initialized instance of the bean is registered with the current |CreationalContext|, as defined in Section
+6.1, "The Contextual interface", the container is permitted to directly inject this instance. However, in performing these optimizations, the container must respect the rules of injected reference validity.</text>
+ </assertion>
+ </section>
+
+ <section id="5.6.2" title="Injected reference validity">
+ <assertion id="d">
+ <text>A reference to a bean injected into a field, bean constructor or initializer method is valid until the object into which it was injected is destroyed.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>A reference to a bean injected into a producer method is valid until the producer method bean instance that is being produced is destroyed.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A reference to a bean injected into a disposer method or observer method is valid until the invocation of the method completes.</text>
+ </assertion>
+
+ <assertion id="g" testable="false">
+ <text>The application should not invoke a method of an invalid reference. If the application invokes a method of an invalid injected reference, the behavior is undefined.</text>
+ </assertion>
+ </section>
+
+ <section id="5.6.3" title="Injection using the bean constructor">
+ <assertion id="a">
+ <text>When the container instantiates a managed bean with a constructor annotated |@Inject|, the container calls this constructor, passing an injectable reference to each parameter. If there is no constructor annotated |@Inject|, the container calls the constructor with no parameters.</text>
+ </assertion>
+ </section>
+
+ <section id="5.6.4" title="Injection of fields and initializer methods">
+ <assertion id="a">
+ <text>When the container creates a new instance of a managed bean, session bean, or of any other Java EE component class supporting injection, the container must initialize the values of all injected fields after injection of Java EE component environment resources has been performed and before the |@PostConstruct| callback occurs and before the servlet |init()| method is called. The container sets the value of each injected field to an injectable reference.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>After the container initializes the values of the injected fields, it must call all initializer methods, passing an injectable reference to each parameter.</text>
+ </assertion>
+ </section>
+
+ <section id="5.6.5" title="Destruction of dependent objects">
+ <assertion id="a">
+ <text>When the container destroys an instance of a bean or of any Java EE component class supporting injection, the container destroys all dependent objects, as defined in Section 6.4.2, "Dependent object destruction", after the |@PreDestroy| callback completes and after the servlet |destroy()| method is called.</text>
+ </assertion>
+ </section>
+
+ <section id="5.6.6" title="Invocation of producer or disposal methods">
+ <assertion id="a">
+ <text>When the container calls a producer method, if the method is static, the container must invoke the method.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When the container calls a disposal method, if the method is static, the container must invoke the method.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>When the container calls a producer method, if the method is non-static the container must obtain a contextual instance of the most specialized bean, as defined by Section 6.5.2 "Contextual instance of a bean", then invoke the method upon this instance.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>When the container calls a disposal method, if the method is non-static the container must obtain a contextual instance of the most specialized bean, as defined by Section 6.5.2 "Contextual instance of a bean", then invoke the method upon this instance.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The container passes an injectable reference to each injected method parameter. The container is also responsible for destroying dependent objects created during this invocation, as defined in Section 6.4.3 "Dependent object destruction".</text>
+ </assertion>
+ </section>
+
+ <section id="5.6.7" title="Access to producer field values">
+ <assertion id="a">
+ <text>When the container accesses the value of a producer field, if the producer field is static, the container must access the field value.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When the container accesses the value of a producer field, if the producer field is non-static, the container must obtain a contextual instance of the most specialized bean, as defined by Section 6.5.2 "Contextual instance of a bean", then access the field value of this instance.</text>
+ </assertion>
+ </section>
+
+ <section id="5.6.8" title="Invocation of observer methods">
+ <assertion id="a">
+ <text>When the container calls an observer method (defined in Section 10.4 "Observer methods"), if the observer method is static, the container must invoke the method.</text>
+ </assertion>
+
+ <assertion id="baa">
+ <text>When the container calls an observer method (defined in Section 10.5 "Observer methods"), if the observer method is non-static, the container must obtain a contextual instance of the bean according to Section 6.5.2 "Contextual instance of a bean". If this observer method is a conditional observer method, obtain the contextual instance that already exists, only if the scope of the bean that declares the observer method is currently active, without creating a new contextual instance. Finally, the container must invoke the observer method on the resulting instance, if any, as a business method invocation, as defined in Section 7.2 "Container invocations and interception".</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The container must pass the event object to the event parameter and an injectable instance to each injected method parameter.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The container is also responsible for destroying dependent objects created during this invocation, as defined in Section 6.4.2, "Dependent object destruction".</text>
+ </assertion>
+ </section>
+
+ <section id="5.6.9" title="Injection point metadata">
+ <assertion id="aa">
+ <text>The |javax.enterprise.inject.spi.InjectionPoint.getBean()| method returns the Bean object representing the bean that defines the injection point. If the injection point does not belong to a bean, |getBean()| returns a null value.</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>The |javax.enterprise.inject.spi.InjectionPoint.getType()| method returns the declared type of the injection point.</text>
+ </assertion>
+
+ <assertion id="bc">
+ <text>The |javax.enterprise.inject.spi.InjectionPoint.getQualifiers()| method returns the declared qualifiers of the injection point.</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>The |javax.enterprise.inject.spi.InjectionPoint.getMember()| method returns the |Field| object in the case of field injection.</text>
+ </assertion>
+
+ <assertion id="cb">
+ <text>The |javax.enterprise.inject.spi.InjectionPoint.getMember()| method returns the |Method| object in the case of method parameter injection.</text>
+ </assertion>
+
+ <assertion id="cc">
+ <text>The |javax.enterprise.inject.spi.InjectionPoint.getMember()| method returns the |Constructor| object in the case of constructor parameter injection.</text>
+ </assertion>
+
+ <assertion id="daa">
+ <text>The |getAnnotated()| method returns an instance of |javax.enterprise.inject.spi.AnnotatedField| or |javax.enterprise.inject.spi.AnnotatedParameter|, depending upon whether the injection point is an injected field or a constructor/method parameter.</text>
+ </assertion>
+
+ <assertion id="dba">
+ <text>The |isDelegate()| method returns true if the injection point is a decorator delegate injection point, and false otherwise.</text>
+ </assertion>
+
+ <assertion id="dca">
+ <text>The |isTransient()| method returns true if the injection point is a transient field, and false otherwise.</text>
+ </assertion>
+
<assertion id="ea">
+ <text>The container must provide a bean with scope |@Dependent|, bean type |InjectionPoint| and qualifier |@Default|, allowing dependent objects, as defined in Section 6.4.1, "Dependent objects", to obtain information about the injection point to which they belong.</text>
+ </assertion>
+
+ <assertion id="eb">
+ <text>The built-in implementation must be a passivation capable dependency, as defined in Section 6.6.2, "Passivation capable dependencies".</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If a bean that declares any scope other than |@Dependent| has an injection point of type |InjectionPoint| and binding |@Default|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ga">
+ <text>If a Java EE component class supporting injection that is not a bean has an injection point of type |InjectionPoint| and binding |@Default|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="5.7" title="Programmatic lookup">
+ <assertion id="aa">
+ <text>An instance of the |javax.enterprise.inject.Instance| interface may be injected.</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>The method |javax.enterprise.inject.Instance.get()| returns a contextual reference.</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>Any combination of qualifiers may be specified at the injection point.</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>The |@Any| qualifier may be used to allow the application to specify qualifiers dynamically.</text>
+ </assertion>
+ </section>
+
+ <section id="5.7.1" title="The Instance interface">
+ <assertion id="aa">
+ <text>The |Instance| interface provides a method for obtaining instances of beans with a specified combination of required type and qualifiers, and inherites the ability to iterate beans with that combination of required type and qualifiers from |java.lang.Iterable|.</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>For an injected |Instance|, the required type is the type parameter specified at the injection point, and the required qualifiers are the qualifiers specified at the injection point.</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>The |select()| method returns a child |Instance| for a given required type and additional required qualifiers. If no required type is given, the required type is the same as the parent.</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>If two instances of the same qualifier type are passed to |select()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If an instance of an annotation that is not a qualifier type is passed to |select()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="fa">
+ <text>The |get()| method must identify a bean that matches the required type and required qualifiers and is accessible to the class into which the parent |Instance| was injected, according to the rules of typesafe resolution, as defined in Section 5.3, "Typesafe resolution" and resolving ambiguities according to Section 5.3.1, "Unsatisfied and ambiguous dependencies".</text>
+ </assertion>
+
+ <assertion id="fba">
+ <text>If typesafe resolution results in an unsatisfied dependency, throw an |UnsatisfiedResolutionException|.</text>
+ </assertion>
+
+ <assertion id="fbb">
+ <text>If typesafe resolution results in an unresolvable ambiguous dependency, throw an |AmbiguousResolutionException|.</text>
+ </assertion>
+
+ <assertion id="fc">
+ <text>Otherwise, obtain a contextual reference for the bean and the required type, as defined in Section 6.5.3, "Contextual reference for a bean".</text>
+ </assertion>
+
+ <assertion id="ja">
+ <text>The |iterator()| method must identify the set of beans that match the required type and required qualifiers and are accessible to the class into which the parent |Instance| was injected, according to the rules of typesafe resolution, as defined in Section 5.3, "Typesafe resolution".</text>
+ </assertion>
+
+ <assertion id="ka">
+ <text>The |iterator()| method must return an |Iterator|, that iterates over the set of contextual references for the resulting beans and required type, as defined in Section 6.5.3, "Contextual reference for a bean".</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>The method |isUnsatisfied()| returns true if there is no bean that matches the required type and qualifiers, or false otherwise.</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>The method |isAmbiguous()| returns true if there is more than one bean that matches the required type and qualifiers, or false otherwise.</text>
+ </assertion>
+ </section>
+
+ <section id="5.7.2" title="The built-in Instance">
+ <assertion id="a">
+ <text>The container must provide a built-in bean with |Instance<X>| and |Provider<X>| for every legal bean type |x| in its set of bean types.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The container must provide a built-in bean with every qualifier type in its set of qualifier types.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The container must provide a built-in bean with scope @Dependent.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The container must provide a built-in bean with no bean EL name.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The container must provide a built-in bean with an implementation provided automatically by the container. </text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The built-in implementation must be a passivation capable dependency, as defined in Section 6.6.2, "Passivation capable dependencies".</text>
+ </assertion>
+ </section>
+
+ <section id="5.7.3" title="Using AnnotationLiteral and TypeLiteral">
+
+ </section>
+
+ <section id="5.8" title="Integration with Unified EL">
+ <assertion id="aaa">
+ <text>The container must provide a Unified EL ELResolver to the servlet engine ~and JSF implementation~ that resolves bean EL names using the rules of name resolution algorithm defined in Section 5.4 "EL name resolution" and resolving ambiguities according to Section 5.4.1, "Ambiguous EL names".</text>
+ <note>This is testable implicitly by trying to resolve using EL from a servlet</note>
+ </assertion>
+
+ <assertion id="aba">
+ <text>The container must provide a Unified EL |ELResolver| to the ~servlet engine~ and JSF implementation that resolves bean EL names using the rules of name resolution algorithm defined in Section 5.4 "EL name resolution" and resolving ambiguities according to Section 5.4.1, "Ambiguous EL names".</text>
+ <note>This is testable implicitly by trying to resolve using EL from a JSF view</note>
+ </assertion>
+
+ <assertion id="bb">
+ <text>If a name used in an EL expression does not resolve to any bean, the |ELResolver| must return a null value.</text>
+ </assertion>
+
+ <assertion id="bc">
+ <text>Otherwise, if a name used in an EL expression resolves to exactly one bean, the |ELResolver| must return a contextual instance of the bean, as defined in Section 6.5.2, "Contextual instance of a bean".</text>
+ </assertion>
+ </section>
+
+ <section id="6" title="Scopes and contexts">
+
+ </section>
+
+ <section id="6.1" title="The Contextual interface">
+ <assertion id="a0">
+ <text>If an exception occurs while creating an instance, the exception is rethrown by the |create()| method. If the exception is a checked exception, it must be wrapped and rethrown as an (unchecked) |CreationException|.</text>
+ </assertion>
+
+ <assertion id="a1">
+ <text>If an exception occurs while destroying an instance, the exception must be caught by the |destroy()| method.</text>
+ </assertion>
+
+ <assertion id="a2" testable="false">
+ <text>If the application invokes a contextual instance after it has been destroyed, the behavior is undefined.</text>
+ <note>A statement about container specific behavior which is not spec defined</note>
+ </assertion>
+
+ <assertion id="a" testable="false">
+ <text>The container and portable extensions may define implementations of the |Contextual| interface that do not extend |Bean|, but it is not recommended that applications directly implement |Contextual|.</text>
+ <note>Advice only</note>
+ </assertion>
+ </section>
+
+ <section id="6.1.1" title="The CreationalContext interface">
+ <assertion id="ca" testable="false">
+ <text>The interface |javax.enterprise.context.spi.CreationalContext| provides operations that are used by the |Contextual| implementation during instance creation and destruction.</text>
+ <note>introductory text</note>
+ </assertion>
+
+ <assertion id="d">
+ <text>|push()| registers an incompletely initialized contextual instance with the container. A contextual instance is considered incompletely initialized until it is returned by the |create()| method.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>|release()| destroys all dependent objects, as defined in Section 6.4.1, "Dependent objects", of the instance which is being destroyed, by passing each dependent object to the |destroy()| method of its |Contextual| object.</text>
+ </assertion>
+
+ <assertion id="f" testable="false">
+ <text>The implementation of |Contextual| is not required to call |push()|. However, for certain bean scopes, invocation of |push()| between instantiation and injection helps the container minimize the use of client proxy objects (which would otherwise be required to allow circular dependencies).</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If |Contextual.create()| calls |push()|, it must also return the instance passed to |push()|.</text>
+ </assertion>
+
+ <assertion id="h" testable="false">
+ <text>|Contextual.create()| should use the given |CreationalContext| when obtaining contextual references to inject, as defined in Section 6.5.3, "Contextual reference for a bean", in order to ensure that any dependent objects are associated with the contextual instance that is being created.</text>
+ <note>Advice</note>
+ </assertion>
+
+ <assertion id="i" testable="false">
+ <text>|Contextual.destroy()| should call |release()| to allow the container to destroy dependent objects of the contextual instance.</text>
+ <note>Advice</note>
+ </assertion>
+ </section>
+
+ <section id="6.2" title="The Context interface">
+ <assertion id="aa" testable="false">
+ <text>The |javax.enterprise.context.spi.Context| interface provides an operation for obtaining contextual instances with a particular scope of any contextual type.</text>
+ <note>Introductory text</note>
+ </assertion>
+
+ <assertion id="ab">
+ <text>The method |getScope()| returns the scope type of the context object.</text>
+ </assertion>
+
+ <assertion id="ha">
+ <text>When a context object is active the |isActive()| method returns |true|. Otherwise, we say that the context object is inactive and the |isActive()| method returns false.</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>The |Context.get()| method may either return an existing instance of the given contextual type, ~or if no |CreationalContext| is given, return a null value, or if a |CreationalContext| is given, create a new instance of the given contextual type by calling |Contextual.create()| and return the new instance~.</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>The |Context.get()| method may either ~return an existing instance of the given contextual type~, or if no |CreationalContext| is given, return a null value, ~or if a |CreationalContext| is given, create a new instance of the given contextual type by calling |Contextual.create()| and return the new instance~.</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>The |Context.get()| method may either ~return an existing instance of the given contextual type, or if no |CreationalContext| is given, return a null value~, or if a |CreationalContext| is given, create a new instance of the given contextual type by calling |Contextual.create()| and return the new instance.</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>If the context object is inactive, the |get()| method must throw a |ContextNotActiveException|.</text>
+ </assertion>
+
+ <assertion id="na">
+ <text>The |get()| method may not return a null value _unless no |CreationalContext| is given_, or |Contextual.create()| returns a null value.</text>
+ </assertion>
+
+ <assertion id="nb">
+ <text>The |get()| method may not return a null value unless no |CreationalContext| is given, or _|Contextual.create()| returns a null value_.</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>The |get()| method may not create a new instance of the given contextual type unless a |CreationalContext| is given.</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>The context object is responsible for destroying any contextual instance it creates by passing the instance to the |destroy()| method of the Contextual object representing the contextual type.</text>
+ </assertion>
+
+ <assertion id="q">
+ <text>A destroyed instance must not subsequently be returned by the |get()| method.</text>
+ </assertion>
+
+ <assertion id="r">
+ <text>The context object must pass the same instance of |CreationalContext| to |Contextual.destroy()| that it passed to |Contextual.create()| when it created the instance.</text>
+ </assertion>
+ </section>
+
+ <section id="6.3" title="Normal scopes and pseudo-scopes">
+ <assertion id="a" testable="false">
+ <text>There may be no more than one mapped instance of a context object per contextual type per thread</text>
+ <note>Not testable through API</note>
+ </assertion>
+
+ <assertion id="b" testable="false">
+ <text>A context may be associated with one or more threads</text>
+ <note>A statement of intent</note>
+ </assertion>
+
+ <assertion id="c">
+ <text>The |get()| operation of the |Context| object for an active normal scope returns the current instance of the given contextual type.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>When a context is destroyed, all mapped instances belonging to that context are destroyed by passing them to the |Contextual.destroy()| method.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Contexts with normal scopes must obey the following rule: Suppose beans A, B and Z all have normal scopes. Suppose A has an injection point x, and B has an injection point y. Suppose further that both x and y resolve to bean Z according to the typesafe resolution algorithm. If a is the current instance of A, and b is the current instance of B, then both a.x and b.y refer to the same instance of Z. This instance is the current instance of Z.</text>
+ </assertion>
+
+ <assertion id="ea">
<text>All normal scopes must be explicitly declared |@NormalScope|, to indicate to the container that a client proxy is required.</text>
- </assertion>
-
- <assertion id="fa" testable="false">
- <text>All pseudo-scopes must be explicitly declared |@Scope|, to indicate to the container that no client proxy is required.</text>
- <note>A statement of intent</note>
- </assertion>
-
- <assertion id="g" testable="false">
- <text>All scopes defined by this specification, except for the |@Dependent| pseudo-scope, are normal scopes</text>
- <note>A statement of intent</note>
- </assertion>
- </section>
-
- <section id="6.4" title="Dependent pseudo-scope">
- <assertion id="a">
- <text>When a bean is declared to have |@Dependent| scope, no injected instance of the bean is ever shared between multiple injection points.</text>
- </assertion>
-
- <assertion id="b">
- <text>When a bean is declared to have |@Dependent| scope, any injected instance of the bean is bound to the lifecycle of the bean, servlet or EJB into which it is injected.</text>
- </assertion>
-
- <assertion id="ca">
- <text>When a bean is declared to have |@Dependent| scope, when a unified EL expression in a JSF or JSP page that refers to the bean by its EL name is evaluated, at most one instance of the bean is instantiated. This instance exists to service just a single evaluation of the EL expression. It is reused if the bean EL name appears multiple times in the EL expression, but is never reused when the EL expression is evaluated again, or when another EL expression is evaluated.</text>
- </assertion>
-
- <assertion id="da">
- <text>When a bean is declared to have |@Dependent| scope, any instance of the bean that receives a producer method~, producer field, disposer method or observer method~ invocation exists to service that invocation only</text>
- </assertion>
-
- <assertion id="db">
- <text>When a bean is declared to have |@Dependent| scope, any instance of the bean that receives a ~producer method,~ producer field~, disposer method or observer method~ invocation exists to service that invocation only</text>
- </assertion>
-
- <assertion id="dc">
- <text>When a bean is declared to have |@Dependent| scope, any instance of the bean that receives a ~producer method, producer field,~ disposer method ~or observer method~ invocation exists to service that invocation only</text>
- </assertion>
-
- <assertion id="dd">
- <text>When a bean is declared to have |@Dependent| scope, any instance of the bean that receives a ~producer method, producer field, disposer method or~ observer method invocation exists to service that invocation only</text>
- </assertion>
-
- <assertion id="e">
- <text>Every invocation of the |get()| operation of the |Context| object for the |@Dependent| scope with a |CreationalContext| returns a new instance of the given bean</text>
- </assertion>
-
- <assertion id="f">
- <text>Every invocation of the |get()| operation of the |Context| object for the |@Dependent| scope with no |CreationalContext| returns a null value</text>
- </assertion>
-
- <assertion id="g">
- <text>The |@Dependent| scope is always active.</text>
- </assertion>
- </section>
-
+ </assertion>
+
+ <assertion id="fa" testable="false">
+ <text>All pseudo-scopes must be explicitly declared |@Scope|, to indicate to the container that no client proxy is required.</text>
+ <note>A statement of intent</note>
+ </assertion>
+
+ <assertion id="g" testable="false">
+ <text>All scopes defined by this specification, except for the |@Dependent| pseudo-scope, are normal scopes</text>
+ <note>A statement of intent</note>
+ </assertion>
+ </section>
+
+ <section id="6.4" title="Dependent pseudo-scope">
+ <assertion id="a">
+ <text>When a bean is declared to have |@Dependent| scope, no injected instance of the bean is ever shared between multiple injection points.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When a bean is declared to have |@Dependent| scope, any injected instance of the bean is bound to the lifecycle of the bean, servlet or EJB into which it is injected.</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>When a bean is declared to have |@Dependent| scope, when a unified EL expression in a JSF or JSP page that refers to the bean by its EL name is evaluated, at most one instance of the bean is instantiated. This instance exists to service just a single evaluation of the EL expression. It is reused if the bean EL name appears multiple times in the EL expression, but is never reused when the EL expression is evaluated again, or when another EL expression is evaluated.</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>When a bean is declared to have |@Dependent| scope, any instance of the bean that receives a producer method~, producer field, disposer method or observer method~ invocation exists to service that invocation only</text>
+ </assertion>
+
+ <assertion id="db">
+ <text>When a bean is declared to have |@Dependent| scope, any instance of the bean that receives a ~producer method,~ producer field~, disposer method or observer method~ invocation exists to service that invocation only</text>
+ </assertion>
+
+ <assertion id="dc">
+ <text>When a bean is declared to have |@Dependent| scope, any instance of the bean that receives a ~producer method, producer field,~ disposer method ~or observer method~ invocation exists to service that invocation only</text>
+ </assertion>
+
+ <assertion id="dd">
+ <text>When a bean is declared to have |@Dependent| scope, any instance of the bean that receives a ~producer method, producer field, disposer method or~ observer method invocation exists to service that invocation only</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Every invocation of the |get()| operation of the |Context| object for the |@Dependent| scope with a |CreationalContext| returns a new instance of the given bean</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Every invocation of the |get()| operation of the |Context| object for the |@Dependent| scope with no |CreationalContext| returns a null value</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The |@Dependent| scope is always active.</text>
+ </assertion>
+ </section>
+
<section id="6.4.1" title="Dependent objects">
<group>
- <text>Instances of interceptors or decorators with scope |@Dependent| are dependent objects of the bean instance they decorate.</text>
- <assertion id="aa">
- <text>Test with a |@Dependent|-scoped interceptor.</text>
+ <text>Instances of interceptors or decorators with scope |@Dependent| are dependent objects of the bean instance they decorate.</text>
+ <assertion id="aa">
+ <text>Test with a |@Dependent|-scoped interceptor.</text>
</assertion>
<assertion id="ab">
<text>Test with a |@Dependent|-scoped decorator.</text>
</assertion>
- </group>
+ </group>
<group>
<text>An instance of a bean with scope |@Dependent| injected into a field, bean constructor or initializer method is a dependent object of the bean or Java EE component class instance into which it was injected.</text>
-
- <assertion id="ga">
- <text>Test with |@Dependent|-scoped bean injected into field.</text>
+
+ <assertion id="ga">
+ <text>Test with |@Dependent|-scoped bean injected into field.</text>
</assertion>
- <assertion id="gb">
- <text>Test with |@Dependent|-scoped bean injected into bean constructor.</text>
+ <assertion id="gb">
+ <text>Test with |@Dependent|-scoped bean injected into bean constructor.</text>
</assertion>
- <assertion id="gc">
- <text>Test with |@Dependent|-scoped bean injected into initializer method.</text>
+ <assertion id="gc">
+ <text>Test with |@Dependent|-scoped bean injected into initializer method.</text>
</assertion>
- </group>
-
- <assertion id="h">
- <text>An instance of a bean with scope |@Dependent| injected into a producer method is a dependent object of the producer method bean instance that is being produced.</text>
- </assertion>
-
- <assertion id="i">
- <text>An instance of a bean with scope |@Dependent| obtained by direct invocation of an |Instance| is a dependent object of the instance of |Instance|.</text>
- </assertion>
- </section>
-
- <section id="6.4.2" title="Dependent object destruction">
+ </group>
+
+ <assertion id="h">
+ <text>An instance of a bean with scope |@Dependent| injected into a producer method is a dependent object of the producer method bean instance that is being produced.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>An instance of a bean with scope |@Dependent| obtained by direct invocation of an |Instance| is a dependent object of the instance of |Instance|.</text>
+ </assertion>
+ </section>
+
+ <section id="6.4.2" title="Dependent object destruction">
<group>
<text>The container must ensure that all dependent objects of a non-contextual instance of a bean or other Java EE component class are destroyed when the instance is destroyed by the container.</text>
-
- <assertion id="aaaa">
- <text>Test with a managed bean.</text>
- </assertion>
-
- <assertion id="aaab">
- <text>Test with a Java EE component.</text>
+
+ <assertion id="aaaa">
+ <text>Test with a managed bean.</text>
</assertion>
- </group>
-
- <assertion id="bbb">
- <text>The container must ensure that all |@Dependent| scoped contextual instances injected into method parameters of an observer method of any container lifecycle event, as defined in Section 11.5, "Container lifecycle events", are destroyed after all observers of the |BeforeShutdown| event complete.</text>
- </assertion>
-
- <group>
- <text>The container must ensure that all |@Dependent| scoped contextual instances injected into method parameters of a disposer method or observer method of any other event are destroyed when the invocation completes.</text>
- <assertion id="ccc">
- <text>Check disposer method</text>
- </assertion>
-
- <assertion id="ccd">
- <text>Check observer method</text>
- </assertion>
- </group>
-
- <group>
- <text>The container must ensure that any |@Dependent| scoped contextual instance created to receive a producer method, producer field, disposer method or observer method invocation is destroyed when the invocation completes.</text>
-
- <assertion id="ddd">
- <text>Check producer method</text>
- </assertion>
-
- <assertion id="dde">
- <text>Check producer field</text>
- </assertion>
-
- <assertion id="ddf">
- <text>Check disposer method</text>
- </assertion>
-
- <assertion id="ddg">
- <text>Check observer method</text>
- </assertion>
- </group>
-
-
- <assertion id="eee">
- <text>The container must ensure that all |@Dependent| scoped contextual instances created during evaluation of a Unified EL expression in a JSP or JSF page are destroyed when the evaluation completes.</text>
- </assertion>
-
- <assertion id="e" testable="false">
- <text>The container is permitted to destroy any |@Dependent| scoped contextual instance at any time if the instance is no longer referenced by the application (excluding weak, soft and phantom references).</text>
- <note>In other words this is unspecified</note>
- </assertion>
+
+ <assertion id="aaab">
+ <text>Test with a Java EE component.</text>
+ </assertion>
+ </group>
+
+ <assertion id="bbb">
+ <text>The container must ensure that all |@Dependent| scoped contextual instances injected into method parameters of an observer method of any container lifecycle event, as defined in Section 11.5, "Container lifecycle events", are destroyed after all observers of the |BeforeShutdown| event complete.</text>
+ </assertion>
+
+ <group>
+ <text>The container must ensure that all |@Dependent| scoped contextual instances injected into method parameters of a disposer method or observer method of any other event are destroyed when the invocation completes.</text>
+ <assertion id="ccc">
+ <text>Check disposer method</text>
+ </assertion>
+
+ <assertion id="ccd">
+ <text>Check observer method</text>
+ </assertion>
+ </group>
+
+ <group>
+ <text>The container must ensure that any |@Dependent| scoped contextual instance created to receive a producer method, producer field, disposer method or observer method invocation is destroyed when the invocation completes.</text>
+
+ <assertion id="ddd">
+ <text>Check producer method</text>
+ </assertion>
+
+ <assertion id="dde">
+ <text>Check producer field</text>
+ </assertion>
+
+ <assertion id="ddf">
+ <text>Check disposer method</text>
+ </assertion>
+
+ <assertion id="ddg">
+ <text>Check observer method</text>
+ </assertion>
+ </group>
+
+
+ <assertion id="eee">
+ <text>The container must ensure that all |@Dependent| scoped contextual instances created during evaluation of a Unified EL expression in a JSP or JSF page are destroyed when the evaluation completes.</text>
+ </assertion>
+
+ <assertion id="e" testable="false">
+ <text>The container is permitted to destroy any |@Dependent| scoped contextual instance at any time if the instance is no longer referenced by the application (excluding weak, soft and phantom references).</text>
+ <note>In other words this is unspecified</note>
+ </assertion>
</section>
<section id="6.4.3" title="Dependent pseudo-scope and Unified EL">
@@ -2869,105 +2869,105 @@
<assertion id="b">
<text>Portable extensions that integrate with the container via Unified EL should also ensure that these rules are enforced.</text>
</assertion>
- </section>
-
- <section id="6.5" title="Contextual instances and contextual references">
-
- </section>
-
- <section id="6.5.1" title="The active context object for a scope">
- <assertion id="a">
- <text>From time to time, the container must obtain an active context object for a certain scope type. The container must search for an active instance of |Context| associated with the scope type. If no active context object exists for the scope type, the container throws a |ContextNotActiveException|.</text>
- </assertion>
-
- <assertion id="b">
- <text>If more than one active context object exists for the given scope type, the container must throw an |IllegalStateException|.</text>
- </assertion>
- </section>
-
- <section id="6.5.2" title="Contextual instance of a bean">
- <assertion id="a">
- <text>From time to time, the container must obtain a contextual instance of a bean. The container must obtain the active context object for the bean scope, then obtain an instance of the bean by calling |Context.get()|, passing the |Bean| instance representing the bean and an instance of |CreationalContext|.</text>
- </assertion>
-
- <assertion id="b">
- <text>From time to time, the container attempts to obtain a contextual instance of a bean that already exists, without creating a new contextual instance. The container must determine if the scope of the bean is active and if it is, obtain the active context object for the bean scope, then attempt to obtain an instance of the bean by calling |Context.get()|, passing the |Bean| instance representing the bean without passing any instance of |CreationalContext|.</text>
- </assertion>
-
- <assertion id="c" testable="false">
- <text>If the scope is not active, or if |Context.get()| returns a null value, there is no contextual instance that already exists.</text>
- <note>Statement of intent</note>
- </assertion>
-
- <assertion id="e">
- <text>For a custom implementation of the |Bean| interface defined in Section 11.1, "The Bean interface", the container calls |getScope()| to determine the bean scope.</text>
- </assertion>
- </section>
-
- <section id="6.5.3" title="Contextual reference for a bean">
- <assertion id="a0">
- <text>Contextual references must be obtained with a given |CreationalContext|, allowing any instance of scope |@Dependent| that is created to be later destroyed.</text>
- </assertion>
-
- <assertion id="a">
- <text>If the bean has a normal scope and the given bean type cannot be proxied by the container, as defined in Section 5.5.1, "Unproxyable bean types", the container throws an |UnproxyableResolutionException|.</text>
- </assertion>
-
- <assertion id="b">
- <text>If the bean has a normal scope, then the contextual reference for the bean is a client proxy, as defined in Section 5.5, "Client proxies", created by the container, that implements the given bean type and all bean types of the bean which are Java interfaces.</text>
- </assertion>
-
- <assertion id="c">
- <text>If the bean has a pseudo-scope, the container must obtain a contextual instance of the bean. If the bean has scope |@Dependent|, the container must associate it with the |CreationalContext|.</text>
- </assertion>
-
- <assertion id="d">
- <text>The container must ensure that every injection point of type |InjectionPoint| and binding |@Default| of any dependent object instantiated during this process receives an instance of |InjectionPoint| representing the injection point into which the dependent object will be injected, or a null value if it is not being injected into any injection point.</text>
- </assertion>
- </section>
-
- <section id="6.5.4" title="Contextual reference validity">
- <assertion id="a">
- <text>Any reference to a bean with a normal scope is valid as long as the application maintains a hard reference to it. However, it may only be invoked when the context associated with the normal scope is active. If it is invoked when the context is inactive, a |ContextNotActiveException| is thrown by the container.</text>
- </assertion>
-
- <assertion id="b" testable="false">
- <text>
- Any reference to a bean with a pseudo-scope (such as |@Dependent|) is valid until the bean instance to which it refers is destroyed. It may be invoked even if the context associated with the pseudo-scope is not active. If the application invokes a method of a reference to an instance that has already been destroyed, the behavior is undefined.
- </text>
- <note>Describes unspecified behavior</note>
- </assertion>
- </section>
-
- <section id="6.6" title="Passivation and passivating scopes">
- <assertion id="a" implied="true">
- <text>Test passivation occurs</text>
- </assertion>
- </section>
-
-
-
- <section id="6.6.1" title="Passivation capable beans">
- <assertion id="a" testable="false">
- <text>As defined by the EJB specification, all stateful session beans are passivation capable. Stateless and singleton session beans are not passivation capable.</text>
- <note>Defined by EJB spec</note>
- </assertion>
+ </section>
+ <section id="6.5" title="Contextual instances and contextual references">
+
+ </section>
+
+ <section id="6.5.1" title="The active context object for a scope">
+ <assertion id="a">
+ <text>From time to time, the container must obtain an active context object for a certain scope type. The container must search for an active instance of |Context| associated with the scope type. If no active context object exists for the scope type, the container throws a |ContextNotActiveException|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If more than one active context object exists for the given scope type, the container must throw an |IllegalStateException|.</text>
+ </assertion>
+ </section>
+
+ <section id="6.5.2" title="Contextual instance of a bean">
+ <assertion id="a">
+ <text>From time to time, the container must obtain a contextual instance of a bean. The container must obtain the active context object for the bean scope, then obtain an instance of the bean by calling |Context.get()|, passing the |Bean| instance representing the bean and an instance of |CreationalContext|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>From time to time, the container attempts to obtain a contextual instance of a bean that already exists, without creating a new contextual instance. The container must determine if the scope of the bean is active and if it is, obtain the active context object for the bean scope, then attempt to obtain an instance of the bean by calling |Context.get()|, passing the |Bean| instance representing the bean without passing any instance of |CreationalContext|.</text>
+ </assertion>
+
+ <assertion id="c" testable="false">
+ <text>If the scope is not active, or if |Context.get()| returns a null value, there is no contextual instance that already exists.</text>
+ <note>Statement of intent</note>
+ </assertion>
+
+ <assertion id="e">
+ <text>For a custom implementation of the |Bean| interface defined in Section 11.1, "The Bean interface", the container calls |getScope()| to determine the bean scope.</text>
+ </assertion>
+ </section>
+
+ <section id="6.5.3" title="Contextual reference for a bean">
+ <assertion id="a0">
+ <text>Contextual references must be obtained with a given |CreationalContext|, allowing any instance of scope |@Dependent| that is created to be later destroyed.</text>
+ </assertion>
+
+ <assertion id="a">
+ <text>If the bean has a normal scope and the given bean type cannot be proxied by the container, as defined in Section 5.5.1, "Unproxyable bean types", the container throws an |UnproxyableResolutionException|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the bean has a normal scope, then the contextual reference for the bean is a client proxy, as defined in Section 5.5, "Client proxies", created by the container, that implements the given bean type and all bean types of the bean which are Java interfaces.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the bean has a pseudo-scope, the container must obtain a contextual instance of the bean. If the bean has scope |@Dependent|, the container must associate it with the |CreationalContext|.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The container must ensure that every injection point of type |InjectionPoint| and binding |@Default| of any dependent object instantiated during this process receives an instance of |InjectionPoint| representing the injection point into which the dependent object will be injected, or a null value if it is not being injected into any injection point.</text>
+ </assertion>
+ </section>
+
+ <section id="6.5.4" title="Contextual reference validity">
+ <assertion id="a">
+ <text>Any reference to a bean with a normal scope is valid as long as the application maintains a hard reference to it. However, it may only be invoked when the context associated with the normal scope is active. If it is invoked when the context is inactive, a |ContextNotActiveException| is thrown by the container.</text>
+ </assertion>
+
+ <assertion id="b" testable="false">
+ <text>
+ Any reference to a bean with a pseudo-scope (such as |@Dependent|) is valid until the bean instance to which it refers is destroyed. It may be invoked even if the context associated with the pseudo-scope is not active. If the application invokes a method of a reference to an instance that has already been destroyed, the behavior is undefined.
+ </text>
+ <note>Describes unspecified behavior</note>
+ </assertion>
+ </section>
+
+ <section id="6.6" title="Passivation and passivating scopes">
+ <assertion id="a" implied="true">
+ <text>Test passivation occurs</text>
+ </assertion>
+ </section>
+
+
+
+ <section id="6.6.1" title="Passivation capable beans">
+ <assertion id="a" testable="false">
+ <text>As defined by the EJB specification, all stateful session beans are passivation capable. Stateless and singleton session beans are not passivation capable.</text>
+ <note>Defined by EJB spec</note>
+ </assertion>
+
<group>
<text>A managed bean is passivation capable if and only if the bean class is serializable and all interceptors and decorators of the bean are serializable.</text>
-
- <assertion id="ba">
- <text>Tests with a serializable bean class.</text>
- </assertion>
-
- <assertion id="bb">
- <text>Tests with a serializable interceptor.</text>
- </assertion>
-
- <assertion id="bc">
- <text>Tests with a serializable decorator.</text>
+
+ <assertion id="ba">
+ <text>Tests with a serializable bean class.</text>
</assertion>
- </group>
+
+ <assertion id="bb">
+ <text>Tests with a serializable interceptor.</text>
+ </assertion>
+
+ <assertion id="bc">
+ <text>Tests with a serializable decorator.</text>
+ </assertion>
+ </group>
<group>
<text>A producer method is passivation capable if and only if it never returns a value which is not passivation capable at runtime. A producer method with a primitive return type or a return type that implements or extends serializable is passivation capable. A producer method with a return type that is declared |final| and does not implement |Serializable| is not passivation capable.</text>
@@ -2975,15 +2975,15 @@
<assertion id="caa">
<text>Test that a producer method with a primitive return type is passivation capable.</text>
</assertion>
-
- <assertion id="ca">
- <text>Test that a producer method with a serializable return type is passivation capable.</text>
- </assertion>
-
- <assertion id="cb">
- <text>Test that a producer method with a final, non-serializable return type is not passivation capable.</text>
+
+ <assertion id="ca">
+ <text>Test that a producer method with a serializable return type is passivation capable.</text>
</assertion>
- </group>
+
+ <assertion id="cb">
+ <text>Test that a producer method with a final, non-serializable return type is not passivation capable.</text>
+ </assertion>
+ </group>
<group>
<text>A producer field is passivation capable if and only if it never refers to a value which is not passivation capable at runtime. A producer field with a primitive type or a type that implements or extends |Serializable| is passivation capable. A producer field with a type that is declared |final| and does not implement |Serializable| is not passivation capable.</text>
@@ -2991,601 +2991,601 @@
<assertion id="daa">
<text>Test that a producer field with a primitive type is passivation capable.</text>
</assertion>
-
- <assertion id="da">
- <text>Test that a producer field with a serializable type is passivation capable.</text>
- </assertion>
-
- <assertion id="db">
- <text>Test that a producer field with a final, non-serializable type is not passivation capable.</text>
+
+ <assertion id="da">
+ <text>Test that a producer field with a serializable type is passivation capable.</text>
</assertion>
- </group>
-
- <assertion id="ea">
- <text>A custom implementation of Bean is passivation capable if it implements the interface |PassivationCapable|.</text>
- </assertion>
-
- <assertion id="f">
- <text>An implementation of |Contextual| that is not a bean is passivation capable if it implements both |PassivationCapable| and |Serializable|.</text>
- </assertion>
-
- <assertion id="g" testable="false">
+
+ <assertion id="db">
+ <text>Test that a producer field with a final, non-serializable type is not passivation capable.</text>
+ </assertion>
+ </group>
+
+ <assertion id="ea">
+ <text>A custom implementation of Bean is passivation capable if it implements the interface |PassivationCapable|.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>An implementation of |Contextual| that is not a bean is passivation capable if it implements both |PassivationCapable| and |Serializable|.</text>
+ </assertion>
+
+ <assertion id="g" testable="false">
<text>The |getId()| method of the |PassivationCapable| implementation must return a value that uniquely identifies the instance of |Bean| or |Contextual|.</text>
- <note>This is a requirement of the implementation</note>
- </assertion>
-
- <assertion id="h" testable="false">
- <text>The |getId()| ~method of the |PassivationCapable| implementation must return a value that uniquely identifies the instance of |Bean| or |Contextual|. It~ is recommended that the string contain the package name of the class that implements |Bean| or |Contextual|.</text>
- <note>Recommendation only</note>
- </assertion>
+ <note>This is a requirement of the implementation</note>
+ </assertion>
+
+ <assertion id="h" testable="false">
+ <text>The |getId()| ~method of the |PassivationCapable| implementation must return a value that uniquely identifies the instance of |Bean| or |Contextual|. It~ is recommended that the string contain the package name of the class that implements |Bean| or |Contextual|.</text>
+ <note>Recommendation only</note>
+ </assertion>
</section>
- <section id="6.6.2" title="Passivation capable dependencies">
- <assertion id="a">
- <text>The container must guarantee that all session beans are passivation capable dependencies.</text>
- </assertion>
-
- <assertion id="b">
- <text>The container must guarantee that all beans with normal scope are passivation capable dependencies.</text>
- </assertion>
-
- <assertion id="c">
- <text>The container must guarantee that all passivation capable beans with scope |@Dependent| are passivation capable dependencies.</text>
- </assertion>
-
- <assertion id="da">
- <text>The container must guarantee that all resources are passivation capable dependencies.</text>
- </assertion>
-
- <assertion id="e">
- <text>The container must guarantee that the built-in beans of type |Instance|, |Event|, |InjectionPoint| and |BeanManager| are passivation capable dependencies.</text>
- </assertion>
-
- <assertion id="fa">
- <text>A custom implementation of |Bean| is a passivation capable dependency if it implements |PassivationCapable| or if |getScope()| returns a normal scope type.</text>
- </assertion>
- </section>
-
+ <section id="6.6.2" title="Passivation capable dependencies">
+ <assertion id="a">
+ <text>The container must guarantee that all session beans are passivation capable dependencies.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The container must guarantee that all beans with normal scope are passivation capable dependencies.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The container must guarantee that all passivation capable beans with scope |@Dependent| are passivation capable dependencies.</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>The container must guarantee that all resources are passivation capable dependencies.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The container must guarantee that the built-in beans of type |Instance|, |Event|, |InjectionPoint| and |BeanManager| are passivation capable dependencies.</text>
+ </assertion>
+
+ <assertion id="fa">
+ <text>A custom implementation of |Bean| is a passivation capable dependency if it implements |PassivationCapable| or if |getScope()| returns a normal scope type.</text>
+ </assertion>
+ </section>
+
<section id="6.6.3" title="Passivating scopes">
<group>
<text>A passivating scope requires that beans with the scope are passivation capable, and implementations of |Contextual| passed to any context object for the scope are passivation capable.</text>
-
+
<assertion id="a">
<text>Test that a bean with the scope is passivation capable.</text>
</assertion>
<assertion id="b">
- <text>Test that an implementation of |Contextual| passed to the context object for the scope is passivation capable.</text>
+ <text>Test that an implementation of |Contextual| passed to the context object for the scope is passivation capable.</text>
</assertion>
- </group>
-
- <assertion id="b" testable="false">
- <text>Passivating scopes must be explicitly declared |@NormalScope(passivating=true)|.</text>
- <note>A statement of intent</note>
- </assertion>
- </section>
-
- <section id="6.6.4" title="Validation of passivation capable beans and dependencies">
- <assertion id="aaa">
- <text>If a managed bean which declares a passivating scope is not passivation capable, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- <note>Here we check the class, as interceptors and decorators are tested below</note>
- </assertion>
+ </group>
+ <assertion id="b" testable="false">
+ <text>Passivating scopes must be explicitly declared |@NormalScope(passivating=true)|.</text>
+ <note>A statement of intent</note>
+ </assertion>
+ </section>
+
+ <section id="6.6.4" title="Validation of passivation capable beans and dependencies">
+ <assertion id="aaa">
+ <text>If a managed bean which declares a passivating scope is not passivation capable, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ <note>Here we check the class, as interceptors and decorators are tested below</note>
+ </assertion>
+
<group>
- <text>If a managed bean which declares a passivating scope has a non-transient injected field, bean constructor parameter or initializer method parameter that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- <assertion id="aaba">
- <text>Test with injected field.</text>
- </assertion>
-
- <assertion id="aabb">
- <text>Test with bean constructor parameter.</text>
- </assertion>
-
- <assertion id="aabc">
- <text>Test with initializer method parameter.</text>
+ <text>If a managed bean which declares a passivating scope has a non-transient injected field, bean constructor parameter or initializer method parameter that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ <assertion id="aaba">
+ <text>Test with injected field.</text>
</assertion>
- </group>
+
+ <assertion id="aabb">
+ <text>Test with bean constructor parameter.</text>
+ </assertion>
+
+ <assertion id="aabc">
+ <text>Test with initializer method parameter.</text>
+ </assertion>
+ </group>
<group>
- <text>If a managed bean which declares a passivating scope has an interceptor or decorator with a non-transient injected field, bean constructor parameter or initializer method parameter that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
-
- <assertion id="aac">
- <text>Test interceptor with injected field.</text>
- </assertion>
-
- <assertion id="aad">
- <text>Test interceptor with bean constructor parameter.</text>
- </assertion>
-
- <assertion id="aae">
- <text>Test interceptor with initializer method parameter.</text>
- </assertion>
-
- <assertion id="aaf">
- <text>Test decorator with injected field.</text>
- </assertion>
-
- <assertion id="aag">
- <text>Test decorator with bean constructor parameter.</text>
- </assertion>
-
- <assertion id="aah">
- <text>Test decorator with initializer method parameter.</text>
+ <text>If a managed bean which declares a passivating scope has an interceptor or decorator with a non-transient injected field, bean constructor parameter or initializer method parameter that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+
+ <assertion id="aac">
+ <text>Test interceptor with injected field.</text>
</assertion>
- </group>
+
+ <assertion id="aad">
+ <text>Test interceptor with bean constructor parameter.</text>
+ </assertion>
+
+ <assertion id="aae">
+ <text>Test interceptor with initializer method parameter.</text>
+ </assertion>
+
+ <assertion id="aaf">
+ <text>Test decorator with injected field.</text>
+ </assertion>
+
+ <assertion id="aag">
+ <text>Test decorator with bean constructor parameter.</text>
+ </assertion>
+
+ <assertion id="aah">
+ <text>Test decorator with initializer method parameter.</text>
+ </assertion>
+ </group>
<group>
<text>If a stateful session bean has a non-transient injected field, bean constructor parameter or initializer method parameter that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
-
- <assertion id="ba">
- <text>Test with an injected field.</text>
- </assertion>
-
- <assertion id="bb" testable="false">
- <text>Test with a bean constructor parameter.</text>
- <note>Session beans don't have bean constructors</note>
- </assertion>
-
- <assertion id="bc">
- <text>Test with an initializer method parameter.</text>
+
+ <assertion id="ba">
+ <text>Test with an injected field.</text>
</assertion>
- </group>
+
+ <assertion id="bb" testable="false">
+ <text>Test with a bean constructor parameter.</text>
+ <note>Session beans don't have bean constructors</note>
+ </assertion>
+
+ <assertion id="bc">
+ <text>Test with an initializer method parameter.</text>
+ </assertion>
+ </group>
<group>
<text>If a stateful session bean has an interceptor or decorator with a non-transient injected field, bean constructor parameter or initializer method parameter that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
-
- <assertion id="bda">
- <text>Test an interceptor with an injected field.</text>
- </assertion>
-
- <assertion id="bdb">
- <text>Test an interceptor with a bean constructor parameter.</text>
- </assertion>
-
- <assertion id="bdc">
- <text>Test an interceptor with an initializer method parameter.</text>
- </assertion>
-
- <assertion id="bdd">
- <text>Test a decorator with an injected field.</text>
- </assertion>
-
- <assertion id="bde">
- <text>Test a decorator with a bean constructor parameter.</text>
- </assertion>
-
- <assertion id="bdf">
- <text>Test a decorator with an initializer method parameter.</text>
+
+ <assertion id="bda">
+ <text>Test an interceptor with an injected field.</text>
</assertion>
- </group>
+
+ <assertion id="bdb">
+ <text>Test an interceptor with a bean constructor parameter.</text>
+ </assertion>
+
+ <assertion id="bdc">
+ <text>Test an interceptor with an initializer method parameter.</text>
+ </assertion>
+
+ <assertion id="bdd">
+ <text>Test a decorator with an injected field.</text>
+ </assertion>
+
+ <assertion id="bde">
+ <text>Test a decorator with a bean constructor parameter.</text>
+ </assertion>
+
+ <assertion id="bdf">
+ <text>Test a decorator with an initializer method parameter.</text>
+ </assertion>
+ </group>
<group>
<text>If a producer method declares a passivating scope and the container is able to determine that it is not passivation capable by inspecting its return type, or has a parameter that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
-
- <assertion id="ca">
- <text>Test a producer method with a non passivation-capable return type.</text>
- </assertion>
-
- <assertion id="cb">
- <text>Test a producer method with a parameter that does not resolve to a passivation capable dependency.</text>
+
+ <assertion id="ca">
+ <text>Test a producer method with a non passivation-capable return type.</text>
</assertion>
- </group>
-
- <assertion id="d">
- <text>If a producer field declares a passivating scope and the container is able to determine that it is not passivation capable by inspecting its type, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4,
-"Problems detected automatically by the container".</text>
- </assertion>
+ <assertion id="cb">
+ <text>Test a producer method with a parameter that does not resolve to a passivation capable dependency.</text>
+ </assertion>
+ </group>
+
+ <assertion id="d">
+ <text>If a producer field declares a passivating scope and the container is able to determine that it is not passivation capable by inspecting its type, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4,
+"Problems detected automatically by the container".</text>
+ </assertion>
+
<group>
<text>If a producer method or field which declares a passivating scope returns an unserializable object at runtime, the container must throw an |IllegalProductException|.</text>
-
- <assertion id="ea">
- <text>Test with a producer method.</text>
- </assertion>
-
- <assertion id="eb">
- <text>Test with a producer field.</text>
+
+ <assertion id="ea">
+ <text>Test with a producer method.</text>
</assertion>
- </group>
+
+ <assertion id="eb">
+ <text>Test with a producer field.</text>
+ </assertion>
+ </group>
<group>
<text>If a producer method or field of scope |@Dependent| returns an unserializable object for injection into an injection point that requires a passivation capable dependency, the container must throw an |IllegalProductException|</text>
-
- <assertion id="fa">
- <text>Test for a deployment exception with a producer method.</text>
+
+ <assertion id="fa">
+ <text>Test for a deployment exception with a producer method.</text>
</assertion>
<assertion id="fab">
<text>Test for a runtime exception with a producer method.</text>
- </assertion>
-
- <assertion id="fb">
- <text>Test for a deployment exception with a producer field.</text>
</assertion>
+ <assertion id="fb">
+ <text>Test for a deployment exception with a producer field.</text>
+ </assertion>
+
<assertion id="fbb">
<text>Test for a runtime exception with a producer field.</text>
</assertion>
- </group>
+ </group>
<group>
<text>For a custom implementation of |Bean|, the container calls |getInjectionPoints()| to determine the injection points, and |InjectionPoint.isTransient()| to determine whether the injected point is a transient field.</text>
-
- <assertion id="ga">
- <text>Test calling |getInjectionPoints()|.</text>
- </assertion>
-
- <assertion id="gb">
- <text>Test calling |InjectionPoint.isTransient()|.</text>
+
+ <assertion id="ga">
+ <text>Test calling |getInjectionPoints()|.</text>
</assertion>
- </group>
+
+ <assertion id="gb">
+ <text>Test calling |InjectionPoint.isTransient()|.</text>
+ </assertion>
+ </group>
<group>
<text>If a bean which declares a passivating scope type, or any stateful session bean, has a decorator which is not a passivation capable dependency, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
-
- <assertion id="ha">
- <text>Test with a bean which declares a passivating scope type.</text>
- </assertion>
-
- <assertion id="hb">
- <text>Test with a stateful session bean.</text>
+
+ <assertion id="ha">
+ <text>Test with a bean which declares a passivating scope type.</text>
</assertion>
- </group>
- </section>
-
- <section id="6.7" title="Context management for built-in scopes">
- <group>
- <text>The built-in context object is active during servlet, web service and EJB invocations, or in the case of the conversation context object, for JSF requests.</text>
- </group>
-
- </section>
-
- <section id="6.7.1" title="Request context lifecycle">
- <assertion id="aa">
- <text>The request scope is active during the |service()| method of any servlet in the web application~, during the |doFilter()| method of any servlet filter and when the container calls any |ServletRequestListener| or |AsyncListener|.~</text>
- </assertion>
-
- <assertion id="ab">
- <text>The request scope is active ~during the |service()| method of any servlet in the web application~, during the |doFilter()| method of any servlet filter and when the container calls any |ServletRequestListener| or |AsyncListener|.</text>
- </assertion>
-
- <assertion id="c">
- <text>The request scope is active during any Java EE web service invocation.</text>
- </assertion>
-
- <assertion id="e">
- <text>The request scope is active during any asynchronous observer method notification.</text>
- </assertion>
+
+ <assertion id="hb">
+ <text>Test with a stateful session bean.</text>
+ </assertion>
+ </group>
+ </section>
+
+ <section id="6.7" title="Context management for built-in scopes">
+ <group>
+ <text>The built-in context object is active during servlet, web service and EJB invocations, or in the case of the conversation context object, for JSF requests.</text>
+ </group>
+ </section>
+
+ <section id="6.7.1" title="Request context lifecycle">
+ <assertion id="aa">
+ <text>The request scope is active during the |service()| method of any servlet in the web application~, during the |doFilter()| method of any servlet filter and when the container calls any |ServletRequestListener| or |AsyncListener|.~</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>The request scope is active ~during the |service()| method of any servlet in the web application~, during the |doFilter()| method of any servlet filter and when the container calls any |ServletRequestListener| or |AsyncListener|.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The request scope is active during any Java EE web service invocation.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The request scope is active during any asynchronous observer method notification.</text>
+ </assertion>
+
<group>
<text>The request scope is active during any remote method invocation of any EJB, during any asynchronous method invocation of any EJB, during any call to an EJB timeout method and during message delivery to any EJB message-driven bean.</text>
-
- <assertion id="ga">
- <text>Test the request scope is active during a remote method invocation of any EJB.</text>
- </assertion>
-
- <assertion id="gb">
- <text>Test the request scope is active during any asynchronous method invocation of any EJB.</text>
- </assertion>
-
- <assertion id="gc">
- <text>Test the request scope is active during any call to an EJB timeout method.</text>
- </assertion>
-
- <assertion id="gd">
- <text>Test the request scope is active during message delivery to any EJB message-driven bean.</text>
+
+ <assertion id="ga">
+ <text>Test the request scope is active during a remote method invocation of any EJB.</text>
+ </assertion>
+
+ <assertion id="gb">
+ <text>Test the request scope is active during any asynchronous method invocation of any EJB.</text>
</assertion>
- </group>
-
- <assertion id="ge">
- <text>The request scope is active during any message delivery to a |MessageListener| for a JMS topic or queue obtained from the Java EE component environment.</text>
- </assertion>
+
+ <assertion id="gc">
+ <text>Test the request scope is active during any call to an EJB timeout method.</text>
+ </assertion>
+
+ <assertion id="gd">
+ <text>Test the request scope is active during message delivery to any EJB message-driven bean.</text>
+ </assertion>
+ </group>
+
+ <assertion id="ge">
+ <text>The request scope is active during any message delivery to a |MessageListener| for a JMS topic or queue obtained from the Java EE component environment.</text>
+ </assertion>
<group>
<text>The request context is destroyed at the end of the servlet request, after the |service()| method and all |doFilter()| methods, and all |requestDestroyed()| and |onComplete()| notifications return.</text>
-
- <assertion id="baa">
- <text>Test the request context is destroyed at the end of the servlet request, after the |service()| method.</text>
- </assertion>
-
- <assertion id="bba">
- <text>Test the request context is destroyed after all |doFilter()| methods, and all |requestDestroyed()| and |onComplete()| notifications return.</text>
+
+ <assertion id="baa">
+ <text>Test the request context is destroyed at the end of the servlet request, after the |service()| method.</text>
</assertion>
- </group>
-
- <assertion id="d">
- <text>The request context is destroyed after the web service invocation completes.</text>
- </assertion>
-
- <assertion id="fa">
- <text>The request context is destroyed after the asynchronous observer notification completes</text>
- </assertion>
+
+ <assertion id="bba">
+ <text>Test the request context is destroyed after all |doFilter()| methods, and all |requestDestroyed()| and |onComplete()| notifications return.</text>
+ </assertion>
+ </group>
+
+ <assertion id="d">
+ <text>The request context is destroyed after the web service invocation completes.</text>
+ </assertion>
+
+ <assertion id="fa">
+ <text>The request context is destroyed after the asynchronous observer notification completes</text>
+ </assertion>
<group>
<text>The request context is destroyed after the EJB remote method invocation, asynchronous method invocation, timeout or message delivery completes.</text>
-
- <assertion id="ha">
- <text>Test the request context is destroyed after an EJB remote method invocation.</text>
- </assertion>
-
- <assertion id="hb">
- <text>Test the request context is destroyed after an EJB asynchronous method invocation.</text>
- </assertion>
-
- <assertion id="hc">
- <text>Test the request context is destroyed after the EJB timeout.</text>
- </assertion>
-
- <assertion id="hd">
- <text>Test the request context is destroyed after the message delivery completes.</text>
+
+ <assertion id="ha">
+ <text>Test the request context is destroyed after an EJB remote method invocation.</text>
</assertion>
- </group>
-
- <assertion id="i">
- <text>The request context is destroyed after the message delivery to the |MessageListener| completes.</text>
- </assertion>
- </section>
-
- <section id="6.7.2" title="Session context lifecycle">
- <assertion id="aa">
- <text>The session scope is active during the |service()| method of any servlet in the web application ~, during the |doFilter()| method of any servlet filter~ and when the container calls any |HttpSessionListener|, |AsyncListener| or |ServletRequestListener|.</text>
- </assertion>
-
- <assertion id="ab">
- <text>The session scope is active ~during the |service()| method of any servlet in the web application~, during the |doFilter()| method of any servlet filter and when the container calls any |HttpSessionListener|, |AsyncListener| or |ServletRequestListener|.</text>
- </assertion>
-
- <assertion id="b">
- <text>The session context is shared between all servlet requests that occur in the same HTTP servlet session.</text>
- </assertion>
-
- <assertion id="ca">
- <text>The session context is destroyed when the ~|HTTPSession| times out, after all |HttpSessionListener|s have been called~, and at the very end of any request in which |invalidate()| was called, after all filters and |ServletRequestListeners| have been called.</text>
- </assertion>
-
- <assertion id="cb">
- <text>The session context is destroyed when the |HTTPSession| times out, ~after all |HttpSessionListener|s have been called, and at the very end of any request in which |invalidate()| was called~, after all filters and |ServletRequestListeners| have been called.</text>
- </assertion>
- </section>
-
- <section id="6.7.3" title="Application context lifecycle">
- <group>
- <text>The application scope is active during the |service()| method of any servlet in the web application, during the |doFilter()| method of any servlet filter and when the container calls any |ServletContextListener|, |HttpSessionListener|, |AsyncListener| or |ServletRequestListener|.</text>
- <assertion id="aa">
- <text>Check service method</text>
- </assertion>
-
- <assertion id="ab">
- <text>Check filter.</text>
- </assertion>
-
- <assertion id="ac">
- <text>Check |ServletContextListener|.</text>
- </assertion>
-
- <assertion id="ad">
- <text>Check |HttpSessionListener|</text>
- </assertion>
-
- <assertion id="ae">
- <text>Check |AsyncListener|</text>
- </assertion>
-
- <assertion id="af">
- <text>Check |ServletRequestListener|</text>
- </assertion>
- </group>
-
- <assertion id="b">
- <text>The application scope is active during any Java EE web service invocation.</text>
- </assertion>
-
- <assertion id="c">
- <text>The application scope is active during any asynchronous observer method notification.</text>
- </assertion>
-
- <group>
- <text>The application scope is also active during any remote method invocation of any EJB, during any asynchronous method invocation of any EJB, during any call to an EJB timeout method and during message delivery to any EJB message-driven bean.</text>
- <assertion id="da">
- <text>Test remote method invocation</text>
- </assertion>
-
- <assertion id="db">
- <text> Test asynchronous method invocation</text>
- </assertion>
-
- <assertion id="dc">
- <text>Test EJB timeout method</text>
- </assertion>
-
- <assertion id="dd">
- <text>Test message delivery to any EJB message-driven bean.</text>
- </assertion>
- </group>
-
- <group>
- <text>The application scope is active during any message delivery to a |MessageListener| for a JMS topic or queue obtained from the Java EE component environment.</text>
- <assertion id="de">
- <text>Test JMS topic</text>
- </assertion>
- <assertion id="df">
- <text>Test JMS queue</text>
- </assertion>
- </group>
-
- <group>
- <text>The application scope is active when the disposer method or |@PreDestroy| callback of any bean with any normal scope other than |@ApplicationScoped| is called.</text>
- <assertion id="dg">
- <text>Test disposer method</text>
- </assertion>
- <assertion id="dh">
- <text>Test |@PreDestroy| method</text>
- </assertion>
- </group>
-
- <assertion id="e">
- <text>The application context is shared between all servlet requests, asynchronous observer method notifications, web service invocations, EJB remote method invocations, EJB asynchronous method invocations, EJB timeouts and message deliveries to message driven beans that execute within the same application.</text>
- <note>A single test needs check *all* these request types</note>
- </assertion>
-
- <assertion id="f">
- <text>The application context is destroyed when the application is undeployed.</text>
- </assertion>
- </section>
-
- <section id="6.7.4" title="Conversation context lifecycle">
- <assertion id="a">
- <text>The conversation scope is active during all standard lifecycle phases of any JSF faces or non-faces request.</text>
- </assertion>
-
- <assertion id="c">
- <text>Any JSF request has exactly one associated conversation.</text>
- </assertion>
-
- <assertion id="da">
- <text>The conversation associated with a JSF request is determined at the beginning of the restore view phase and does not change during the request.</text>
- </assertion>
-
- <assertion id="e">
- <text>By default, a conversation is transient.</text>
- </assertion>
-
- <assertion id="f">
- <text>A transient conversation may be marked long-running by calling |Conversation.begin()|</text>
- </assertion>
-
- <assertion id="g">
- <text>A long-running conversation may be marked transient by calling |Conversation.end()|</text>
- </assertion>
-
- <assertion id="ha">
- <text>All long-running conversations have a string-valued unique identifier, _which may be set by the application_ when the conversation is marked long-running~, or generated by the container~</text>
- </assertion>
-
- <assertion id="hb">
- <text>All long-running conversations have a string-valued unique identifier, _which may be_ ~set by the application when the conversation is marked long-running, or~ _generated by the container_</text>
- </assertion>
-
- <assertion id="j">
- <text>If the conversation associated with the current JSF request is in the transient state at the end of a JSF request, it is destroyed, and the conversation context is also destroyed.</text>
- </assertion>
-
- <assertion id="k">
- <text>If the conversation associated with the current JSF request is in the long-running state at the end of a JSF request, it is not destroyed.</text>
- </assertion>
-
- <assertion id="l">
- <text>The long-running conversation context associated with a request that renders a JSF view is automatically propagated to any faces request (JSF form submission) that originates from that rendered page.</text>
- </assertion>
-
- <assertion id="m">
- <text>The long-running conversation context associated with a request that results in a JSF redirect (via a navigation rule) is automatically propagated to the resulting non-faces request, and to any other subsequent request to the same URL. This is accomplished via use of a GET request parameter named cid containing the unique identifier of the conversation.</text>
- </assertion>
-
- <assertion id="n">
- <text>The long-running conversation associated with a request may be propagated to any non-faces request via use of a GET request parameter named |cid| containing the unique identifier of the conversation. In this case, the application must manage this request parameter.</text>
- </assertion>
-
- <assertion id="o">
- <text>When no conversation is propagated to a JSF request, the request is associated with a new transient conversation.</text>
- </assertion>
-
- <assertion id="p">
- <text>All long-running conversations are scoped to a particular HTTP servlet session and may not cross session boundaries.</text>
- </assertion>
-
- <assertion id="qa">
- <text>When the HTTP servlet session is invalidated, all long-running conversation contexts created during the current session are destroyed, after the servlet |service()| method completes.</text>
- </assertion>
-
- <assertion id="r" testable="false">
- <text>The container is permitted to arbitrarily destroy any long-running conversation that is associated with no current JSF request, in order to conserve resources</text>
- <note>In other words, this is unspecified</note>
- </assertion>
-
- <assertion id="ta" testable="false">
- <text>The conversation timeout, which may be specified by calling |Conversation.setTimeout()| is a hint to the container that a conversation should not be destroyed if it has been active within the last given interval in milliseconds.</text>
- <note>Not required</note>
- </assertion>
-
- <assertion id="tb">
- <text>If the propagated conversation cannot be restored, the container must associate the request with a new transient conversation and throw an exception of type |javax.context.NonexistentConversationException| from the restore view phase of the JSF lifecycle. The application may handle this exception using the JSF |ExceptionHandler|.</text>
- </assertion>
-
- <assertion id="ua">
- <text>The container ensures that a long-running conversation may be associated with at most one request at a time, by blocking or rejecting concurrent requests. If the container rejects a request, it must associate the request with a new transient conversation and throw an exception of type |javax.context.BusyConversationException| from the restore view phase of the JSF lifecycle. The application may handle this exception using the JSF |ExceptionHandler|.</text>
- </assertion>
- </section>
-
+
+ <assertion id="hb">
+ <text>Test the request context is destroyed after an EJB asynchronous method invocation.</text>
+ </assertion>
+
+ <assertion id="hc">
+ <text>Test the request context is destroyed after the EJB timeout.</text>
+ </assertion>
+
+ <assertion id="hd">
+ <text>Test the request context is destroyed after the message delivery completes.</text>
+ </assertion>
+ </group>
+
+ <assertion id="i">
+ <text>The request context is destroyed after the message delivery to the |MessageListener| completes.</text>
+ </assertion>
+ </section>
+
+ <section id="6.7.2" title="Session context lifecycle">
+ <assertion id="aa">
+ <text>The session scope is active during the |service()| method of any servlet in the web application ~, during the |doFilter()| method of any servlet filter~ and when the container calls any |HttpSessionListener|, |AsyncListener| or |ServletRequestListener|.</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>The session scope is active ~during the |service()| method of any servlet in the web application~, during the |doFilter()| method of any servlet filter and when the container calls any |HttpSessionListener|, |AsyncListener| or |ServletRequestListener|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The session context is shared between all servlet requests that occur in the same HTTP servlet session.</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>The session context is destroyed when the ~|HTTPSession| times out, after all |HttpSessionListener|s have been called~, and at the very end of any request in which |invalidate()| was called, after all filters and |ServletRequestListeners| have been called.</text>
+ </assertion>
+
+ <assertion id="cb">
+ <text>The session context is destroyed when the |HTTPSession| times out, ~after all |HttpSessionListener|s have been called, and at the very end of any request in which |invalidate()| was called~, after all filters and |ServletRequestListeners| have been called.</text>
+ </assertion>
+ </section>
+
+ <section id="6.7.3" title="Application context lifecycle">
+ <group>
+ <text>The application scope is active during the |service()| method of any servlet in the web application, during the |doFilter()| method of any servlet filter and when the container calls any |ServletContextListener|, |HttpSessionListener|, |AsyncListener| or |ServletRequestListener|.</text>
+ <assertion id="aa">
+ <text>Check service method</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>Check filter.</text>
+ </assertion>
+
+ <assertion id="ac">
+ <text>Check |ServletContextListener|.</text>
+ </assertion>
+
+ <assertion id="ad">
+ <text>Check |HttpSessionListener|</text>
+ </assertion>
+
+ <assertion id="ae">
+ <text>Check |AsyncListener|</text>
+ </assertion>
+
+ <assertion id="af">
+ <text>Check |ServletRequestListener|</text>
+ </assertion>
+ </group>
+
+ <assertion id="b">
+ <text>The application scope is active during any Java EE web service invocation.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The application scope is active during any asynchronous observer method notification.</text>
+ </assertion>
+
+ <group>
+ <text>The application scope is also active during any remote method invocation of any EJB, during any asynchronous method invocation of any EJB, during any call to an EJB timeout method and during message delivery to any EJB message-driven bean.</text>
+ <assertion id="da">
+ <text>Test remote method invocation</text>
+ </assertion>
+
+ <assertion id="db">
+ <text> Test asynchronous method invocation</text>
+ </assertion>
+
+ <assertion id="dc">
+ <text>Test EJB timeout method</text>
+ </assertion>
+
+ <assertion id="dd">
+ <text>Test message delivery to any EJB message-driven bean.</text>
+ </assertion>
+ </group>
+
+ <group>
+ <text>The application scope is active during any message delivery to a |MessageListener| for a JMS topic or queue obtained from the Java EE component environment.</text>
+ <assertion id="de">
+ <text>Test JMS topic</text>
+ </assertion>
+ <assertion id="df">
+ <text>Test JMS queue</text>
+ </assertion>
+ </group>
+
+ <group>
+ <text>The application scope is active when the disposer method or |@PreDestroy| callback of any bean with any normal scope other than |@ApplicationScoped| is called.</text>
+ <assertion id="dg">
+ <text>Test disposer method</text>
+ </assertion>
+ <assertion id="dh">
+ <text>Test |@PreDestroy| method</text>
+ </assertion>
+ </group>
+
+ <assertion id="e">
+ <text>The application context is shared between all servlet requests, asynchronous observer method notifications, web service invocations, EJB remote method invocations, EJB asynchronous method invocations, EJB timeouts and message deliveries to message driven beans that execute within the same application.</text>
+ <note>A single test needs check *all* these request types</note>
+ </assertion>
+
+ <assertion id="f">
+ <text>The application context is destroyed when the application is undeployed.</text>
+ </assertion>
+ </section>
+
+ <section id="6.7.4" title="Conversation context lifecycle">
+ <assertion id="a">
+ <text>The conversation scope is active during all standard lifecycle phases of any JSF faces or non-faces request.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Any JSF request has exactly one associated conversation.</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>The conversation associated with a JSF request is determined at the beginning of the restore view phase and does not change during the request.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>By default, a conversation is transient.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A transient conversation may be marked long-running by calling |Conversation.begin()|</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>A long-running conversation may be marked transient by calling |Conversation.end()|</text>
+ </assertion>
+
+ <assertion id="ha">
+ <text>All long-running conversations have a string-valued unique identifier, _which may be set by the application_ when the conversation is marked long-running~, or generated by the container~</text>
+ </assertion>
+
+ <assertion id="hb">
+ <text>All long-running conversations have a string-valued unique identifier, _which may be_ ~set by the application when the conversation is marked long-running, or~ _generated by the container_</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>If the conversation associated with the current JSF request is in the transient state at the end of a JSF request, it is destroyed, and the conversation context is also destroyed.</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>If the conversation associated with the current JSF request is in the long-running state at the end of a JSF request, it is not destroyed.</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>The long-running conversation context associated with a request that renders a JSF view is automatically propagated to any faces request (JSF form submission) that originates from that rendered page.</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>The long-running conversation context associated with a request that results in a JSF redirect (via a navigation rule) is automatically propagated to the resulting non-faces request, and to any other subsequent request to the same URL. This is accomplished via use of a GET request parameter named cid containing the unique identifier of the conversation.</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>The long-running conversation associated with a request may be propagated to any non-faces request via use of a GET request parameter named |cid| containing the unique identifier of the conversation. In this case, the application must manage this request parameter.</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>When no conversation is propagated to a JSF request, the request is associated with a new transient conversation.</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>All long-running conversations are scoped to a particular HTTP servlet session and may not cross session boundaries.</text>
+ </assertion>
+
+ <assertion id="qa">
+ <text>When the HTTP servlet session is invalidated, all long-running conversation contexts created during the current session are destroyed, after the servlet |service()| method completes.</text>
+ </assertion>
+
+ <assertion id="r" testable="false">
+ <text>The container is permitted to arbitrarily destroy any long-running conversation that is associated with no current JSF request, in order to conserve resources</text>
+ <note>In other words, this is unspecified</note>
+ </assertion>
+
+ <assertion id="ta" testable="false">
+ <text>The conversation timeout, which may be specified by calling |Conversation.setTimeout()| is a hint to the container that a conversation should not be destroyed if it has been active within the last given interval in milliseconds.</text>
+ <note>Not required</note>
+ </assertion>
+
+ <assertion id="tb">
+ <text>If the propagated conversation cannot be restored, the container must associate the request with a new transient conversation and throw an exception of type |javax.context.NonexistentConversationException| from the restore view phase of the JSF lifecycle. The application may handle this exception using the JSF |ExceptionHandler|.</text>
+ </assertion>
+
+ <assertion id="ua">
+ <text>The container ensures that a long-running conversation may be associated with at most one request at a time, by blocking or rejecting concurrent requests. If the container rejects a request, it must associate the request with a new transient conversation and throw an exception of type |javax.context.BusyConversationException| from the restore view phase of the JSF lifecycle. The application may handle this exception using the JSF |ExceptionHandler|.</text>
+ </assertion>
+ </section>
+
<section id="6.7.5" title="The Conversation interface">
<group>
<text>The container provides a built-in bean with bean type |Conversation|, scope |@RequestScoped|, and binding |@Default|, named |javax.enterprise.context.conversation|.</text>
- <assertion id="iaa">
- <text>Test the bean type is correct.</text>
- </assertion>
-
- <assertion id="ib">
- <text>Test the scope is correct.</text>
- </assertion>
-
- <assertion id="id">
- <text>Test the binding type is correct.</text>
- </assertion>
-
- <assertion id="ie">
- <text>Test the bean name is correct.</text>
+ <assertion id="iaa">
+ <text>Test the bean type is correct.</text>
+ </assertion>
+
+ <assertion id="ib">
+ <text>Test the scope is correct.</text>
+ </assertion>
+
+ <assertion id="id">
+ <text>Test the binding type is correct.</text>
+ </assertion>
+
+ <assertion id="ie">
+ <text>Test the bean name is correct.</text>
</assertion>
- </group>
-
- <assertion id="j">
- <text>|begin()| marks the current transient conversation long-running. A conversation identifier may, optionally, be specified. If no conversation identifier is specified, an identifier is generated by the container.</text>
- </assertion>
-
- <assertion id="k">
- <text>|end()| marks the current long-running conversation transient.</text>
- </assertion>
-
- <assertion id="l">
- <text>|getId()| returns the identifier of the current long-running conversation, or a null value of the current conversation is transient.</text>
- </assertion>
-
- <assertion id="m">
- <text>|getTimeout()| returns the timeout, in milliseconds, of the current conversation.</text>
- </assertion>
-
- <assertion id="n">
- <text>|setTimeout()| sets the timeout of the current conversation.</text>
- </assertion>
-
- <assertion id="o">
- <text>|isTransient()| returns |true| if the conversation is marked transient, or |false| if it is marked long-running.</text>
- </assertion>
-
- <assertion id="p">
- <text>If any method of |Conversation| is called when the conversation scope is not active, a |ContextNotActiveException| is thrown.</text>
- </assertion>
-
- <assertion id="q">
- <text>If |end()| is called, and the current conversation is marked transient, an |IllegalStateException| is thrown.</text>
- </assertion>
-
- <assertion id="r">
- <text>If |begin()| is called, and the current conversation is already marked long-running, an |IllegalStateException| is thrown.</text>
- </assertion>
-
- <assertion id="s">
- <text>If |begin()| is called with an explicit conversation identifier, and a long-running conversation with that identifier already exists, an |IllegalArgumentException| is thrown.</text>
- </assertion>
- </section>
-
- <section id="7" title="Lifecycle of contextual instances">
-
- </section>
-
- <section id="7.1" title="Restriction upon bean instantiation">
-
- </section>
-
+ </group>
+
+ <assertion id="j">
+ <text>|begin()| marks the current transient conversation long-running. A conversation identifier may, optionally, be specified. If no conversation identifier is specified, an identifier is generated by the container.</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>|end()| marks the current long-running conversation transient.</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>|getId()| returns the identifier of the current long-running conversation, or a null value of the current conversation is transient.</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>|getTimeout()| returns the timeout, in milliseconds, of the current conversation.</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>|setTimeout()| sets the timeout of the current conversation.</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>|isTransient()| returns |true| if the conversation is marked transient, or |false| if it is marked long-running.</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>If any method of |Conversation| is called when the conversation scope is not active, a |ContextNotActiveException| is thrown.</text>
+ </assertion>
+
+ <assertion id="q">
+ <text>If |end()| is called, and the current conversation is marked transient, an |IllegalStateException| is thrown.</text>
+ </assertion>
+
+ <assertion id="r">
+ <text>If |begin()| is called, and the current conversation is already marked long-running, an |IllegalStateException| is thrown.</text>
+ </assertion>
+
+ <assertion id="s">
+ <text>If |begin()| is called with an explicit conversation identifier, and a long-running conversation with that identifier already exists, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+ </section>
+
+ <section id="7" title="Lifecycle of contextual instances">
+
+ </section>
+
+ <section id="7.1" title="Restriction upon bean instantiation">
+
+ </section>
+
<section id="7.2" title="Container invocations and interception">
<assertion id="a0" testable="false">
<text>When the application invokes a method of a bean via a contextual reference to the bean, as defined in Section 6.5.3, "Contextual reference for a bean", or a business method of a session bean via an EJB remote or local reference, the invocation is treated as a business method invocation.</text>
@@ -3594,195 +3594,195 @@
<assertion id="a1">
<text>Invocations of initializer methods by the container are not business method invocations.</text>
</assertion>
-
- <group>
- <text>Invocations of producer, disposer and observer methods by the container are business method invocations are are intercepted by method interceptors and decorators.</text>
-
- <assertion id="ia">
- <text>Verify producer methods are intercepted</text>
- </assertion>
-
- <assertion id="ib">
- <text>Verify producer methods are decorated</text>
- </assertion>
-
- <assertion id="ic">
- <text>Verify disposer methods are intercepted</text>
- </assertion>
-
- <assertion id="id">
- <text>Verify disposer methods are decorated</text>
- </assertion>
-
- <assertion id="ie">
- <text>Verify observer methods are intercepted</text>
- </assertion>
-
- <assertion id="if">
- <text>Verify observer methods are decorated</text>
- </assertion>
+
+ <group>
+ <text>Invocations of producer, disposer and observer methods by the container are business method invocations are are intercepted by method interceptors and decorators.</text>
+
+ <assertion id="ia">
+ <text>Verify producer methods are intercepted</text>
+ </assertion>
+
+ <assertion id="ib">
+ <text>Verify producer methods are decorated</text>
+ </assertion>
+
+ <assertion id="ic">
+ <text>Verify disposer methods are intercepted</text>
+ </assertion>
+
+ <assertion id="id">
+ <text>Verify disposer methods are decorated</text>
+ </assertion>
+
+ <assertion id="ie">
+ <text>Verify observer methods are intercepted</text>
+ </assertion>
+
+ <assertion id="if">
+ <text>Verify observer methods are decorated</text>
+ </assertion>
</group>
- <assertion id="j">
- <text>Invocation of lifecycle callbacks by the container are not business method invocations, but are intercepted by interceptors for lifecycle callbacks.</text>
+ <assertion id="j">
+ <text>Invocation of lifecycle callbacks by the container are not business method invocations, but are intercepted by interceptors for lifecycle callbacks.</text>
</assertion>
- <group>
- <text>Invocations of interceptors and decorator methods during method or lifecycle callback interception are not business method invocations, and therefore no recursive interception occurs.</text>
- <assertion id="ka">
- <text>Verify decorators callbacks are not intercepted</text>
- </assertion>
-
- <assertion id="kb">
- <text>Verify decorators callbacks are not decorated</text>
- </assertion>
-
- <assertion id="kc">
- <text>Verify interceptor callbacks are not intercepted</text>
- </assertion>
-
- <assertion id="kd">
- <text>Verify interceptor callbacks are not decorated</text>
- </assertion>
+ <group>
+ <text>Invocations of interceptors and decorator methods during method or lifecycle callback interception are not business method invocations, and therefore no recursive interception occurs.</text>
+ <assertion id="ka">
+ <text>Verify decorators callbacks are not intercepted</text>
+ </assertion>
+
+ <assertion id="kb">
+ <text>Verify decorators callbacks are not decorated</text>
+ </assertion>
+
+ <assertion id="kc">
+ <text>Verify interceptor callbacks are not intercepted</text>
+ </assertion>
+
+ <assertion id="kd">
+ <text>Verify interceptor callbacks are not decorated</text>
+ </assertion>
</group>
<assertion id="a5">
<text>Invocations of message listener methods of message-driven beans during message delivery are business method invocations.</text>
</assertion>
-
- <group>
- <text>If, and only if, the invocation is a business method invocation it passes through the method interceptor and decorator stacks, and in the case of a session bean, it is subject to EJB services such a declarative transaction management, concurrency, security and asynchronicity, as defined by the EJB specification.</text>
-
- <assertion id="a">
- <text>Verify that a managed bean's business methods are intercepted</text>
- </assertion>
-
- <assertion id="b">
- <text>Verify that a managed bean's business methods are decorated</text>
- </assertion>
-
- <assertion id="c">
- <text>Verify that a session bean's business methods are intercepted</text>
- </assertion>
-
- <assertion id="d">
- <text>Verify that a session bean's business methods are decorated</text>
- </assertion>
-
- <assertion id="f" testable="false">
- <text>Verify that a session bean's business methods receive EJB services</text>
- <note>This is tested by the EJB TCK</note>
- </assertion>
- </group>
-
- <assertion id="g">
- <text>If the invocation is not a business method invocation, it is treated as a normal Java method call and is not intercepted by the container.</text>
- </assertion>
- </section>
-
- <section id="7.3" title="Lifecycle of contextual instances">
-
- </section>
-
- <section id="7.3.1" title="Lifecycle of managed beans">
- <assertion id="aa">
- <text>When the |create()| method of the |Bean| object that represents a managed bean is called, the container obtains an instance of the bean, as defined by the Managed Beans specification, calling the bean constructor as defined by Section 5.6.3, "Injection using the bean constructor", and performing dependency injection as defined in Section 5.6.4, "Injection of fields and initializer methods".</text>
- </assertion>
-
- <assertion id="ba">
- <text>When the |destroy()| method is called, the container destroys the instance, as defined by the Managed Beans specification, and any dependent objects, as defined in Section 5.6.5, "Destruction of dependent objects".</text>
- </assertion>
- </section>
-
- <section id="7.3.2" title="Lifecycle of stateful session beans">
- <assertion id="aa">
- <text>When the |create()| method of a |Bean| object that represents a stateful session bean that is called, the container creates and returns a container-specific internal local reference to a new session bean instance. The reference must be passivation capable. This reference is not directly exposed to the application.</text>
- </assertion>
-
- <assertion id="bb">
- <text>Before injecting or returning a contextual instance to the application, the container transforms its internal reference into an object that implements the bean types expected by the application and delegates method invocations to the underlying stateful session bean instance. This object must be passivation capable.</text>
- </assertion>
-
- <assertion id="bc">
- <text>When the |destroy()| method is called, and if the underlying EJB was not already removed by direct invocation of a remove method by the application, the container removes the stateful session bean. The |@PreDestroy| callback must be invoked by the container.</text>
- </assertion>
- </section>
-
- <section id="7.3.3" title="Lifecycle of stateless session and singleton beans">
- <assertion id="a">
- <text>When the |create()| method of a Bean object that represents a stateless session or singleton session bean is called, the container
-creates and returns a container-specific internal local reference to the session bean. This reference is not directly exposed to the application.</text>
- </assertion>
-
- <assertion id="b">
- <text>Before injecting or returning a contextual instance to the application, the container transforms its internal reference into an object that implements the bean types expected by the application and delegates method invocations to the underlying session bean. This object must be passivation capable.</text>
- </assertion>
-
- <assertion id="c">
- <text>When the |destroy()| method is called, the container simply discards this internal reference.</text>
- </assertion>
- </section>
-
- <section id="7.3.4" title="Lifecycle of producer methods">
- <assertion id="ea">
- <text>When the create() method of a |Bean| object that represents a producer method is called, the container must invoke the producer method as defined by Section 5.6.6, "Invocation of producer or disposer methods". The return value of the producer method, after method interception completes, is the new contextual instance to be returned by |Bean.create()|.</text>
- </assertion>
-
- <assertion id="k">
- <text>If the producer method returns a null value and the producer method bean has the scope |@Dependent|, the |create()| method returns a null value.</text>
- </assertion>
-
- <assertion id="l">
- <text>If the producer method returns a null value, and the scope of the producer method is not |@Dependent|, the |create()| method throws an |IllegalProductException|.</text>
- </assertion>
-
- <assertion id="ma">
- <text>When the |destroy()| method is called, and if there is a disposal method for this producer method, the container must invoke the disposer method as defined by Section 5.6.6, "Invocation of producer or disposal methods", passing the instance given to |destroy()| to the disposed parameter.</text>
- </assertion>
-
- <assertion id="r">
- <text>Finally, the container destroys dependent objects, as defined in Section 5.6.5, "Destruction of dependent objects".</text>
- </assertion>
- </section>
-
- <section id="7.3.5" title="Lifecycle of producer fields">
- <assertion id="ga">
- <text>When the |create()| method of a |Bean| object that represents a producer field is called, the container must access the producer field as defined by Section 5.6.7, "Access to producer field values" to obtain the current value of the field. The value of the producer field is the new contextual instance to be returned by |Bean.create()|.</text>
- </assertion>
-
- <assertion id="m">
- <text>If the producer field contains a null value and the producer field bean has the scope |@Dependent|, the |create()| method returns a null value.</text>
- </assertion>
-
- <assertion id="n">
- <text>If the producer field contains a null value, and the scope of the producer method is not |@Dependent|, the |create()| method throws an |IllegalProductException|.</text>
- </assertion>
- </section>
-
- <section id="7.3.6" title="Lifecycle of resources">
+
<group>
- <text>When the |create()| method of a |Bean| object that represents a resource is called, the container creates and returns a container-specific internal reference to the Java EE component environment resource, entity manager, entity manager factory, remote EJB instance or web service reference. This reference is not directly exposed to the application.</text>
+ <text>If, and only if, the invocation is a business method invocation it passes through the method interceptor and decorator stacks, and in the case of a session bean, it is subject to EJB services such a declarative transaction management, concurrency, security and asynchronicity, as defined by the EJB specification.</text>
+ <assertion id="a">
+ <text>Verify that a managed bean's business methods are intercepted</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Verify that a managed bean's business methods are decorated</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Verify that a session bean's business methods are intercepted</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Verify that a session bean's business methods are decorated</text>
+ </assertion>
+
+ <assertion id="f" testable="false">
+ <text>Verify that a session bean's business methods receive EJB services</text>
+ <note>This is tested by the EJB TCK</note>
+ </assertion>
+ </group>
+
+ <assertion id="g">
+ <text>If the invocation is not a business method invocation, it is treated as a normal Java method call and is not intercepted by the container.</text>
+ </assertion>
+ </section>
+
+ <section id="7.3" title="Lifecycle of contextual instances">
+
+ </section>
+
+ <section id="7.3.1" title="Lifecycle of managed beans">
+ <assertion id="aa">
+ <text>When the |create()| method of the |Bean| object that represents a managed bean is called, the container obtains an instance of the bean, as defined by the Managed Beans specification, calling the bean constructor as defined by Section 5.6.3, "Injection using the bean constructor", and performing dependency injection as defined in Section 5.6.4, "Injection of fields and initializer methods".</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>When the |destroy()| method is called, the container destroys the instance, as defined by the Managed Beans specification, and any dependent objects, as defined in Section 5.6.5, "Destruction of dependent objects".</text>
+ </assertion>
+ </section>
+
+ <section id="7.3.2" title="Lifecycle of stateful session beans">
+ <assertion id="aa">
+ <text>When the |create()| method of a |Bean| object that represents a stateful session bean that is called, the container creates and returns a container-specific internal local reference to a new session bean instance. The reference must be passivation capable. This reference is not directly exposed to the application.</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>Before injecting or returning a contextual instance to the application, the container transforms its internal reference into an object that implements the bean types expected by the application and delegates method invocations to the underlying stateful session bean instance. This object must be passivation capable.</text>
+ </assertion>
+
+ <assertion id="bc">
+ <text>When the |destroy()| method is called, and if the underlying EJB was not already removed by direct invocation of a remove method by the application, the container removes the stateful session bean. The |@PreDestroy| callback must be invoked by the container.</text>
+ </assertion>
+ </section>
+
+ <section id="7.3.3" title="Lifecycle of stateless session and singleton beans">
+ <assertion id="a">
+ <text>When the |create()| method of a Bean object that represents a stateless session or singleton session bean is called, the container
+creates and returns a container-specific internal local reference to the session bean. This reference is not directly exposed to the application.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Before injecting or returning a contextual instance to the application, the container transforms its internal reference into an object that implements the bean types expected by the application and delegates method invocations to the underlying session bean. This object must be passivation capable.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>When the |destroy()| method is called, the container simply discards this internal reference.</text>
+ </assertion>
+ </section>
+
+ <section id="7.3.4" title="Lifecycle of producer methods">
+ <assertion id="ea">
+ <text>When the create() method of a |Bean| object that represents a producer method is called, the container must invoke the producer method as defined by Section 5.6.6, "Invocation of producer or disposer methods". The return value of the producer method, after method interception completes, is the new contextual instance to be returned by |Bean.create()|.</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>If the producer method returns a null value and the producer method bean has the scope |@Dependent|, the |create()| method returns a null value.</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>If the producer method returns a null value, and the scope of the producer method is not |@Dependent|, the |create()| method throws an |IllegalProductException|.</text>
+ </assertion>
+
+ <assertion id="ma">
+ <text>When the |destroy()| method is called, and if there is a disposal method for this producer method, the container must invoke the disposer method as defined by Section 5.6.6, "Invocation of producer or disposal methods", passing the instance given to |destroy()| to the disposed parameter.</text>
+ </assertion>
+
+ <assertion id="r">
+ <text>Finally, the container destroys dependent objects, as defined in Section 5.6.5, "Destruction of dependent objects".</text>
+ </assertion>
+ </section>
+
+ <section id="7.3.5" title="Lifecycle of producer fields">
+ <assertion id="ga">
+ <text>When the |create()| method of a |Bean| object that represents a producer field is called, the container must access the producer field as defined by Section 5.6.7, "Access to producer field values" to obtain the current value of the field. The value of the producer field is the new contextual instance to be returned by |Bean.create()|.</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>If the producer field contains a null value and the producer field bean has the scope |@Dependent|, the |create()| method returns a null value.</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>If the producer field contains a null value, and the scope of the producer method is not |@Dependent|, the |create()| method throws an |IllegalProductException|.</text>
+ </assertion>
+ </section>
+
+ <section id="7.3.6" title="Lifecycle of resources">
+ <group>
+ <text>When the |create()| method of a |Bean| object that represents a resource is called, the container creates and returns a container-specific internal reference to the Java EE component environment resource, entity manager, entity manager factory, remote EJB instance or web service reference. This reference is not directly exposed to the application.</text>
+
<assertion id="la">
<text>Check Java EE component environment resource</text>
- </assertion>
-
+ </assertion>
+
<assertion id="lb">
<text>Check Entity Manager</text>
- </assertion>
-
+ </assertion>
+
<assertion id="lc">
<text>Check Entity Manager Factory</text>
- </assertion>
-
+ </assertion>
+
<assertion id="ld">
<text>Check Remote EJB instance</text>
</assertion>
<assertion id="le">
<text>Check Web Service Reference</text>
- </assertion>
+ </assertion>
</group>
-
+
<group>
<text>Before injecting or returning a contextual instance to the application, the container transforms its internal reference into an object that implements the bean types expected by the application and delegates method invocations to the underlying resource, entity manager, entity manager factory, remote EJB instance or web service reference. This object must be passivation capable.</text>
@@ -3831,7 +3831,7 @@
<text>When the |destroy()| method is called, the container discards this internal reference and performs any cleanup required of state associated with the client or transaction.</text>
<assertion id="na" testable="false">
- <text>Check Java EE component environment resource</text>
+ <text>Check Java EE component environment resource</text>
<note>No behavior specified by platform spec</note>
</assertion>
@@ -3840,17 +3840,17 @@
</assertion>
<assertion id="nc" testable="false">
- <text>Check Entity Manager Factory</text>
+ <text>Check Entity Manager Factory</text>
<note>No behavior specified by platform spec</note>
</assertion>
<assertion id="nd" testable="false">
- <text>Check Remote EJB instance</text>
+ <text>Check Remote EJB instance</text>
<note>No behavior specified by platform spec</note>
</assertion>
<assertion id="ne" testable="false">
- <text>Check Web Service Reference</text>
+ <text>Check Web Service Reference</text>
<note>No behavior specified by platform spec</note>
</assertion>
</group>
@@ -3863,333 +3863,333 @@
</group>
- <assertion id="p" testable="false">
- <text>The container is not required to perform Java EE component environment injection upon a static field. Portable applications should not rely upon the value of a static field that functions as a resource declaration.</text>
+ <assertion id="p" testable="false">
+ <text>The container is not required to perform Java EE component environment injection upon a static field. Portable applications should not rely upon the value of a static field that functions as a resource declaration.</text>
<note>Defines non-portable behavior</note>
- </assertion>
- </section>
-
- <section id="8" title="Decorators">
- <assertion id="a" testable="false">
- <text>Decorators may be associated with any managed bean that is not itself an interceptor or decorator or with any EJB session bean.</text>
- <note>Doesn't specify an error</note>
- </assertion>
- </section>
-
- <section id="8.1" title="Decorator beans">
- <assertion id="a" testable="false">
- <text>A decorator is a managed bean.</text>
- <note>Statement of intent</note>
- </assertion>
-
- <assertion id="b">
- <text>The set of decorated types of a decorator includes all interfaces implemented directly or indirectly by the bean class, except for |java.io.Serializable|.</text>
- </assertion>
-
- <assertion id="c">
- <text>The decorator bean class and its superclasses are not decorated types of the decorator.</text>
- </assertion>
-
- <assertion id="d">
- <text>The decorator class may be abstract.</text>
- </assertion>
-
- <assertion id="e">
- <text>Decorators of a session bean must comply with the bean provider programming restrictions defined by the EJB specification.</text>
- </assertion>
-
- <assertion id="f">
- <text>Decorators of a stateful session bean must comply with the rules for instance passivation and conversational state defined by the EJB specification.</text>
- </assertion>
- </section>
-
- <section id="8.1.1" title="Declaring a decorator">
- <assertion id="a">
- <text>A decorator is declared by annotating the bean class with the |(a)javax.decorator.Decorator| stereotype.</text>
- </assertion>
- </section>
-
- <section id="8.1.2" title="Decorator delegate injection points">
- <assertion id="a">
- <text>All decorators have a delegate injection point. A delegate injection point is an injection point of the bean class. The type and qualifiers of the injection point are called the delegate type and delegate qualifiers. The delegate injection point must be be declared by annotating the injection point with the annotation |(a)javax.decorator.Decorates|.</text>
- </assertion>
-
- <assertion id="b">
- <text>The decorator applies to any bean that is eligible for injection to the delegate injection point, according to the rules defined
-in Section 5.1, "Typesafe resolution algorithm".</text>
- </assertion>
-
- <assertion id="ca">
- <text>A decorator must have exactly one delegate injection point. If a decorator has more than one delegate injection point~, or does not have a delegate injection point,~ the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="cb">
- <text>A decorator must have exactly one delegate injection point. If a decorator ~has more than one delegate injection point, or~ does not have a delegate injection point, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <group>
- <text>The delegate injection point must be an injected field, initializer method parameter or bean constructor method parameter. If an injection point that is not an injected field, initializer method parameter or bean constructor method parameter is annotated |@Decorates|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
-
- <assertion id="cc">
- <text>Check an injected field is ok</text>
- </assertion>
-
- <assertion id="cd">
- <text>Check an initializer method parameter is ok</text>
- </assertion>
-
- <assertion id="ce">
- <text>Check a bean constructor method parameter is ok</text>
- </assertion>
-
- <assertion id="cf">
- <text>Check that a producer method parameter is not ok</text>
- </assertion>
-
- </group>
-
- <assertion id="cg">
- <text>If a bean class that is not a decorator has an injection point annotated |@Decorates|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="d">
- <text>If a decorator applies to a managed bean, and the bean class is declared final, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="e">
- <text>If a decorator applies to a managed bean with a non-static, non-private, final method, and the decorator also implements that method, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="f">
- <text>The container must inject a delegate object to the delegate injection point. The delegate object implements the delegate type and delegates method invocations along the decorator stack.</text>
- </assertion>
- </section>
-
- <section id="8.1.3" title="Decorated types of a decorator">
- <assertion id="a">
- <text>The delegate type of a decorator must implement or extend every decorated type. If the delegate type does not implement or extend a decorated type of the decorator, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="ab">
- <text>If a decorated type is a parameterized type and the delegate type does not have exactly the same type parameters as the decorated type, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="b">
- <text>A decorator is not required to implement the delegate type.</text>
- </assertion>
-
- <assertion id="c">
- <text>A decorator may be an abstract Java class, and is not required to implement every method of every decorated type.</text>
- </assertion>
-
- <assertion id="d">
- <text>The decorator intercepts every method declared by a decorated type of the decorator, and that is implemented by the bean class of the decorator.</text>
- </assertion>
- </section>
-
- <section id="8.2" title="Decorator enablement and ordering">
- <assertion id="a">
- <text>By default, decorators are not enabled. A decorator must be explicitly enabled by listing its bean class under the |<Decorators>| element in |beans.xml| file of the bean deployment archive.</text>
- </assertion>
-
- <assertion id="b">
- <text>The order of the decorator declarations determines the decorator ordering. Decorators which occur earlier in the list are called first.</text>
- </assertion>
-
- <assertion id="ba">
- <text>Each child |<class>| element must specify the name of a decorator bean class. If there is no class with the specified name~, or if the class with the specified name is not a decorator bean class,~ the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="bb">
- <text>Each child |<class>| element must specify the name of a decorator bean class. If ~there is no class with the specified name, or if~ the class with the specified name is not a decorator bean class~,~ the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="bc">
- <text>If the same class is listed twice under the |<decorators>| element, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="f">
- <text>Decorators are called after interceptors.</text>
- </assertion>
- </section>
-
- <section id="8.3" title="Decorator resolution">
- <assertion id="aa">
- <text>The following procedure must be used by the container when resolving decorators for a certain bean - First, the container identifies the set of matching decorators for which the bean is eligible for injection to the delegate injection point according to the rules defined in Section 5.3, "Typesafe resolution", and for which the decorator is enabled in the bean deployment archive of the bean. Next, the container orders the matching decorators according to the decorator ordering specified in Section 8.2, "Decorator enablement and ordering".</text>
- </assertion>
-
- <assertion id="b">
- <text>For a custom implementation of the Decorator interface defined in Section 11.1.1, "The Decorator interface", the container calls |getDelegateType()|, |getDelegateQualifiers()| and |getDecoratedTypes()| to determine the delegate type and qualifiers and decorated types of the decorator.</text>
- </assertion>
- </section>
-
- <section id="8.4" title="Decorator stack creation">
- <assertion id="a">
- <text>When a bean with decorators is created, the container must
-identify the decorators for the bean according to Section 8.3, "Decorator resolution", and for each decorator, obtain a contextual reference, as defined in Section 6.5.3, "Contextual reference for a bean", and build an ordered list of the decorator instances.</text>
- </assertion>
- </section>
-
- <section id="8.5" title="Decorator invocation">
- <assertion id="a">
- <text>Whenever a business method is invoked on an instance of a bean with decorators, the container intercepts the business method invocation and, after processing the interceptor stack, invokes decorators of the bean. The container searches for the first decorator in the decorator stack for the instance that implements the method that is being
-invoked as a business method.</text>
- </assertion>
-
- <assertion id="b">
- <text>If no such decorator exists, the container invokes the business method of the intercepted instance.</text>
- </assertion>
-
- <assertion id="c">
- <text>Otherwise, the container calls the method of the decorator.</text>
- </assertion>
-
- <assertion id="d">
- <text>When any decorator is invoked by the container, it may in turn invoke a method of the delegate. The container intercepts the delegate invocation and searches for the first decorator in the decorator stack for the instance such that the decorator implements the method that is being invoked upon the delegate, and the decorator has not previously been invoked during this business method invocation.</text>
- </assertion>
-
- <assertion id="e">
- <text>If no such decorator exists, the container invokes the business method of the intercepted instance.</text>
- </assertion>
-
- <assertion id="f">
- <text>Otherwise, the container calls the method of the decorator.</text>
- </assertion>
- </section>
-
- <section id="9" title="Interceptor bindings">
-
- </section>
-
- <section id="9.1" title="Interceptor binding types">
- <assertion id="a">
- <text>An interceptor binding type is a Java annotation defined as |@Target({TYPE, METHOD})| or |@Target(TYPE)| and |@Retention(RUNTIME)|.</text>
- </assertion>
-
- <assertion id="b">
- <text>An interceptor binding type may be declared by specifying the |(a)javax.interceptor.InterceptorBinding| meta-annotation.</text>
- </assertion>
-
- <assertion id="c">
- <text>Multiple interceptors may be bound to the same interceptor binding type or types.</text>
- </assertion>
- </section>
-
- <section id="9.1.1" title="Interceptor binding types with additional interceptor bindings">
- <assertion id="a">
- <text>An interceptor binding type may declare other interceptor bindings.</text>
- </assertion>
-
- <assertion id="b">
- <text>Interceptor bindings are transitive�an interceptor binding declared by an interceptor binding type is inherited by all beans and other interceptor binding types that declare that interceptor binding type.</text>
- </assertion>
-
- <assertion id="c" testable="false">
+ </assertion>
+ </section>
+
+ <section id="8" title="Decorators">
+ <assertion id="a" testable="false">
+ <text>Decorators may be associated with any managed bean that is not itself an interceptor or decorator or with any EJB session bean.</text>
+ <note>Doesn't specify an error</note>
+ </assertion>
+ </section>
+
+ <section id="8.1" title="Decorator beans">
+ <assertion id="a" testable="false">
+ <text>A decorator is a managed bean.</text>
+ <note>Statement of intent</note>
+ </assertion>
+
+ <assertion id="b">
+ <text>The set of decorated types of a decorator includes all interfaces implemented directly or indirectly by the bean class, except for |java.io.Serializable|.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The decorator bean class and its superclasses are not decorated types of the decorator.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The decorator class may be abstract.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Decorators of a session bean must comply with the bean provider programming restrictions defined by the EJB specification.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Decorators of a stateful session bean must comply with the rules for instance passivation and conversational state defined by the EJB specification.</text>
+ </assertion>
+ </section>
+
+ <section id="8.1.1" title="Declaring a decorator">
+ <assertion id="a">
+ <text>A decorator is declared by annotating the bean class with the |(a)javax.decorator.Decorator| stereotype.</text>
+ </assertion>
+ </section>
+
+ <section id="8.1.2" title="Decorator delegate injection points">
+ <assertion id="a">
+ <text>All decorators have a delegate injection point. A delegate injection point is an injection point of the bean class. The type and qualifiers of the injection point are called the delegate type and delegate qualifiers. The delegate injection point must be be declared by annotating the injection point with the annotation |(a)javax.decorator.Decorates|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The decorator applies to any bean that is eligible for injection to the delegate injection point, according to the rules defined
+in Section 5.1, "Typesafe resolution algorithm".</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>A decorator must have exactly one delegate injection point. If a decorator has more than one delegate injection point~, or does not have a delegate injection point,~ the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="cb">
+ <text>A decorator must have exactly one delegate injection point. If a decorator ~has more than one delegate injection point, or~ does not have a delegate injection point, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <group>
+ <text>The delegate injection point must be an injected field, initializer method parameter or bean constructor method parameter. If an injection point that is not an injected field, initializer method parameter or bean constructor method parameter is annotated |@Decorates|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+
+ <assertion id="cc">
+ <text>Check an injected field is ok</text>
+ </assertion>
+
+ <assertion id="cd">
+ <text>Check an initializer method parameter is ok</text>
+ </assertion>
+
+ <assertion id="ce">
+ <text>Check a bean constructor method parameter is ok</text>
+ </assertion>
+
+ <assertion id="cf">
+ <text>Check that a producer method parameter is not ok</text>
+ </assertion>
+
+ </group>
+
+ <assertion id="cg">
+ <text>If a bean class that is not a decorator has an injection point annotated |@Decorates|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If a decorator applies to a managed bean, and the bean class is declared final, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If a decorator applies to a managed bean with a non-static, non-private, final method, and the decorator also implements that method, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The container must inject a delegate object to the delegate injection point. The delegate object implements the delegate type and delegates method invocations along the decorator stack.</text>
+ </assertion>
+ </section>
+
+ <section id="8.1.3" title="Decorated types of a decorator">
+ <assertion id="a">
+ <text>The delegate type of a decorator must implement or extend every decorated type. If the delegate type does not implement or extend a decorated type of the decorator, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>If a decorated type is a parameterized type and the delegate type does not have exactly the same type parameters as the decorated type, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A decorator is not required to implement the delegate type.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A decorator may be an abstract Java class, and is not required to implement every method of every decorated type.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The decorator intercepts every method declared by a decorated type of the decorator, and that is implemented by the bean class of the decorator.</text>
+ </assertion>
+ </section>
+
+ <section id="8.2" title="Decorator enablement and ordering">
+ <assertion id="a">
+ <text>By default, decorators are not enabled. A decorator must be explicitly enabled by listing its bean class under the |<Decorators>| element in |beans.xml| file of the bean deployment archive.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The order of the decorator declarations determines the decorator ordering. Decorators which occur earlier in the list are called first.</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>Each child |<class>| element must specify the name of a decorator bean class. If there is no class with the specified name~, or if the class with the specified name is not a decorator bean class,~ the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>Each child |<class>| element must specify the name of a decorator bean class. If ~there is no class with the specified name, or if~ the class with the specified name is not a decorator bean class~,~ the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="bc">
+ <text>If the same class is listed twice under the |<decorators>| element, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Decorators are called after interceptors.</text>
+ </assertion>
+ </section>
+
+ <section id="8.3" title="Decorator resolution">
+ <assertion id="aa">
+ <text>The following procedure must be used by the container when resolving decorators for a certain bean - First, the container identifies the set of matching decorators for which the bean is eligible for injection to the delegate injection point according to the rules defined in Section 5.3, "Typesafe resolution", and for which the decorator is enabled in the bean deployment archive of the bean. Next, the container orders the matching decorators according to the decorator ordering specified in Section 8.2, "Decorator enablement and ordering".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>For a custom implementation of the Decorator interface defined in Section 11.1.1, "The Decorator interface", the container calls |getDelegateType()|, |getDelegateQualifiers()| and |getDecoratedTypes()| to determine the delegate type and qualifiers and decorated types of the decorator.</text>
+ </assertion>
+ </section>
+
+ <section id="8.4" title="Decorator stack creation">
+ <assertion id="a">
+ <text>When a bean with decorators is created, the container must
+identify the decorators for the bean according to Section 8.3, "Decorator resolution", and for each decorator, obtain a contextual reference, as defined in Section 6.5.3, "Contextual reference for a bean", and build an ordered list of the decorator instances.</text>
+ </assertion>
+ </section>
+
+ <section id="8.5" title="Decorator invocation">
+ <assertion id="a">
+ <text>Whenever a business method is invoked on an instance of a bean with decorators, the container intercepts the business method invocation and, after processing the interceptor stack, invokes decorators of the bean. The container searches for the first decorator in the decorator stack for the instance that implements the method that is being
+invoked as a business method.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If no such decorator exists, the container invokes the business method of the intercepted instance.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Otherwise, the container calls the method of the decorator.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>When any decorator is invoked by the container, it may in turn invoke a method of the delegate. The container intercepts the delegate invocation and searches for the first decorator in the decorator stack for the instance such that the decorator implements the method that is being invoked upon the delegate, and the decorator has not previously been invoked during this business method invocation.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If no such decorator exists, the container invokes the business method of the intercepted instance.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Otherwise, the container calls the method of the decorator.</text>
+ </assertion>
+ </section>
+
+ <section id="9" title="Interceptor bindings">
+
+ </section>
+
+ <section id="9.1" title="Interceptor binding types">
+ <assertion id="a">
+ <text>An interceptor binding type is a Java annotation defined as |@Target({TYPE, METHOD})| or |@Target(TYPE)| and |@Retention(RUNTIME)|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>An interceptor binding type may be declared by specifying the |(a)javax.interceptor.InterceptorBinding| meta-annotation.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Multiple interceptors may be bound to the same interceptor binding type or types.</text>
+ </assertion>
+ </section>
+
+ <section id="9.1.1" title="Interceptor binding types with additional interceptor bindings">
+ <assertion id="a">
+ <text>An interceptor binding type may declare other interceptor bindings.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Interceptor bindings are transitive�an interceptor binding declared by an interceptor binding type is inherited by all beans and other interceptor binding types that declare that interceptor binding type.</text>
+ </assertion>
+
+ <assertion id="c" testable="false">
<text>Interceptor binding types declared |@Target(TYPE)| may not be applied to interceptor binding types declared |@Target({TYPE, METHOD})|.</text>
- <note>The behaviour here is undefined.</note>
- </assertion>
- </section>
-
- <section id="9.1.2" title="Interceptor bindings for stereotypes">
- <assertion id="a">
- <text>Interceptor bindings may be applied to a stereotype by annotating the stereotype annotation</text>
- </assertion>
-
- <assertion id="b">
- <text>An interceptor binding declared by a stereotype are inherited by any bean that declares that stereotype.</text>
- </assertion>
-
- <assertion id="c" testable="false">
+ <note>The behaviour here is undefined.</note>
+ </assertion>
+ </section>
+
+ <section id="9.1.2" title="Interceptor bindings for stereotypes">
+ <assertion id="a">
+ <text>Interceptor bindings may be applied to a stereotype by annotating the stereotype annotation</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>An interceptor binding declared by a stereotype are inherited by any bean that declares that stereotype.</text>
+ </assertion>
+
+ <assertion id="c" testable="false">
<text>If a stereotype declares interceptor bindings, it must be defined as |@Target(TYPE)|.</text>
- <note>The behaviour here is undefined.</note>
- </assertion>
- </section>
-
- <section id="9.2" title="Declaring the interceptor bindings of an interceptor">
- <assertion id="a">
- <text>The interceptor bindings of an interceptor are specified by annotating the interceptor class with the binding types and the |(a)javax.interceptor.Interceptor| annotation.</text>
- </assertion>
-
- <assertion id="b">
- <text>If an interceptor does not declare an |@Interceptor| annotation, it must be bound to beans using |@Interceptors| or |ejb-jar.xml|.</text>
- </assertion>
-
- <assertion id="c">
- <text>All interceptors declared using |@Interceptor| must specify at least one interceptor binding. If an interceptor declared using |@Interceptor| does not declare any interceptor binding, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="d">
- <text>An interceptor for lifecycle callbacks may only declare interceptor binding types that are defined as |@Target(TYPE)|. If an interceptor for lifecycle callbacks declares an interceptor binding type that is defined |@Target({TYPE, METHOD})|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
- </section>
-
- <section id="9.3" title="Binding an interceptor to a bean">
- <assertion id="a">
- <text>An interceptor binding may be declared by annotating the bean class, or a method of the bean class, with the interceptor binding type.</text>
- </assertion>
- </section>
-
- <section id="9.4" title="Interceptor enablement and ordering">
- <assertion id="a">
- <text>By default, a bean deployment archive has no enabled interceptors bound via interceptor bindings. An interceptor must be explicitly enabled by listing
-its class under the |<Interceptors>| element of the |beans.xml| file for the bean deployment archive.</text>
- </assertion>
-
- <assertion id="b">
- <text>The order of the interceptor declarations determines the interceptor ordering. Interceptors which occur earlier in the list are
-called first.</text>
- </assertion>
+ <note>The behaviour here is undefined.</note>
+ </assertion>
+ </section>
- <group>
+ <section id="9.2" title="Declaring the interceptor bindings of an interceptor">
+ <assertion id="a">
+ <text>The interceptor bindings of an interceptor are specified by annotating the interceptor class with the binding types and the |(a)javax.interceptor.Interceptor| annotation.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If an interceptor does not declare an |@Interceptor| annotation, it must be bound to beans using |@Interceptors| or |ejb-jar.xml|.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>All interceptors declared using |@Interceptor| must specify at least one interceptor binding. If an interceptor declared using |@Interceptor| does not declare any interceptor binding, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>An interceptor for lifecycle callbacks may only declare interceptor binding types that are defined as |@Target(TYPE)|. If an interceptor for lifecycle callbacks declares an interceptor binding type that is defined |@Target({TYPE, METHOD})|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="9.3" title="Binding an interceptor to a bean">
+ <assertion id="a">
+ <text>An interceptor binding may be declared by annotating the bean class, or a method of the bean class, with the interceptor binding type.</text>
+ </assertion>
+ </section>
+
+ <section id="9.4" title="Interceptor enablement and ordering">
+ <assertion id="a">
+ <text>By default, a bean deployment archive has no enabled interceptors bound via interceptor bindings. An interceptor must be explicitly enabled by listing
+its class under the |<Interceptors>| element of the |beans.xml| file for the bean deployment archive.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The order of the interceptor declarations determines the interceptor ordering. Interceptors which occur earlier in the list are
+called first.</text>
+ </assertion>
+
+ <group>
<text>Each child |<class>| element must specify the name of an interceptor class. If there is no class with the specified name, or if the class with the specified name is not an interceptor class, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- <assertion id="caa">
- <text>Test with a non-existant class.</text>
+ <assertion id="caa">
+ <text>Test with a non-existant class.</text>
</assertion>
<assertion id="cab">
<text>Test with a class that isn't an interceptor.</text>
</assertion>
- </group>
-
- <assertion id="cb">
- <text>If the same class is listed twice under the |<interceptors>| element, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="f">
- <text>Interceptors declared using |@Interceptors| or in |ejb-jar.xml| are called before interceptors declared using interceptor bindings.</text>
- </assertion>
-
- <assertion id="g">
- <text>Interceptors are called before decorators.</text>
- </assertion>
- </section>
-
- <section id="9.5" title="Interceptor resolution">
- <assertion id="a">
- <text>For a lifecycle callback, the bean interceptor bindings include the interceptor bindings declared by the bean at the class level, including interceptor bindings declared as meta-annotations of other interceptor bindings, recursively, and of stereotypes.
- </text>
- </assertion>
-
- <assertion id="b">
- <text>For a method, the bean interceptor bindings include the interceptor bindings declared by the bean at the class level, including interceptor bindings declared as meta-annotations of other interceptor bindings, recursively, and of stereotypes, together with all interceptor bindings declared at the method level, including interceptor bindings declared as meta-annotations of other interceptor bindings, recursively.</text>
- </assertion>
-
- <assertion id="ca">
- <text>First, the container identifies the set of matching enabled interceptors where, for each interceptor binding declared by the interceptor, there exists an interceptor binding in the set of bean interceptor bindings with (a) the same type and (b) the same annotation member value for each member which is not annotated |(a)javax.enterprise.inject.NonBinding| (see Section 9.5.2, "Interceptor binding types with members"), and the interceptor intercepts the given kind of lifecycle callback or business method, and the interceptor is enabled in the bean deployment archive of the bean.</text>
- </assertion>
-
- <assertion id="ea">
- <text>Next, the container orders the matching interceptors according to the interceptor ordering specified in Section 9.4, "Interceptor enablement and ordering".</text>
- </assertion>
-
- <assertion id="f">
- <text>For a custom implementation of the Interceptor interface defined in Section 11.1.2, "The Interceptor interface", the container calls |getInterceptorBindings()| to determine the interceptor bindings of the interceptor and |intercepts()| to determine if the interceptor intercepts a given kind of lifecycle callback or business method.</text>
- </assertion>
- </section>
-
- <section id="9.5.1" title="Interceptors with multiple bindings">
- <group>
+ </group>
+
+ <assertion id="cb">
+ <text>If the same class is listed twice under the |<interceptors>| element, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Interceptors declared using |@Interceptors| or in |ejb-jar.xml| are called before interceptors declared using interceptor bindings.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>Interceptors are called before decorators.</text>
+ </assertion>
+ </section>
+
+ <section id="9.5" title="Interceptor resolution">
+ <assertion id="a">
+ <text>For a lifecycle callback, the bean interceptor bindings include the interceptor bindings declared by the bean at the class level, including interceptor bindings declared as meta-annotations of other interceptor bindings, recursively, and of stereotypes.
+ </text>
+ </assertion>
+
+ <assertion id="b">
+ <text>For a method, the bean interceptor bindings include the interceptor bindings declared by the bean at the class level, including interceptor bindings declared as meta-annotations of other interceptor bindings, recursively, and of stereotypes, together with all interceptor bindings declared at the method level, including interceptor bindings declared as meta-annotations of other interceptor bindings, recursively.</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>First, the container identifies the set of matching enabled interceptors where, for each interceptor binding declared by the interceptor, there exists an interceptor binding in the set of bean interceptor bindings with (a) the same type and (b) the same annotation member value for each member which is not annotated |(a)javax.enterprise.inject.NonBinding| (see Section 9.5.2, "Interceptor binding types with members"), and the interceptor intercepts the given kind of lifecycle callback or business method, and the interceptor is enabled in the bean deployment archive of the bean.</text>
+ </assertion>
+
+ <assertion id="ea">
+ <text>Next, the container orders the matching interceptors according to the interceptor ordering specified in Section 9.4, "Interceptor enablement and ordering".</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>For a custom implementation of the Interceptor interface defined in Section 11.1.2, "The Interceptor interface", the container calls |getInterceptorBindings()| to determine the interceptor bindings of the interceptor and |intercepts()| to determine if the interceptor intercepts a given kind of lifecycle callback or business method.</text>
+ </assertion>
+ </section>
+
+ <section id="9.5.1" title="Interceptors with multiple bindings">
+ <group>
<text>An interceptor class may specify multiple interceptor bindings, in which case the interceptor will be applied only to beans that declare all the bindings at the class level, and to methods of beans for which every binding appears at either the method or class level.</text>
<assertion id="a">
<text>Test that the interceptor is applied to a bean with all of the bindings.</text>
@@ -4197,874 +4197,874 @@
<assertion id="b">
<text>Test that the interceptor it not applied to a bean with only some of the interceptor bindings.</text>
- </assertion>
- </group>
- </section>
-
- <section id="9.5.2" title="Interceptor binding types with members">
- <assertion id="a">
- <text>Interceptor binding types may have annotation members.</text>
- </assertion>
-
- <assertion id="b">
- <text>An annotation member may be excluded from consideration using the @Nonbinding annotation.</text>
- </assertion>
-
- <assertion id="ca">
- <text>Array-valued or annotation-valued members of an interceptor binding type should be annotated |@Nonbinding| in a portable application. If an array-valued or annotation-valued member of an interceptor binding type is not annotated |@Nonbinding|, non-portable behavior results.</text>
- </assertion>
-
- <assertion id="d">
- <text>If the set of interceptor bindings of a bean or interceptor, including bindings inherited from stereotypes and other interceptor bindings, has two instances of a certain interceptor binding type and the instances have different values of some annotation member, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
- </section>
-
- <section id="10" title="Events">
-
- </section>
-
- <section id="10.1" title="Event types and qualifier types">
-
- <assertion id="aa">
- <text>An event object is an instance of a concrete Java class with no type variables.</text>
- </assertion>
-
- <assertion id="c">
- <text>The event types of the event include all superclasses and interfaces of the runtime class of the event object.</text>
- </assertion>
-
- <assertion id="cb" testable="false">
- <text>An event type may not contain a type variable.</text>
- <note>Doesn't specify an error condition</note>
- </assertion>
-
- <assertion id="d">
- <text>An event qualifier type is a Java annotation defined as |@Target({FIELD, PARAMETER})| ~or |@Target({METHOD, FIELD, PARAMETER, TYPE})| and |@Retention(RUNTIME)|~</text>
- </assertion>
-
- <assertion id="e">
- <text>An event qualifier type is a Java annotation defined as ~|@Target({FIELD, PARAMETER})| or~ |@Target({METHOD, FIELD, PARAMETER, TYPE})| ~and |@Retention(RUNTIME)|~</text>
- </assertion>
-
- <assertion id="f">
- <text>An event qualifier type is a Java annotation defined as ~|@Target({FIELD, PARAMETER})| or |@Target({METHOD, FIELD, PARAMETER, TYPE})| and ~|@Retention(RUNTIME)|</text>
- </assertion>
-
- <assertion id="g">
- <text>All event qualifier types must specify the |(a)javax.enterprise.inject.BindingType| meta-annotation</text>
- </assertion>
-
- <assertion id="i">
- <text>Every event has the qualifier |(a)javax.enterprise.inject.Any|, even if it does not explicitly declare this qualifier.</text>
- </assertion>
-
- <assertion id="j">
- <text>Any Java type may be an observed event type.</text>
- </assertion>
- </section>
-
- <section id="10.2" title="Observer resolution">
- <assertion id="h">
- <text>An observer method will be notified of an event if the observed event type it specifies is one of the event types of the event, and if all the observed event qualifiers it specifies are event qualifiers of the event.</text>
+ </assertion>
+ </group>
+ </section>
+
+ <section id="9.5.2" title="Interceptor binding types with members">
+ <assertion id="a">
+ <text>Interceptor binding types may have annotation members.</text>
</assertion>
+
+ <assertion id="b">
+ <text>An annotation member may be excluded from consideration using the @Nonbinding annotation.</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>Array-valued or annotation-valued members of an interceptor binding type should be annotated |@Nonbinding| in a portable application. If an array-valued or annotation-valued member of an interceptor binding type is not annotated |@Nonbinding|, non-portable behavior results.</text>
+ </assertion>
+ <assertion id="d">
+ <text>If the set of interceptor bindings of a bean or interceptor, including bindings inherited from stereotypes and other interceptor bindings, has two instances of a certain interceptor binding type and the instances have different values of some annotation member, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="10" title="Events">
+
+ </section>
+
+ <section id="10.1" title="Event types and qualifier types">
+
+ <assertion id="aa">
+ <text>An event object is an instance of a concrete Java class with no type variables.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The event types of the event include all superclasses and interfaces of the runtime class of the event object.</text>
+ </assertion>
+
+ <assertion id="cb" testable="false">
+ <text>An event type may not contain a type variable.</text>
+ <note>Doesn't specify an error condition</note>
+ </assertion>
+
+ <assertion id="d">
+ <text>An event qualifier type is a Java annotation defined as |@Target({FIELD, PARAMETER})| ~or |@Target({METHOD, FIELD, PARAMETER, TYPE})| and |@Retention(RUNTIME)|~</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>An event qualifier type is a Java annotation defined as ~|@Target({FIELD, PARAMETER})| or~ |@Target({METHOD, FIELD, PARAMETER, TYPE})| ~and |@Retention(RUNTIME)|~</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>An event qualifier type is a Java annotation defined as ~|@Target({FIELD, PARAMETER})| or |@Target({METHOD, FIELD, PARAMETER, TYPE})| and ~|@Retention(RUNTIME)|</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>All event qualifier types must specify the |(a)javax.enterprise.inject.BindingType| meta-annotation</text>
+ </assertion>
+
<assertion id="i">
+ <text>Every event has the qualifier |(a)javax.enterprise.inject.Any|, even if it does not explicitly declare this qualifier.</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>Any Java type may be an observed event type.</text>
+ </assertion>
+ </section>
+
+ <section id="10.2" title="Observer resolution">
+ <assertion id="h">
+ <text>An observer method will be notified of an event if the observed event type it specifies is one of the event types of the event, and if all the observed event qualifiers it specifies are event qualifiers of the event.</text>
+ </assertion>
+
+ <assertion id="i">
<text>When resolving observers of an event, the container identifies the set of observer methods which satisfy the following conditions: The event object must be assignable to the observer event type, taking type parameters into considersion, and for each observed event qualifier, the event qualifiers must contain a matching qualifier with (a) the same type and (b) the same annotation member value for each member which is not annotated |(a)javax.enterprise.inject.Nonbinding|.</text>
- </assertion>
-
- <assertion id="j">
- <text>If the runtime type of the event object contains a type variable, the container must throw an |IllegalArgumentException|.</text>
</assertion>
+
+ <assertion id="j">
+ <text>If the runtime type of the event object contains a type variable, the container must throw an |IllegalArgumentException|.</text>
+ </assertion>
<assertion id="k">
<text>For a custom implementation of the |ObserverMethod| interface defined in Section 11.1.3, "The ObserverMethod interface", the container must call |getObservedType()| and |getObservedQualifiers()| to determine the observed event type and qualifiers.</text>
- </assertion>
- </section>
-
- <section id="10.2.1" title="Assignability of type variables, raw and parameterized types">
- <assertion id="a">
- <text>An event type is considered assignable to a type variable if the event type is assignable to the upper bound, if any.</text>
- </assertion>
-
- <assertion id="b">
- <text>A parameterized event type is considered assignable to a raw observed event type if the raw types are identical.</text>
- </assertion>
-
- <assertion id="c">
- <text>A parameterized event type is considered assignable to a parameterized observed event type if they have identical raw type and for each parameter the observed event type parameter is an actual type with identical raw type to the event type parameter, and, if the type is parameterized, the event type parameter is assignable to the observed event type parameter according to these rules, or the observed event type parameter is a wildcard and the event type parameter is assignable to the upper bound, if any, of the wildcard and assignable from the lower bound, if any, of the wildcard, or the observed event type parameter is a type variable and the event type parameter is assignable to the upper bound, if any, of the type variable.</text>
- </assertion>
- </section>
-
- <section id="10.2.2" title="Event binding types with members">
- <assertion id="a">
- <text>The qualifier type for an |Event| binding may have annotation members.</text>
- </assertion>
-
- <assertion id="b" testable="false">
- <text>The container uses |equals()| to compare event qualifier type member values.</text>
- <note>Since only primitive types are allowed, the call to equals() cannot be checked</note>
- </assertion>
- </section>
-
- <section id="10.2.3" title="Multiple event bindings">
- <assertion id="a">
- <text>An event parameter may have multiple qualifiers.</text>
- </assertion>
-
- <assertion id="b">
- <text>An observer method will only be notified if all the observed event qualifiers are specified when the event is fired.</text>
- </assertion>
-
- <assertion id="c">
- <text>Other, less specific, observers will also be notified of events with multiple event qualifiers.</text>
- </assertion>
- </section>
-
- <section id="10.3" title="Firing events">
- <assertion id="a">
- <text>Beans fire events via an instance of the |javax.enterprise.event.Event| interface, which may be injected.</text>
- </assertion>
-
- <assertion id="b">
- <text>The method |fire()| accepts an event object.</text>
- </assertion>
-
- <assertion id="c">
- <text>Any combination of qualifiers may be specified at the injection point.</text>
- </assertion>
-
- <assertion id="d">
- <text>Or, the application may specify qualifiers dynamically.</text>
- </assertion>
- </section>
-
- <section id="10.3.1" title="The Event interface">
- <assertion id="ca">
- <text>The |Event| interface provides a method for firing events with a specified combination of type and qualifiers.</text>
- </assertion>
-
- <assertion id="cb">qualifiers
- <text>For an injected |Event|, the specified type is the type parameter specified at the injection point, and the specified qualifiers are the bindings specified at the injection point.</text>
- </assertion>
-
- <assertion id="eaa">
- <text>The |select()| method returns a child |Event| for a given specified type and additional specified qualifiers. If no specified type is given, the specified type is the same as the parent.</text>
- </assertion>
-
- <assertion id="eab">
- <text>If the specified type contains a type variable, an |IllegalArgumentException| is thrown.</text>
- </assertion>
-
- <assertion id="eba">
- <text>If two instances of the same binding type are passed to |select()|, an |IllegalArgumentException| is thrown.</text>
- </assertion>
-
- <assertion id="ec">
- <text>If an instance of an annotation that is not a qualifier type is passed to |select()|, an |IllegalArgumentException| is thrown.</text>
- </assertion>
-
- <assertion id="eda">
- <text>The method |fire()| fires an event with the specified qualifiers and notifies observers, as defined by Section 10.5, "Observer notification".</text>
- </assertion>
-
- <assertion id="f">
- <text>If the runtime type of the event object contains a type variable, an |IllegalArgumentException| is thrown.</text>
- </assertion>
- </section>
-
- <section id="10.3.2" title="The built-in Event">
- <assertion id="a">
- <text>The container must provide a built-in bean with |Event<X>| for every legal observed event type X in its set of bean types.</text>
- </assertion>
-
- <assertion id="b">
- <text>The container must provide a built-in bean with every event qualifier type in its set of qualifier types.</text>
- </assertion>
-
- <assertion id="d">
- <text>The container must provide a built-in bean with scope |@Dependent|.</text>
- </assertion>
-
- <assertion id="e">
- <text>The container must provide a built-in bean with no bean EL name.</text>
- </assertion>
-
- <assertion id="f">
- <text>The container must provide a built-in bean with an implementation provided automatically by the container.</text>
- </assertion>
-
- <assertion id="g">
- <text>The built-in implementation must be a passivation capable dependency, as defined in Section 6.6.2, "Passivation capable
-dependencies".</text>
- </assertion>
- </section>
-
- <section id="10.4" title="Observer methods">
- <assertion id="aa">
- <text>An observer method is a non-abstract method of a managed bean class or session bean class.</text>
- </assertion>
-
- <assertion id="c">
- <text>An observer method may be either static or non-static.</text>
- </assertion>
-
- <assertion id="d">
- <text>If the bean is a session bean, the observer method must be either a business method of the EJB or a static method of the bean class.</text>
- </assertion>
-
- <assertion id="e">
- <text>There may be arbitrarily many observer methods with the same event parameter type and qualifiers.</text>
- </assertion>
-
- <assertion id="f">
- <text>A bean may declare multiple observer methods.</text>
- </assertion>
- </section>
-
- <section id="10.4.1" title="Event parameter of an observer method">
- <assertion id="a">
- <text>Each observer method must have exactly one event parameter, of the same type as the event type it observes. When searching for observer methods for an event, the container considers the type and qualifiers of the event parameter</text>
- </assertion>
-
- <assertion id="b">
- <text>If the event parameter does not explicitly declare any qualifier, the observer method observes events with no qualifier.</text>
- </assertion>
-
- <assertion id="ca">
- <text>The event parameter type may contain a type variable or ~wildcard~.</text>
- </assertion>
-
- <assertion id="cb">
- <text>The event parameter type may contain a ~type variable~ or wildcard.</text>
- </assertion>
-
- </section>
-
- <section id="10.4.2" title="Declaring an observer method">
- <assertion id="a"> <assertion id="ea">
- <text>For a Producer that represents a producer _method_ or field, |produce()| _calls the producer method on_, or accesses the producer field of, a contextual instance of the most specialized bean that specializes the bean that declares the producer method, as defined in Section 5.6.6, "Invocation of producer or disposer methods".</text>
- </assertion>
-
- <assertion id="eb">
- <text>For a Producer that represents a producer method or _field_, |produce()| calls the producer method on, _or accesses the producer field of_, a contextual instance of the most specialized bean that specializes the bean that declares the producer method, as defined in Section 5.6.6, "Invocation of producer or disposer methods".</text>
- </assertion>
-
- <text>An observer method may be declared by annotating a parameter |(a)javax.enterprise.event.Observes|. That parameter is the event parameter. The declared type of the parameter is the observed event type.</text>
- </assertion>
-
- <assertion id="b">
- <text>If a method has more than one parameter annotated |@Observes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="c">
- <text>Observed event qualifiers may be declared by annotating the event parameter.</text>
- </assertion>
-
- <assertion id="d">
- <text>If an observer method is annotated |@Produces| the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="e">
- <text>If an observer method is annotated |@Inject| the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="f">
- <text>If an observer method is has a parameter annotated |@Disposes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="g">
- <text>If a non-static method of a session bean class has a parameter annotated |@Observes|, and the method is not a business method of the EJB, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="h">
- <text>Interceptors and decorators may not declare observer methods. If an interceptor or decorator has a method with a parameter annotated |@Observes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
- </section>
-
- <section id="10.4.3" title="Observer method parameters">
- <assertion id="a">
- <text>In addition to the event parameter, observer methods may declare additional parameters, which may declare qualifiers. These additional parameters are injection points.</text>
- </assertion>
- </section>
-
- <section id="10.4.4" title="Conditional observer methods">
- <assertion id="a">
- <text>A conditional observer method may be declared by specifying |receive=IF_EXISTS|.</text>
- </assertion>
-
- <assertion id="b">
- <text>Beans with scope |@Dependent| may not have conditional observer methods. If a bean with scope |@Dependent| has an observer method declared |receive=IF_EXISTS|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="c">
- <text>The enumeration |javax.enterprise.event.Reception| identifies the supported values of |receive|.</text>
- </assertion>
- </section>
-
- <section id="10.4.5" title="Transactional observer methods">
- <assertion id="a">
- <text>Transactional observer methods are observer methods which receive event notifications during the before or after completion phase of the transaction in which the event was fired. If no transaction is in progress when the event is fired, they are notified at the same time as other observers</text>
- </assertion>
-
- <assertion id="b">
- <text>A before completion observer method is called during the before completion phase of the transaction</text>
- </assertion>
-
- <assertion id="c">
- <text>An after completion observer method is called during the after completion phase of the transaction</text>
- </assertion>
-
- <assertion id="d">
- <text>An after success observer method is called during the after completion phase of the transaction, only when the transaction completes successfully</text>
- </assertion>
-
- <assertion id="e">
- <text>An after failure observer method is called during the after completion phase of the transaction, only when the transaction fails</text>
- </assertion>
-
- <assertion id="f" testable="false">
- <text>The enumeration |javax.enterprise.event.TransactionPhase| identifies the kind of transactional observer method.</text>
- <note>Should we just sigtest this?</note>
- </assertion>
-
- <assertion id="gaa">
- <text>A transactional observer method may be declared by specifying any value other than |IN_PROGRESS| for |during|.</text>
- </assertion>
- </section>
-
- <section id="10.5" title="Observer notification">
- <assertion id="aa">
- <text>When an event is fired by the application, the container must determine the observers for that event according to the observer resolution defined by Section 10.2, "Observer resolution", then then for each observer method, either invoke the observer method immediately or register the observer method for later invocation during the transaction completion phase, using a JTA |Synchronization|.</text>
- </assertion>
-
- <assertion id="b" testable="false">
- <text>The order in which observers are called in not defined, and so portable applications should not rely upon the order in which observers are called.</text>
- <note>Behavior is not defined.</note>
- </assertion>
-
- <assertion id="bb">
- <text>If the observer method is a transactional observer method and there is currently a JTA transaction in progress, the container calls the observer method during the appropriate transaction completion phase. ~Otherwise, the container calls the observer immediately.~</text>
- </assertion>
-
- <assertion id="bc">
- <text>If the observer method is a transactional observer method and there is currently a JTA transaction in progress, ~the container calls the observer method during the appropriate transaction completion phase.~ Otherwise, the container calls the observer immediately.</text>
- </assertion>
-
- <assertion id="bd">
- <text>Any observer method called before completion of a transaction may call |setRollbackOnly()| to force a transaction rollback.</text>
- </assertion>
-
- <assertion id="bd" testable="false">
- <text>An observer method may not directly initiate, commit or rollback JTA transactions.</text>
- <note>Doesn't specify what happens if they do</note>
- </assertion>
-
- <assertion id="ca" testable="false">
- <text>Observers may throw exceptions. If an observer method is a transactional observer method, any exception is caught and logged by the container.</text>
- <note>We can't verify what is logged</note>
- </assertion>
-
- <assertion id="cb">
- <text>Observers may throw exceptions. If an observer method is a transactional observer method, ~any exception is caught and logged by the container.~ Otherwise, the exception aborts processing of the event.</text>
- </assertion>
-
- <assertion id="cc">
- <text>Observers may throw exceptions. ~If an observer method is a transactional observer method, any exception is caught and logged by the container. Otherwise, the exception aborts processing of the event. No other observer methods of that event will be called.~ The |fireEvent()| method rethrows the exception. ~If the exception is a checked exception, it is wrapped and rethrown as an (unchecked) |ObserverException|~.</text>
- </assertion>
-
- <assertion id="cd">
- <text>Observers may throw exceptions. ~If an observer method is a transactional observer method, any exception is caught and logged by the container. Otherwise, the exception aborts processing of the event. No other observer methods of that event will be called. The |fireEvent()| method rethrows the exception.~ If the exception is a checked exception, it is wrapped and rethrown as an (unchecked) |ObserverException|.</text>
- </assertion>
-
- <assertion id="f">
- <text>For a custom implementation of the |ObserverMethod| interface defined in Section 11.1.3, "The ObserverMethod interface", the container must call |getReception()| and |getTransactionPhase()| to determine is the observer method is a conditional or transactional observer method, and |notify()| to invoke the method.</text>
- </assertion>
- </section>
-
- <section id="10.5.1" title="Observer method invocation context">
- <assertion id="ba">
- <text>If the observer method is a before completion transactional observer method, it is called within the context of the transaction that is about to complete and with the same client security context and lifecycle contexts.</text>
- </assertion>
-
- <assertion id="c">
- <text>If the observer method is any other kind of transactional observer method, it is called in an unspecified transaction context, but with the same client security context and lifecycle contexts as the transaction that just completed.</text>
- </assertion>
-
- <assertion id="da">
- <text>If an observer method is not a before completion transactional method, and not any other kind of transactional observer method, then the observer method is called in the same transaction context, client security context and lifecycle contexts as the invocation of |Event.fire()| or |BeanManager.fireEvent()|.</text>
- </assertion>
-
- <assertion id="e">
- <text>The transaction and security contexts for a business method of a session bean also depend upon the transaction attribute and |@RunAs| descriptor, if any.</text>
- </assertion>
- </section>
-
- <section id="11" title="Portable extensions">
- <assertion id="a" testable="false">
- <text>A portable extension may integrate with the container by providing its own beans, interceptors and decorators to the container.</text>
- </assertion>
-
- <assertion id="b" testable="false">
- <text>A portable extension may integrate with the container by injecting dependencies into its own objects using the dependency injection service.</text>
- </assertion>
-
- <assertion id="c" testable="false">
- <text>A portable extension may integrate with the container by providing a context implementation for a custom scope.</text>
- </assertion>
-
- <assertion id="f" testable="false">
- <text>Augmenting or overriding the annotation-based metadata with metadata from some other source.</text>
- </assertion>
- </section>
-
- <section id="11.1" title="The Bean interface">
- <assertion id="aa">
- <text>Implementations of |Bean| must also implement the inherited operations defined by the |Contextual| interface defined in Section 6.1, "The Contextual interface".</text>
- </assertion>
-
- <assertion id="ba">
- <text>|getTypes()|, |getQualifiers()|, |getScope()|, |getName()| and |getStereotypes()| must return the bean types, qualifiers, scope type, EL name and stereotypes of the bean, as defined in Chapter 2, Concepts.</text>
- </assertion>
-
- <assertion id="bb">
- <text>|getBeanClass()| returns the bean class of the managed bean or session bean or of the bean that declares the producer method or field.</text>
- </assertion>
-
- <assertion id="bc">
- <text>|isAlternative()| must return |true| if the bean is an alternative, and |false| otherwise.</text>
- </assertion>
-
- <assertion id="bd">
- <text>|isNullable()| must return |true| if the method |create()| sometimes returns a |null| value, and |false| otherwise, as defined in Section 5.3.4, "Primitive types and null values".</text>
- </assertion>
-
- <assertion id="c">
- <text>|getInjectionPoints()| returns a set of |InjectionPoint| objects, defined in Section 5.6.9, "Injection point metadata", representing injection points of the bean, that will be validated by the container at initialization time.</text>
- </assertion>
-
- <assertion id="f">
- <text>An instance of |Bean| exists for every enabled bean.</text>
- </assertion>
-
- <assertion id="g" testable="false">
- <text>An application or portable extension may add support for new kinds of beans beyond those defined by the this specification (managed beans, session beans, producer methods and fields, resources and message destinations) by implementing |Bean| and registering beans with the container, using the mechanism defined in Section 11.5.2, "AfterBeanDiscovery event".</text>
- </assertion>
- </section>
-
- <section id="11.1.1" title="The Decorator interface">
- <assertion id="a">
- <text>The |Bean| object for a decorator must implement the interface |javax.enterprise.inject.spi.Decorator|.</text>
- </assertion>
-
- <assertion id="b">
- <text>|getDecoratedTypes()| returns the decorated types of the decorator.</text>
- </assertion>
-
- <assertion id="c">
- <text>|getDelegateType()| and |getDelegateBindings()| return the delegate type and bindings of the decorator.</text>
- </assertion>
-
- <assertion id="d">
- <text>An instance of |Decorator| exists for every enabled decorator.</text>
- </assertion>
- </section>
-
- <section id="11.1.2" title="The Interceptor interface">
- <assertion id="a">
- <text>The |Bean| object for an interceptor must implement |javax.enterprise.inject.spi.Interceptor|.</text>
- </assertion>
-
- <assertion id="b">
- <text>|getInterceptorBindingTypes()| returns the interceptor bindings of the interceptor.</text>
- </assertion>
-
- <assertion id="c">
- <text>|intercepts()| returns |true| if the interceptor intercepts callbacks or business methods of the given type, and |false| otherwise.</text>
- </assertion>
-
- <assertion id="d">
- <text>|intercept()| invokes the specified kind of lifecycle callback or business method upon the given instance.</text>
- </assertion>
-
- <assertion id="e">
- <text>An |InterceptionType| identifies the kind of lifecycle callback or business method.</text>
- </assertion>
-
- <assertion id="f">
- <text>An instance of |Interceptor| exists for every enabled interceptor.</text>
- </assertion>
- </section>
-
- <section id="11.1.3" title="The ObserverMethod interface">
- <assertion id="a" testable="false">
- <text>The interface |javax.enterprise.inject.spi.ObserverMethod| defines everything the container needs to know about an observer method.</text>
- </assertion>
-
- <assertion id="b">
- <text>|getBean()| returns the bean with the observer method.</text>
- </assertion>
-
- <assertion id="c">
- <text>|getObservedType()| and |getObservedBindings()| return the observed event type and bindings.</text>
- </assertion>
-
- <assertion id="d">
- <text>|getReception()| returns |IF_EXISTS| for a conditional observer and |ALWAYS| otherwise.</text>
- </assertion>
-
- <assertion id="e">
- <text>|getTransactionPhase()| returns the appropriate transaction phase for a transactional observer method or |IN_PROGRESS| otherwise.</text>
- </assertion>
-
- <assertion id="f">
- <text>|notify()| calls the observer method, as defined in Section 5.6.8 "Invocation of observer methods".</text>
- </assertion>
-
- <assertion id="ga">
- <text>An instance of |ObserverMethod| exists for every observer method of every enabled bean.</text>
- </assertion>
- </section>
-
- <section id="11.2" title="The Producer and InjectionTarget interfaces">
- <assertion id="a" testable="false">
- <text>The interface |javax.enterprise.inject.spi.Producer| provides a generic operation for producing an instance of a type.</text>
- <note>Statement of intent</note>
- </assertion>
-
- <assertion id="ba">
- <text>For a |Producer| that represents a class, |produce()| calls the constructor annotated |@Inject| if it exists, or the constructor with no parameters otherwise, as defined in Section 5.6.3, "Injection using the bean constructor".</text>
- </assertion>
-
- <assertion id="c">
- <text>For a |Producer| that represents a class, |dispose()| does nothing.</text>
- </assertion>
-
- <assertion id="da">
- <text>For a |Producer| that represents a class, |getInjectionPoints()| returns a set of |InjectionPoint| objects representing all _injected fields_, bean constructor parameters and initializer method parameters.</text>
- </assertion>
-
- <assertion id="db">
- <text>For a |Producer| that represents a class, |getInjectionPoints()| returns a set of |InjectionPoint| objects representing all injected fields, _bean constructor parameters_ and initializer method parameters.</text>
- </assertion>
-
- <assertion id="dc">
- <text>For a |Producer| that represents a class, |getInjectionPoints()| returns a set of |InjectionPoint| objects representing all injected fields, bean constructor parameters and _initializer method parameters_.</text>
- </assertion>
+ </assertion>
+ </section>
+
+ <section id="10.2.1" title="Assignability of type variables, raw and parameterized types">
+ <assertion id="a">
+ <text>An event type is considered assignable to a type variable if the event type is assignable to the upper bound, if any.</text>
+ </assertion>
+ <assertion id="b">
+ <text>A parameterized event type is considered assignable to a raw observed event type if the raw types are identical.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A parameterized event type is considered assignable to a parameterized observed event type if they have identical raw type and for each parameter the observed event type parameter is an actual type with identical raw type to the event type parameter, and, if the type is parameterized, the event type parameter is assignable to the observed event type parameter according to these rules, or the observed event type parameter is a wildcard and the event type parameter is assignable to the upper bound, if any, of the wildcard and assignable from the lower bound, if any, of the wildcard, or the observed event type parameter is a type variable and the event type parameter is assignable to the upper bound, if any, of the type variable.</text>
+ </assertion>
+ </section>
+
+ <section id="10.2.2" title="Event binding types with members">
+ <assertion id="a">
+ <text>The qualifier type for an |Event| binding may have annotation members.</text>
+ </assertion>
+
+ <assertion id="b" testable="false">
+ <text>The container uses |equals()| to compare event qualifier type member values.</text>
+ <note>Since only primitive types are allowed, the call to equals() cannot be checked</note>
+ </assertion>
+ </section>
+
+ <section id="10.2.3" title="Multiple event bindings">
+ <assertion id="a">
+ <text>An event parameter may have multiple qualifiers.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>An observer method will only be notified if all the observed event qualifiers are specified when the event is fired.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Other, less specific, observers will also be notified of events with multiple event qualifiers.</text>
+ </assertion>
+ </section>
+
+ <section id="10.3" title="Firing events">
+ <assertion id="a">
+ <text>Beans fire events via an instance of the |javax.enterprise.event.Event| interface, which may be injected.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The method |fire()| accepts an event object.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Any combination of qualifiers may be specified at the injection point.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Or, the application may specify qualifiers dynamically.</text>
+ </assertion>
+ </section>
+
+ <section id="10.3.1" title="The Event interface">
+ <assertion id="ca">
+ <text>The |Event| interface provides a method for firing events with a specified combination of type and qualifiers.</text>
+ </assertion>
+
+ <assertion id="cb">qualifiers
+ <text>For an injected |Event|, the specified type is the type parameter specified at the injection point, and the specified qualifiers are the bindings specified at the injection point.</text>
+ </assertion>
+
+ <assertion id="eaa">
+ <text>The |select()| method returns a child |Event| for a given specified type and additional specified qualifiers. If no specified type is given, the specified type is the same as the parent.</text>
+ </assertion>
+
+ <assertion id="eab">
+ <text>If the specified type contains a type variable, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="eba">
+ <text>If two instances of the same binding type are passed to |select()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="ec">
+ <text>If an instance of an annotation that is not a qualifier type is passed to |select()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="eda">
+ <text>The method |fire()| fires an event with the specified qualifiers and notifies observers, as defined by Section 10.5, "Observer notification".</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the runtime type of the event object contains a type variable, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+ </section>
+
+ <section id="10.3.2" title="The built-in Event">
+ <assertion id="a">
+ <text>The container must provide a built-in bean with |Event<X>| for every legal observed event type X in its set of bean types.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The container must provide a built-in bean with every event qualifier type in its set of qualifier types.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The container must provide a built-in bean with scope |@Dependent|.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The container must provide a built-in bean with no bean EL name.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The container must provide a built-in bean with an implementation provided automatically by the container.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The built-in implementation must be a passivation capable dependency, as defined in Section 6.6.2, "Passivation capable
+dependencies".</text>
+ </assertion>
+ </section>
+
+ <section id="10.4" title="Observer methods">
+ <assertion id="aa">
+ <text>An observer method is a non-abstract method of a managed bean class or session bean class.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>An observer method may be either static or non-static.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the bean is a session bean, the observer method must be either a business method of the EJB or a static method of the bean class.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>There may be arbitrarily many observer methods with the same event parameter type and qualifiers.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A bean may declare multiple observer methods.</text>
+ </assertion>
+ </section>
+
+ <section id="10.4.1" title="Event parameter of an observer method">
+ <assertion id="a">
+ <text>Each observer method must have exactly one event parameter, of the same type as the event type it observes. When searching for observer methods for an event, the container considers the type and qualifiers of the event parameter</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the event parameter does not explicitly declare any qualifier, the observer method observes events with no qualifier.</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>The event parameter type may contain a type variable or ~wildcard~.</text>
+ </assertion>
+
+ <assertion id="cb">
+ <text>The event parameter type may contain a ~type variable~ or wildcard.</text>
+ </assertion>
+
+ </section>
+
+ <section id="10.4.2" title="Declaring an observer method">
+ <assertion id="a"> <assertion id="ea">
+ <text>For a Producer that represents a producer _method_ or field, |produce()| _calls the producer method on_, or accesses the producer field of, a contextual instance of the most specialized bean that specializes the bean that declares the producer method, as defined in Section 5.6.6, "Invocation of producer or disposer methods".</text>
+ </assertion>
+
+ <assertion id="eb">
+ <text>For a Producer that represents a producer method or _field_, |produce()| calls the producer method on, _or accesses the producer field of_, a contextual instance of the most specialized bean that specializes the bean that declares the producer method, as defined in Section 5.6.6, "Invocation of producer or disposer methods".</text>
+ </assertion>
+
+ <text>An observer method may be declared by annotating a parameter |(a)javax.enterprise.event.Observes|. That parameter is the event parameter. The declared type of the parameter is the observed event type.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If a method has more than one parameter annotated |@Observes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Observed event qualifiers may be declared by annotating the event parameter.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If an observer method is annotated |@Produces| the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If an observer method is annotated |@Inject| the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If an observer method is has a parameter annotated |@Disposes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If a non-static method of a session bean class has a parameter annotated |@Observes|, and the method is not a business method of the EJB, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>Interceptors and decorators may not declare observer methods. If an interceptor or decorator has a method with a parameter annotated |@Observes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="10.4.3" title="Observer method parameters">
+ <assertion id="a">
+ <text>In addition to the event parameter, observer methods may declare additional parameters, which may declare qualifiers. These additional parameters are injection points.</text>
+ </assertion>
+ </section>
+
+ <section id="10.4.4" title="Conditional observer methods">
+ <assertion id="a">
+ <text>A conditional observer method may be declared by specifying |receive=IF_EXISTS|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Beans with scope |@Dependent| may not have conditional observer methods. If a bean with scope |@Dependent| has an observer method declared |receive=IF_EXISTS|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The enumeration |javax.enterprise.event.Reception| identifies the supported values of |receive|.</text>
+ </assertion>
+ </section>
+
+ <section id="10.4.5" title="Transactional observer methods">
+ <assertion id="a">
+ <text>Transactional observer methods are observer methods which receive event notifications during the before or after completion phase of the transaction in which the event was fired. If no transaction is in progress when the event is fired, they are notified at the same time as other observers</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A before completion observer method is called during the before completion phase of the transaction</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>An after completion observer method is called during the after completion phase of the transaction</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>An after success observer method is called during the after completion phase of the transaction, only when the transaction completes successfully</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>An after failure observer method is called during the after completion phase of the transaction, only when the transaction fails</text>
+ </assertion>
+
+ <assertion id="f" testable="false">
+ <text>The enumeration |javax.enterprise.event.TransactionPhase| identifies the kind of transactional observer method.</text>
+ <note>Should we just sigtest this?</note>
+ </assertion>
+
+ <assertion id="gaa">
+ <text>A transactional observer method may be declared by specifying any value other than |IN_PROGRESS| for |during|.</text>
+ </assertion>
+ </section>
+
+ <section id="10.5" title="Observer notification">
+ <assertion id="aa">
+ <text>When an event is fired by the application, the container must determine the observers for that event according to the observer resolution defined by Section 10.2, "Observer resolution", then then for each observer method, either invoke the observer method immediately or register the observer method for later invocation during the transaction completion phase, using a JTA |Synchronization|.</text>
+ </assertion>
+
+ <assertion id="b" testable="false">
+ <text>The order in which observers are called in not defined, and so portable applications should not rely upon the order in which observers are called.</text>
+ <note>Behavior is not defined.</note>
+ </assertion>
+
+ <assertion id="bb">
+ <text>If the observer method is a transactional observer method and there is currently a JTA transaction in progress, the container calls the observer method during the appropriate transaction completion phase. ~Otherwise, the container calls the observer immediately.~</text>
+ </assertion>
+
+ <assertion id="bc">
+ <text>If the observer method is a transactional observer method and there is currently a JTA transaction in progress, ~the container calls the observer method during the appropriate transaction completion phase.~ Otherwise, the container calls the observer immediately.</text>
+ </assertion>
+
+ <assertion id="bd">
+ <text>Any observer method called before completion of a transaction may call |setRollbackOnly()| to force a transaction rollback.</text>
+ </assertion>
+
+ <assertion id="bd" testable="false">
+ <text>An observer method may not directly initiate, commit or rollback JTA transactions.</text>
+ <note>Doesn't specify what happens if they do</note>
+ </assertion>
+
+ <assertion id="ca" testable="false">
+ <text>Observers may throw exceptions. If an observer method is a transactional observer method, any exception is caught and logged by the container.</text>
+ <note>We can't verify what is logged</note>
+ </assertion>
+
+ <assertion id="cb">
+ <text>Observers may throw exceptions. If an observer method is a transactional observer method, ~any exception is caught and logged by the container.~ Otherwise, the exception aborts processing of the event.</text>
+ </assertion>
+
+ <assertion id="cc">
+ <text>Observers may throw exceptions. ~If an observer method is a transactional observer method, any exception is caught and logged by the container. Otherwise, the exception aborts processing of the event. No other observer methods of that event will be called.~ The |fireEvent()| method rethrows the exception. ~If the exception is a checked exception, it is wrapped and rethrown as an (unchecked) |ObserverException|~.</text>
+ </assertion>
+
+ <assertion id="cd">
+ <text>Observers may throw exceptions. ~If an observer method is a transactional observer method, any exception is caught and logged by the container. Otherwise, the exception aborts processing of the event. No other observer methods of that event will be called. The |fireEvent()| method rethrows the exception.~ If the exception is a checked exception, it is wrapped and rethrown as an (unchecked) |ObserverException|.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>For a custom implementation of the |ObserverMethod| interface defined in Section 11.1.3, "The ObserverMethod interface", the container must call |getReception()| and |getTransactionPhase()| to determine is the observer method is a conditional or transactional observer method, and |notify()| to invoke the method.</text>
+ </assertion>
+ </section>
+
+ <section id="10.5.1" title="Observer method invocation context">
+ <assertion id="ba">
+ <text>If the observer method is a before completion transactional observer method, it is called within the context of the transaction that is about to complete and with the same client security context and lifecycle contexts.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the observer method is any other kind of transactional observer method, it is called in an unspecified transaction context, but with the same client security context and lifecycle contexts as the transaction that just completed.</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>If an observer method is not a before completion transactional method, and not any other kind of transactional observer method, then the observer method is called in the same transaction context, client security context and lifecycle contexts as the invocation of |Event.fire()| or |BeanManager.fireEvent()|.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The transaction and security contexts for a business method of a session bean also depend upon the transaction attribute and |@RunAs| descriptor, if any.</text>
+ </assertion>
+ </section>
+
+ <section id="11" title="Portable extensions">
+ <assertion id="a" testable="false">
+ <text>A portable extension may integrate with the container by providing its own beans, interceptors and decorators to the container.</text>
+ </assertion>
+
+ <assertion id="b" testable="false">
+ <text>A portable extension may integrate with the container by injecting dependencies into its own objects using the dependency injection service.</text>
+ </assertion>
+
+ <assertion id="c" testable="false">
+ <text>A portable extension may integrate with the container by providing a context implementation for a custom scope.</text>
+ </assertion>
+
+ <assertion id="f" testable="false">
+ <text>Augmenting or overriding the annotation-based metadata with metadata from some other source.</text>
+ </assertion>
+ </section>
+
+ <section id="11.1" title="The Bean interface">
+ <assertion id="aa">
+ <text>Implementations of |Bean| must also implement the inherited operations defined by the |Contextual| interface defined in Section 6.1, "The Contextual interface".</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>|getTypes()|, |getQualifiers()|, |getScope()|, |getName()| and |getStereotypes()| must return the bean types, qualifiers, scope type, EL name and stereotypes of the bean, as defined in Chapter 2, Concepts.</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>|getBeanClass()| returns the bean class of the managed bean or session bean or of the bean that declares the producer method or field.</text>
+ </assertion>
+
+ <assertion id="bc">
+ <text>|isAlternative()| must return |true| if the bean is an alternative, and |false| otherwise.</text>
+ </assertion>
+
+ <assertion id="bd">
+ <text>|isNullable()| must return |true| if the method |create()| sometimes returns a |null| value, and |false| otherwise, as defined in Section 5.3.4, "Primitive types and null values".</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>|getInjectionPoints()| returns a set of |InjectionPoint| objects, defined in Section 5.6.9, "Injection point metadata", representing injection points of the bean, that will be validated by the container at initialization time.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>An instance of |Bean| exists for every enabled bean.</text>
+ </assertion>
+
+ <assertion id="g" testable="false">
+ <text>An application or portable extension may add support for new kinds of beans beyond those defined by the this specification (managed beans, session beans, producer methods and fields, resources and message destinations) by implementing |Bean| and registering beans with the container, using the mechanism defined in Section 11.5.2, "AfterBeanDiscovery event".</text>
+ </assertion>
+ </section>
+
+ <section id="11.1.1" title="The Decorator interface">
+ <assertion id="a">
+ <text>The |Bean| object for a decorator must implement the interface |javax.enterprise.inject.spi.Decorator|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>|getDecoratedTypes()| returns the decorated types of the decorator.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>|getDelegateType()| and |getDelegateBindings()| return the delegate type and bindings of the decorator.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>An instance of |Decorator| exists for every enabled decorator.</text>
+ </assertion>
+ </section>
+
+ <section id="11.1.2" title="The Interceptor interface">
+ <assertion id="a">
+ <text>The |Bean| object for an interceptor must implement |javax.enterprise.inject.spi.Interceptor|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>|getInterceptorBindingTypes()| returns the interceptor bindings of the interceptor.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>|intercepts()| returns |true| if the interceptor intercepts callbacks or business methods of the given type, and |false| otherwise.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>|intercept()| invokes the specified kind of lifecycle callback or business method upon the given instance.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>An |InterceptionType| identifies the kind of lifecycle callback or business method.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>An instance of |Interceptor| exists for every enabled interceptor.</text>
+ </assertion>
+ </section>
+
+ <section id="11.1.3" title="The ObserverMethod interface">
+ <assertion id="a" testable="false">
+ <text>The interface |javax.enterprise.inject.spi.ObserverMethod| defines everything the container needs to know about an observer method.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>|getBean()| returns the bean with the observer method.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>|getObservedType()| and |getObservedBindings()| return the observed event type and bindings.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>|getReception()| returns |IF_EXISTS| for a conditional observer and |ALWAYS| otherwise.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>|getTransactionPhase()| returns the appropriate transaction phase for a transactional observer method or |IN_PROGRESS| otherwise.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>|notify()| calls the observer method, as defined in Section 5.6.8 "Invocation of observer methods".</text>
+ </assertion>
+
+ <assertion id="ga">
+ <text>An instance of |ObserverMethod| exists for every observer method of every enabled bean.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2" title="The Producer and InjectionTarget interfaces">
+ <assertion id="a" testable="false">
+ <text>The interface |javax.enterprise.inject.spi.Producer| provides a generic operation for producing an instance of a type.</text>
+ <note>Statement of intent</note>
+ </assertion>
+
+ <assertion id="ba">
+ <text>For a |Producer| that represents a class, |produce()| calls the constructor annotated |@Inject| if it exists, or the constructor with no parameters otherwise, as defined in Section 5.6.3, "Injection using the bean constructor".</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>For a |Producer| that represents a class, |dispose()| does nothing.</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>For a |Producer| that represents a class, |getInjectionPoints()| returns a set of |InjectionPoint| objects representing all _injected fields_, bean constructor parameters and initializer method parameters.</text>
+ </assertion>
+
+ <assertion id="db">
+ <text>For a |Producer| that represents a class, |getInjectionPoints()| returns a set of |InjectionPoint| objects representing all injected fields, _bean constructor parameters_ and initializer method parameters.</text>
+ </assertion>
+
+ <assertion id="dc">
+ <text>For a |Producer| that represents a class, |getInjectionPoints()| returns a set of |InjectionPoint| objects representing all injected fields, bean constructor parameters and _initializer method parameters_.</text>
+ </assertion>
+
<group>
<text>For a |Producer| that represents a producer method or field, |produce()| calls the producer method on, or accesses the producer field of, a contextual instance of the bean that declares the producer method, as defined in Section 5.6.6, "Invocation of producer or disposer methods".</text>
- <assertion id="eaa">
- <text>Test with producer method.</text>
- </assertion>
-
- <assertion id="eba">
- <text>Test with producer field.</text>
+ <assertion id="eaa">
+ <text>Test with producer method.</text>
+ </assertion>
+
+ <assertion id="eba">
+ <text>Test with producer field.</text>
</assertion>
</group>
<group>
<text>For a Producer that represents a producer method or field, |dispose()| calls the disposer method, if any, on a contextual instance of the bean that declares the disposer method, as defined in Section 5.6.6, "Invocation of producer or disposer methods", or performs any additional required cleanup, if any, to destroy state associated with a resource.</text>
-
- <assertion id="faa">
- <text>Test with producer method.</text>
- </assertion>
+
+ <assertion id="faa">
+ <text>Test with producer method.</text>
+ </assertion>
- </group>
-
- <assertion id="g">
- <text>For a Producer that represents a producer method, |getInjectionPoints()| returns the set of |InjectionPoint| objects representing all parameters of the producer method.</text>
- </assertion>
-
- <assertion id="h" testable="false">
- <text>The subinterface |javax.enterprise.inject.spi.InjectionTarget| provides operations for performing dependency injection and lifecycle callbacks on an instance of a type.</text>
- <note>Statement of intent</note>
- </assertion>
-
- <assertion id="i">
- <text>|inject()| performs dependency injection upon the given object. First, the container performs Java EE component environment injection according to the semantics required by the Java EE platform specification. Next, it sets the value of all injected fields, and then calls all initializer methods, as defined in Section 5.6.4, "Injection of fields and initializer methods".</text>
- </assertion>
-
- <assertion id="j">
- <text>|postConstruct()| calls the |@PostConstruct| callback, if it exists, according to the semantics required by the Java EE platform specification.</text>
- </assertion>
-
- <assertion id="k">
- <text>|preDestroy()| calls the |@PreDestroy| callback, if it exists, according to the semantics required by the Java EE platform specification.</text>
- </assertion>
- </section>
-
+ </group>
+
+ <assertion id="g">
+ <text>For a Producer that represents a producer method, |getInjectionPoints()| returns the set of |InjectionPoint| objects representing all parameters of the producer method.</text>
+ </assertion>
+
+ <assertion id="h" testable="false">
+ <text>The subinterface |javax.enterprise.inject.spi.InjectionTarget| provides operations for performing dependency injection and lifecycle callbacks on an instance of a type.</text>
+ <note>Statement of intent</note>
+ </assertion>
+
+ <assertion id="i">
+ <text>|inject()| performs dependency injection upon the given object. First, the container performs Java EE component environment injection according to the semantics required by the Java EE platform specification. Next, it sets the value of all injected fields, and then calls all initializer methods, as defined in Section 5.6.4, "Injection of fields and initializer methods".</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>|postConstruct()| calls the |@PostConstruct| callback, if it exists, according to the semantics required by the Java EE platform specification.</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>|preDestroy()| calls the |@PreDestroy| callback, if it exists, according to the semantics required by the Java EE platform specification.</text>
+ </assertion>
+ </section>
+
<section id="11.3" title="The BeanManager object">
<group>
<text>The container provides a built-in bean with bean type |BeanManager|, scope |@Dependent| and qualifier |@Default|.</text>
-
- <assertion id="aa">
- <text>Test the bean type.</text>
- </assertion>
-
- <assertion id="ab">
- <text>Test the scope.</text>
- </assertion>
-
- <assertion id="ac">
- <text>Test the qualifier.</text>
+
+ <assertion id="aa">
+ <text>Test the bean type.</text>
</assertion>
- </group>
-
- <assertion id="b">
- <text>The built-in implementation must be a passivation capable dependency, as defined in Section 6.6.2, "Passivation capable dependencies".</text>
- </assertion>
-
- <assertion id="c">
- <text>Any bean may obtain an instance of |BeanManager| by injecting it.</text>
- </assertion>
-
- <assertion id="da">
- <text>Java EE components may obtain an instance of |BeanManager| from JNDI by looking up the name |java:comp/BeanManager|.</text>
- </assertion>
-
- <assertion id="e">
- <text>Any operation of |BeanManager| may be called at any time during the execution of the application.</text>
- <note>This does not appear to be testable</note>
- </assertion>
- </section>
-
- <section id="11.3.1" title="Obtaining a contextual reference for a bean">
- <assertion id="a">
- <text>The method |BeanManager.getReference()| returns a contextual reference for a given bean and bean type, as defined in Section 6.5.3, "Contextual reference for a bean".</text>
- </assertion>
-
- <assertion id="b">
- <text>The first parameter is the |Bean| object representing the bean. The second parameter represents the bean type that must be implemented by any client proxy that is returned.</text>
- </assertion>
- </section>
-
- <section id="11.3.2" title="Obtaining an injectable reference">
- <assertion id="a">
- <text>The method |BeanManager.getInjectableReference()| returns an injectable reference for a given injection point, as defined in Section 5.6.1, "Injectable references".</text>
- </assertion>
-
- <assertion id="b">
- <text>If the |InjectionPoint| represents a decorator delegate injection point, |getInjectableReference()| returns a delegate, as defined in Section 8.1.2, "Decorator delegate injection points".</text>
- </assertion>
-
- <assertion id="bb">
- <text>If typesafe resolution results in an unsatisfied dependency, the container must throw an |UnsatisfiedResolutionException|.</text>
- </assertion>
-
- <assertion id="bc">
- <text>If typesafe resolution results in an unresolvable ambiguous dependency, the container must throw an |AmbiguousResolutionException|.</text>
- </assertion>
-
- <assertion id="c">
- <text>Implementations of |Bean| usually maintain a reference to an instance of |BeanManager|. When the |Bean| implementation performs dependency injection, it must obtain the contextual instances to inject by calling |BeanManager.getInjectableReference()|, passing an instance of |InjectionPoint| that represents the injection point and the instance of |CreationalContext| that was passed to |Bean.create()|.</text>
- <note>This cannot be well tested at the moment.</note>
- </assertion>
- </section>
-
- <section id="11.3.3" title="Obtaining a CreationalContext">
- <assertion id="a">
- <text>An instance of |CreationalContext| for a certain instance of |Contextual| may be obtained by calling |BeanManager.createCreationalContext()|.</text>
+
+ <assertion id="ab">
+ <text>Test the scope.</text>
+ </assertion>
+
+ <assertion id="ac">
+ <text>Test the qualifier.</text>
+ </assertion>
+ </group>
+
+ <assertion id="b">
+ <text>The built-in implementation must be a passivation capable dependency, as defined in Section 6.6.2, "Passivation capable dependencies".</text>
</assertion>
+
+ <assertion id="c">
+ <text>Any bean may obtain an instance of |BeanManager| by injecting it.</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>Java EE components may obtain an instance of |BeanManager| from JNDI by looking up the name |java:comp/BeanManager|.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Any operation of |BeanManager| may be called at any time during the execution of the application.</text>
+ <note>This does not appear to be testable</note>
+ </assertion>
+ </section>
+
+ <section id="11.3.1" title="Obtaining a contextual reference for a bean">
+ <assertion id="a">
+ <text>The method |BeanManager.getReference()| returns a contextual reference for a given bean and bean type, as defined in Section 6.5.3, "Contextual reference for a bean".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The first parameter is the |Bean| object representing the bean. The second parameter represents the bean type that must be implemented by any client proxy that is returned.</text>
+ </assertion>
+ </section>
+
+ <section id="11.3.2" title="Obtaining an injectable reference">
+ <assertion id="a">
+ <text>The method |BeanManager.getInjectableReference()| returns an injectable reference for a given injection point, as defined in Section 5.6.1, "Injectable references".</text>
+ </assertion>
<assertion id="b">
+ <text>If the |InjectionPoint| represents a decorator delegate injection point, |getInjectableReference()| returns a delegate, as defined in Section 8.1.2, "Decorator delegate injection points".</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>If typesafe resolution results in an unsatisfied dependency, the container must throw an |UnsatisfiedResolutionException|.</text>
+ </assertion>
+
+ <assertion id="bc">
+ <text>If typesafe resolution results in an unresolvable ambiguous dependency, the container must throw an |AmbiguousResolutionException|.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Implementations of |Bean| usually maintain a reference to an instance of |BeanManager|. When the |Bean| implementation performs dependency injection, it must obtain the contextual instances to inject by calling |BeanManager.getInjectableReference()|, passing an instance of |InjectionPoint| that represents the injection point and the instance of |CreationalContext| that was passed to |Bean.create()|.</text>
+ <note>This cannot be well tested at the moment.</note>
+ </assertion>
+ </section>
+
+ <section id="11.3.3" title="Obtaining a CreationalContext">
+ <assertion id="a">
+ <text>An instance of |CreationalContext| for a certain instance of |Contextual| may be obtained by calling |BeanManager.createCreationalContext()|.</text>
+ </assertion>
+
+ <assertion id="b">
<text>An instance of |CreationalContext| for a non-contextual object may be obtained by passing a null value to |createCreationalContext()|.</text>
- </assertion>
- </section>
-
- <section id="11.3.4" title="Obtaining a Bean by type">
- <assertion id="aa">
- <text>The method |BeanManager.getBeans()| returns the set of beans which match the given required type and qualifiers and are accessible to the class into which the |BeanManager| was injected, or to the Java EE component from whose JNDI environment namespace the |BeanManager| was obtained, according to the rules of typesafe resolution defined in Section 5.3, "Typesafe resolution".</text>
- </assertion>
-
- <assertion id="b">
- <text>The first parameter is a required bean type. The remaining parameters are required qualifiers.</text>
- </assertion>
-
- <assertion id="c">
- <text>If no qualifiers are passed to |getBeans()|, the default qualifier |@Default| is assumed.</text>
- </assertion>
-
- <assertion id="da">
- <text>If the given type represents a type variable, an |IllegalArgumentException| is thrown.</text>
- </assertion>
-
- <assertion id="e">
- <text>If two instances of the same qualifier type are given, an |IllegalArgumentException| is thrown.</text>
- </assertion>
-
- <assertion id="f">
- <text>If an instance of an annotation that is not a qualifier type is given, an |IllegalArgumentException| is thrown.</text>
- </assertion>
- </section>
-
- <section id="11.3.5" title="Obtaining a Bean by name">
- <assertion id="aa">
- <text>The method |BeanManager.getBeans()| which accepts a string returns the set of beans which match the given EL name and are accessible to the class into which the |BeanManager| was injected, or to the Java EE component from whose JNDI environment namespace the |BeanManager| was obtained, according to the rules of EL name resolution defined in Section 5.4, "EL name resolution".</text>
- </assertion>
-
- <assertion id="b">
- <text>The parameter is an EL name.</text>
- </assertion>
- </section>
-
- <section id="11.3.6" title="Obtaining a passivation capable bean by identifier">
- <assertion id="a">
- <text>The method |BeanManager.getPassivationCapableBean()| returns the |PassivationCapableBean| with the given identifier.</text>
- </assertion>
- </section>
-
- <section id="11.3.7" title="Resolving an ambiguous dependency">
- <assertion id="a">
- <text>The method |BeanManager.resolve()| applies the ambiguous dependency resolution rules defined in Section 5.3.1, "Unsatisfied and ambiguous dependencies" to a set of |Bean|s.</text>
- </assertion>
-
- <assertion id="b">
- <text>If the ambiguous dependency resolution rules fail, the container must throw an |AmbiguousResolutionException|.</text>
- </assertion>
- </section>
-
- <section id="11.3.8" title="Validating a dependency">
- <assertion id="a">
- <text>The |BeanManager.validate()| operation validates a dependency.</text>
- <note>Statement of intent</note>
- </assertion>
-
- <assertion id="b">
- <text>The method |validate()| validates the dependency and throws an |InjectionException| if there is a deployment problem (for example, an unsatisfied or unresolvable ambiguous dependency) associated with the injection point.</text>
- </assertion>
- </section>
-
- <section id="11.3.9" title="Firing an event">
- <assertion id="a">
- <text>The method |BeanManager.fireEvent()| fires an event and notifies observers, according to Section 10.5, "Observer notification".</text>
- </assertion>
-
- <assertion id="b">
- <text>The first argument is the event object. The remaining parameters are event qualifiers.</text>
- </assertion>
-
- <assertion id="c">
- <text>If the runtime type of the event object contains a type variable, an |IllegalArgumentException| is thrown.</text>
- </assertion>
-
- <assertion id="d">
- <text>If two instances of the same qualifier type are given, an |IllegalArgumentException| is thrown.</text>
- </assertion>
-
- <assertion id="e">
- <text>If an instance of an annotation that is not a qualifier type is given, an |IllegalArgumentException| is thrown.</text>
- </assertion>
- </section>
-
- <section id="11.3.10" title="Observer method resolution">
- <assertion id="a">
- <text>The method |BeanManager.resolveObserverMethods()| resolves observer methods for an event according to the rules of observer resolution defined in Section 10.2, "Observer resolution".</text>
- </assertion>
-
- <assertion id="b">
- <text>The first parameter of |resolveObserverMethods()| is the event object. The remaining parameters are event qualifiers.</text>
- </assertion>
-
- <assertion id="c">
- <text>If the runtime type of the event object contains a type variable, an |IllegalArgumentException| is thrown.</text>
- </assertion>
-
- <assertion id="d">
- <text>If two instances of the same qualifier type are given, an |IllegalArgumentException| is thrown.</text>
- </assertion>
-
- <assertion id="e">
- <text>If an instance of an annotation that is not a qualifier type is given, an |IllegalArgumentException| is thrown.</text>
- </assertion>
- </section>
-
- <section id="11.3.11" title="Decorator resolution">
- <assertion id="a">
- <text>The method |BeanManager.resolveDecorators()| returns the ordered list of decorators for a set of bean types and a set of qualifiers, as defined in Section 8.3, "Decorator resolution".</text>
- </assertion>
-
- <assertion id="b">
- <text>The first argument is the set of bean types of the decorated bean. The annotations are qualifiers declared by the decorated bean.</text>
- </assertion>
-
- <assertion id="c">
- <text>If two instances of the same qualifier type are given, an |IllegalArgumentException| is thrown.</text>
- </assertion>
-
- <assertion id="d">
- <text>If an instance of an annotation that is not a qualifier type is given, an |IllegalArgumentException| is thrown.</text>
- </assertion>
-
- <assertion id="e">
- <text>If the set of bean types is empty, an |IllegalArgumentException| is thrown.</text>
- </assertion>
- </section>
-
- <section id="11.3.12" title="Interceptor resolution">
- <assertion id="a">
- <text>The method |BeanManager.resolveInterceptors()| returns the ordered list of interceptors for a set of interceptor bindings, as defined in Section 9.5, "Interceptor resolution".</text>
- </assertion>
-
- <assertion id="b">
- <text>If two instances of the same interceptor binding type are given, an |IllegalArgumentException| is thrown.</text>
- </assertion>
-
- <assertion id="c">
- <text>If no interceptor binding type instance is given, an |IllegalArgumentException| is thrown.</text>
- </assertion>
-
- <assertion id="d">
- <text>If an instance of an annotation that is not an interceptor binding type is given, an |IllegalArgumentException| is thrown.</text>
- </assertion>
- </section>
-
+ </assertion>
+ </section>
+
+ <section id="11.3.4" title="Obtaining a Bean by type">
+ <assertion id="aa">
+ <text>The method |BeanManager.getBeans()| returns the set of beans which match the given required type and qualifiers and are accessible to the class into which the |BeanManager| was injected, or to the Java EE component from whose JNDI environment namespace the |BeanManager| was obtained, according to the rules of typesafe resolution defined in Section 5.3, "Typesafe resolution".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The first parameter is a required bean type. The remaining parameters are required qualifiers.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If no qualifiers are passed to |getBeans()|, the default qualifier |@Default| is assumed.</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>If the given type represents a type variable, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If two instances of the same qualifier type are given, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If an instance of an annotation that is not a qualifier type is given, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+ </section>
+
+ <section id="11.3.5" title="Obtaining a Bean by name">
+ <assertion id="aa">
+ <text>The method |BeanManager.getBeans()| which accepts a string returns the set of beans which match the given EL name and are accessible to the class into which the |BeanManager| was injected, or to the Java EE component from whose JNDI environment namespace the |BeanManager| was obtained, according to the rules of EL name resolution defined in Section 5.4, "EL name resolution".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The parameter is an EL name.</text>
+ </assertion>
+ </section>
+
+ <section id="11.3.6" title="Obtaining a passivation capable bean by identifier">
+ <assertion id="a">
+ <text>The method |BeanManager.getPassivationCapableBean()| returns the |PassivationCapableBean| with the given identifier.</text>
+ </assertion>
+ </section>
+
+ <section id="11.3.7" title="Resolving an ambiguous dependency">
+ <assertion id="a">
+ <text>The method |BeanManager.resolve()| applies the ambiguous dependency resolution rules defined in Section 5.3.1, "Unsatisfied and ambiguous dependencies" to a set of |Bean|s.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the ambiguous dependency resolution rules fail, the container must throw an |AmbiguousResolutionException|.</text>
+ </assertion>
+ </section>
+
+ <section id="11.3.8" title="Validating a dependency">
+ <assertion id="a">
+ <text>The |BeanManager.validate()| operation validates a dependency.</text>
+ <note>Statement of intent</note>
+ </assertion>
+
+ <assertion id="b">
+ <text>The method |validate()| validates the dependency and throws an |InjectionException| if there is a deployment problem (for example, an unsatisfied or unresolvable ambiguous dependency) associated with the injection point.</text>
+ </assertion>
+ </section>
+
+ <section id="11.3.9" title="Firing an event">
+ <assertion id="a">
+ <text>The method |BeanManager.fireEvent()| fires an event and notifies observers, according to Section 10.5, "Observer notification".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The first argument is the event object. The remaining parameters are event qualifiers.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the runtime type of the event object contains a type variable, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If two instances of the same qualifier type are given, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If an instance of an annotation that is not a qualifier type is given, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+ </section>
+
+ <section id="11.3.10" title="Observer method resolution">
+ <assertion id="a">
+ <text>The method |BeanManager.resolveObserverMethods()| resolves observer methods for an event according to the rules of observer resolution defined in Section 10.2, "Observer resolution".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The first parameter of |resolveObserverMethods()| is the event object. The remaining parameters are event qualifiers.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the runtime type of the event object contains a type variable, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If two instances of the same qualifier type are given, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If an instance of an annotation that is not a qualifier type is given, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+ </section>
+
+ <section id="11.3.11" title="Decorator resolution">
+ <assertion id="a">
+ <text>The method |BeanManager.resolveDecorators()| returns the ordered list of decorators for a set of bean types and a set of qualifiers, as defined in Section 8.3, "Decorator resolution".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The first argument is the set of bean types of the decorated bean. The annotations are qualifiers declared by the decorated bean.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If two instances of the same qualifier type are given, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If an instance of an annotation that is not a qualifier type is given, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the set of bean types is empty, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+ </section>
+
+ <section id="11.3.12" title="Interceptor resolution">
+ <assertion id="a">
+ <text>The method |BeanManager.resolveInterceptors()| returns the ordered list of interceptors for a set of interceptor bindings, as defined in Section 9.5, "Interceptor resolution".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If two instances of the same interceptor binding type are given, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If no interceptor binding type instance is given, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If an instance of an annotation that is not an interceptor binding type is given, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+ </section>
+
<section id="11.3.13" title="Determining if an annotation is a qualifier type, scope type, stereotype or interceptor binding type">
<group>
- <text>A portable extension may test an annotation to determine if it is a qualifier type, scope type, stereotype or interceptor binding type, obtain the set of meta-annotations declared by a stereotype or interceptor binding type, or determine if a scope type is a normal or passivating scope.</text>
-
- <assertion id="aa">
- <text>Test qualifier type.</text>
- </assertion>
-
- <assertion id="ab">
- <text>Test scope type.</text>
- </assertion>
-
- <assertion id="ac">
- <text>Test stereotype.</text>
- </assertion>
-
- <assertion id="ad">
- <text>Test interceptor binding type.</text>
- </assertion>
-
- <assertion id="ae">
- <text>Test meta-annotations for stereotype.</text>
- </assertion>
-
- <assertion id="af">
- <text>Test meta-annotations for interceptor binding type.</text>
- </assertion>
-
- <assertion id="ag">
- <text>Test obtaining a |ScopeType|.</text>
+ <text>A portable extension may test an annotation to determine if it is a qualifier type, scope type, stereotype or interceptor binding type, obtain the set of meta-annotations declared by a stereotype or interceptor binding type, or determine if a scope type is a normal or passivating scope.</text>
+
+ <assertion id="aa">
+ <text>Test qualifier type.</text>
</assertion>
- </group>
- </section>
-
- <section id="11.3.14" title="Obtaining the active Context for a scope">
- <assertion id="a">
- <text>The method |BeanManager.getContext()| retrieves an active context object associated with the a given scope, as defined in Section 6.5.1, "The active context object for a scope".</text>
- </assertion>
- </section>
-
- <section id="11.3.15" title="Obtaining the ELResolver">
- <assertion id="a">
- <text>The method |BeanManager.getELResolver()| returns the |javax.el.ELResolver| specified in Section 5.8, "Integration with Unified EL".</text>
- </assertion>
+
+ <assertion id="ab">
+ <text>Test scope type.</text>
+ </assertion>
+
+ <assertion id="ac">
+ <text>Test stereotype.</text>
+ </assertion>
+
+ <assertion id="ad">
+ <text>Test interceptor binding type.</text>
+ </assertion>
+
+ <assertion id="ae">
+ <text>Test meta-annotations for stereotype.</text>
+ </assertion>
+
+ <assertion id="af">
+ <text>Test meta-annotations for interceptor binding type.</text>
+ </assertion>
+
+ <assertion id="ag">
+ <text>Test obtaining a |ScopeType|.</text>
+ </assertion>
+ </group>
</section>
+ <section id="11.3.14" title="Obtaining the active Context for a scope">
+ <assertion id="a">
+ <text>The method |BeanManager.getContext()| retrieves an active context object associated with the a given scope, as defined in Section 6.5.1, "The active context object for a scope".</text>
+ </assertion>
+ </section>
+
+ <section id="11.3.15" title="Obtaining the ELResolver">
+ <assertion id="a">
+ <text>The method |BeanManager.getELResolver()| returns the |javax.el.ELResolver| specified in Section 5.8, "Integration with Unified EL".</text>
+ </assertion>
+ </section>
+
<section id="11.3.16" title="Wrapping a Unified EL ExpressionFactory">
<assertion id="a">
<text>The method |BeanManager.wrapExpressionFactory()| returns a wrapper |javax.el.ExpressionFactory| that delegates |MethodExpression| and |ValueExpression| creation to the given |ExpressionFactory|.</text>
@@ -5073,654 +5073,654 @@
<assertion id="b">
<text>When a Unified EL expression is evaluated using a |MethodExpression| or |ValueExpression| returned by the wrapper |ExpressionFactory|, the rules defined in Section 6.4.3, "Dependent pseudo-scope and Unified EL" are enforced by the container.</text>
</assertion>
- </section>
-
- <section id="11.3.17" title="Obtaining an AnnotatedType for a class">
- <assertion id="a">
- <text>The method |BeanManager.createAnnotatedType()| returns an |AnnotatedType| for the given Java class.</text>
- </assertion>
- </section>
-
- <section id="11.3.18" title="Obtaining an InjectionTarget">
-
- <group>
- <text>The method |BeanManager.createInjectionTarget()| returns a container provided implementation of |InjectionTarget| for a given |AnnotatedType| or throws an |IllegalArgumentException| if there is a definition error associated with any injection point of the type.</text>
- <assertion id="aa">
- <text>Check |InjectionTarget| is provided.</text>
- </assertion>
-
- <assertion id="ab">
- <text>Check |IllegalArgumentException| is thrown.</text>
- </assertion>
- </group>
-
- </section>
-
- <section id="11.4" title="Alternative metadata sources">
- <assertion id="a" testable="false">
- <text>The interfaces |AnnotatedType|, |AnnotatedField|, |AnnotatedMethod|, |AnnotatedConstructor| and |AnnotatedParameter| in the package |javax.enterprise.inject.spi| allow a portable extension to specify metadata that overrides the annotations that exist on a bean class. The portable extension is responsible for implementing the interfaces, thereby exposing the metadata to the container.</text>
- <note>Statement of intent</note>
- </assertion>
-
- <assertion id="b" testable="false">
- <text>The interface |javax.enterprise.inject.spi.Annotated| exposes the overriding annotations and type declarations.</text>
- <note>Statement of intent</note>
- </assertion>
-
- <assertion id="c">
- <text>|getBaseType()| returns the type of the program element.</text>
- </assertion>
-
- <assertion id="d">
- <text>|getTypeClosure()| returns all types to which the base type should be considered assignable.</text>
- </assertion>
-
- <assertion id="e">
- <text>|getAnnotation()| returns the program element annotation of the given annotation type, or a null value.</text>
- </assertion>
-
- <assertion id="f">
- <text>|getAnnotations()| returns all annotations of the program element.</text>
- </assertion>
-
- <assertion id="g">
- <text>|isAnnotationPresent()| returns true if the program element has an annotation of the given annotation type, or false otherwise.</text>
- </assertion>
-
- <group>
- <text>The container must use the operations of |Annotated| and its subinterfaces to discover program element types and annotations, instead of directly calling the Java Reflection API. In particular, the container must call |Annotated.getBaseType()| to determine the type of an injection point, event parameter or disposed parameter, call |Annotated.getTypeClosure()| to determine the bean types of any kind of bean, call |Annotated.getAnnotations()| to determine the scope, qualifiers, stereotypes and interceptor bindings of a bean, call |Annotated.isAnnotationPresent()| and |Annotated.getAnnotation()| to read any bean annotations defined by this specification, and call |AnnotatedType.getConstructors()|, |AnnotatedType.getMethods()| and |AnnotatedType.getFields()| to determine the members of a bean class.</text>
-
- <assertion id="h">
- <text>Check that |getBaseType()| is used to determine the type of _an injection point_. The base type should be different from the orignal type specified in the class definition</text>
- </assertion>
-
- <assertion id="i">
- <text>Check that |getBaseType()| is used to determine the type of _an event parameter_. The base type should be different from the orignal type specified in the class definition</text>
- </assertion>
-
- <assertion id="j">
- <text>Check that |getBaseType()| is used to determine the type of _disposed parameter_. The base type should be different from the orignal type specified in the class definition</text>
- </assertion>
-
- <assertion id="k">
- <text>Check that a |getTypeClosure()| is used to determine the bean types. The type closure should be different from the orignal type specified in the class definition.</text>
- </assertion>
-
- <assertion id="l">
- <text>Check that |getAnnotations()| is used to determine the bean scope. The annotations should be different from the orignal type specified in the class definition.</text>
- </assertion>
-
- <assertion id="m">
- <text>Check that |getAnnotations()| is used to determine the bean qualifiers. The annotations should be different from the orignal type specified in the class definition.</text>
- </assertion>
-
- <assertion id="n">
- <text>Check that |getAnnotations()| is used to determine the bean stereotypes. The annotations should be different from the orignal type specified in the class definition.</text>
- </assertion>
-
- <assertion id="p">
- <text>Check that |getAnnotations()| is used to determine the bean interceptors. The annotations should be different from the orignal type specified in the class definition.</text>
- </assertion>
-
- <assertion id="q" testable="false">
- <text>Check that |isAnnotationPresent()| returns the provided annotations</text>
- <note>No testable behavior</note>
- </assertion>
-
- <assertion id="r">
- <text>Check that a previously non-inject-annotated constructor is used by the container to instantiate a bean.</text>
- </assertion>
-
- <assertion id="s">
- <text>Check that a qualifier added to a parameter is used by the container to instantiate a bean.</text>
- </assertion>
-
- <assertion id="t">
- <text>Check that a previously non-inject-annotated field is injected.</text>
- </assertion>
-
- <assertion id="u">
- <text>Check that an extra qualifier is applied.</text>
- </assertion>
-
- <assertion id="v">
- <text>Check that |@Produces| added creates a producer field.</text>
- </assertion>
-
- <assertion id="w">
- <text>Check that a previously non-inject-annotated method is injected.</text>
- </assertion>
-
- <assertion id="x">
- <text>Check that an extra qualifier is applied to an injectable method</text>
- </assertion>
-
- <assertion id="y">
- <text>Check that |@Produces| added creates a producer method</text>
- </assertion>
-
- <assertion id="z">
- <text>Check that an extra qualifier is applied to a producer method.</text>
- </assertion>
-
- <assertion id="aa">
- <text>Check that a qualifer added to a producer method parameter is applied.</text>
- </assertion>
-
- <assertion id="ab">
- <text>Check that |@Disposes| added to a parameter creates a disposes method</text>
- </assertion>
-
- <assertion id="ac">
- <text>Check that an extra qualifier is applied to a disposes method parameter.</text>
- </assertion>
-
- <assertion id="ad">
- <text>Check that a qualifer added to a disposes method injectable parameter is applied.</text>
- </assertion>
-
- <assertion id="ae">
- <text>Check that |@Observes| added to a parameter creates a observer method</text>
- </assertion>
-
- <assertion id="af">
- <text>Check that an extra qualifier is applied to an observes method parameter.</text>
- </assertion>
-
- <assertion id="ag">
- <text>Check that a qualifer added to a observes method injectable parameter is applied.</text>
- </assertion>
-
- </group>
- </section>
-
- <section id="11.5" title="Container lifecycle events">
- <assertion id="a" testable="false">
- <text>During the application initialization process, the container fires a series of events, allowing portable extensions to integrate with the container initialization process defined in Section 12.2, "Application initialization lifecycle".</text>
- <note>Generic statement</note>
- </assertion>
-
- <assertion id="b">
- <text>Observers of these events must be service providers of the service |javax.enterprise.inject.spi.Extension| declared in |META-INF/services|.</text>
- </assertion>
-
- <assertion id="c">
- <text>The container instantiates a single instance of each service provider at the beginning of the application initialization process and maintains a reference to it until the application shuts down.</text>
- </assertion>
-
- <assertion id="d">
- <text>Service providers may have observer methods, which may observe container initialization events and obtain an injected |BeanManager| reference.</text>
- </assertion>
-
- <assertion id="e">
- <text>For each service provider, the container must provide a bean of scope |@ApplicationScoped| and binding |@Default|, supporting injection of a reference to the service provider instance. The bean types of this bean include the class of the service
-provider and all superclases and interfaces.</text>
- </assertion>
- </section>
-
- <section id="11.5.1" title="BeforeBeanDiscovery event">
- <assertion id="a">
- <text>The container must fire an event before it begins the bean discovery process. The event object must be of type |javax.enterprise.inject.spi.BeforeBeanDiscovery|.</text>
- </assertion>
-
- <assertion id="ab">
- <text>|addQualifier()| declares an annotation type as a qualifier type.</text>
- </assertion>
-
- <assertion id="ac">
- <text>|addScope()| declares an annotation type as a scope type.</text>
- </assertion>
-
- <assertion id="ad">
- <text>|addStereotype()| declares an annotation type as a stereotype, and specifies its meta-annotations.</text>
- </assertion>
-
- <assertion id="ae">
- <text>|addInterceptorBinding()| declares an annotation type as an interceptor binding type, and specifies its meta-annotations.</text>
- </assertion>
-
- <assertion id="af">
- <text>|addAnnotatedType()| adds a given |AnnotatedType| to the set of types which will be scanned during bean discovery.</text>
- </assertion>
-
- <assertion id="ag">
- <text>If any observer method of the |BeforeBeanDiscovery| event throws an exception, the exception is treated as a definition error by the container.</text>
- </assertion>
- </section>
-
- <section id="11.5.2" title="AfterBeanDiscovery event">
- <assertion id="a">
- <text>The container must fire a second event when it has fully completed the bean discovery process, validated that there are no definition errors relating to the discovered beans, and registered |Bean| and |Observer| objects for the discovered beans, but before detecting deployment problems. The event object must be of type |javax.enterprise.inject.spi.AfterBeanDiscovery|.</text>
- </assertion>
-
- <assertion id="ca">
- <text>|addDefinitionError()| registers a definition error with the container, causing the container to abort deployment after all observers have been notified.</text>
- </assertion>
-
- <group>
- <text>|addBean()| fires an event of type |ProcessBean| containing the given |Bean| and then registers the |Bean| with the container, thereby making it available for injection into other beans. The given |Bean| may implement |Interceptor| or |Decorator|.</text>
-
- <assertion id="da">
- <text>Check that |ProcessBean| is fired</text>
- </assertion>
-
- <assertion id="db">
- <text>Check that a bean is registered</text>
- </assertion>
-
- <assertion id="dc">
- <text>Check that a decorator is registered</text>
- </assertion>
-
- <assertion id="dd">
- <text>Check that an interceptor is registered</text>
- </assertion>
- </group>
-
- <group>
- <text>|addObserverMethod()| fires an event of type |ProcessObserverMethod| containing the given |ObserverMethod| and then registers the |ObserverMethod| with the container, thereby making it available for event notifications.</text>
- <assertion id="ea">
- <text>Check that the |ProcessObserverMethod| is fired</text>
- </assertion>
- <assertion id="eb">
- <text>Check that the observer method is registered</text>
- </assertion>
- </group>
-
- <assertion id="f">
- <text>|addContext()| registers a custom |Context| object with the container. A portable extension may take advantage of this event to register beans, interceptors, decorators, observer methods and custom context objects with the container.</text>
- </assertion>
-
- <assertion id="g">
- <text>If any observer method of the |AfterBeanDiscovery| event throws an exception, the exception is treated as a definition error by the container.</text>
- </assertion>
- </section>
-
- <section id="11.5.3" title="AfterDeploymentValidation event">
- <assertion id="a">
- <text>The container must fire a third event after it has validated that there are no deployment problems and before creating contexts or processing requests. The event object must be of type |javax.enterprise.inject.spi.AfterDeploymentValidation|.</text>
- </assertion>
-
- <assertion id="b">
- <text>|addDeploymentProblem()| registers a deployment problem with the container, causing the container to abort deployment after all observers have been notified.</text>
- </assertion>
-
- <assertion id="c">
- <text>If any observer method of the |AfterDeploymentValidation| event throws an exception, the exception is treated as a deployment problem by the container.</text>
- </assertion>
-
- <assertion id="d">
- <text>The container must not allow any request to be processed by the deployment until all observers of this event return.</text>
- </assertion>
- </section>
-
- <section id="11.5.4" title="BeforeShutdown event">
- <assertion id="a">
- <text>The container must fire a final event after it has finished processing requests and destroyed all contexts. The event object must be of type |javax.enterprise.inject.spi.BeforeShutdown|.</text>
- </assertion>
-
- <assertion id="ba">
- <text>If any observer method of the |BeforeShutdown| event throws an exception, the exception is ignored by the container.</text>
- </assertion>
- </section>
-
- <section id="11.5.5" title="ProcessAnnotatedType event">
- <assertion id="a">
- <text>The container must fire an event for each Java class it discovers, before it reads the declared annotations. The event object must be of type |javax.enterprise.inject.spi.ProcessAnnotatedType<X>|, where |X| is the class.</text>
- </assertion>
-
- <assertion id="ba">
- <text>|getAnnotatedType()| returns the |AnnotatedType| object that will be used by the container to read the declared annotations.</text>
- </assertion>
-
- <assertion id="bb">
- <text>|setAnnotatedType()| replaces the |AnnotatedType|.</text>
- </assertion>
-
- <assertion id="bc">
- <text>|veto()| forces the container to ignore the type.</text>
- </assertion>
-
- <assertion id="ca">
- <text>Any observer of this event is permitted to wrap and/or replace the |AnnotatedType|. The container must use the final value of this property, after all observers have been called, to discover the types and read the annotations of the program elements.</text>
- </assertion>
-
- <assertion id="e">
- <text>If any observer method of a |ProcessAnnotatedType| event throws an exception, the exception is treated as a definition error by the container.</text>
- </assertion>
- </section>
-
- <section id="11.5.6" title="ProcessInjectionTarget event">
- <group>
- <text>The container must fire an event for each managed bean, session bean, Java EE component class supporting injection, producer method or producer field it discovers. The event object must be of type |javax.enterprise.inject.spi.ProcessInjectionTarget<X>|, where |X| is the managed bean class, session bean class or Java EE component class supporting injection.</text>
- <assertion id="aaa">
- <text>Test event is fired for a managed bean</text>
- </assertion>
- <assertion id="aab">
- <text>Test event is fired for a session bean</text>
- </assertion>
- <assertion id="aac">
- <text>Test event is fired for a servlet listener</text>
- </assertion>
- <assertion id="aad">
- <text>Test event is fired for a tag handler</text>
- </assertion>
- <assertion id="aae">
- <text>Test event is fired for a tag library listener</text>
- </assertion>
- <assertion id="aaf">
- <text>Test event is fired for an EJB Interceptor</text>
- </assertion>
- <assertion id="aag">
- <text>Test event is fired for a WS endpoint</text>
- </assertion>
- <assertion id="aah">
- <text>Test event is fired for a servlet</text>
- </assertion>
- <assertion id="aai">
- <text>Test event is fired for a filter</text>
- </assertion>
- <assertion id="aaj">
- <text>Test event is fired for a producer method</text>
- </assertion>
- <assertion id="aak">
- <text>Test event is fired for a producer field</text>
- </assertion>
- <assertion id="aal">
- <text>Test type for a managed bean</text>
- </assertion>
- <assertion id="aam">
- <text>Test type for a session bean</text>
- </assertion>
- <assertion id="aan">
- <text>Test type for a servlet listener</text>
- </assertion>
- <assertion id="aao">
- <text>Test type for a tag handler</text>
- </assertion>
- <assertion id="aap">
- <text>Test type for a tag library listener</text>
- </assertion>
- <assertion id="aaq">
- <text>Test type for an EJB Interceptor</text>
- </assertion>
- <assertion id="aar">
- <text>Test type for a WS endpoint</text>
- </assertion>
- <assertion id="aas">
- <text>Test type for a servlet</text>
- </assertion>
- <assertion id="aat">
- <text>Test type for a filter</text>
- </assertion>
- <assertion id="aau">
- <text>Test type for a producer method</text>
- </assertion>
- <assertion id="aav">
- <text>Test type for a producer field</text>
- </assertion>
- </group>
-
- <group>
- <text>|getAnnotatedType()| returns the |AnnotatedType| representing the managed bean class, session bean or other Java EE component class supporting injection.</text>
- <assertion id="aba">
- <text>Test type for a managed bean</text>
- </assertion>
- <assertion id="abb">
- <text>Test type for a session bean</text>
- </assertion>
- <assertion id="abc">
- <text>Test type for a servlet listener</text>
- </assertion>
- <assertion id="abd">
- <text>Test type for a tag handler</text>
- </assertion>
- <assertion id="abe">
- <text>Test type for a tag library listener</text>
- </assertion>
- <assertion id="abf">
- <text>Test type for an EJB Interceptor</text>
- </assertion>
- <assertion id="abg">
- <text>Test type for a WS endpoint</text>
- </assertion>
- <assertion id="abh">
- <text>Test type for a servlet</text>
- </assertion>
- <assertion id="abi">
- <text>Test type for a filter</text>
- </assertion>
- <assertion id="abj">
- <text>Test type for a producer method</text>
- </assertion>
- <assertion id="abk">
- <text>Test type for a producer field</text>
- </assertion>
- </group>
-
- <assertion id="bb">
- <text>|setInjectionTarget()| replaces the |InjectionTarget|.</text>
- </assertion>
-
- <assertion id="da">
- <text>|addDefinitionError()| registers a definition error with the container, causing the container to abort deployment after bean discovery is complete.</text>
- </assertion>
-
- <group>
- <text>Any observer of this event is permitted to wrap and/or replace the |InjectionTarget|. The container must use the final value of this property, after all observers have been called, whenever it performs injection upon the managed bean, session bean or other Java EE component class supporting injection.</text>
- <assertion id="ea">
- <text>Test type for a managed bean</text>
- </assertion>
- <assertion id="eb">
- <text>Test type for a session bean</text>
- </assertion>
- <assertion id="ec">
- <text>Test type for a servlet listener</text>
- </assertion>
- <assertion id="ed">
- <text>Test type for a tag handler</text>
- </assertion>
- <assertion id="ee">
- <text>Test type for a tag library listener</text>
- </assertion>
- <assertion id="ef">
- <text>Test type for an EJB Interceptor</text>
- </assertion>
- <assertion id="eg">
- <text>Test type for a WS endpoint</text>
- </assertion>
- <assertion id="eh">
- <text>Test type for a servlet</text>
- </assertion>
- <assertion id="ei">
- <text>Test type for a filter</text>
- </assertion>
- <assertion id="ej">
- <text>Test type for a producer method</text>
- </assertion>
- <assertion id="ek">
- <text>Test type for a producer field</text>
- </assertion>
- </group>
-
- <assertion id="f">
- <text>If any observer method of a |ProcessInjectionTarget| event throws an exception, the exception is treated as a definition error by the container.</text>
- </assertion>
- </section>
-
- <section id="11.5.7" title="ProcessProducer event">
- <group>
- <text>The container must fire an event for each producer method or field, including resources.</text>
- <assertion id="aa">
- <text>Test producer method</text>
- </assertion>
- <assertion id="ab">
- <text>Test producer field</text>
- </assertion>
- <assertion id="ac">
- <text>Test resource producer field</text>
- </assertion>
- </group>
-
- <group>
- <text>The event object must be of type |javax.enterprise.inject.spi.ProcessProducer<T, X>|, where |T| is the bean class of the bean that declares the producer method or field and |X| is the return type of the producer method or the type of the producer field.</text>
- <assertion id="ba">
- <text>Test producer method</text>
- </assertion>
- <assertion id="bb">
- <text>Test producer field</text>
- </assertion>
- </group>
-
- <group>
- <text>|getAnnotatedMember()| returns the |AnnotatedField| representing the producer field or the |AnnotatedMethod| representing the producer method.</text>
- <assertion id="ca">
- <text>Test producer method</text>
- </assertion>
- <assertion id="cb">
- <text>Test producer field</text>
- </assertion>
- </group>
-
- <group>
- <text>|getProducer()| returns the |Producer| object that will be used by the container to call the producer method or read the producer field.</text>
- <assertion id="da">
- <text>Test producer method</text>
- </assertion>
- <assertion id="db">
- <text>Test producer field</text>
- </assertion>
- </group>
-
- <assertion id="e">
- <text>|setProducer()| replaces the |Producer|.</text>
- </assertion>
-
- <assertion id="f">
- <text>|addDefinitionError()| registers a definition error with the container, causing the container to abort deployment after bean discovery is complete.</text>
- </assertion>
-
- <group>
- <text>Any observer of this event is permitted to wrap and/or replace the |Producer|. The container must use the final value of this property, after all observers have been called, whenever it calls the producer or disposer.</text>
- <assertion id="ga">
- <text>Test producer method</text>
- </assertion>
- <assertion id="gb">
- <text>Test producer field</text>
- </assertion>
- </group>
-
- <assertion id="h">
- <text>If any observer method of a |ProcessProducer| event throws an exception, the exception is treated as a definition error by the container.</text>
- </assertion>
- </section>
-
- <section id="11.5.8" title="ProcessBean event">
- <assertion id="aa">
- <text>The container must fire an event for each bean it discovers, before registering the |Bean| object. The event object in the package |javax.enterprise.inject.spi| depends upon what kind of bean was discovered.</text>
- </assertion>
-
- <assertion id="ba">
- <text>For a managed bean with bean class |X|, the container must raise an event of type |ProcessManagedBean<X>|.</text>
- </assertion>
-
- <assertion id="c">
- <text>For a session bean with bean class |X|, the container must raise an event of type |ProcessSessionBean<X>|.</text>
- </assertion>
-
- <assertion id="eaa">
- <text>For a producer method with method return type |X| of a bean with bean class |T|, the container must raise an event of type |ProcessProducerMethod<T, X>|.</text>
- </assertion>
-
- <assertion id="eb">
- <text>For a producer field with field type |X| of a bean with bean class |T|, the container must raise an event of type |ProcessProducerField<T, X>|.</text>
- </assertion>
-
- <assertion id="ec">
- <text>Resources are considered to be producer fields.</text>
- </assertion>
-
- <assertion id="ed">
- <text>The interface |javax.enterprise.inject.spi.ProcessBean| is a supertype of all these event types.</text>
- </assertion>
-
- <group>
- <text>|getAnnotated()| returns the |AnnotatedType| representing the bean class, the |AnnotatedMethod| representing the producer method, or the |AnnotatedField| representing the producer field.</text>
- <assertion id="efa">
- <text>Test producer method</text>
- </assertion>
- <assertion id="efb">
- <text>Test producer field</text>
- </assertion>
- </group>
-
- <assertion id="fa">
- <text>|getBean()| returns the |Bean| object that is about to be registered. The |Bean| may implement |Interceptor| or |Decorator|.</text>
- </assertion>
-
- <assertion id="h">
- <text>|addDefinitionError()| registers a definition error with the container, causing the container to abort deployment after bean discovery is complete.</text>
- </assertion>
-
- <assertion id="hb">
- <text>|getEjbName()| returns the EJB name of the session bean.</text>
- </assertion>
-
- <assertion id="hc">
- <text>|getSessionBeanType()| returns a |javax.enterprise.inject.spi.SessionBeanType| representing the kind of session bean.</text>
- </assertion>
-
- <assertion id="hd">
- <text>If any observer method of a |ProcessBean| event throws an exception, the exception is treated as a definition error by the container.</text>
- </assertion>
- </section>
-
- <section id="11.5.9" title="ProcessObserverMethod event">
- <assertion id="aaa">
- <text>The container must fire an event for each observer method. The event object must be of type |javax.enterprise.inject.spi.ProcessObserverMethod<T, X>| where |T| is the bean class of the bean that declares the observer method and |X| is the observed event type of the observer method.</text>
- </assertion>
-
- <assertion id="aba">
- <text>|getAnnotatedEventParameter()| returns the |AnnotatedParameter| representing the event parameter.</text>
- </assertion>
-
- <assertion id="ba">
- <text>|getObserverMethod()| returns the |ObserverMethod| object that will be used by the container to call the observer method.</text>
- </assertion>
-
- <assertion id="da">
- <text>|addDefinitionError()| registers a definition error with the container, causing the container to abort deployment after bean discovery is complete.</text>
- </assertion>
-
- <assertion id="db">
- <text>If any observer method of a |ProcessObserverMethod| event throws an exception, the exception is treated as a definition error by the container.</text>
- </assertion>
- </section>
-
- <section id="12" title="Packaging and Deployment">
-
- </section>
-
- <section id="12.1" title="Bean deployment archives">
- <assertion id="aa" testable="false">
- <text>Bean classes must be deployed in bean deployment archives.</text>
- </assertion>
-
+ </section>
+
+ <section id="11.3.17" title="Obtaining an AnnotatedType for a class">
+ <assertion id="a">
+ <text>The method |BeanManager.createAnnotatedType()| returns an |AnnotatedType| for the given Java class.</text>
+ </assertion>
+ </section>
+
+ <section id="11.3.18" title="Obtaining an InjectionTarget">
+
+ <group>
+ <text>The method |BeanManager.createInjectionTarget()| returns a container provided implementation of |InjectionTarget| for a given |AnnotatedType| or throws an |IllegalArgumentException| if there is a definition error associated with any injection point of the type.</text>
+ <assertion id="aa">
+ <text>Check |InjectionTarget| is provided.</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>Check |IllegalArgumentException| is thrown.</text>
+ </assertion>
+ </group>
+
+ </section>
+
+ <section id="11.4" title="Alternative metadata sources">
<assertion id="a" testable="false">
+ <text>The interfaces |AnnotatedType|, |AnnotatedField|, |AnnotatedMethod|, |AnnotatedConstructor| and |AnnotatedParameter| in the package |javax.enterprise.inject.spi| allow a portable extension to specify metadata that overrides the annotations that exist on a bean class. The portable extension is responsible for implementing the interfaces, thereby exposing the metadata to the container.</text>
+ <note>Statement of intent</note>
+ </assertion>
+
+ <assertion id="b" testable="false">
+ <text>The interface |javax.enterprise.inject.spi.Annotated| exposes the overriding annotations and type declarations.</text>
+ <note>Statement of intent</note>
+ </assertion>
+
+ <assertion id="c">
+ <text>|getBaseType()| returns the type of the program element.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>|getTypeClosure()| returns all types to which the base type should be considered assignable.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>|getAnnotation()| returns the program element annotation of the given annotation type, or a null value.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>|getAnnotations()| returns all annotations of the program element.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>|isAnnotationPresent()| returns true if the program element has an annotation of the given annotation type, or false otherwise.</text>
+ </assertion>
+
+ <group>
+ <text>The container must use the operations of |Annotated| and its subinterfaces to discover program element types and annotations, instead of directly calling the Java Reflection API. In particular, the container must call |Annotated.getBaseType()| to determine the type of an injection point, event parameter or disposed parameter, call |Annotated.getTypeClosure()| to determine the bean types of any kind of bean, call |Annotated.getAnnotations()| to determine the scope, qualifiers, stereotypes and interceptor bindings of a bean, call |Annotated.isAnnotationPresent()| and |Annotated.getAnnotation()| to read any bean annotations defined by this specification, and call |AnnotatedType.getConstructors()|, |AnnotatedType.getMethods()| and |AnnotatedType.getFields()| to determine the members of a bean class.</text>
+
+ <assertion id="h">
+ <text>Check that |getBaseType()| is used to determine the type of _an injection point_. The base type should be different from the orignal type specified in the class definition</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>Check that |getBaseType()| is used to determine the type of _an event parameter_. The base type should be different from the orignal type specified in the class definition</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>Check that |getBaseType()| is used to determine the type of _disposed parameter_. The base type should be different from the orignal type specified in the class definition</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>Check that a |getTypeClosure()| is used to determine the bean types. The type closure should be different from the orignal type specified in the class definition.</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>Check that |getAnnotations()| is used to determine the bean scope. The annotations should be different from the orignal type specified in the class definition.</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>Check that |getAnnotations()| is used to determine the bean qualifiers. The annotations should be different from the orignal type specified in the class definition.</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>Check that |getAnnotations()| is used to determine the bean stereotypes. The annotations should be different from the orignal type specified in the class definition.</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>Check that |getAnnotations()| is used to determine the bean interceptors. The annotations should be different from the orignal type specified in the class definition.</text>
+ </assertion>
+
+ <assertion id="q" testable="false">
+ <text>Check that |isAnnotationPresent()| returns the provided annotations</text>
+ <note>No testable behavior</note>
+ </assertion>
+
+ <assertion id="r">
+ <text>Check that a previously non-inject-annotated constructor is used by the container to instantiate a bean.</text>
+ </assertion>
+
+ <assertion id="s">
+ <text>Check that a qualifier added to a parameter is used by the container to instantiate a bean.</text>
+ </assertion>
+
+ <assertion id="t">
+ <text>Check that a previously non-inject-annotated field is injected.</text>
+ </assertion>
+
+ <assertion id="u">
+ <text>Check that an extra qualifier is applied.</text>
+ </assertion>
+
+ <assertion id="v">
+ <text>Check that |@Produces| added creates a producer field.</text>
+ </assertion>
+
+ <assertion id="w">
+ <text>Check that a previously non-inject-annotated method is injected.</text>
+ </assertion>
+
+ <assertion id="x">
+ <text>Check that an extra qualifier is applied to an injectable method</text>
+ </assertion>
+
+ <assertion id="y">
+ <text>Check that |@Produces| added creates a producer method</text>
+ </assertion>
+
+ <assertion id="z">
+ <text>Check that an extra qualifier is applied to a producer method.</text>
+ </assertion>
+
+ <assertion id="aa">
+ <text>Check that a qualifer added to a producer method parameter is applied.</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>Check that |@Disposes| added to a parameter creates a disposes method</text>
+ </assertion>
+
+ <assertion id="ac">
+ <text>Check that an extra qualifier is applied to a disposes method parameter.</text>
+ </assertion>
+
+ <assertion id="ad">
+ <text>Check that a qualifer added to a disposes method injectable parameter is applied.</text>
+ </assertion>
+
+ <assertion id="ae">
+ <text>Check that |@Observes| added to a parameter creates a observer method</text>
+ </assertion>
+
+ <assertion id="af">
+ <text>Check that an extra qualifier is applied to an observes method parameter.</text>
+ </assertion>
+
+ <assertion id="ag">
+ <text>Check that a qualifer added to a observes method injectable parameter is applied.</text>
+ </assertion>
+
+ </group>
+ </section>
+
+ <section id="11.5" title="Container lifecycle events">
+ <assertion id="a" testable="false">
+ <text>During the application initialization process, the container fires a series of events, allowing portable extensions to integrate with the container initialization process defined in Section 12.2, "Application initialization lifecycle".</text>
+ <note>Generic statement</note>
+ </assertion>
+
+ <assertion id="b">
+ <text>Observers of these events must be service providers of the service |javax.enterprise.inject.spi.Extension| declared in |META-INF/services|.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The container instantiates a single instance of each service provider at the beginning of the application initialization process and maintains a reference to it until the application shuts down.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Service providers may have observer methods, which may observe container initialization events and obtain an injected |BeanManager| reference.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>For each service provider, the container must provide a bean of scope |@ApplicationScoped| and binding |@Default|, supporting injection of a reference to the service provider instance. The bean types of this bean include the class of the service
+provider and all superclases and interfaces.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.1" title="BeforeBeanDiscovery event">
+ <assertion id="a">
+ <text>The container must fire an event before it begins the bean discovery process. The event object must be of type |javax.enterprise.inject.spi.BeforeBeanDiscovery|.</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>|addQualifier()| declares an annotation type as a qualifier type.</text>
+ </assertion>
+
+ <assertion id="ac">
+ <text>|addScope()| declares an annotation type as a scope type.</text>
+ </assertion>
+
+ <assertion id="ad">
+ <text>|addStereotype()| declares an annotation type as a stereotype, and specifies its meta-annotations.</text>
+ </assertion>
+
+ <assertion id="ae">
+ <text>|addInterceptorBinding()| declares an annotation type as an interceptor binding type, and specifies its meta-annotations.</text>
+ </assertion>
+
+ <assertion id="af">
+ <text>|addAnnotatedType()| adds a given |AnnotatedType| to the set of types which will be scanned during bean discovery.</text>
+ </assertion>
+
+ <assertion id="ag">
+ <text>If any observer method of the |BeforeBeanDiscovery| event throws an exception, the exception is treated as a definition error by the container.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.2" title="AfterBeanDiscovery event">
+ <assertion id="a">
+ <text>The container must fire a second event when it has fully completed the bean discovery process, validated that there are no definition errors relating to the discovered beans, and registered |Bean| and |Observer| objects for the discovered beans, but before detecting deployment problems. The event object must be of type |javax.enterprise.inject.spi.AfterBeanDiscovery|.</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>|addDefinitionError()| registers a definition error with the container, causing the container to abort deployment after all observers have been notified.</text>
+ </assertion>
+
+ <group>
+ <text>|addBean()| fires an event of type |ProcessBean| containing the given |Bean| and then registers the |Bean| with the container, thereby making it available for injection into other beans. The given |Bean| may implement |Interceptor| or |Decorator|.</text>
+
+ <assertion id="da">
+ <text>Check that |ProcessBean| is fired</text>
+ </assertion>
+
+ <assertion id="db">
+ <text>Check that a bean is registered</text>
+ </assertion>
+
+ <assertion id="dc">
+ <text>Check that a decorator is registered</text>
+ </assertion>
+
+ <assertion id="dd">
+ <text>Check that an interceptor is registered</text>
+ </assertion>
+ </group>
+
+ <group>
+ <text>|addObserverMethod()| fires an event of type |ProcessObserverMethod| containing the given |ObserverMethod| and then registers the |ObserverMethod| with the container, thereby making it available for event notifications.</text>
+ <assertion id="ea">
+ <text>Check that the |ProcessObserverMethod| is fired</text>
+ </assertion>
+ <assertion id="eb">
+ <text>Check that the observer method is registered</text>
+ </assertion>
+ </group>
+
+ <assertion id="f">
+ <text>|addContext()| registers a custom |Context| object with the container. A portable extension may take advantage of this event to register beans, interceptors, decorators, observer methods and custom context objects with the container.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If any observer method of the |AfterBeanDiscovery| event throws an exception, the exception is treated as a definition error by the container.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.3" title="AfterDeploymentValidation event">
+ <assertion id="a">
+ <text>The container must fire a third event after it has validated that there are no deployment problems and before creating contexts or processing requests. The event object must be of type |javax.enterprise.inject.spi.AfterDeploymentValidation|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>|addDeploymentProblem()| registers a deployment problem with the container, causing the container to abort deployment after all observers have been notified.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If any observer method of the |AfterDeploymentValidation| event throws an exception, the exception is treated as a deployment problem by the container.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The container must not allow any request to be processed by the deployment until all observers of this event return.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.4" title="BeforeShutdown event">
+ <assertion id="a">
+ <text>The container must fire a final event after it has finished processing requests and destroyed all contexts. The event object must be of type |javax.enterprise.inject.spi.BeforeShutdown|.</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>If any observer method of the |BeforeShutdown| event throws an exception, the exception is ignored by the container.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.5" title="ProcessAnnotatedType event">
+ <assertion id="a">
+ <text>The container must fire an event for each Java class it discovers, before it reads the declared annotations. The event object must be of type |javax.enterprise.inject.spi.ProcessAnnotatedType<X>|, where |X| is the class.</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>|getAnnotatedType()| returns the |AnnotatedType| object that will be used by the container to read the declared annotations.</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>|setAnnotatedType()| replaces the |AnnotatedType|.</text>
+ </assertion>
+
+ <assertion id="bc">
+ <text>|veto()| forces the container to ignore the type.</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>Any observer of this event is permitted to wrap and/or replace the |AnnotatedType|. The container must use the final value of this property, after all observers have been called, to discover the types and read the annotations of the program elements.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If any observer method of a |ProcessAnnotatedType| event throws an exception, the exception is treated as a definition error by the container.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.6" title="ProcessInjectionTarget event">
+ <group>
+ <text>The container must fire an event for each managed bean, session bean, Java EE component class supporting injection, producer method or producer field it discovers. The event object must be of type |javax.enterprise.inject.spi.ProcessInjectionTarget<X>|, where |X| is the managed bean class, session bean class or Java EE component class supporting injection.</text>
+ <assertion id="aaa">
+ <text>Test event is fired for a managed bean</text>
+ </assertion>
+ <assertion id="aab">
+ <text>Test event is fired for a session bean</text>
+ </assertion>
+ <assertion id="aac">
+ <text>Test event is fired for a servlet listener</text>
+ </assertion>
+ <assertion id="aad">
+ <text>Test event is fired for a tag handler</text>
+ </assertion>
+ <assertion id="aae">
+ <text>Test event is fired for a tag library listener</text>
+ </assertion>
+ <assertion id="aaf">
+ <text>Test event is fired for an EJB Interceptor</text>
+ </assertion>
+ <assertion id="aag">
+ <text>Test event is fired for a WS endpoint</text>
+ </assertion>
+ <assertion id="aah">
+ <text>Test event is fired for a servlet</text>
+ </assertion>
+ <assertion id="aai">
+ <text>Test event is fired for a filter</text>
+ </assertion>
+ <assertion id="aaj">
+ <text>Test event is fired for a producer method</text>
+ </assertion>
+ <assertion id="aak">
+ <text>Test event is fired for a producer field</text>
+ </assertion>
+ <assertion id="aal">
+ <text>Test type for a managed bean</text>
+ </assertion>
+ <assertion id="aam">
+ <text>Test type for a session bean</text>
+ </assertion>
+ <assertion id="aan">
+ <text>Test type for a servlet listener</text>
+ </assertion>
+ <assertion id="aao">
+ <text>Test type for a tag handler</text>
+ </assertion>
+ <assertion id="aap">
+ <text>Test type for a tag library listener</text>
+ </assertion>
+ <assertion id="aaq">
+ <text>Test type for an EJB Interceptor</text>
+ </assertion>
+ <assertion id="aar">
+ <text>Test type for a WS endpoint</text>
+ </assertion>
+ <assertion id="aas">
+ <text>Test type for a servlet</text>
+ </assertion>
+ <assertion id="aat">
+ <text>Test type for a filter</text>
+ </assertion>
+ <assertion id="aau">
+ <text>Test type for a producer method</text>
+ </assertion>
+ <assertion id="aav">
+ <text>Test type for a producer field</text>
+ </assertion>
+ </group>
+
+ <group>
+ <text>|getAnnotatedType()| returns the |AnnotatedType| representing the managed bean class, session bean or other Java EE component class supporting injection.</text>
+ <assertion id="aba">
+ <text>Test type for a managed bean</text>
+ </assertion>
+ <assertion id="abb">
+ <text>Test type for a session bean</text>
+ </assertion>
+ <assertion id="abc">
+ <text>Test type for a servlet listener</text>
+ </assertion>
+ <assertion id="abd">
+ <text>Test type for a tag handler</text>
+ </assertion>
+ <assertion id="abe">
+ <text>Test type for a tag library listener</text>
+ </assertion>
+ <assertion id="abf">
+ <text>Test type for an EJB Interceptor</text>
+ </assertion>
+ <assertion id="abg">
+ <text>Test type for a WS endpoint</text>
+ </assertion>
+ <assertion id="abh">
+ <text>Test type for a servlet</text>
+ </assertion>
+ <assertion id="abi">
+ <text>Test type for a filter</text>
+ </assertion>
+ <assertion id="abj">
+ <text>Test type for a producer method</text>
+ </assertion>
+ <assertion id="abk">
+ <text>Test type for a producer field</text>
+ </assertion>
+ </group>
+
+ <assertion id="bb">
+ <text>|setInjectionTarget()| replaces the |InjectionTarget|.</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>|addDefinitionError()| registers a definition error with the container, causing the container to abort deployment after bean discovery is complete.</text>
+ </assertion>
+
+ <group>
+ <text>Any observer of this event is permitted to wrap and/or replace the |InjectionTarget|. The container must use the final value of this property, after all observers have been called, whenever it performs injection upon the managed bean, session bean or other Java EE component class supporting injection.</text>
+ <assertion id="ea">
+ <text>Test type for a managed bean</text>
+ </assertion>
+ <assertion id="eb">
+ <text>Test type for a session bean</text>
+ </assertion>
+ <assertion id="ec">
+ <text>Test type for a servlet listener</text>
+ </assertion>
+ <assertion id="ed">
+ <text>Test type for a tag handler</text>
+ </assertion>
+ <assertion id="ee">
+ <text>Test type for a tag library listener</text>
+ </assertion>
+ <assertion id="ef">
+ <text>Test type for an EJB Interceptor</text>
+ </assertion>
+ <assertion id="eg">
+ <text>Test type for a WS endpoint</text>
+ </assertion>
+ <assertion id="eh">
+ <text>Test type for a servlet</text>
+ </assertion>
+ <assertion id="ei">
+ <text>Test type for a filter</text>
+ </assertion>
+ <assertion id="ej">
+ <text>Test type for a producer method</text>
+ </assertion>
+ <assertion id="ek">
+ <text>Test type for a producer field</text>
+ </assertion>
+ </group>
+
+ <assertion id="f">
+ <text>If any observer method of a |ProcessInjectionTarget| event throws an exception, the exception is treated as a definition error by the container.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.7" title="ProcessProducer event">
+ <group>
+ <text>The container must fire an event for each producer method or field, including resources.</text>
+ <assertion id="aa">
+ <text>Test producer method</text>
+ </assertion>
+ <assertion id="ab">
+ <text>Test producer field</text>
+ </assertion>
+ <assertion id="ac">
+ <text>Test resource producer field</text>
+ </assertion>
+ </group>
+
+ <group>
+ <text>The event object must be of type |javax.enterprise.inject.spi.ProcessProducer<T, X>|, where |T| is the bean class of the bean that declares the producer method or field and |X| is the return type of the producer method or the type of the producer field.</text>
+ <assertion id="ba">
+ <text>Test producer method</text>
+ </assertion>
+ <assertion id="bb">
+ <text>Test producer field</text>
+ </assertion>
+ </group>
+
+ <group>
+ <text>|getAnnotatedMember()| returns the |AnnotatedField| representing the producer field or the |AnnotatedMethod| representing the producer method.</text>
+ <assertion id="ca">
+ <text>Test producer method</text>
+ </assertion>
+ <assertion id="cb">
+ <text>Test producer field</text>
+ </assertion>
+ </group>
+
+ <group>
+ <text>|getProducer()| returns the |Producer| object that will be used by the container to call the producer method or read the producer field.</text>
+ <assertion id="da">
+ <text>Test producer method</text>
+ </assertion>
+ <assertion id="db">
+ <text>Test producer field</text>
+ </assertion>
+ </group>
+
+ <assertion id="e">
+ <text>|setProducer()| replaces the |Producer|.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>|addDefinitionError()| registers a definition error with the container, causing the container to abort deployment after bean discovery is complete.</text>
+ </assertion>
+
+ <group>
+ <text>Any observer of this event is permitted to wrap and/or replace the |Producer|. The container must use the final value of this property, after all observers have been called, whenever it calls the producer or disposer.</text>
+ <assertion id="ga">
+ <text>Test producer method</text>
+ </assertion>
+ <assertion id="gb">
+ <text>Test producer field</text>
+ </assertion>
+ </group>
+
+ <assertion id="h">
+ <text>If any observer method of a |ProcessProducer| event throws an exception, the exception is treated as a definition error by the container.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.8" title="ProcessBean event">
+ <assertion id="aa">
+ <text>The container must fire an event for each bean it discovers, before registering the |Bean| object. The event object in the package |javax.enterprise.inject.spi| depends upon what kind of bean was discovered.</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>For a managed bean with bean class |X|, the container must raise an event of type |ProcessManagedBean<X>|.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>For a session bean with bean class |X|, the container must raise an event of type |ProcessSessionBean<X>|.</text>
+ </assertion>
+
+ <assertion id="eaa">
+ <text>For a producer method with method return type |X| of a bean with bean class |T|, the container must raise an event of type |ProcessProducerMethod<T, X>|.</text>
+ </assertion>
+
+ <assertion id="eb">
+ <text>For a producer field with field type |X| of a bean with bean class |T|, the container must raise an event of type |ProcessProducerField<T, X>|.</text>
+ </assertion>
+
+ <assertion id="ec">
+ <text>Resources are considered to be producer fields.</text>
+ </assertion>
+
+ <assertion id="ed">
+ <text>The interface |javax.enterprise.inject.spi.ProcessBean| is a supertype of all these event types.</text>
+ </assertion>
+
+ <group>
+ <text>|getAnnotated()| returns the |AnnotatedType| representing the bean class, the |AnnotatedMethod| representing the producer method, or the |AnnotatedField| representing the producer field.</text>
+ <assertion id="efa">
+ <text>Test producer method</text>
+ </assertion>
+ <assertion id="efb">
+ <text>Test producer field</text>
+ </assertion>
+ </group>
+
+ <assertion id="fa">
+ <text>|getBean()| returns the |Bean| object that is about to be registered. The |Bean| may implement |Interceptor| or |Decorator|.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>|addDefinitionError()| registers a definition error with the container, causing the container to abort deployment after bean discovery is complete.</text>
+ </assertion>
+
+ <assertion id="hb">
+ <text>|getEjbName()| returns the EJB name of the session bean.</text>
+ </assertion>
+
+ <assertion id="hc">
+ <text>|getSessionBeanType()| returns a |javax.enterprise.inject.spi.SessionBeanType| representing the kind of session bean.</text>
+ </assertion>
+
+ <assertion id="hd">
+ <text>If any observer method of a |ProcessBean| event throws an exception, the exception is treated as a definition error by the container.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.9" title="ProcessObserverMethod event">
+ <assertion id="aaa">
+ <text>The container must fire an event for each observer method. The event object must be of type |javax.enterprise.inject.spi.ProcessObserverMethod<T, X>| where |T| is the bean class of the bean that declares the observer method and |X| is the observed event type of the observer method.</text>
+ </assertion>
+
+ <assertion id="aba">
+ <text>|getAnnotatedEventParameter()| returns the |AnnotatedParameter| representing the event parameter.</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>|getObserverMethod()| returns the |ObserverMethod| object that will be used by the container to call the observer method.</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>|addDefinitionError()| registers a definition error with the container, causing the container to abort deployment after bean discovery is complete.</text>
+ </assertion>
+
+ <assertion id="db">
+ <text>If any observer method of a |ProcessObserverMethod| event throws an exception, the exception is treated as a definition error by the container.</text>
+ </assertion>
+ </section>
+
+ <section id="12" title="Packaging and Deployment">
+
+ </section>
+
+ <section id="12.1" title="Bean deployment archives">
+ <assertion id="aa" testable="false">
+ <text>Bean classes must be deployed in bean deployment archives.</text>
+ </assertion>
+
+ <assertion id="a" testable="false">
<text>A library jar, EJB jar or rar archive is a bean deployment archive if it has a file named |beans.xml| in the |META-INF| directory. The |WEB-INF/classes| directory of a war is a bean deployment archive if there is a file named |beans.xml| in the |WEBINF| directory of the war. A directory in the JVM classpath is a bean deployment archive if it has a file named |beans.xml| in the |META-INF| directory.</text>
<note>covered in bb*, bc*, bd*</note>
- </assertion>
-
- <assertion id="ba" testable="false">
- <text>The container searches for beans in bean deployment archives in the application classpath.</text>
+ </assertion>
+
+ <assertion id="ba" testable="false">
+ <text>The container searches for beans in bean deployment archives in the application classpath.</text>
<note>covered in bb*, bc*, bd*</note>
- </assertion>
-
+ </assertion>
+
<group>
- <text>In an application deployed as an ear, the container searches every bean deployment archive bundled with or referenced by the ear, including bean deployment archives bundled with or referenced by wars and EJB jars contained in the ear. The bean deployment archives might be library jars, EJB jars, rars or war |WEB-INF/classes| directories.</text>
+ <text>In an application deployed as an ear, the container searches every bean deployment archive bundled with or referenced by the ear, including bean deployment archives bundled with or referenced by wars and EJB jars contained in the ear. The bean deployment archives might be library jars, EJB jars, rars or war |WEB-INF/classes| directories.</text>
<assertion id="bba">
<text>Check an EJB jar in an EAR</text>
- </assertion>
+ </assertion>
<assertion id="bbb">
<text>Check a bundled library in an EAR</text>
</assertion>
@@ -5732,23 +5732,23 @@
</assertion>
<assertion id="bbe">
<text>Check a war in an ear</text>
- </assertion>
- <assertion id="bbf">
- <text>Check for a jar installed as a library</text>
</assertion>
+ <assertion id="bbf">
+ <text>Check for a jar installed as a library</text>
+ </assertion>
</group>
-
+
<group>
- <text>In an application deployed as a war, the container searches every bean deployment archive bundled with or referenced by the war. The bean deployment archives might be library jars or the |WEB-INF/classes| directory.</text>
+ <text>In an application deployed as a war, the container searches every bean deployment archive bundled with or referenced by the war. The bean deployment archives might be library jars or the |WEB-INF/classes| directory.</text>
<assertion id="bca">
<text>Check classes in the war</text>
- </assertion>
+ </assertion>
<assertion id="bcb">
<text>Check bundled libraries in the war</text>
- </assertion>
- <assertion id="bcc">
- <text>Check for a jar installed as a library</text>
</assertion>
+ <assertion id="bcc">
+ <text>Check for a jar installed as a library</text>
+ </assertion>
</group>
<group>
@@ -5758,272 +5758,272 @@
<text>Check classes in the jar.</text>
</assertion>
</group>
-
+
<group>
- <text>An embeddable EJB container searches each bean deployment archive in the JVM classpath that is listed in the value of the embeddable container initialization property |javax.ejb.embeddable.modules|, or every bean deployment archive in the JVM classpath if the property is not specified. The bean deployment archives might be directories, library jars or EJB jars.</text>
+ <text>An embeddable EJB container searches each bean deployment archive in the JVM classpath that is listed in the value of the embeddable container initialization property |javax.ejb.embeddable.modules|, or every bean deployment archive in the JVM classpath if the property is not specified. The bean deployment archives might be directories, library jars or EJB jars.</text>
<assertion id="bda" testable="false">
- <text>Check modules specified by |javax.ejb.embeddable.modules|</text>
+ <text>Check modules specified by |javax.ejb.embeddable.modules|</text>
<note>1.0 release of the TCK does not cover embeddable EJB</note>
</assertion>
<assertion id="bdb" testable="false">
- <text>Check libraries</text>
+ <text>Check libraries</text>
<note>1.0 release of the TCK does not cover embeddable EJB</note>
</assertion>
<assertion id="bdc" testable="false">
- <text>Check directories</text>
+ <text>Check directories</text>
<note>1.0 release of the TCK does not cover embeddable EJB</note>
- </assertion>
+ </assertion>
<assertion id="bda" testable="false">
- <text>Check ejb jars</text>
+ <text>Check ejb jars</text>
<note>1.0 release of the TCK does not cover embeddable EJB</note>
</assertion>
</group>
-
- <assertion id="be" testable="false">
- <text>When searching for beans, the container considers any Java class in any bean deployment archive, and any |ejb-jar.xml| file in the metadata directory of any EJB bean deployment archive.</text>
- <note>covered in bb*, bc*, bd*</note>
- </assertion>
-
- <assertion id="ca">
- <text>If a bean is deployed in an archive or directory that does not contain a file named |beans.xml| in the metadata directory, it will not be discovered by the container.</text>
- </assertion>
-
- <assertion id="d" testable="false">
- <text>If a bean class is deployed in two different bean deployment archives, non-portable behaviour results. Portable applications must deploy each bean class in exactly one bean deployment archive.</text>
- <note>Describes undefined behavior</note>
- </assertion>
- </section>
-
- <section id="12.2" title="Application initialization lifecycle">
- <assertion id="a" testable="false">
- <text>When an application is started, the container performs the following steps.</text>
- <note>Description</note>
- </assertion>
-
- <assertion id="b">
- <text>First, the container must search for service providers for the service |javax.enterprise.inject.spi.Extension| defined in Section 11.5, "Container lifecycle events", instantiate a single instance of each service provider, and search the service provider class for observer methods of initialization events.</text>
- </assertion>
-
- <assertion id="c">
- <text>Next, the container must fire an event of type |BeforeBeanDiscovery|, as defined in Section 11.5.1, "BeforeBeanDiscovery event".</text>
- </assertion>
-
- <group>
- <text>Next, the container must perform bean discovery, and abort initialization of the application if any definition errors exist, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- <assertion id="da">
- <text>Check beans are discovered</text>
- </assertion>
- <assertion id="db">
- <text>
- Check definitions errors occur
- </text>
- </assertion>
- </group>
-
-
- <assertion id="e">
- <text>Next, the container must fire an event of type |AfterBeanDiscovery|, as defined in Section 11.5.2, "AfterBeanDiscovery event", and abort initialization of the application if any observer registers a definition error.</text>
- </assertion>
-
- <assertion id="f">
- <text>Next, the container must detect deployment problems by validating bean dependencies and specialization and abort initialization of the application if any deployment problems exist, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
-
- <assertion id="g">
- <text>Next, the container must fire an event of type |AfterDeploymentValidation|, as defined in Section 11.5.3, "AfterDeploymentValidation event", and abort initialization of the application if any observer registers a deployment problem.</text>
- </assertion>
-
- <assertion id="h">
- <text>Finally, the container begins directing requests to the application.</text>
- <note>Can only check the inverse, that requests aren't directed to the application before</note>
- </assertion>
- </section>
-
- <section id="12.3" title="Bean discovery">
- <assertion id="a" testable="false">
- <text>The container automatically discovers managed beans (according to the rules of Section 3.2.1, "Which Java classes are managed beans?") and session beans in bean deployment archives and searches the bean classes for producer methods, producer fields, disposal methods and observer methods.</text>
- <note>Statement of intent</note>
- </assertion>
-
- <group>
- <text>For each Java class in any bean deployment archive, the container must create an |AnnotatedType| representing the class and fire an event of type |ProcessAnnotatedType|, as defined in Section 11.5.5, "ProcessAnnotatedType event".</text>
- <assertion id="ba">
- <text>Check managed bean</text>
- </assertion>
- <assertion id="bb">
- <text>Check session bean</text>
- </assertion>
- <assertion id="bc">
- <text>Check non-contextual session bean</text>
- </assertion>
- <assertion id="bd">
- <text>Check JSF managed beans</text>
- </assertion>
- <assertion id="be">
- <text>Check servlet listener</text>
- </assertion>
- <assertion id="bf">
- <text>Check tag handler</text>
- </assertion>
- <assertion id="bg">
- <text>Check tag library listener</text>
- </assertion>
- <assertion id="bh">
- <text>Check EJB Interceptor</text>
- </assertion>
- <assertion id="bi">
- <text>Check WS endpoint</text>
- </assertion>
- <assertion id="bj">
- <text>Check servlet</text>
- </assertion>
- <assertion id="bk">
- <text>Check filter</text>
- </assertion>
- </group>
-
- <assertion id="c" testable="false">
- <text>For each Java class in any bean deployment archive, the container must inspect the class metadata to determine if it is a bean or other Java EE component class supporting injection, or if it declares event mappings.</text>
- <note>No consequence</note>
- </assertion>
-
- <assertion id="d" testable="false">
- <text>For each Java class in any bean deployment archive, the container must detect definition errors by validating the class and its metadata.</text>
- <note>Tested elsewhere</note>
- </assertion>
-
- <group>
- <text>For each Java class in any bean deployment archive, the container must, if the class is a managed bean, session bean, producer method or field, or other Java EE component class supporting injection, create an |InjectionTarget| for the class, as defined in Section 11.2, "The Producer and InjectionTarget interfaces", and fire an event of type |ProcessInjectionTarget|, as defined in Section 11.5.6, "ProcessInjectionTarget event"</text>
- <assertion id="ba">
- <text>Check managed bean</text>
- </assertion>
- <assertion id="bb">
- <text>Check session bean</text>
- </assertion>
- <assertion id="bb">
- <text>Check producer field</text>
- </assertion>
- <assertion id="bb">
- <text>Check producer method</text>
- </assertion>
- <assertion id="bc">
- <text>Check non-contextual session bean</text>
- </assertion>
- <assertion id="bd">
- <text>Check JSF managed beans</text>
- </assertion>
- <assertion id="be">
- <text>Check servlet listener</text>
- </assertion>
- <assertion id="bf">
- <text>Check tag handler</text>
- </assertion>
- <assertion id="bg">
- <text>Check tag library listener</text>
- </assertion>
- <assertion id="bh">
- <text>Check EJB Interceptor</text>
- </assertion>
- <assertion id="bi">
- <text>Check WS endpoint</text>
- </assertion>
- <assertion id="bj">
- <text>Check servlet</text>
- </assertion>
- <assertion id="bk">
- <text>Check filter</text>
- </assertion>
- </group>
-
- <group>
- <text>For each Java class in any bean deployment archive, the container must, if the class is a bean, create a |Bean| object that implements the rules defined in Section 7.3.1, "Lifecycle of managed beans", Section 7.3.2, "Lifecycle of stateful session beans" or Section 7.3.3, "Lifecycle of stateless session and singleton beans", and fire an event which is a subtype of |ProcessBean|, as defined in Section 11.5.8, "ProcessBean event".</text>
- <assertion id="fa">
- <text>Check a managed bean</text>
- </assertion>
- <assertion id="fb">
- <text>Check a session bean</text>
- </assertion>
- </group>
-
- <assertion id="g">
- <text>For each session bean declared in |ejb-jar.xml| in each EJB bean deployment archive the container must create a |Bean| object that implements the rules defined in Section 7.3.2, "Lifecycle of stateful session beans" or Section 7.3.3, "Lifecycle of stateless session and singleton beans", and fire an event of type |ProcessSessionBean|, as defined in Section 11.5.8, "ProcessBean event".</text>
- </assertion>
-
- <group>
- <text>For each bean, the container must search the clas for producer methods and fields, including resources, and for each producer method or field create a |Producer|, as defined in Section 11.2, "The Producer and InjectionTarget interfaces", and fire an event of type |ProcessProducer|, as defined in Section 11.5.7, "ProcessProducer event", and then create a |Bean| object that implements the rules defined in Section 7.3.4, "Lifecycle of producer methods", Section 7.3.5, "Lifecycle of producer fields" or Section 7.3.6, "Lifecycle of resources", and fire an event which is a subtype of |ProcessBean|, as defined in Section 11.5.8, "ProcessBean event".</text>
- <assertion id="ha">
- <text>
- Check a producer method
- </text>
- </assertion>
- <assertion id="hb">
- <text>
- Check a producer field
- </text>
- </assertion>
- </group>
-
-
- <assertion id="i">
- <text>For each bean, the container must search the class for observer methods, and for each observer method create an |ObserverMethod| object, as defined in Section 11.1.3, "The ObserverMethod interface" and fire an event of type |ProcessObserverMethod|, as defined in Section 11.5.9, "ProcessObserverMethod event".</text>
- </assertion>
-
- <group>
- <text>The container determines which alternatives, interceptors and decorators are enabled, according to the rules defined in Section 5.2.2, "Enabled and disabled beans", Section 9.4, "Interceptor enablement and ordering" and Section 8.2, "Decorator enablement and ordering", taking into account any |<enable>|, |<interceptors>| and |<decorators>| declarations in the |beans.xml| files, and registers the |Bean| and |ObserverMethod| objects.</text>
- <assertion id="ka">
- <text>Check only beans for enabled policies registered</text>
- </assertion>
- <assertion id="kb">
- <text>Check only enabled interceptors registered</text>
- </assertion>
- <assertion id="kc">
- <text>Check only enabled decorators registered</text>
- </assertion>
- </group>
-
- <assertion id="l" testable="false">
- <text>For each enabled bean that is not an interceptor or decorator, the container registers an instance of the |Bean| interface defined in Section 11.1, "The Bean interface".</text>
- <note>Checked above</note>
- </assertion>
-
- <assertion id="m" testable="false">
- <text>For each enabled interceptor, the container registers an instance of the |Interceptor| interface as defined in Section 11.1.2, "The Interceptor interface".</text>
- <note>Checked above</note>
- </assertion>
-
- <assertion id="n" testable="false">
- <text>For each enabled decorator, the container registers an instance of the |Decorator| interface defined in Section 11.1.1, "The Decorator interface".</text>
- <note>Checked above</note>
- </assertion>
-
- <assertion id="o">
- <text>For each observer method of an enabled bean, the container registers an instance of the |ObserverMethod| interface defined in Section 11.1.3, "The ObserverMethod interface".</text>
- </assertion>
- </section>
-
- <section id="12.4" title="Problems detected automatically by the container">
- <assertion id="a">
- <text>Definition errors may be detected by tooling at development time, and are also detected by the container at initialization time. If a definition error exists in a deployment, initialization will be aborted by the container.</text>
- </assertion>
-
- <assertion id="b">
- <text>Deployment problems are detected by the container at initialization time. If a deployment problem exists in a deployment, initialization will be aborted by the container.</text>
- </assertion>
-
- <assertion id="d" testable="false">
- <text>The container is permitted to define a non-portable mode, for use at development time, in which some definition errors and deployment problems do not cause application initialization to abort.</text>
- <note>Specifies undefined behavior</note>
- </assertion>
-
- <assertion id="e" testable="false">
- <text>Exceptions represent problems that may not be detected until they actually occur at runtime. All exceptions defined by this specification are unchecked exceptions.</text>
- <note>Explanatory note</note>
- </assertion>
-
- <assertion id="f" testable="false">
- <text>All exceptions defined by this specification may be safely caught and handled by the application.</text>
- <note>Explanatory note</note>
- </assertion>
- </section>
-
-</specification>
+
+ <assertion id="be" testable="false">
+ <text>When searching for beans, the container considers any Java class in any bean deployment archive, and any |ejb-jar.xml| file in the metadata directory of any EJB bean deployment archive.</text>
+ <note>covered in bb*, bc*, bd*</note>
+ </assertion>
+
+ <assertion id="ca">
+ <text>If a bean is deployed in an archive or directory that does not contain a file named |beans.xml| in the metadata directory, it will not be discovered by the container.</text>
+ </assertion>
+
+ <assertion id="d" testable="false">
+ <text>If a bean class is deployed in two different bean deployment archives, non-portable behaviour results. Portable applications must deploy each bean class in exactly one bean deployment archive.</text>
+ <note>Describes undefined behavior</note>
+ </assertion>
+ </section>
+
+ <section id="12.2" title="Application initialization lifecycle">
+ <assertion id="a" testable="false">
+ <text>When an application is started, the container performs the following steps.</text>
+ <note>Description</note>
+ </assertion>
+
+ <assertion id="b">
+ <text>First, the container must search for service providers for the service |javax.enterprise.inject.spi.Extension| defined in Section 11.5, "Container lifecycle events", instantiate a single instance of each service provider, and search the service provider class for observer methods of initialization events.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Next, the container must fire an event of type |BeforeBeanDiscovery|, as defined in Section 11.5.1, "BeforeBeanDiscovery event".</text>
+ </assertion>
+
+ <group>
+ <text>Next, the container must perform bean discovery, and abort initialization of the application if any definition errors exist, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ <assertion id="da">
+ <text>Check beans are discovered</text>
+ </assertion>
+ <assertion id="db">
+ <text>
+ Check definitions errors occur
+ </text>
+ </assertion>
+ </group>
+
+
+ <assertion id="e">
+ <text>Next, the container must fire an event of type |AfterBeanDiscovery|, as defined in Section 11.5.2, "AfterBeanDiscovery event", and abort initialization of the application if any observer registers a definition error.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Next, the container must detect deployment problems by validating bean dependencies and specialization and abort initialization of the application if any deployment problems exist, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>Next, the container must fire an event of type |AfterDeploymentValidation|, as defined in Section 11.5.3, "AfterDeploymentValidation event", and abort initialization of the application if any observer registers a deployment problem.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>Finally, the container begins directing requests to the application.</text>
+ <note>Can only check the inverse, that requests aren't directed to the application before</note>
+ </assertion>
+ </section>
+
+ <section id="12.3" title="Bean discovery">
+ <assertion id="a" testable="false">
+ <text>The container automatically discovers managed beans (according to the rules of Section 3.2.1, "Which Java classes are managed beans?") and session beans in bean deployment archives and searches the bean classes for producer methods, producer fields, disposal methods and observer methods.</text>
+ <note>Statement of intent</note>
+ </assertion>
+
+ <group>
+ <text>For each Java class in any bean deployment archive, the container must create an |AnnotatedType| representing the class and fire an event of type |ProcessAnnotatedType|, as defined in Section 11.5.5, "ProcessAnnotatedType event".</text>
+ <assertion id="ba">
+ <text>Check managed bean</text>
+ </assertion>
+ <assertion id="bb">
+ <text>Check session bean</text>
+ </assertion>
+ <assertion id="bc">
+ <text>Check non-contextual session bean</text>
+ </assertion>
+ <assertion id="bd">
+ <text>Check JSF managed beans</text>
+ </assertion>
+ <assertion id="be">
+ <text>Check servlet listener</text>
+ </assertion>
+ <assertion id="bf">
+ <text>Check tag handler</text>
+ </assertion>
+ <assertion id="bg">
+ <text>Check tag library listener</text>
+ </assertion>
+ <assertion id="bh">
+ <text>Check EJB Interceptor</text>
+ </assertion>
+ <assertion id="bi">
+ <text>Check WS endpoint</text>
+ </assertion>
+ <assertion id="bj">
+ <text>Check servlet</text>
+ </assertion>
+ <assertion id="bk">
+ <text>Check filter</text>
+ </assertion>
+ </group>
+
+ <assertion id="c" testable="false">
+ <text>For each Java class in any bean deployment archive, the container must inspect the class metadata to determine if it is a bean or other Java EE component class supporting injection, or if it declares event mappings.</text>
+ <note>No consequence</note>
+ </assertion>
+
+ <assertion id="d" testable="false">
+ <text>For each Java class in any bean deployment archive, the container must detect definition errors by validating the class and its metadata.</text>
+ <note>Tested elsewhere</note>
+ </assertion>
+
+ <group>
+ <text>For each Java class in any bean deployment archive, the container must, if the class is a managed bean, session bean, producer method or field, or other Java EE component class supporting injection, create an |InjectionTarget| for the class, as defined in Section 11.2, "The Producer and InjectionTarget interfaces", and fire an event of type |ProcessInjectionTarget|, as defined in Section 11.5.6, "ProcessInjectionTarget event"</text>
+ <assertion id="ba">
+ <text>Check managed bean</text>
+ </assertion>
+ <assertion id="bb">
+ <text>Check session bean</text>
+ </assertion>
+ <assertion id="bb">
+ <text>Check producer field</text>
+ </assertion>
+ <assertion id="bb">
+ <text>Check producer method</text>
+ </assertion>
+ <assertion id="bc">
+ <text>Check non-contextual session bean</text>
+ </assertion>
+ <assertion id="bd">
+ <text>Check JSF managed beans</text>
+ </assertion>
+ <assertion id="be">
+ <text>Check servlet listener</text>
+ </assertion>
+ <assertion id="bf">
+ <text>Check tag handler</text>
+ </assertion>
+ <assertion id="bg">
+ <text>Check tag library listener</text>
+ </assertion>
+ <assertion id="bh">
+ <text>Check EJB Interceptor</text>
+ </assertion>
+ <assertion id="bi">
+ <text>Check WS endpoint</text>
+ </assertion>
+ <assertion id="bj">
+ <text>Check servlet</text>
+ </assertion>
+ <assertion id="bk">
+ <text>Check filter</text>
+ </assertion>
+ </group>
+
+ <group>
+ <text>For each Java class in any bean deployment archive, the container must, if the class is a bean, create a |Bean| object that implements the rules defined in Section 7.3.1, "Lifecycle of managed beans", Section 7.3.2, "Lifecycle of stateful session beans" or Section 7.3.3, "Lifecycle of stateless session and singleton beans", and fire an event which is a subtype of |ProcessBean|, as defined in Section 11.5.8, "ProcessBean event".</text>
+ <assertion id="fa">
+ <text>Check a managed bean</text>
+ </assertion>
+ <assertion id="fb">
+ <text>Check a session bean</text>
+ </assertion>
+ </group>
+
+ <assertion id="g">
+ <text>For each session bean declared in |ejb-jar.xml| in each EJB bean deployment archive the container must create a |Bean| object that implements the rules defined in Section 7.3.2, "Lifecycle of stateful session beans" or Section 7.3.3, "Lifecycle of stateless session and singleton beans", and fire an event of type |ProcessSessionBean|, as defined in Section 11.5.8, "ProcessBean event".</text>
+ </assertion>
+
+ <group>
+ <text>For each bean, the container must search the clas for producer methods and fields, including resources, and for each producer method or field create a |Producer|, as defined in Section 11.2, "The Producer and InjectionTarget interfaces", and fire an event of type |ProcessProducer|, as defined in Section 11.5.7, "ProcessProducer event", and then create a |Bean| object that implements the rules defined in Section 7.3.4, "Lifecycle of producer methods", Section 7.3.5, "Lifecycle of producer fields" or Section 7.3.6, "Lifecycle of resources", and fire an event which is a subtype of |ProcessBean|, as defined in Section 11.5.8, "ProcessBean event".</text>
+ <assertion id="ha">
+ <text>
+ Check a producer method
+ </text>
+ </assertion>
+ <assertion id="hb">
+ <text>
+ Check a producer field
+ </text>
+ </assertion>
+ </group>
+
+
+ <assertion id="i">
+ <text>For each bean, the container must search the class for observer methods, and for each observer method create an |ObserverMethod| object, as defined in Section 11.1.3, "The ObserverMethod interface" and fire an event of type |ProcessObserverMethod|, as defined in Section 11.5.9, "ProcessObserverMethod event".</text>
+ </assertion>
+
+ <group>
+ <text>The container determines which alternatives, interceptors and decorators are enabled, according to the rules defined in Section 5.2.2, "Enabled and disabled beans", Section 9.4, "Interceptor enablement and ordering" and Section 8.2, "Decorator enablement and ordering", taking into account any |<enable>|, |<interceptors>| and |<decorators>| declarations in the |beans.xml| files, and registers the |Bean| and |ObserverMethod| objects.</text>
+ <assertion id="ka">
+ <text>Check only beans for enabled policies registered</text>
+ </assertion>
+ <assertion id="kb">
+ <text>Check only enabled interceptors registered</text>
+ </assertion>
+ <assertion id="kc">
+ <text>Check only enabled decorators registered</text>
+ </assertion>
+ </group>
+
+ <assertion id="l" testable="false">
+ <text>For each enabled bean that is not an interceptor or decorator, the container registers an instance of the |Bean| interface defined in Section 11.1, "The Bean interface".</text>
+ <note>Checked above</note>
+ </assertion>
+
+ <assertion id="m" testable="false">
+ <text>For each enabled interceptor, the container registers an instance of the |Interceptor| interface as defined in Section 11.1.2, "The Interceptor interface".</text>
+ <note>Checked above</note>
+ </assertion>
+
+ <assertion id="n" testable="false">
+ <text>For each enabled decorator, the container registers an instance of the |Decorator| interface defined in Section 11.1.1, "The Decorator interface".</text>
+ <note>Checked above</note>
+ </assertion>
+
+ <assertion id="o">
+ <text>For each observer method of an enabled bean, the container registers an instance of the |ObserverMethod| interface defined in Section 11.1.3, "The ObserverMethod interface".</text>
+ </assertion>
+ </section>
+
+ <section id="12.4" title="Problems detected automatically by the container">
+ <assertion id="a">
+ <text>Definition errors may be detected by tooling at development time, and are also detected by the container at initialization time. If a definition error exists in a deployment, initialization will be aborted by the container.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Deployment problems are detected by the container at initialization time. If a deployment problem exists in a deployment, initialization will be aborted by the container.</text>
+ </assertion>
+
+ <assertion id="d" testable="false">
+ <text>The container is permitted to define a non-portable mode, for use at development time, in which some definition errors and deployment problems do not cause application initialization to abort.</text>
+ <note>Specifies undefined behavior</note>
+ </assertion>
+
+ <assertion id="e" testable="false">
+ <text>Exceptions represent problems that may not be detected until they actually occur at runtime. All exceptions defined by this specification are unchecked exceptions.</text>
+ <note>Explanatory note</note>
+ </assertion>
+
+ <assertion id="f" testable="false">
+ <text>All exceptions defined by this specification may be safely caught and handled by the application.</text>
+ <note>Explanatory note</note>
+ </assertion>
+ </section>
+
+</specification>
Modified: cdi-tck/trunk/impl/src/main/resources/tck-audit-int.xml
===================================================================
--- cdi-tck/trunk/impl/src/main/resources/tck-audit-int.xml 2009-10-09 01:24:59 UTC (rev 3905)
+++ cdi-tck/trunk/impl/src/main/resources/tck-audit-int.xml 2009-10-09 04:49:23 UTC (rev 3906)
@@ -1,11 +1,11 @@
-<specification
- xmlns="http://jboss.com/products/webbeans/tck/audit"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://jboss.com/products/webbeans/tck/audit"
+<specification
+ xmlns="http://jboss.com/products/weld/tck/audit"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://jboss.com/products/weld/tck/audit"
name="JSR-318: Enterprise JavaBeans Interceptors Requirements"
- id="int"
- version="3.1.PFD">
-
+ id="int"
+ version="3.1.PFD">
+
<section id="1" title="Overview">
<assertion id="a">
<text>An interceptor method may be defined on a target class itself or on an interceptor class associated with the target class.</text>
@@ -47,12 +47,12 @@
<text>The deployment descriptor may be used as an alternative to specify the invocation order of interceptors or to override the order specified in metadata annotations.</text>
<assertion id="j" testable="false">
- <text>Test that the deployment descriptor can be used to specify the invocation order.</text>
+ <text>Test that the deployment descriptor can be used to specify the invocation order.</text>
<note>CDI doesn't support interceptors</note>
</assertion>
<assertion id="k" testable="false">
- <text>Test that the deployment descriptor overrides the order specified by the annotations.</text>
+ <text>Test that the deployment descriptor overrides the order specified by the annotations.</text>
<note>CDI doesn't support interceptors</note>
</assertion>
</group>
@@ -128,12 +128,12 @@
<section id="3.1" title="Multiple Method Interceptor Methods">
<assertion id="a" testable="false">
- <text>The deployment descriptor may be used to override the interceptor invocation order specified in annotations.</text>
+ <text>The deployment descriptor may be used to override the interceptor invocation order specified in annotations.</text>
<note>CDI doesn't support interceptors</note>
</assertion>
<assertion id="b" testable="false">
- <text>Default interceptors, if any, are invoked first. Default interceptors can only be specified in the deployment descriptor. Default interceptors are invoked in the order of their specification in the deployment descriptor.</text>
+ <text>Default interceptors, if any, are invoked first. Default interceptors can only be specified in the deployment descriptor. Default interceptors are invoked in the order of their specification in the deployment descriptor.</text>
<note>CDI doesn't support interceptors</note>
</assertion>
@@ -158,7 +158,7 @@
</assertion>
<assertion id="h" testable="false">
- <text>The deployment descriptor may be used to override the interceptor invocation order specified in annotations.</text>
+ <text>The deployment descriptor may be used to override the interceptor invocation order specified in annotations.</text>
<note>CDI doesn't support interceptors</note>
</assertion>
@@ -192,12 +192,12 @@
<section id="4" title="Timeout Method Interceptors">
<assertion id="a" testable="false">
- <text>Interceptor methods that interpose on timeout methods are denoted by the |AroundTimeout| annotation or |around-timeout| deployment descriptor element.</text>
+ <text>Interceptor methods that interpose on timeout methods are denoted by the |AroundTimeout| annotation or |around-timeout| deployment descriptor element.</text>
<note>CDI doesn't support timeout methods</note>
</assertion>
<assertion id="b" testable="false">
- <text>Around-timeout methods may be defined on interceptor classes and the target class (or superclass). However, only one |AroundTimeout| method may be present on a given class.</text>
+ <text>Around-timeout methods may be defined on interceptor classes and the target class (or superclass). However, only one |AroundTimeout| method may be present on a given class.</text>
<note>CDI doesn't support timeout methods</note>
</assertion>
@@ -205,22 +205,22 @@
<text>Around-timer methods can have |public|, |private|, |protected|, or |package| level access.</text>
<assertion id="c" testable="false">
- <text>Test with a |public| method.</text>
+ <text>Test with a |public| method.</text>
<note>CDI doesn't support timeout methods</note>
</assertion>
<assertion id="d" testable="false">
- <text>Test with a |private| method.</text>
+ <text>Test with a |private| method.</text>
<note>CDI doesn't support timeout methods</note>
</assertion>
<assertion id="e" testable="false">
- <text>Test with a |protected| method.</text>
+ <text>Test with a |protected| method.</text>
<note>CDI doesn't support timeout methods</note>
</assertion>
<assertion id="f" testable="false">
- <text>Test with a |package| method.</text>
+ <text>Test with a |package| method.</text>
<note>CDI doesn't support timeout methods</note>
</assertion>
</group>
@@ -231,91 +231,91 @@
</assertion>
<assertion id="h" testable="false">
- <text>Around-timer methods must have the following signature: |Object <METHOD>(InvocationContext) throws Exception|</text>
+ <text>Around-timer methods must have the following signature: |Object <METHOD>(InvocationContext) throws Exception|</text>
<note>CDI doesn't support timeout methods</note>
</assertion>
<assertion id="i" testable="false">
- <text>An around-timer method can invoke any component or resource that its corresponding timeout method can invoke.</text>
+ <text>An around-timer method can invoke any component or resource that its corresponding timeout method can invoke.</text>
<note>CDI doesn't support timeout methods</note>
</assertion>
<assertion id="j" testable="false">
- <text>Around-timer method invocations occur within the same transaction and security context as the timeout method on which they are interposing.</text>
+ <text>Around-timer method invocations occur within the same transaction and security context as the timeout method on which they are interposing.</text>
<note>CDI doesn't support timeout methods</note>
</assertion>
<assertion id="k" testable="false">
- <text>The |InvocationContext.getTimer()| method allows the around-timeout method to retrieve the timer object associated with the timeout.</text>
+ <text>The |InvocationContext.getTimer()| method allows the around-timeout method to retrieve the timer object associated with the timeout.</text>
<note>CDI doesn't support timeout methods</note>
</assertion>
</section>
<section id="4.1" title="Multiple Timeout Method Interceptor Methods">
<assertion id="a" testable="false">
- <text>If multiple timeout method interceptor methods are defined for a target class, the following rules governing their invocation order apply. The deployment descriptor may be used to override the interceptor invocation order specified in annotations.</text>
+ <text>If multiple timeout method interceptor methods are defined for a target class, the following rules governing their invocation order apply. The deployment descriptor may be used to override the interceptor invocation order specified in annotations.</text>
<note>CDI doesn't support timeout methods</note>
</assertion>
<assertion id="b" testable="false">
- <text>Default interceptors, if any, are invoked first. Default interceptors can only be specified in the deployment descriptor. Default interceptors are invoked in the order of their specification in the deployment descriptor.</text>
+ <text>Default interceptors, if any, are invoked first. Default interceptors can only be specified in the deployment descriptor. Default interceptors are invoked in the order of their specification in the deployment descriptor.</text>
<note>CDI doesn't support timeout methods</note>
</assertion>
<assertion id="c" testable="false">
- <text>If there are any interceptor classes associated with the target class using the |Interceptors| annotation, the interceptor methods defined by those interceptor classes are invoked before any interceptor methods defined on the target class itself.</text>
+ <text>If there are any interceptor classes associated with the target class using the |Interceptors| annotation, the interceptor methods defined by those interceptor classes are invoked before any interceptor methods defined on the target class itself.</text>
<note>CDI doesn't support timeout methods</note>
</assertion>
<assertion id="d" testable="false">
- <text>The around-timeout methods defined on those interceptor classes are invoked in the same order as the specification of the interceptor classes in the |Interceptors| annotation.</text>
+ <text>The around-timeout methods defined on those interceptor classes are invoked in the same order as the specification of the interceptor classes in the |Interceptors| annotation.</text>
<note>CDI doesn't support timeout methods</note>
</assertion>
<assertion id="e" testable="false">
- <text>If an interceptor class itself has superclasses, the interceptor methods defined by the interceptor class's superclasses are invoked before the interceptor method defined by the interceptor class, most general superclass first.</text>
+ <text>If an interceptor class itself has superclasses, the interceptor methods defined by the interceptor class's superclasses are invoked before the interceptor method defined by the interceptor class, most general superclass first.</text>
<note>CDI doesn't support timeout methods</note>
</assertion>
<assertion id="f" testable="false">
- <text>After the interceptor methods defined on interceptor classes have been invoked, then, in order: If any method-level interceptors are defined for the target class method that is to be invoked, the methods defined on those interceptor classes are invoked in the same order as the specification of those interceptor classes in the |Interceptors| annotation applied to that target class method. If a target class has superclasses, any around-timeout methods defined on those superclasses are invoked, most general superclass first. The around-timeout method, if any, on the target class itself is invoked.</text>
+ <text>After the interceptor methods defined on interceptor classes have been invoked, then, in order: If any method-level interceptors are defined for the target class method that is to be invoked, the methods defined on those interceptor classes are invoked in the same order as the specification of those interceptor classes in the |Interceptors| annotation applied to that target class method. If a target class has superclasses, any around-timeout methods defined on those superclasses are invoked, most general superclass first. The around-timeout method, if any, on the target class itself is invoked.</text>
<note>CDI doesn't support timeout methods</note>
</assertion>
<assertion id="g" testable="false">
- <text>If an around-timeout method is overridden by another method (regardless of whether that method is itself an around-timeout method), it will not be invoked.</text>
+ <text>If an around-timeout method is overridden by another method (regardless of whether that method is itself an around-timeout method), it will not be invoked.</text>
<note>CDI doesn't support timeout methods</note>
</assertion>
<assertion id="h" testable="false">
- <text>The deployment descriptor may be used to override the interceptor invocation order specified in annotations.</text>
+ <text>The deployment descriptor may be used to override the interceptor invocation order specified in annotations.</text>
<note>CDI doesn't support timeout methods</note>
</assertion>
<assertion id="i" testable="false">
- <text>The |InvocationContext| object provides metadata that enables interceptor methods to control the behaviour of the invocation chain, including whether the next method in the chain is invoked and the values of its parameters and result.</text>
+ <text>The |InvocationContext| object provides metadata that enables interceptor methods to control the behaviour of the invocation chain, including whether the next method in the chain is invoked and the values of its parameters and result.</text>
<note>CDI doesn't support timeout methods</note>
</assertion>
</section>
<section id="4.2" title="Exceptions">
<assertion id="a" testable="false">
- <text>Around-timeout interceptor methods may throw any exceptions that are allowed in the throws clause of the timeout method on which they are interposing.</text>
+ <text>Around-timeout interceptor methods may throw any exceptions that are allowed in the throws clause of the timeout method on which they are interposing.</text>
<note>CDI doesn't support timeout methods</note>
</assertion>
<assertion id="b" testable="false">
- <text>Around-timeout methods are allowed to catch and suppress exceptions and recover by calling |proceed()|. Around-timeout methods are allowed to throw runtime exceptions or any checked exceptions that the associated target method allows within its throws clause.</text>
+ <text>Around-timeout methods are allowed to catch and suppress exceptions and recover by calling |proceed()|. Around-timeout methods are allowed to throw runtime exceptions or any checked exceptions that the associated target method allows within its throws clause.</text>
<note>CDI doesn't support timeout methods</note>
</assertion>
<assertion id="c" testable="false">
- <text>Around-timeout methods run in the same Java call stack as the associated target method.</text>
+ <text>Around-timeout methods run in the same Java call stack as the associated target method.</text>
<note>CDI doesn't support timeout methods</note>
</assertion>
<assertion id="d" testable="false">
- <text>|InvocationContext.proceed()| will throw the same exception as any thrown by the associated target method unless an interceptor further down the Java call stack has caught it and thrown a different exception.</text>
+ <text>|InvocationContext.proceed()| will throw the same exception as any thrown by the associated target method unless an interceptor further down the Java call stack has caught it and thrown a different exception.</text>
<note>CDI doesn't support timeout methods</note>
</assertion>
@@ -331,7 +331,7 @@
</assertion>
<assertion id="b" testable="false">
- <text>If the deployment descriptor is used to define interceptors, the |post-construct| and |pre-destroy| elements are used.</text>
+ <text>If the deployment descriptor is used to define interceptors, the |post-construct| and |pre-destroy| elements are used.</text>
<note>CDI doesn't support deployment descriptors</note>
</assertion>
@@ -419,7 +419,7 @@
</assertion>
<assertion id="h" testable="false">
- <text>The deployment descriptor may be used to override the interceptor invocation order specified in annotations.</text>
+ <text>The deployment descriptor may be used to override the interceptor invocation order specified in annotations.</text>
<note>CDI doesn't support deployment descriptors</note>
</assertion>
@@ -539,22 +539,22 @@
<section id="7" title="Default Interceptors">
<assertion id="a" testable="false">
- <text>Default interceptors may be defined to apply to a set of target classes.</text>
+ <text>Default interceptors may be defined to apply to a set of target classes.</text>
<note>CDI doesn't support deployment descriptors</note>
</assertion>
<assertion id="b" testable="false">
- <text>The deployment descriptor is used to define default interceptors and their relative ordering.</text>
+ <text>The deployment descriptor is used to define default interceptors and their relative ordering.</text>
<note>CDI doesn't support deployment descriptors</note>
</assertion>
<assertion id="c" testable="false">
- <text>The |ExcludeDefaultInterceptors| annotation or |exclude-default-interceptors| deployment descriptor element is used to exclude the invocation of default interceptors for a target class.</text>
+ <text>The |ExcludeDefaultInterceptors| annotation or |exclude-default-interceptors| deployment descriptor element is used to exclude the invocation of default interceptors for a target class.</text>
<note>CDI doesn't support deployment descriptors</note>
</assertion>
<assertion id="d" testable="false">
- <text>The default interceptors are invoked before any other interceptors for a target class. The |interceptor-order| deployment descriptor element may be used to specify alternative orderings.</text>
+ <text>The default interceptors are invoked before any other interceptors for a target class. The |interceptor-order| deployment descriptor element may be used to specify alternative orderings.</text>
<note>CDI doesn't support deployment descriptors</note>
</assertion>
</section>
@@ -565,7 +565,7 @@
</assertion>
<assertion id="b" testable="false">
- <text>Likewise, an around-timeout interceptor method may be defined to apply only to a specific timeout method, independent of the other timeout methods of the target class.</text>
+ <text>Likewise, an around-timeout interceptor method may be defined to apply only to a specific timeout method, independent of the other timeout methods of the target class.</text>
<note>CDI doesn't support timeout interceptors</note>
</assertion>
@@ -582,7 +582,7 @@
</assertion>
<assertion id="f" testable="false">
- <text>Method-level target class method interceptors are invoked in addition to any default interceptors and interceptors defined for the target class (and its superclasses). The deployment descriptor may be used to override this ordering.</text>
+ <text>Method-level target class method interceptors are invoked in addition to any default interceptors and interceptors defined for the target class (and its superclasses). The deployment descriptor may be used to override this ordering.</text>
<note>Default interceptors not supported</note>
</assertion>
@@ -595,7 +595,7 @@
</assertion>
<assertion id="i" testable="false">
- <text>The |ExcludeDefaultInterceptors| annotation or |exclude-default-interceptors| deployment descriptor element, when applied to a target class method, is used to exclude the invocation of default interceptors for that method.</text>
+ <text>The |ExcludeDefaultInterceptors| annotation or |exclude-default-interceptors| deployment descriptor element, when applied to a target class method, is used to exclude the invocation of default interceptors for that method.</text>
<note>CDI doesn't support default interceptors</note>
</assertion>
@@ -604,88 +604,88 @@
</assertion>
<assertion id="k" testable="false">
- <text>If default interceptors have also been defined for the bean class, they can be excluded for the specific method by applying the |ExcludeDefaultInterceptors| annotation on the method.</text>
+ <text>If default interceptors have also been defined for the bean class, they can be excluded for the specific method by applying the |ExcludeDefaultInterceptors| annotation on the method.</text>
<note>CDI doesn't support default interceptors</note>
</assertion>
</section>
<section id="9" title="Specification of Interceptors in the Deployment Descriptor">
<assertion id="a" testable="false">
- <text>The deployment descriptor can be used as an alternative to metadata annotations to specify interceptors and their binding to target classes or to override the invocation order of interceptors as specified in annotations.</text>
+ <text>The deployment descriptor can be used as an alternative to metadata annotations to specify interceptors and their binding to target classes or to override the invocation order of interceptors as specified in annotations.</text>
<note>CDI doesn't support deployment descriptors</note>
</assertion>
</section>
<section id="9.1" title="Specification of Interceptors">
<assertion id="a" testable="false">
- <text>The |interceptor| deployment descriptor element is used to specify the interceptor methods of an interceptor class.</text>
+ <text>The |interceptor| deployment descriptor element is used to specify the interceptor methods of an interceptor class.</text>
<note>CDI doesn't support deployment descriptors</note>
</assertion>
<assertion id="b" testable="false">
- <text>The interceptor methods are specified by using the |around-invoke|, |around-timeout|, |post-construct| and |pre-destroy| elements.</text>
+ <text>The interceptor methods are specified by using the |around-invoke|, |around-timeout|, |post-construct| and |pre-destroy| elements.</text>
<note>CDI doesn't support deployment descriptors</note>
</assertion>
<assertion id="c" testable="false">
- <text>At most one method of a given interceptor class can be designated as an around-invoke method, an around-timeout method, a post-construct method, or pre-destroy method, regardless of whether the deployment descriptor is used to defined interceptors or whether some combination of annotations and deployment descriptor elements is used.</text>
+ <text>At most one method of a given interceptor class can be designated as an around-invoke method, an around-timeout method, a post-construct method, or pre-destroy method, regardless of whether the deployment descriptor is used to defined interceptors or whether some combination of annotations and deployment descriptor elements is used.</text>
<note>CDI doesn't support deployment descriptors</note>
</assertion>
</section>
<section id="9.2" title="Binding of Interceptors to TargetClasses">
<assertion id="a" testable="false">
- <text>The |interceptor-binding| element is used to specify the binding of interceptor classes to target classes and their methods.</text>
+ <text>The |interceptor-binding| element is used to specify the binding of interceptor classes to target classes and their methods.</text>
<note>CDI doesn't support deployment descriptors</note>
</assertion>
<assertion id="b" testable="false">
- <text>The |target-name| element must identify the associated target class or the wildcard value "*" (which is used to define interceptors that are bound to all target classes).</text>
+ <text>The |target-name| element must identify the associated target class or the wildcard value "*" (which is used to define interceptors that are bound to all target classes).</text>
<note>CDI doesn't support deployment descriptors</note>
</assertion>
<assertion id="c" testable="false">
- <text>The |interceptor-class| element specifies the interceptor class. The interceptor class contained in an |interceptor-class| element must either be declared in the |interceptor| deployment descriptor element or appear in a least one |@Interceptor| annotation on a target class. The |interceptor-order| element is used as an optional alternative to specify a total ordering over the interceptors defined for the given level and above.</text>
+ <text>The |interceptor-class| element specifies the interceptor class. The interceptor class contained in an |interceptor-class| element must either be declared in the |interceptor| deployment descriptor element or appear in a least one |@Interceptor| annotation on a target class. The |interceptor-order| element is used as an optional alternative to specify a total ordering over the interceptors defined for the given level and above.</text>
<note>CDI doesn't support deployment descriptors</note>
</assertion>
<assertion id="d" testable="false">
- <text>The |exclude-default-interceptors| and |exclude-class-interceptors| elements specify that default interceptors and class interceptors, respectively, are not to be applied to a target class and/or method.</text>
+ <text>The |exclude-default-interceptors| and |exclude-class-interceptors| elements specify that default interceptors and class interceptors, respectively, are not to be applied to a target class and/or method.</text>
<note>CDI doesn't support deployment descriptors</note>
</assertion>
<assertion id="e" testable="false">
- <text>The |method-name| element specifies the method name for a method-level interceptor; and the optional |method-params| elements identify a single method among multiple methods with an overloaded method name.</text>
+ <text>The |method-name| element specifies the method name for a method-level interceptor; and the optional |method-params| elements identify a single method among multiple methods with an overloaded method name.</text>
<note>CDI doesn't support deployment descriptors</note>
</assertion>
<assertion id="f" testable="false">
- <text>Interceptors bound to all target classes using the wildcard syntax "*" are default interceptors. In addition, interceptors may be bound at the level of the target class (class-level interceptors) or methods of the target class (method-level interceptors).</text>?
+ <text>Interceptors bound to all target classes using the wildcard syntax "*" are default interceptors. In addition, interceptors may be bound at the level of the target class (class-level interceptors) or methods of the target class (method-level interceptors).</text>?
<note>CDI doesn't support deployment descriptors</note>
</assertion>
<assertion id="g" testable="false">
- <text>The binding of interceptors to classes is additive. If interceptors are bound at the class-level and/or default-level as well as at the method-level, both class-level and/or default-level as well as method-level interceptors will apply.</text>
+ <text>The binding of interceptors to classes is additive. If interceptors are bound at the class-level and/or default-level as well as at the method-level, both class-level and/or default-level as well as method-level interceptors will apply.</text>
<note>CDI doesn't support deployment descriptors</note>
</assertion>
<assertion id="h" testable="false">
- <text>The deployment descriptor may be used to augment the interceptors and interceptor methods defined by means of annotations. When the deployment descriptor is used to augment the interceptors specified in annotations, the interceptor methods specified in the deployment descriptor will be invoked after those specified in annotations, according to the ordering specified earlier. The |interceptor-order| deployment descriptor element may be used to override this ordering.</text>
+ <text>The deployment descriptor may be used to augment the interceptors and interceptor methods defined by means of annotations. When the deployment descriptor is used to augment the interceptors specified in annotations, the interceptor methods specified in the deployment descriptor will be invoked after those specified in annotations, according to the ordering specified earlier. The |interceptor-order| deployment descriptor element may be used to override this ordering.</text>
<note>CDI doesn't support deployment descriptors</note>
</assertion>
<assertion id="i" testable="false">
- <text>The |exclude-default-interceptors| element disables default interceptors for the level at which it is specified and lower. That is, |exclude-default-interceptors| when applied at the class-level disables the application of default-interceptors for all methods of the class.</text>
+ <text>The |exclude-default-interceptors| element disables default interceptors for the level at which it is specified and lower. That is, |exclude-default-interceptors| when applied at the class-level disables the application of default-interceptors for all methods of the class.</text>
<note>CDI doesn't support deployment descriptors</note>
</assertion>
<assertion id="j" testable="false">
- <text>The |exclude-class-interceptors| element applied to a method, disables the application of class-level interceptors for the given method. Explicitly listing an excluded higher-level interceptor at a lower level causes it to be applied at that level and below.</text>
+ <text>The |exclude-class-interceptors| element applied to a method, disables the application of class-level interceptors for the given method. Explicitly listing an excluded higher-level interceptor at a lower level causes it to be applied at that level and below.</text>
<note>CDI doesn't support deployment descriptors</note>
</assertion>
<assertion id="k" testable="false">
- <text>It is possible to override the ordering of interceptors by using the |interceptor-order| element to specify a total ordering of interceptors at class-level and/or method-level. If the |interceptor-order| element is used, the ordering specified at the given level must be a total order over all interceptor classes that have been defined at that level and above (unless they have been explicitly excluded by means of one of the exclude- elements described above).</text>
+ <text>It is possible to override the ordering of interceptors by using the |interceptor-order| element to specify a total ordering of interceptors at class-level and/or method-level. If the |interceptor-order| element is used, the ordering specified at the given level must be a total order over all interceptor classes that have been defined at that level and above (unless they have been explicitly excluded by means of one of the exclude- elements described above).</text>
<note>CDI doesn't support deployment descriptors</note>
</assertion>
Modified: cdi-tck/trunk/impl/src/main/resources/tck-audit-mb.xml
===================================================================
--- cdi-tck/trunk/impl/src/main/resources/tck-audit-mb.xml 2009-10-09 01:24:59 UTC (rev 3905)
+++ cdi-tck/trunk/impl/src/main/resources/tck-audit-mb.xml 2009-10-09 04:49:23 UTC (rev 3906)
@@ -1,30 +1,30 @@
-<specification
- xmlns="http://jboss.com/products/webbeans/tck/audit"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://jboss.com/products/webbeans/tck/audit /Users/pmuir/workspace/jboss-test-audit/api/src/main/resources/tck-audit.xsd"
+<specification
+ xmlns="http://jboss.com/products/weld/tck/audit"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://jboss.com/products/weld/tck/audit /Users/pmuir/workspace/jboss-test-audit/api/src/main/resources/tck-audit.xsd"
name="Java EE: Managed Beans"
- id="mb"
- version="1.0.PFD">
-
- <section id="2" title="Managed Beans Definition">
-
+ id="mb"
+ version="1.0.PFD">
+
+ <section id="2" title="Managed Beans Definition">
+
</section>
<section id="2.1" title="Basic Model">
</section>
- <section id="2.1.1" title="Component definition">
- <group>
- <text>A Managed Bean can be declared by annotating its class with the |javax.annotation.ManagedBean| annotation.</text>
- <assertion id="aa">
- <text>Verify a top-level class</text>
- </assertion>
-
- <assertion id="ab">
- <text>Verify a static inner class</text>
- </assertion>
-
+ <section id="2.1.1" title="Component definition">
+ <group>
+ <text>A Managed Bean can be declared by annotating its class with the |javax.annotation.ManagedBean| annotation.</text>
+ <assertion id="aa">
+ <text>Verify a top-level class</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>Verify a static inner class</text>
+ </assertion>
+
</group>
@@ -32,28 +32,28 @@
<text>A Managed Bean must not be: a final class, an abstract class, a non-static inner class or a generic class.</text>
<assertion id="b" testable="false">
- <text>Test that a managed bean may not be a final class.</text>
+ <text>Test that a managed bean may not be a final class.</text>
<note>Doesn't define any error condition</note>
</assertion>
<assertion id="c" testable="false">
- <text>Test that a managed bean may not be an abstract class.</text>
+ <text>Test that a managed bean may not be an abstract class.</text>
<note>Doesn't define any error condition</note>
</assertion>
<assertion id="d" testable="false">
- <text>Test that a managed bean may not be a non-static inner class.</text>
+ <text>Test that a managed bean may not be a non-static inner class.</text>
<note>Doesn't define any error condition</note>
</assertion>
<assertion id="e" testable="false">
- <text>Test that a managed bean may not be a generic class.</text>
+ <text>Test that a managed bean may not be a generic class.</text>
<note>Doesn't define any error condition</note>
</assertion>
</group>
<assertion id="f" testable="false">
- <text>A Managed Bean may not be serializable, unlike a regular JavaBean component.</text>
+ <text>A Managed Bean may not be serializable, unlike a regular JavaBean component.</text>
<note>Doesn't define any error condition</note>
</assertion>
@@ -64,7 +64,7 @@
<section id="2.1.2" title="Naming">
<assertion id="a">
- <text>A Managed Bean may optionally have a name, a |String|.</text>
+ <text>A Managed Bean may optionally have a name, a |String|.</text>
<note>Verify the name is optional</note>
</assertion>
@@ -115,19 +115,19 @@
<text>Test the |javax.annotation.PreDestroy| annotation.</text>
</assertion>
</group>
-
- <group>
- <text>In a Java EE implementation, a Managed Bean may use any of the resource injection functionality laid out in Chapter EE.5 of the Java EE Platform specification, "Resources, Naming and Injection".</text>
- <assertion id="ca">
- <text>Check @Resource injection</text>
- </assertion>
- <assertion id="cb">
- <text>Check @EJB injection</text>
- </assertion>
+
+ <group>
+ <text>In a Java EE implementation, a Managed Bean may use any of the resource injection functionality laid out in Chapter EE.5 of the Java EE Platform specification, "Resources, Naming and Injection".</text>
+ <assertion id="ca">
+ <text>Check @Resource injection</text>
+ </assertion>
+ <assertion id="cb">
+ <text>Check @EJB injection</text>
+ </assertion>
</group>
<assertion id="d">
- <text>A Managed Bean does not have its own component-scoped "|java:comp|" namespace. For this reason, Managed Beans should define resources in the "|java:module|" namespace or above. JNDI lookup operations from a method defined on a Managed Bean will use the naming context of that method's caller.</text>
+ <text>A Managed Bean does not have its own component-scoped "|java:comp|" namespace. For this reason, Managed Beans should define resources in the "|java:module|" namespace or above. JNDI lookup operations from a method defined on a Managed Bean will use the naming context of that method's caller.</text>
<note>Check that lookup does use the naming context of the method's caller</note>
</assertion>
</section>
@@ -140,7 +140,7 @@
<section id="2.1.5" title="Interceptors">
<assertion id="a" testable="false">
- <text>A Managed Bean may use interceptors as defined in the Interceptor specification.</text>
+ <text>A Managed Bean may use interceptors as defined in the Interceptor specification.</text>
<note>No way to verify as spec doesn't provide a way to bind interceptors to a bean</note>
</assertion>
</section>
@@ -221,7 +221,7 @@
<section id="2.3.1" title="Application Component Provider's Responsibilities">
<assertion id="a" testable="false">
- <text>The Application Component Provider is responsible for requesting injection of a Managed Bean, or by looking it up in JNDI using an appropriate name.</text>
+ <text>The Application Component Provider is responsible for requesting injection of a Managed Bean, or by looking it up in JNDI using an appropriate name.</text>
<note>What is this about?</note>
</assertion>
</section>
@@ -230,6 +230,6 @@
<assertion id="a" testable="false">
<text>The Java EE Product Provider is responsible for providing appropriate instances of the requested Managed Bean class as required by this specification.</text>
</assertion>
- </section>
-
-</specification>
+ </section>
+
+</specification>
Modified: cdi-tck/trunk/interceptor/src/main/resources/META-INF/tck-unit.properties
===================================================================
--- cdi-tck/trunk/interceptor/src/main/resources/META-INF/tck-unit.properties 2009-10-09 01:24:59 UTC (rev 3905)
+++ cdi-tck/trunk/interceptor/src/main/resources/META-INF/tck-unit.properties 2009-10-09 04:49:23 UTC (rev 3906)
@@ -1,5 +1,5 @@
-fisheye_base_url=http\://fisheye.jboss.org/browse/Webbeans/tck/trunk/impl/src/main/java
-svn_base_url=http\://anonsvn.jboss.org/repos/webbeans/tck/trunk/impl/src/main/java/
+fisheye_base_url=http\://fisheye.jboss.org/browse/Weld/cdi-tck/trunk/impl/src/main/java
+svn_base_url=http\://anonsvn.jboss.org/repos/weld/cdi-tck/trunk/impl/src/main/java/
pass_threshold=75
fail_threshold=50
-unimplemented_test_groups=stub,broken
\ No newline at end of file
+unimplemented_test_groups=stub,broken
Modified: cdi-tck/trunk/interceptor/src/main/resources/tck-audit.xml
===================================================================
--- cdi-tck/trunk/interceptor/src/main/resources/tck-audit.xml 2009-10-09 01:24:59 UTC (rev 3905)
+++ cdi-tck/trunk/interceptor/src/main/resources/tck-audit.xml 2009-10-09 04:49:23 UTC (rev 3906)
@@ -1,7 +1,7 @@
<specification
- xmlns="http://jboss.com/products/webbeans/tck/audit"
+ xmlns="http://jboss.com/products/weld/cdi-tck/audit"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://jboss.com/products/webbeans/tck/audit http://snapshots.jboss.org/maven2/org/hibernate/tck-utils-api/0.9-SNAPSHO..."
+ xsi:schemaLocation="http://jboss.com/products/weld/cdi-tck/audit http://snapshots.jboss.org/maven2/org/hibernate/tck-utils-api/0.9-SNAPSHO..."
name="JSR-299: Java Contexts and Dependency Injection"
version="Revised Public Review Draft">
Modified: cdi-tck/trunk/pom.xml
===================================================================
--- cdi-tck/trunk/pom.xml 2009-10-09 01:24:59 UTC (rev 3905)
+++ cdi-tck/trunk/pom.xml 2009-10-09 04:49:23 UTC (rev 3906)
@@ -6,7 +6,7 @@
<packaging>pom</packaging>
<version>1.0.0-SNAPSHOT</version>
<name>JSR-299 TCK</name>
- <url>http://www.seamframework.org/WebBeans</url>
+ <url>http://www.seamframework.org/Weld</url>
<developers>
<developer>
Modified: cdi-tck/trunk/xml/src/main/resources/META-INF/tck-unit.properties
===================================================================
--- cdi-tck/trunk/xml/src/main/resources/META-INF/tck-unit.properties 2009-10-09 01:24:59 UTC (rev 3905)
+++ cdi-tck/trunk/xml/src/main/resources/META-INF/tck-unit.properties 2009-10-09 04:49:23 UTC (rev 3906)
@@ -1,5 +1,5 @@
-fisheye_base_url=http\://fisheye.jboss.org/browse/Webbeans/tck/trunk/impl/src/main/java
-svn_base_url=http\://anonsvn.jboss.org/repos/webbeans/tck/trunk/impl/src/main/java/
+fisheye_base_url=http\://fisheye.jboss.org/browse/Weld/cdi-tck/trunk/impl/src/main/java
+svn_base_url=http\://anonsvn.jboss.org/repos/weld/cdi-tck/trunk/impl/src/main/java/
pass_threshold=75
fail_threshold=50
-unimplemented_test_groups=stub,broken
\ No newline at end of file
+unimplemented_test_groups=stub,broken
Modified: cdi-tck/trunk/xml/src/main/resources/README.TXT
===================================================================
--- cdi-tck/trunk/xml/src/main/resources/README.TXT 2009-10-09 01:24:59 UTC (rev 3905)
+++ cdi-tck/trunk/xml/src/main/resources/README.TXT 2009-10-09 04:49:23 UTC (rev 3906)
@@ -7,4 +7,4 @@
---------------------------
To generate a signature file, use the following command:
-java -cp %JAVA_HOME%\jre\lib\rt.jar%;sigtestdev.jar com.sun.tdk.signaturetest.Setup -Package javax.annotation -Package javax.context -Package javax.decorator -Package javax.event -Package javax.inject -Package javax.interceptor -Package javax.webbeans -FileName webbeans.sig -Classpath .;%JAVA_HOME%\jre\lib\rt.jar -static -Exclude java
\ No newline at end of file
+java -cp %JAVA_HOME%\jre\lib\rt.jar%;sigtestdev.jar com.sun.tdk.signaturetest.Setup -Package javax.annotation -Package javax.context -Package javax.decorator -Package javax.event -Package javax.inject -Package javax.interceptor -Package javax.weld -FileName weld.sig -Classpath .;%JAVA_HOME%\jre\lib\rt.jar -static -Exclude java
Modified: cdi-tck/trunk/xml/src/main/resources/tck-audit.xml
===================================================================
--- cdi-tck/trunk/xml/src/main/resources/tck-audit.xml 2009-10-09 01:24:59 UTC (rev 3905)
+++ cdi-tck/trunk/xml/src/main/resources/tck-audit.xml 2009-10-09 04:49:23 UTC (rev 3906)
@@ -1,7 +1,7 @@
<specification
- xmlns="http://jboss.com/products/webbeans/tck/audit"
+ xmlns="http://jboss.com/products/weld/tck/audit"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://jboss.com/products/webbeans/tck/audit http://snapshots.jboss.org/maven2/org/hibernate/tck-utils-api/0.9-SNAPSHO..."
+ xsi:schemaLocation="http://jboss.com/products/weld/tck/audit http://snapshots.jboss.org/maven2/org/hibernate/tck-utils-api/0.9-SNAPSHO..."
name="JSR-299: Java Contexts and Dependency Injection"
version="Revised Public Review Draft">
15 years, 1 month
Weld SVN: r3905 - in extensions/trunk/servlet/tests/src/test/resources/org/jboss: weld/test/tomcat/examples and 1 other directories.
by weld-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-10-08 21:24:59 -0400 (Thu, 08 Oct 2009)
New Revision: 3905
Added:
extensions/trunk/servlet/tests/src/test/resources/org/jboss/weld/
Removed:
extensions/trunk/servlet/tests/src/test/resources/org/jboss/webbeans/
Modified:
extensions/trunk/servlet/tests/src/test/resources/org/jboss/weld/test/tomcat/examples/beans.xml
extensions/trunk/servlet/tests/src/test/resources/org/jboss/weld/test/tomcat/lookup/context-servlet-injection.xml
extensions/trunk/servlet/tests/src/test/resources/org/jboss/weld/test/tomcat/lookup/context.xml
extensions/trunk/servlet/tests/src/test/resources/org/jboss/weld/test/tomcat/lookup/web-servlet-injection.xml
Log:
rename test resources
Copied: extensions/trunk/servlet/tests/src/test/resources/org/jboss/weld (from rev 3901, extensions/trunk/servlet/tests/src/test/resources/org/jboss/webbeans)
Modified: extensions/trunk/servlet/tests/src/test/resources/org/jboss/weld/test/tomcat/examples/beans.xml
===================================================================
--- extensions/trunk/servlet/tests/src/test/resources/org/jboss/webbeans/test/tomcat/examples/beans.xml 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/tests/src/test/resources/org/jboss/weld/test/tomcat/examples/beans.xml 2009-10-09 01:24:59 UTC (rev 3905)
@@ -1,5 +1,5 @@
<beans>
<alternatives>
- <class>org.jboss.webbeans.test.tomcat.examples.MockSentenceTranslator</class>
+ <class>org.jboss.weld.test.tomcat.examples.MockSentenceTranslator</class>
</alternatives>
</beans>
Modified: extensions/trunk/servlet/tests/src/test/resources/org/jboss/weld/test/tomcat/lookup/context-servlet-injection.xml
===================================================================
--- extensions/trunk/servlet/tests/src/test/resources/org/jboss/webbeans/test/tomcat/lookup/context-servlet-injection.xml 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/tests/src/test/resources/org/jboss/weld/test/tomcat/lookup/context-servlet-injection.xml 2009-10-09 01:24:59 UTC (rev 3905)
@@ -1,9 +1,9 @@
<Context>
<Resource name="app/Manager" auth="Container"
type="javax.inject.manager.Manager"
- factory="org.jboss.webbeans.resources.ManagerObjectFactory"/>
+ factory="org.jboss.weld.resources.ManagerObjectFactory"/>
<!-- Uncomment to enable injection into Servlet -->
- <Listener className="org.jboss.webbeans.environment.tomcat.WebBeansLifecycleListener" />
+ <Listener className="org.jboss.weld.environment.tomcat.WeldLifecycleListener" />
</Context>
Modified: extensions/trunk/servlet/tests/src/test/resources/org/jboss/weld/test/tomcat/lookup/context.xml
===================================================================
--- extensions/trunk/servlet/tests/src/test/resources/org/jboss/webbeans/test/tomcat/lookup/context.xml 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/tests/src/test/resources/org/jboss/weld/test/tomcat/lookup/context.xml 2009-10-09 01:24:59 UTC (rev 3905)
@@ -1,9 +1,9 @@
<Context>
<Resource name="app/Manager" auth="Container"
type="javax.inject.manager.Manager"
- factory="org.jboss.webbeans.resources.ManagerObjectFactory"/>
+ factory="org.jboss.weld.resources.ManagerObjectFactory"/>
<!-- Uncomment to enable injection into Servlet -->
-<Listener className="org.jboss.webbeans.environment.tomcat.WebBeansLifecycleListener" />
+<Listener className="org.jboss.weld.environment.tomcat.WeldLifecycleListener" />
</Context>
Modified: extensions/trunk/servlet/tests/src/test/resources/org/jboss/weld/test/tomcat/lookup/web-servlet-injection.xml
===================================================================
--- extensions/trunk/servlet/tests/src/test/resources/org/jboss/webbeans/test/tomcat/lookup/web-servlet-injection.xml 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/tests/src/test/resources/org/jboss/weld/test/tomcat/lookup/web-servlet-injection.xml 2009-10-09 01:24:59 UTC (rev 3905)
@@ -12,12 +12,12 @@
</listener>
<listener>
- <listener-class>org.jboss.webbeans.environment.servlet.Listener</listener-class>
+ <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
</listener>
<servlet>
<servlet-name>Rat Servlet</servlet-name>
- <servlet-class>org.jboss.webbeans.test.tomcat.lookup.RatServlet</servlet-class>
+ <servlet-class>org.jboss.weld.test.tomcat.lookup.RatServlet</servlet-class>
</servlet>
<servlet-mapping>
15 years, 1 month
Weld SVN: r3904 - in extensions/trunk: bean-utils/src/main/java/org/jboss/webbeans/beanutils and 36 other directories.
by weld-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-10-08 10:58:57 -0400 (Thu, 08 Oct 2009)
New Revision: 3904
Added:
extensions/trunk/bean-utils/src/main/java/org/jboss/weld/
extensions/trunk/bean-utils/src/main/java/org/jboss/weld/beanutils/
extensions/trunk/bean-utils/src/main/java/org/jboss/weld/beanutils/exisiting/
extensions/trunk/bean-utils/src/main/java/org/jboss/weld/beanutils/impl/
extensions/trunk/bean-utils/src/main/java/org/jboss/weld/beanutils/spi/
extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/
extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/
extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/AbstractBeanUtilsTest.java
extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/RegisterBeansObserver.java
extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/
extensions/trunk/bean-utils/src/test/java/org/jboss/weld/
extensions/trunk/bean-utils/src/test/java/org/jboss/weld/beanutils/
extensions/trunk/logger/src/main/java/org/jboss/weld/
extensions/trunk/logger/src/main/java/org/jboss/weld/log/
extensions/trunk/logger/src/test/java/org/jboss/weld/
extensions/trunk/logger/src/test/java/org/jboss/weld/test/
extensions/trunk/logger/src/test/java/org/jboss/weld/test/log/
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/WeldApplicationFactory.java
Removed:
extensions/trunk/bean-utils/src/main/java/org/jboss/webbeans/beanutils/exisiting/
extensions/trunk/bean-utils/src/main/java/org/jboss/webbeans/beanutils/impl/
extensions/trunk/bean-utils/src/main/java/org/jboss/webbeans/beanutils/spi/
extensions/trunk/bean-utils/src/test/java/org/jboss/test/webbeans/beanutils/AbstractBeanUtilsTest.java
extensions/trunk/bean-utils/src/test/java/org/jboss/test/webbeans/beanutils/RegisterBeansObserver.java
extensions/trunk/bean-utils/src/test/java/org/jboss/test/webbeans/beanutils/existing/
extensions/trunk/bean-utils/src/test/java/org/jboss/webbeans/beanutils/
extensions/trunk/logger/src/main/java/org/jboss/webbeans/log/
extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/log/
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/WebBeansApplicationFactory.java
Modified:
extensions/trunk/bean-utils/src/main/java/org/jboss/weld/beanutils/exisiting/ExistingBeanDescriberImpl.java
extensions/trunk/bean-utils/src/main/java/org/jboss/weld/beanutils/exisiting/ExistingSimpleBean.java
extensions/trunk/bean-utils/src/main/java/org/jboss/weld/beanutils/impl/BeansImpl.java
extensions/trunk/bean-utils/src/main/java/org/jboss/weld/beanutils/spi/BeanType.java
extensions/trunk/bean-utils/src/main/java/org/jboss/weld/beanutils/spi/Beans.java
extensions/trunk/bean-utils/src/main/java/org/jboss/weld/beanutils/spi/ExistingBeanDescriber.java
extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/ABean.java
extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/Bean.java
extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/Custom.java
extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/CustomBean.java
extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/CustomDefaultConstructorReceiver.java
extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/CustomDefaultFieldReceiver.java
extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/DefaultBean.java
extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/DefaultConstructorReceiver.java
extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/DefaultFieldReceiver.java
extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/DefaultMethodProducerWithInjection.java
extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/ExisitingBeanDescriberTest.java
extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/FieldProducer.java
extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/MethodProducer.java
extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/ProducerBean.java
extensions/trunk/logger/src/main/java/org/jboss/weld/log/Logger.java
extensions/trunk/logger/src/main/java/org/jboss/weld/log/LoggerProducer.java
extensions/trunk/logger/src/test/java/org/jboss/weld/test/log/Finch.java
extensions/trunk/logger/src/test/java/org/jboss/weld/test/log/LoggerInjectionTest.java
extensions/trunk/logger/src/test/java/org/jboss/weld/test/log/Sparrow.java
extensions/trunk/logger/src/test/java/org/jboss/weld/test/log/TestAppender.java
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/ShutdownManager.java
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/StartMain.java
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEBeanDeploymentArchive.java
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEWeldDeployment.java
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEWeldDiscovery.java
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/events/ContainerInitialized.java
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/events/Shutdown.java
extensions/trunk/se/src/test/resources/META-INF/services/javax.enterprise.inject.spi.Extension
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/Listener.java
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/deployment/AbstractScanner.java
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/deployment/WebAppBeanDeploymentArchive.java
extensions/trunk/servlet/int/src/main/resources/META-INF/faces-config.xml
extensions/trunk/servlet/support/pom.xml
extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/JspInitialization.java
extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/WeldLifecycleListener.java
extensions/trunk/servlet/tests/src/test/debug-resources/META-INF/jboss-test-harness.properties
extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/environment/servlet/discovery/ServletWeldDiscoveryTest.java
extensions/trunk/servlet/tests/unit-tests.xml
extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldApplication.java
extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldMetaData.java
extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldRequestCycle.java
extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldWebRequestCycleProcessor.java
Log:
name refactoring, fix compiler errors
Copied: extensions/trunk/bean-utils/src/main/java/org/jboss/weld/beanutils/exisiting (from rev 3901, extensions/trunk/bean-utils/src/main/java/org/jboss/webbeans/beanutils/exisiting)
Modified: extensions/trunk/bean-utils/src/main/java/org/jboss/weld/beanutils/exisiting/ExistingBeanDescriberImpl.java
===================================================================
--- extensions/trunk/bean-utils/src/main/java/org/jboss/webbeans/beanutils/exisiting/ExistingBeanDescriberImpl.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/bean-utils/src/main/java/org/jboss/weld/beanutils/exisiting/ExistingBeanDescriberImpl.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -19,27 +19,27 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.webbeans.beanutils.exisiting;
+package org.jboss.weld.beanutils.exisiting;
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.AnnotatedType;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
-import org.jboss.webbeans.BeanManagerImpl;
-import org.jboss.webbeans.bean.AbstractClassBean;
-import org.jboss.webbeans.bean.NewSimpleBean;
-import org.jboss.webbeans.bean.ProducerFieldBean;
-import org.jboss.webbeans.bean.ProducerMethodBean;
-import org.jboss.webbeans.beanutils.impl.BeansImpl;
-import org.jboss.webbeans.beanutils.spi.Beans;
-import org.jboss.webbeans.beanutils.spi.ExistingBeanDescriber;
-import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
-import org.jboss.webbeans.introspector.WBClass;
-import org.jboss.webbeans.introspector.WBField;
-import org.jboss.webbeans.introspector.WBMethod;
-import org.jboss.webbeans.introspector.jlr.WBClassImpl;
-import org.jboss.webbeans.resources.ClassTransformer;
+import org.jboss.weld.BeanManagerImpl;
+import org.jboss.weld.bean.AbstractClassBean;
+import org.jboss.weld.bean.NewManagedBean;
+import org.jboss.weld.bean.ProducerField;
+import org.jboss.weld.bean.ProducerMethod;
+import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
+import org.jboss.weld.introspector.WeldClass;
+import org.jboss.weld.introspector.WeldField;
+import org.jboss.weld.introspector.WeldMethod;
+import org.jboss.weld.introspector.jlr.WeldClassImpl;
+import org.jboss.weld.resources.ClassTransformer;
+import org.jboss.weld.beanutils.impl.BeansImpl;
+import org.jboss.weld.beanutils.spi.Beans;
+import org.jboss.weld.beanutils.spi.ExistingBeanDescriber;
/**
*
@@ -66,9 +66,9 @@
if (beanManager instanceof BeanManagerImpl == false)
throw new IllegalArgumentException("BeanManager is not an instance of BeanManagerImpl");
- WBClass<T> clazz = type instanceof WBClass ?
- (WBClass<T>)type :
- WBClassImpl.of(type, ((BeanManagerImpl)beanManager).getServices().get(ClassTransformer.class));
+ WeldClass<T> clazz = type instanceof WeldClass ?
+ (WeldClass<T>)type :
+ WeldClassImpl.of(type, ((BeanManagerImpl)beanManager).getServices().get(ClassTransformer.class));
BeansImpl<T> beans = new BeansImpl<T>();
@@ -76,20 +76,21 @@
beans.setMainBean(bean);
beans.setNewBean(createNewBean(clazz, env, (BeanManagerImpl)beanManager));
- for (WBMethod<?, ?> method : clazz.getDeclaredWBAnnotatedMethods(Produces.class))
+ for (WeldMethod<?, ?> method : clazz.getDeclaredAnnotatedWeldMethods(Produces.class))
{
- beans.addMethodProducerBean(createProducerMethodBean(bean, env, (BeanManagerImpl)beanManager, (WBMethod<T, ?>)method));
+ beans.addMethodProducerBean(createProducerMethodBean(bean, env, (BeanManagerImpl)beanManager, (WeldMethod<T, ?>)method));
}
- for (WBField<?, ?> field : clazz.getDeclaredAnnotatedWBFields(Produces.class))
+ for (WeldField<?, ?> field : clazz.getDeclaredAnnotatedWeldFields(Produces.class))
{
- beans.addFieldProducerBean(createProducerFieldBean(bean, env, (BeanManagerImpl)beanManager, (WBField<T, ?>)field));
+ beans.addFieldProducerBean(createProducerFieldBean(bean, env, (BeanManagerImpl)beanManager, (WeldField<T, ?>)field));
}
return beans;
}
- private static <T> Bean<T> createSimpleBean(WBClass<T> clazz, BeanDeployerEnvironment env, BeanManagerImpl beanManager, T instance)
+ private static <T> Bean<T> createSimpleBean(WeldClass<T> clazz,
+ BeanDeployerEnvironment env, BeanManagerImpl beanManager, T instance)
{
ExistingSimpleBean<T> bean = ExistingSimpleBean.of(clazz, beanManager, instance);
@@ -98,18 +99,20 @@
return bean;
}
- private static <T> Bean<T> createNewBean(WBClass<T> clazz, BeanDeployerEnvironment env, BeanManagerImpl beanManager)
+ private static <T> Bean<T> createNewBean(WeldClass<T> clazz,
+ BeanDeployerEnvironment env, BeanManagerImpl beanManager)
{
- NewSimpleBean<T> bean = NewSimpleBean.of(clazz, beanManager);
+ NewManagedBean<T> bean = NewManagedBean.of(clazz, beanManager);
//TODO How to get BeanDeployerEnvironment?
bean.initialize(env);
return bean;
}
- private static <T> Bean<T> createProducerMethodBean(AbstractClassBean<T> declaringBean, BeanDeployerEnvironment env, BeanManagerImpl beanManager, WBMethod<T, ?> method)
+ private static <T> Bean<T> createProducerMethodBean(AbstractClassBean<T> declaringBean,
+ BeanDeployerEnvironment env, BeanManagerImpl beanManager, WeldMethod<T, ?> method)
{
- ProducerMethodBean<T> bean = ProducerMethodBean.of(method, declaringBean, beanManager);
+ ProducerMethod<T> bean = ProducerMethod.of(method, declaringBean, beanManager);
//TODO How to get BeanDeployerEnvironment?
bean.initialize(env);
@@ -117,9 +120,10 @@
}
- private static <T> Bean<T> createProducerFieldBean(AbstractClassBean<T> declaringBean, BeanDeployerEnvironment env, BeanManagerImpl beanManager, WBField<T, ?> field)
+ private static <T> Bean<T> createProducerFieldBean(AbstractClassBean<T> declaringBean,
+ BeanDeployerEnvironment env, BeanManagerImpl beanManager, WeldField<T, ?> field)
{
- ProducerFieldBean<T> bean = ProducerFieldBean.of(field, declaringBean, beanManager);
+ ProducerField<T> bean = ProducerField.of(field, declaringBean, beanManager);
//TODO How to get BeanDeployerEnvironment?
bean.initialize(env);
Modified: extensions/trunk/bean-utils/src/main/java/org/jboss/weld/beanutils/exisiting/ExistingSimpleBean.java
===================================================================
--- extensions/trunk/bean-utils/src/main/java/org/jboss/webbeans/beanutils/exisiting/ExistingSimpleBean.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/bean-utils/src/main/java/org/jboss/weld/beanutils/exisiting/ExistingSimpleBean.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -19,13 +19,13 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.webbeans.beanutils.exisiting;
+package org.jboss.weld.beanutils.exisiting;
import javax.enterprise.context.spi.CreationalContext;
-import org.jboss.webbeans.BeanManagerImpl;
-import org.jboss.webbeans.bean.SimpleBean;
-import org.jboss.webbeans.introspector.WBClass;
+import org.jboss.weld.BeanManagerImpl;
+import org.jboss.weld.bean.ManagedBean;
+import org.jboss.weld.introspector.WeldClass;
/**
* used to create a bean implementation for an existing instance
@@ -33,7 +33,7 @@
* @author <a href="kabir.khan(a)jboss.com">Kabir Khan</a>
* @version $Revision: 1.1 $
*/
-public class ExistingSimpleBean<T> extends SimpleBean<T>
+public class ExistingSimpleBean<T> extends ManagedBean<T>
{
T instance;
@@ -47,9 +47,9 @@
* @param instance the existing instance
* @return A Web Bean
*/
- protected ExistingSimpleBean(WBClass<T> type, BeanManagerImpl manager, T instance)
+ protected ExistingSimpleBean(WeldClass<T> type, BeanManagerImpl manager, T instance)
{
- super(type, manager);
+ super(type, null, manager);
this.instance = instance;
}
@@ -61,7 +61,7 @@
* @param manager the current manager
* @return A Web Bean
*/
- public static <T> ExistingSimpleBean<T> of(WBClass<T> clazz, BeanManagerImpl manager, T instance)
+ public static <T> ExistingSimpleBean<T> of(WeldClass<T> clazz, BeanManagerImpl manager, T instance)
{
return new ExistingSimpleBean<T>(clazz, manager, instance);
}
Copied: extensions/trunk/bean-utils/src/main/java/org/jboss/weld/beanutils/impl (from rev 3901, extensions/trunk/bean-utils/src/main/java/org/jboss/webbeans/beanutils/impl)
Modified: extensions/trunk/bean-utils/src/main/java/org/jboss/weld/beanutils/impl/BeansImpl.java
===================================================================
--- extensions/trunk/bean-utils/src/main/java/org/jboss/webbeans/beanutils/impl/BeansImpl.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/bean-utils/src/main/java/org/jboss/weld/beanutils/impl/BeansImpl.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -19,14 +19,14 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.webbeans.beanutils.impl;
+package org.jboss.weld.beanutils.impl;
import java.util.HashSet;
import java.util.Set;
import javax.enterprise.inject.spi.Bean;
-import org.jboss.webbeans.beanutils.spi.Beans;
+import org.jboss.weld.beanutils.spi.Beans;
/**
*
Copied: extensions/trunk/bean-utils/src/main/java/org/jboss/weld/beanutils/spi (from rev 3901, extensions/trunk/bean-utils/src/main/java/org/jboss/webbeans/beanutils/spi)
Modified: extensions/trunk/bean-utils/src/main/java/org/jboss/weld/beanutils/spi/BeanType.java
===================================================================
--- extensions/trunk/bean-utils/src/main/java/org/jboss/webbeans/beanutils/spi/BeanType.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/bean-utils/src/main/java/org/jboss/weld/beanutils/spi/BeanType.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.webbeans.beanutils.spi;
+package org.jboss.weld.beanutils.spi;
/**
* Enum to look up beans in the map returned by BeanDescriber.getBeans()
Modified: extensions/trunk/bean-utils/src/main/java/org/jboss/weld/beanutils/spi/Beans.java
===================================================================
--- extensions/trunk/bean-utils/src/main/java/org/jboss/webbeans/beanutils/spi/Beans.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/bean-utils/src/main/java/org/jboss/weld/beanutils/spi/Beans.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.webbeans.beanutils.spi;
+package org.jboss.weld.beanutils.spi;
import java.util.Set;
Modified: extensions/trunk/bean-utils/src/main/java/org/jboss/weld/beanutils/spi/ExistingBeanDescriber.java
===================================================================
--- extensions/trunk/bean-utils/src/main/java/org/jboss/webbeans/beanutils/spi/ExistingBeanDescriber.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/bean-utils/src/main/java/org/jboss/weld/beanutils/spi/ExistingBeanDescriber.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -19,13 +19,13 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.webbeans.beanutils.spi;
+package org.jboss.weld.beanutils.spi;
import javax.enterprise.inject.spi.AnnotatedType;
import javax.enterprise.inject.spi.BeanManager;
-import org.jboss.webbeans.beanutils.exisiting.ExistingBeanDescriberImpl;
-import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
+import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
+import org.jboss.weld.beanutils.exisiting.ExistingBeanDescriberImpl;
/**
* Utilities to create beans that take an existing instance
Deleted: extensions/trunk/bean-utils/src/test/java/org/jboss/test/webbeans/beanutils/AbstractBeanUtilsTest.java
===================================================================
--- extensions/trunk/bean-utils/src/test/java/org/jboss/test/webbeans/beanutils/AbstractBeanUtilsTest.java 2009-10-08 14:22:10 UTC (rev 3903)
+++ extensions/trunk/bean-utils/src/test/java/org/jboss/test/webbeans/beanutils/AbstractBeanUtilsTest.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -1,128 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source.
-* Copyright 2006, Red Hat Middleware LLC, and individual contributors
-* as indicated by the @author tags. See the copyright.txt file in the
-* distribution for a full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.test.webbeans.beanutils;
-
-import java.lang.reflect.Field;
-import java.util.Arrays;
-import java.util.Map;
-
-import javax.enterprise.inject.spi.BeanManager;
-
-import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
-import org.jboss.webbeans.bootstrap.BeanDeployment;
-import org.jboss.webbeans.bootstrap.WebBeansBootstrap;
-import org.jboss.webbeans.bootstrap.spi.BeanDeploymentArchive;
-import org.jboss.webbeans.mock.MockEELifecycle;
-
-/**
- *
- * @author <a href="kabir.khan(a)jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public abstract class AbstractBeanUtilsTest
-{
- /**
- * Contains the web beans deployment
- */
- MockEELifecycle lifecycle;
-
- boolean deployedWebBeans;
-
- /**
- * Initialises the lifecycle with the classes to deploy once deployWebBeans() is called
- *
- * @param classes the classes to deploy
- */
- protected void initialiseEnvironment(Class<?>...classes)
- {
- lifecycle = new MockEELifecycle();
- lifecycle.getDeployment().getArchive().setBeanClasses(Arrays.asList(classes));
- lifecycle.initialize();
- }
-
- /**
- * Deploys classes as web beans and sets {@link #lifecycle} to point to the created lifecycle
- *
- * @throws Exception if an error occured
- */
- protected void deployWebBeans() throws Exception
- {
- if (lifecycle == null)
- throw new IllegalStateException("Lifecycle needs to be initialised by calling initialiseEnvironment()");
- lifecycle.beginApplication();
- lifecycle.beginSession();
- lifecycle.beginRequest();
- deployedWebBeans = true;
- }
-
-
- /**
- * Undeploys the webbeans deployed if {@link #lifecycle} is set
- */
- protected void undeployWebBeans() throws Exception
- {
- lifecycle = null;
- if (lifecycle != null)
- {
- if (deployedWebBeans)
- {
- lifecycle.endRequest();
- lifecycle.endSession();
- lifecycle.endApplication();
- }
- lifecycle = null;
- }
- }
-
-
- /**
- * Gets the current bean manager used.
- *
- * @return the bean manager
- */
- protected BeanManager getCurrentManager() throws Exception
- {
- if (lifecycle == null)
- throw new IllegalStateException("Lifecycle needs to be initialised by calling initialiseEnvironment()");
- return lifecycle.getBootstrap().getManager(lifecycle.getDeployment().getArchive());
- }
-
- protected BeanDeployerEnvironment getBeanDeployerEnvironment() throws Exception
- {
- if (lifecycle == null)
- throw new IllegalStateException("Lifecycle needs to be initialised by calling initialiseEnvironment()");
-
- WebBeansBootstrap bootstrap = lifecycle.getBootstrap();
-
- //TODO: Hack
- Field field = WebBeansBootstrap.class.getDeclaredField("beanDeployments");
- field.setAccessible(true);
- Map<BeanDeploymentArchive, BeanDeployment> deployments = (Map<BeanDeploymentArchive, BeanDeployment>)field.get(bootstrap);
-
- assert deployments != null;
- assert deployments.size() == 1;
- BeanDeployment deployment = deployments.entrySet().iterator().next().getValue();
-
- return deployment.getBeanDeployer().getEnvironment();
-
- }
-}
Deleted: extensions/trunk/bean-utils/src/test/java/org/jboss/test/webbeans/beanutils/RegisterBeansObserver.java
===================================================================
--- extensions/trunk/bean-utils/src/test/java/org/jboss/test/webbeans/beanutils/RegisterBeansObserver.java 2009-10-08 14:22:10 UTC (rev 3903)
+++ extensions/trunk/bean-utils/src/test/java/org/jboss/test/webbeans/beanutils/RegisterBeansObserver.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -1,63 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source.
-* Copyright 2006, Red Hat Middleware LLC, and individual contributors
-* as indicated by the @author tags. See the copyright.txt file in the
-* distribution for a full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.test.webbeans.beanutils;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.enterprise.event.Observes;
-import javax.enterprise.inject.spi.AfterBeanDiscovery;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.Extension;
-
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.webbeans.beanutils.spi.Beans;
-
-/**
- *
- * @author <a href="kabir.khan(a)jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-@Artifact
-public class RegisterBeansObserver implements Extension
-{
- static List<Beans<?>> beans = new ArrayList<Beans<?>>();
-
- public static void clear()
- {
- beans.clear();
- }
-
- public static void addBeans(Beans<?> beans)
- {
- RegisterBeansObserver.beans.add(beans);
- }
-
- public void observe(@Observes AfterBeanDiscovery afterBeanDiscovery)
- {
- for (Beans<?> beans : RegisterBeansObserver.beans)
- {
- for(Bean<?> bean : beans.getAllBeans())
- afterBeanDiscovery.addBean(bean);
- }
- }
-}
Copied: extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/AbstractBeanUtilsTest.java (from rev 3901, extensions/trunk/bean-utils/src/test/java/org/jboss/test/webbeans/beanutils/AbstractBeanUtilsTest.java)
===================================================================
--- extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/AbstractBeanUtilsTest.java (rev 0)
+++ extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/AbstractBeanUtilsTest.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -0,0 +1,128 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.weld.beanutils;
+
+import java.lang.reflect.Field;
+import java.util.Arrays;
+import java.util.Map;
+
+import javax.enterprise.inject.spi.BeanManager;
+
+import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
+import org.jboss.weld.bootstrap.BeanDeployment;
+import org.jboss.weld.bootstrap.WeldBootstrap;
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.mock.MockEELifecycle;
+
+/**
+ *
+ * @author <a href="kabir.khan(a)jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractBeanUtilsTest
+{
+ /**
+ * Contains the web beans deployment
+ */
+ MockEELifecycle lifecycle;
+
+ boolean deployedWebBeans;
+
+ /**
+ * Initialises the lifecycle with the classes to deploy once deployWebBeans() is called
+ *
+ * @param classes the classes to deploy
+ */
+ protected void initialiseEnvironment(Class<?>...classes)
+ {
+ lifecycle = new MockEELifecycle();
+ lifecycle.getDeployment().getArchive().setBeanClasses(Arrays.asList(classes));
+ lifecycle.initialize();
+ }
+
+ /**
+ * Deploys classes as web beans and sets {@link #lifecycle} to point to the created lifecycle
+ *
+ * @throws Exception if an error occured
+ */
+ protected void deployWebBeans() throws Exception
+ {
+ if (lifecycle == null)
+ throw new IllegalStateException("Lifecycle needs to be initialised by calling initialiseEnvironment()");
+ lifecycle.beginApplication();
+ lifecycle.beginSession();
+ lifecycle.beginRequest();
+ deployedWebBeans = true;
+ }
+
+
+ /**
+ * Undeploys the webbeans deployed if {@link #lifecycle} is set
+ */
+ protected void undeployWebBeans() throws Exception
+ {
+ lifecycle = null;
+ if (lifecycle != null)
+ {
+ if (deployedWebBeans)
+ {
+ lifecycle.endRequest();
+ lifecycle.endSession();
+ lifecycle.endApplication();
+ }
+ lifecycle = null;
+ }
+ }
+
+
+ /**
+ * Gets the current bean manager used.
+ *
+ * @return the bean manager
+ */
+ protected BeanManager getCurrentManager() throws Exception
+ {
+ if (lifecycle == null)
+ throw new IllegalStateException("Lifecycle needs to be initialised by calling initialiseEnvironment()");
+ return lifecycle.getBootstrap().getManager(lifecycle.getDeployment().getArchive());
+ }
+
+ protected BeanDeployerEnvironment getBeanDeployerEnvironment() throws Exception
+ {
+ if (lifecycle == null)
+ throw new IllegalStateException("Lifecycle needs to be initialised by calling initialiseEnvironment()");
+
+ WeldBootstrap bootstrap = lifecycle.getBootstrap();
+
+ //TODO: Hack
+ Field field = WeldBootstrap.class.getDeclaredField("beanDeployments");
+ field.setAccessible(true);
+ Map<BeanDeploymentArchive, BeanDeployment> deployments = (Map<BeanDeploymentArchive, BeanDeployment>)field.get(bootstrap);
+
+ assert deployments != null;
+ assert deployments.size() == 1;
+ BeanDeployment deployment = deployments.entrySet().iterator().next().getValue();
+
+ return deployment.getBeanDeployer().getEnvironment();
+
+ }
+}
Copied: extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/RegisterBeansObserver.java (from rev 3901, extensions/trunk/bean-utils/src/test/java/org/jboss/test/webbeans/beanutils/RegisterBeansObserver.java)
===================================================================
--- extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/RegisterBeansObserver.java (rev 0)
+++ extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/RegisterBeansObserver.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -0,0 +1,63 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.weld.beanutils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.AfterBeanDiscovery;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.Extension;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.weld.beanutils.spi.Beans;
+
+/**
+ *
+ * @author <a href="kabir.khan(a)jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+@Artifact
+public class RegisterBeansObserver implements Extension
+{
+ static List<Beans<?>> beans = new ArrayList<Beans<?>>();
+
+ public static void clear()
+ {
+ beans.clear();
+ }
+
+ public static void addBeans(Beans<?> beans)
+ {
+ RegisterBeansObserver.beans.add(beans);
+ }
+
+ public void observe(@Observes AfterBeanDiscovery afterBeanDiscovery)
+ {
+ for (Beans<?> beans : RegisterBeansObserver.beans)
+ {
+ for(Bean<?> bean : beans.getAllBeans())
+ afterBeanDiscovery.addBean(bean);
+ }
+ }
+}
Copied: extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing (from rev 3901, extensions/trunk/bean-utils/src/test/java/org/jboss/test/webbeans/beanutils/existing)
Modified: extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/ABean.java
===================================================================
--- extensions/trunk/bean-utils/src/test/java/org/jboss/test/webbeans/beanutils/existing/ABean.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/ABean.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.webbeans.beanutils.existing;
+package org.jboss.test.weld.beanutils.existing;
/**
*
Modified: extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/Bean.java
===================================================================
--- extensions/trunk/bean-utils/src/test/java/org/jboss/test/webbeans/beanutils/existing/Bean.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/Bean.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.webbeans.beanutils.existing;
+package org.jboss.test.weld.beanutils.existing;
/**
*
Modified: extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/Custom.java
===================================================================
--- extensions/trunk/bean-utils/src/test/java/org/jboss/test/webbeans/beanutils/existing/Custom.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/Custom.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.webbeans.beanutils.existing;
+package org.jboss.test.weld.beanutils.existing;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Modified: extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/CustomBean.java
===================================================================
--- extensions/trunk/bean-utils/src/test/java/org/jboss/test/webbeans/beanutils/existing/CustomBean.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/CustomBean.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.webbeans.beanutils.existing;
+package org.jboss.test.weld.beanutils.existing;
/**
*
Modified: extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/CustomDefaultConstructorReceiver.java
===================================================================
--- extensions/trunk/bean-utils/src/test/java/org/jboss/test/webbeans/beanutils/existing/CustomDefaultConstructorReceiver.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/CustomDefaultConstructorReceiver.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.webbeans.beanutils.existing;
+package org.jboss.test.weld.beanutils.existing;
import javax.enterprise.inject.Default;
import javax.inject.Inject;
Modified: extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/CustomDefaultFieldReceiver.java
===================================================================
--- extensions/trunk/bean-utils/src/test/java/org/jboss/test/webbeans/beanutils/existing/CustomDefaultFieldReceiver.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/CustomDefaultFieldReceiver.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.webbeans.beanutils.existing;
+package org.jboss.test.weld.beanutils.existing;
import javax.enterprise.inject.Default;
import javax.inject.Inject;
Modified: extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/DefaultBean.java
===================================================================
--- extensions/trunk/bean-utils/src/test/java/org/jboss/test/webbeans/beanutils/existing/DefaultBean.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/DefaultBean.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.webbeans.beanutils.existing;
+package org.jboss.test.weld.beanutils.existing;
import javax.enterprise.inject.Default;
Modified: extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/DefaultConstructorReceiver.java
===================================================================
--- extensions/trunk/bean-utils/src/test/java/org/jboss/test/webbeans/beanutils/existing/DefaultConstructorReceiver.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/DefaultConstructorReceiver.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.webbeans.beanutils.existing;
+package org.jboss.test.weld.beanutils.existing;
import javax.enterprise.inject.Default;
import javax.inject.Inject;
Modified: extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/DefaultFieldReceiver.java
===================================================================
--- extensions/trunk/bean-utils/src/test/java/org/jboss/test/webbeans/beanutils/existing/DefaultFieldReceiver.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/DefaultFieldReceiver.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.webbeans.beanutils.existing;
+package org.jboss.test.weld.beanutils.existing;
import javax.enterprise.inject.Default;
import javax.inject.Inject;
Modified: extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/DefaultMethodProducerWithInjection.java
===================================================================
--- extensions/trunk/bean-utils/src/test/java/org/jboss/test/webbeans/beanutils/existing/DefaultMethodProducerWithInjection.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/DefaultMethodProducerWithInjection.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.webbeans.beanutils.existing;
+package org.jboss.test.weld.beanutils.existing;
import javax.enterprise.inject.Default;
import javax.enterprise.inject.Produces;
Modified: extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/ExisitingBeanDescriberTest.java
===================================================================
--- extensions/trunk/bean-utils/src/test/java/org/jboss/test/webbeans/beanutils/existing/ExisitingBeanDescriberTest.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/ExisitingBeanDescriberTest.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.webbeans.beanutils.existing;
+package org.jboss.test.weld.beanutils.existing;
import java.util.Set;
@@ -27,10 +27,10 @@
import javax.enterprise.inject.spi.AnnotatedType;
import javax.enterprise.inject.spi.Bean;
-import org.jboss.test.webbeans.beanutils.AbstractBeanUtilsTest;
-import org.jboss.test.webbeans.beanutils.RegisterBeansObserver;
-import org.jboss.webbeans.beanutils.spi.Beans;
-import org.jboss.webbeans.beanutils.spi.ExistingBeanDescriber;
+import org.jboss.test.weld.beanutils.AbstractBeanUtilsTest;
+import org.jboss.test.weld.beanutils.RegisterBeansObserver;
+import org.jboss.weld.beanutils.spi.Beans;
+import org.jboss.weld.beanutils.spi.ExistingBeanDescriber;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
Modified: extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/FieldProducer.java
===================================================================
--- extensions/trunk/bean-utils/src/test/java/org/jboss/test/webbeans/beanutils/existing/FieldProducer.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/FieldProducer.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.webbeans.beanutils.existing;
+package org.jboss.test.weld.beanutils.existing;
import javax.enterprise.inject.Default;
import javax.enterprise.inject.Produces;
Modified: extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/MethodProducer.java
===================================================================
--- extensions/trunk/bean-utils/src/test/java/org/jboss/test/webbeans/beanutils/existing/MethodProducer.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/MethodProducer.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.webbeans.beanutils.existing;
+package org.jboss.test.weld.beanutils.existing;
import javax.enterprise.inject.Default;
import javax.enterprise.inject.Produces;
Modified: extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/ProducerBean.java
===================================================================
--- extensions/trunk/bean-utils/src/test/java/org/jboss/test/webbeans/beanutils/existing/ProducerBean.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/bean-utils/src/test/java/org/jboss/test/weld/beanutils/existing/ProducerBean.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.webbeans.beanutils.existing;
+package org.jboss.test.weld.beanutils.existing;
/**
*
Copied: extensions/trunk/bean-utils/src/test/java/org/jboss/weld/beanutils (from rev 3901, extensions/trunk/bean-utils/src/test/java/org/jboss/webbeans/beanutils)
Copied: extensions/trunk/logger/src/main/java/org/jboss/weld/log (from rev 3901, extensions/trunk/logger/src/main/java/org/jboss/webbeans/log)
Modified: extensions/trunk/logger/src/main/java/org/jboss/weld/log/Logger.java
===================================================================
--- extensions/trunk/logger/src/main/java/org/jboss/webbeans/log/Logger.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/logger/src/main/java/org/jboss/weld/log/Logger.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.log;
+package org.jboss.weld.log;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
Modified: extensions/trunk/logger/src/main/java/org/jboss/weld/log/LoggerProducer.java
===================================================================
--- extensions/trunk/logger/src/main/java/org/jboss/webbeans/log/LoggerProducer.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/logger/src/main/java/org/jboss/weld/log/LoggerProducer.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.jboss.webbeans.log;
+package org.jboss.weld.log;
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.InjectionPoint;
Copied: extensions/trunk/logger/src/test/java/org/jboss/weld/test/log (from rev 3901, extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/log)
Modified: extensions/trunk/logger/src/test/java/org/jboss/weld/test/log/Finch.java
===================================================================
--- extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/log/Finch.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/logger/src/test/java/org/jboss/weld/test/log/Finch.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -1,9 +1,9 @@
-package org.jboss.webbeans.test.log;
+package org.jboss.weld.test.log;
import javax.inject.Inject;
-import org.jboss.webbeans.log.Log;
-import org.jboss.webbeans.log.Logger;
+import org.jboss.weld.log.Log;
+import org.jboss.weld.log.Logger;
public class Finch
{
Modified: extensions/trunk/logger/src/test/java/org/jboss/weld/test/log/LoggerInjectionTest.java
===================================================================
--- extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/log/LoggerInjectionTest.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/logger/src/test/java/org/jboss/weld/test/log/LoggerInjectionTest.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -15,11 +15,11 @@
* limitations under the License.
*/
-package org.jboss.webbeans.test.log;
+package org.jboss.weld.test.log;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.Classes;
-import org.jboss.webbeans.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
/**
@@ -29,7 +29,7 @@
*/
@Artifact
@Classes(packages = { "org.jboss.webbeans.log", "org.jboss.webbeans.test.log" })
-public class LoggerInjectionTest extends AbstractWebBeansTest
+public class LoggerInjectionTest extends AbstractWeldTest
{
@Test
public void testBasicLogInjection()
Modified: extensions/trunk/logger/src/test/java/org/jboss/weld/test/log/Sparrow.java
===================================================================
--- extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/log/Sparrow.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/logger/src/test/java/org/jboss/weld/test/log/Sparrow.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -1,9 +1,9 @@
-package org.jboss.webbeans.test.log;
+package org.jboss.weld.test.log;
import javax.inject.Inject;
-import org.jboss.webbeans.log.Log;
-import org.jboss.webbeans.log.Logger;
+import org.jboss.weld.log.Log;
+import org.jboss.weld.log.Logger;
class Sparrow
{
Modified: extensions/trunk/logger/src/test/java/org/jboss/weld/test/log/TestAppender.java
===================================================================
--- extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/log/TestAppender.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/logger/src/test/java/org/jboss/weld/test/log/TestAppender.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.test.log;
+package org.jboss.weld.test.log;
import org.apache.log4j.spi.LoggingEvent;
import org.apache.log4j.varia.NullAppender;
Modified: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/ShutdownManager.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/ShutdownManager.java 2009-10-08 14:22:10 UTC (rev 3903)
+++ extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/ShutdownManager.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -65,7 +65,7 @@
}
/**
- * Shutdown WebBeans SE gracefully (call this as an alternative to firing the
+ * Shutdown Weld SE gracefully (call this as an alternative to firing the
* "@Shutdown Manager" event.
*/
public void shutdown()
Modified: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/StartMain.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/StartMain.java 2009-10-08 14:22:10 UTC (rev 3903)
+++ extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/StartMain.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -31,8 +31,8 @@
/**
* This is the main class that should always be called from the command line for
- * a WebBEans SE app. Something like: <code>
- * java -jar MyApp.jar org.jboss.webbeans.environment.se.StarMain arguments
+ * a Weld SE app. Something like: <code>
+ * java -jar MyApp.jar org.jboss.weld.environment.se.StarMain arguments
* </code>
*
* @author Peter Royle
@@ -41,7 +41,7 @@
public class StartMain
{
- private static final String BOOTSTRAP_IMPL_CLASS_NAME = "org.jboss.webbeans.bootstrap.WebBeansBootstrap";
+ private static final String BOOTSTRAP_IMPL_CLASS_NAME = "org.jboss.weld.bootstrap.WeldBootstrap";
private final Bootstrap bootstrap;
private final BeanStore applicationBeanStore;
public static String[] PARAMETERS;
@@ -56,7 +56,7 @@
}
catch (Exception e)
{
- throw new IllegalStateException("Error loading Web Beans bootstrap, check that Web Beans is on the classpath", e);
+ throw new IllegalStateException("Error loading Weld bootstrap, check that Weld is on the classpath", e);
}
this.applicationBeanStore = new ConcurrentHashMapBeanStore();
}
Modified: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEBeanDeploymentArchive.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEBeanDeploymentArchive.java 2009-10-08 14:22:10 UTC (rev 3903)
+++ extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEBeanDeploymentArchive.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -28,7 +28,7 @@
/**
* A Java SE implementation of BeanDeploymentArchive. It is essentially an
- * adaptor from the SEWebBeanDiscovery to the BeanDeploymentArchive interface.
+ * adaptor from the SEWeldDiscovery to the BeanDeploymentArchive interface.
* It returns, in a single logical archive, all Bean classes and beans.xml
* descriptors. It always returns an empty collection of EJBs.
*
@@ -69,7 +69,7 @@
*/
public Collection<URL> getBeansXml()
{
- return wbDiscovery.discoverWebBeansXml();
+ return wbDiscovery.discoverWeldXml();
}
/**
Modified: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEWeldDeployment.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEWeldDeployment.java 2009-10-08 14:22:10 UTC (rev 3903)
+++ extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEWeldDeployment.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -23,7 +23,7 @@
import org.jboss.weld.bootstrap.spi.Deployment;
/**
- * WebBeans Deployment for Java SE environment.
+ * Weld Deployment for Java SE environment.
*
* @author Peter Royle
*/
Modified: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEWeldDiscovery.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEWeldDiscovery.java 2009-10-08 14:22:10 UTC (rev 3903)
+++ extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEWeldDiscovery.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -25,8 +25,8 @@
import org.jboss.weld.environment.se.util.Reflections;
/**
- * The means by which Web Beans are discovered on the classpath. This will only
- * discover simple web beans - there is no EJB/Servlet/JPA integration.
+ * The means by which beans are discovered on the classpath. This will only
+ * discover simple beans - there is no EJB/Servlet/JPA integration.
*
* @author Peter Royle
* @author Pete Muir
@@ -45,12 +45,12 @@
scan();
}
- public Iterable<Class<?>> discoverWebBeanClasses()
+ public Iterable<Class<?>> discoverWeldClasses()
{
return Collections.unmodifiableSet(wbClasses);
}
- public Collection<URL> discoverWebBeansXml()
+ public Collection<URL> discoverWeldXml()
{
return Collections.unmodifiableSet(wbUrls);
}
Modified: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/events/ContainerInitialized.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/events/ContainerInitialized.java 2009-10-08 14:22:10 UTC (rev 3903)
+++ extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/events/ContainerInitialized.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -17,7 +17,7 @@
package org.jboss.weld.environment.se.events;
/**
- * The event that is fired when the WebBeans CDI container is initialized and
+ * The event that is fired when the Weld CDI container is initialized and
* ready for applications to take control, which it may do by observing this
* event.
*
Modified: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/events/Shutdown.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/events/Shutdown.java 2009-10-08 14:22:10 UTC (rev 3903)
+++ extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/events/Shutdown.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -24,7 +24,7 @@
/**
- * Fired by webbeans SE before shutting down. Applications and modules should
+ * Fired by weld SE before shutting down. Applications and modules should
* release resources cleanly in response to this event.
*
* @author Peter Royle
Modified: extensions/trunk/se/src/test/resources/META-INF/services/javax.enterprise.inject.spi.Extension
===================================================================
--- extensions/trunk/se/src/test/resources/META-INF/services/javax.enterprise.inject.spi.Extension 2009-10-08 14:22:10 UTC (rev 3903)
+++ extensions/trunk/se/src/test/resources/META-INF/services/javax.enterprise.inject.spi.Extension 2009-10-08 14:58:57 UTC (rev 3904)
@@ -1 +1 @@
-org.jboss.webbeans.environment.se.test.beans.ObserverTestBean
+org.jboss.weld.environment.se.test.beans.ObserverTestBean
Modified: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/Listener.java
===================================================================
--- extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/Listener.java 2009-10-08 14:22:10 UTC (rev 3903)
+++ extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/Listener.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -43,17 +43,16 @@
* @author Pete Muir
*/
public class Listener extends ForwardingServletListener
-{
-
+{
private static final Log log = Logging.getLog(Listener.class);
- private static final String BOOTSTRAP_IMPL_CLASS_NAME = "org.jboss.webbeans.bootstrap.WebBeansBootstrap";
- private static final String WEB_BEANS_LISTENER_CLASS_NAME = "org.jboss.webbeans.servlet.WebBeansListener";
+ private static final String BOOTSTRAP_IMPL_CLASS_NAME = "org.jboss.weld.bootstrap.WeldBootstrap";
+ private static final String WELD_LISTENER_CLASS_NAME = "org.jboss.weld.servlet.WeldListener";
private static final String APPLICATION_BEAN_STORE_ATTRIBUTE_NAME = Listener.class.getName() + ".applicationBeanStore";
- private static final String EXPRESSION_FACTORY_NAME = "org.jboss.webbeans.el.ExpressionFactory";
+ private static final String EXPRESSION_FACTORY_NAME = "org.jboss.weld.el.ExpressionFactory";
private final transient Bootstrap bootstrap;
- private final transient ServletListener webBeansListener;
+ private final transient ServletListener weldListener;
private WeldManager manager;
public Listener()
@@ -64,15 +63,15 @@
}
catch (IllegalArgumentException e)
{
- throw new IllegalStateException("Error loading Web Beans bootstrap, check that Web Beans is on the classpath", e);
+ throw new IllegalStateException("Error loading Weld bootstrap, check that Weld is on the classpath", e);
}
try
{
- webBeansListener = Reflections.newInstance(WEB_BEANS_LISTENER_CLASS_NAME);
+ weldListener = Reflections.newInstance(WELD_LISTENER_CLASS_NAME);
}
catch (IllegalArgumentException e)
{
- throw new IllegalStateException("Error loading Web Beans listener, check that Web Beans is on the classpath", e);
+ throw new IllegalStateException("Error loading Weld listener, check that Weld is on the classpath", e);
}
}
@@ -94,7 +93,8 @@
ServletDeployment deployment = new ServletDeployment(sce.getServletContext());
try
{
- deployment.getWebAppBeanDeploymentArchive().getServices().add(ResourceInjectionServices.class, new ServletResourceInjectionServices() {});
+ deployment.getWebAppBeanDeploymentArchive().getServices().add(
+ ResourceInjectionServices.class, new ServletResourceInjectionServices() {});
}
catch (NoClassDefFoundError e)
{
@@ -102,7 +102,8 @@
log.warn("@Resource injection not available in simple beans");
}
- deployment.getServices().add(ServletServices.class, new ServletServicesImpl(deployment.getWebAppBeanDeploymentArchive()));
+ deployment.getServices().add(ServletServices.class,
+ new ServletServicesImpl(deployment.getWebAppBeanDeploymentArchive()));
bootstrap.startContainer(Environments.SERVLET, deployment, applicationBeanStore).startInitialization();
manager = bootstrap.getManager(deployment.getWebAppBeanDeploymentArchive());
@@ -144,10 +145,12 @@
jspApplicationContext.addELResolver(manager.getELResolver());
// Register ELContextListener with JSP
- jspApplicationContext.addELContextListener(Reflections.<ELContextListener>newInstance("org.jboss.webbeans.el.WebBeansELContextListener"));
+ jspApplicationContext.addELContextListener(Reflections.<ELContextListener>
+ newInstance("org.jboss.weld.el.WeldELContextListener"));
// Push the wrapped expression factory into the servlet context so that Tomcat or Jetty can hook it in using a container code
- sce.getServletContext().setAttribute(EXPRESSION_FACTORY_NAME, manager.wrapExpressionFactory(jspApplicationContext.getExpressionFactory()));
+ sce.getServletContext().setAttribute(EXPRESSION_FACTORY_NAME,
+ manager.wrapExpressionFactory(jspApplicationContext.getExpressionFactory()));
}
bootstrap.deployBeans().validateBeans().endInitialization();
@@ -159,7 +162,7 @@
@Override
protected ServletListener delegate()
{
- return webBeansListener;
+ return weldListener;
}
}
Modified: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/deployment/AbstractScanner.java
===================================================================
--- extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/deployment/AbstractScanner.java 2009-10-08 14:22:10 UTC (rev 3903)
+++ extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/deployment/AbstractScanner.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -62,7 +62,7 @@
}
else if (name.equals(WebAppBeanDeploymentArchive.META_INF_BEANS_XML))
{
- webAppBeanDeploymentArchive.getWbUrls().add(url);
+ webAppBeanDeploymentArchive.getWeldUrls().add(url);
}
}
Modified: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/deployment/WebAppBeanDeploymentArchive.java
===================================================================
--- extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/deployment/WebAppBeanDeploymentArchive.java 2009-10-08 14:22:10 UTC (rev 3903)
+++ extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/deployment/WebAppBeanDeploymentArchive.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -59,17 +59,17 @@
scan(servletContext);
}
- public Iterable<Class<?>> discoverWebBeanClasses()
+ public Iterable<Class<?>> discoverWeldClasses()
{
return Collections.unmodifiableSet(classes);
}
- public Iterable<URL> discoverWebBeansXml()
+ public Iterable<URL> discoverWeldXml()
{
return Collections.unmodifiableSet(beansXml);
}
- public Set<URL> getWbUrls()
+ public Set<URL> getWeldUrls()
{
return beansXml;
}
@@ -83,7 +83,7 @@
URL beans = servletContext.getResource(WEB_INF_BEANS_XML);
if (beans != null)
{
- beansXml.add(beans); // this is consistent with how the JBoss webbeans.deployer works
+ beansXml.add(beans); // this is consistent with how the JBoss weld.deployer works
File webInfClasses = Servlets.getRealFile(servletContext, WEB_INF_CLASSES);
if (webInfClasses != null)
{
Deleted: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/WebBeansApplicationFactory.java
===================================================================
--- extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/WebBeansApplicationFactory.java 2009-10-08 14:22:10 UTC (rev 3903)
+++ extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/WebBeansApplicationFactory.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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.weld.environment.servlet.jsf;
-
-import javax.faces.application.Application;
-import javax.faces.application.ApplicationFactory;
-
-
-/**
- * @author pmuir
- *
- */
-public class WebBeansApplicationFactory extends ForwardingApplicationFactory
-{
-
- private final ApplicationFactory applicationFactory;
-
- private Application application;
-
- public WebBeansApplicationFactory(ApplicationFactory applicationFactory)
- {
- this.applicationFactory = applicationFactory;
- }
-
- @Override
- protected ApplicationFactory delegate()
- {
- return applicationFactory;
- }
-
- @Override
- public Application getApplication()
- {
- if (application == null)
- {
- application = new WeldApplication(delegate().getApplication());
- }
- return application;
- }
-
-}
Copied: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/WeldApplicationFactory.java (from rev 3902, extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/WebBeansApplicationFactory.java)
===================================================================
--- extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/WeldApplicationFactory.java (rev 0)
+++ extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/WeldApplicationFactory.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.weld.environment.servlet.jsf;
+
+import javax.faces.application.Application;
+import javax.faces.application.ApplicationFactory;
+
+
+/**
+ * @author pmuir
+ *
+ */
+public class WeldApplicationFactory extends ForwardingApplicationFactory
+{
+
+ private final ApplicationFactory applicationFactory;
+
+ private Application application;
+
+ public WeldApplicationFactory(ApplicationFactory applicationFactory)
+ {
+ this.applicationFactory = applicationFactory;
+ }
+
+ @Override
+ protected ApplicationFactory delegate()
+ {
+ return applicationFactory;
+ }
+
+ @Override
+ public Application getApplication()
+ {
+ if (application == null)
+ {
+ application = new WeldApplication(delegate().getApplication());
+ }
+ return application;
+ }
+
+}
Modified: extensions/trunk/servlet/int/src/main/resources/META-INF/faces-config.xml
===================================================================
--- extensions/trunk/servlet/int/src/main/resources/META-INF/faces-config.xml 2009-10-08 14:22:10 UTC (rev 3903)
+++ extensions/trunk/servlet/int/src/main/resources/META-INF/faces-config.xml 2009-10-08 14:58:57 UTC (rev 3904)
@@ -5,15 +5,15 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
<factory>
- <application-factory>org.jboss.webbeans.environment.servlet.jsf.WebBeansApplicationFactory</application-factory>
+ <application-factory>org.jboss.weld.environment.servlet.jsf.WeldApplicationFactory</application-factory>
</factory>
<application>
- <view-handler>org.jboss.webbeans.jsf.ConversationAwareViewHandler</view-handler>
+ <view-handler>org.jboss.weld.jsf.ConversationAwareViewHandler</view-handler>
</application>
<lifecycle>
- <phase-listener>org.jboss.webbeans.jsf.WebBeansPhaseListener</phase-listener>
+ <phase-listener>org.jboss.weld.jsf.WeldPhaseListener</phase-listener>
</lifecycle>
</faces-config>
Modified: extensions/trunk/servlet/support/pom.xml
===================================================================
--- extensions/trunk/servlet/support/pom.xml 2009-10-08 14:22:10 UTC (rev 3903)
+++ extensions/trunk/servlet/support/pom.xml 2009-10-08 14:58:57 UTC (rev 3904)
@@ -11,7 +11,7 @@
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Weld Servlet Integration: Tomcat Support</name>
- <url>http://www.seamframework.org/WebBeans</url>
+ <url>http://www.seamframework.org/Weld</url>
<dependencies>
<dependency>
Modified: extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/JspInitialization.java
===================================================================
--- extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/JspInitialization.java 2009-10-08 14:22:10 UTC (rev 3903)
+++ extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/JspInitialization.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -22,18 +22,15 @@
*/
package org.jboss.weld.environment.tomcat;
-import javax.el.ELContextListener;
-import javax.el.ELResolver;
import javax.el.ExpressionFactory;
import javax.servlet.ServletContext;
import javax.servlet.jsp.JspApplicationContext;
import javax.servlet.jsp.JspFactory;
import org.apache.jasper.runtime.JspApplicationContextImpl;
-import org.jboss.weld.environment.tomcat.util.Reflections;
/**
- * The Web Beans JSP initialization listener
+ * The Weld JSP initialization listener
*
*
* @author Pete Muir
@@ -42,14 +39,14 @@
public class JspInitialization
{
- private static final String EXPRESSION_FACTORY_NAME = "org.jboss.webbeans.el.ExpressionFactory";
+ private static final String EXPRESSION_FACTORY_NAME = "org.jboss.weld.el.ExpressionFactory";
- private static class WebBeansJspApplicationContextImpl extends ForwardingJspApplicationContextImpl
+ private static class WeldJspApplicationContextImpl extends ForwardingJspApplicationContextImpl
{
private final JspApplicationContextImpl delegate;
private final ExpressionFactory expressionFactory;
- public WebBeansJspApplicationContextImpl(JspApplicationContextImpl delegate, ExpressionFactory expressionFactory)
+ public WeldJspApplicationContextImpl(JspApplicationContextImpl delegate, ExpressionFactory expressionFactory)
{
this.delegate = delegate;
this.expressionFactory = expressionFactory;
@@ -78,7 +75,7 @@
{
ExpressionFactory expressionFactory = (ExpressionFactory) context.getAttribute(EXPRESSION_FACTORY_NAME);
// Hack into JBoss Web/Catalina to replace the ExpressionFactory
- JspApplicationContextImpl wrappedJspApplicationContextImpl = new WebBeansJspApplicationContextImpl(JspApplicationContextImpl.getInstance(context), expressionFactory);
+ JspApplicationContextImpl wrappedJspApplicationContextImpl = new WeldJspApplicationContextImpl(JspApplicationContextImpl.getInstance(context), expressionFactory);
context.setAttribute(JspApplicationContextImpl.class.getName(), wrappedJspApplicationContextImpl);
}
// otherwise something went wrong starting WB, so don't register with JSP
Modified: extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/WeldLifecycleListener.java
===================================================================
--- extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/WeldLifecycleListener.java 2009-10-08 14:22:10 UTC (rev 3903)
+++ extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/WeldLifecycleListener.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -69,7 +69,7 @@
{
if (processor == null)
{
- Object o = servletContext.getAttribute("org.jboss.webbeans.environment.tomcat.WebBeansAnnotationProcessor");
+ Object o = servletContext.getAttribute("org.jboss.weld.environment.tomcat.WeldAnnotationProcessor");
if (o instanceof AnnotationProcessor)
{
processor = (AnnotationProcessor) o;
Modified: extensions/trunk/servlet/tests/src/test/debug-resources/META-INF/jboss-test-harness.properties
===================================================================
--- extensions/trunk/servlet/tests/src/test/debug-resources/META-INF/jboss-test-harness.properties 2009-10-08 14:22:10 UTC (rev 3903)
+++ extensions/trunk/servlet/tests/src/test/debug-resources/META-INF/jboss-test-harness.properties 2009-10-08 14:58:57 UTC (rev 3904)
@@ -1,7 +1,7 @@
# Configuration for running incontainer tests from your IDE
-# Alter the path webbeans accordingly (relative from the tck/impl dir)
+# Alter the path weld accordingly (relative from the tck/impl dir)
org.jboss.testharness.standalone=false
org.jboss.testharness.container.extraConfigurationDir=../
org.jboss.testharness.container.forceRestart=false
org.jboss.testharness.libraryDirectory=target/dependency/lib
-org.jboss.testharness.runIntegrationTests=true
\ No newline at end of file
+org.jboss.testharness.runIntegrationTests=true
Modified: extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/environment/servlet/discovery/ServletWeldDiscoveryTest.java
===================================================================
--- extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/environment/servlet/discovery/ServletWeldDiscoveryTest.java 2009-10-08 14:22:10 UTC (rev 3903)
+++ extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/environment/servlet/discovery/ServletWeldDiscoveryTest.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -33,7 +33,7 @@
{
};
- Set<URL> beansXmls = discovery.getWbUrls();
+ Set<URL> beansXmls = discovery.getWeldUrls();
assert beansXmls.size() >= 1 : "Expecting to find at least one META-INF/beans.xml resource on the test classpath";
for (URL beansXml : beansXmls)
{
Modified: extensions/trunk/servlet/tests/unit-tests.xml
===================================================================
--- extensions/trunk/servlet/tests/unit-tests.xml 2009-10-08 14:22:10 UTC (rev 3903)
+++ extensions/trunk/servlet/tests/unit-tests.xml 2009-10-08 14:58:57 UTC (rev 3904)
@@ -1,8 +1,8 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
-<suite name="Web Beans Tomcat Integration" verbose="1" >
+<suite name="Weld Tomcat Integration" verbose="1" >
- <test name="Web Beans Tomcat Integration">
+ <test name="Weld Tomcat Integration">
<method-selectors>
<method-selector>
<selector-class name="org.jboss.testharness.impl.testng.DisableIntegrationTestsMethodSelector" />
@@ -16,10 +16,10 @@
<exclude name="stub" />
<exclude name="broken" />
</run>
- </groups>
+ </groups>"tests/src/test/debug-resources/META-INF/jboss-test-harness.properties"
<packages>
- <package name="org.jboss.webbeans.test.tomcat.examples" />
- <package name="org.jboss.webbeans.test.tomcat.lookup" />
+ <package name="org.jboss.weld.test.tomcat.examples" />
+ <package name="org.jboss.weld.test.tomcat.lookup" />
</packages>
</test>
Modified: extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldApplication.java
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldApplication.java 2009-10-08 14:22:10 UTC (rev 3903)
+++ extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldApplication.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -22,9 +22,9 @@
* JSR-299 conversation scopes with Wicket page metadata. If you have your own
* WebApplication subclass, and can't subclass this class, you just need to do
* the three things that this class does, i.e. register the
- * WebBeansComponentInstantiationListener, and override the two methods below to
+ * WeldComponentInstantiationListener, and override the two methods below to
* return the RequestCycle and IRequestCycleProcessor subclasses specific to
- * WebBeans, or your subclasses of those classes.
+ * Weld, or your subclasses of those classes.
*
* @author cpopetz
*
@@ -64,7 +64,7 @@
/**
* Add our component instantiation listener
*
- * @see WebBeansComponentInstantiationListener
+ * @see WeldComponentInstantiationListener
*/
protected void internalInit()
{
@@ -74,7 +74,7 @@
/**
- * Override to return our WebBeans-specific request cycle processor
+ * Override to return our Weld-specific request cycle processor
*
* @see WeldWebRequestCycleProcessor
*/
@@ -85,7 +85,7 @@
}
/**
- * Override to return our WebBeans-specific request cycle
+ * Override to return our Weld-specific request cycle
*
* @see WeldRequestCycle
*/
Modified: extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldMetaData.java
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldMetaData.java 2009-10-08 14:22:10 UTC (rev 3903)
+++ extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldMetaData.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -3,7 +3,7 @@
import org.apache.wicket.MetaDataKey;
/**
- * Public storage for the metadata key used by the WebBeans integration to store
+ * Public storage for the metadata key used by the Weld integration to store
* conversation ids in wicket page metadata.
*
* @author cpopetz
Modified: extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldRequestCycle.java
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldRequestCycle.java 2009-10-08 14:22:10 UTC (rev 3903)
+++ extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldRequestCycle.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -25,7 +25,7 @@
import org.jboss.weld.servlet.ConversationBeanStore;
/**
- * WebBeansRequestCycle is a subclass of the standard wicket WebRequestCycle
+ * WeldRequestCycle is a subclass of the standard wicket WebRequestCycle
* which:
* <ul>
* <li>restores long-running conversations specified in wicket page metadata
Modified: extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldWebRequestCycleProcessor.java
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldWebRequestCycleProcessor.java 2009-10-08 14:22:10 UTC (rev 3903)
+++ extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldWebRequestCycleProcessor.java 2009-10-08 14:58:57 UTC (rev 3904)
@@ -12,7 +12,7 @@
import org.jboss.weld.conversation.ConversationManager;
/**
- * WebBeansWebRequestCycleProcessor is a subclass of the standard wicket
+ * WeldWebRequestCycleProcessor is a subclass of the standard wicket
* WebRequestCycleProcessor which saves the conversation id of any long-running
* cornversation in wicket page metadata. It also cleans up the conversation
* context.
15 years, 1 month
Weld SVN: r3903 - in extensions/trunk/xsd/src/main/java/org/jboss: webbeans/xsd and 8 other directories.
by weld-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-10-08 10:22:10 -0400 (Thu, 08 Oct 2009)
New Revision: 3903
Added:
extensions/trunk/xsd/src/main/java/org/jboss/weld/
extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/
extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/NamespaceHandler.java
extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/PackageSchemaGenerator.java
extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/Schema.java
extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/model/
extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/sample-schema.xsd
extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/test/
extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/test/Bar.java
extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/test/Foo.java
extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/test/Test.java
extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/test/test/
extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/test/test/Foo.java
extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/test/test/test/
Removed:
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/NamespaceHandler.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/Schema.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/sample-schema.xsd
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/Bar.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/Foo.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/Test.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/test/Foo.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/test/test/
Modified:
extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/model/ClassModel.java
extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/model/ConstructorModel.java
extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/model/FieldModel.java
extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/model/MethodModel.java
extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/model/NamedModel.java
extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/model/TypedModel.java
extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/test/test/test/Foo.java
Log:
refactor package naming, fix compiler errors
Deleted: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/NamespaceHandler.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/NamespaceHandler.java 2009-10-08 13:44:49 UTC (rev 3902)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/NamespaceHandler.java 2009-10-08 14:22:10 UTC (rev 3903)
@@ -1,222 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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.webbeans.xsd;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.stream.events.Namespace;
-
-/**
- * Helper for generating and keeping track of namespaces in a schema
- *
- * @author Nicklas Karlsson
- *
- */
-public class NamespaceHandler
-{
- // The packages that belong to urn:java:ee
- private static final Set<String> URN_JAVA_EE = new HashSet<String>(Arrays.asList("java.lang", "java.util", "javax.annotation", "javax.inject", "javax.context", "javax.interceptor", "javax.decorator", "javax.event", "javax.ejb", "javax.persistence", "javax.xml.ws", "javax.jms", "javax.sql"));
-
- // The package of the schema
- private String localPackage;
- // The namespaces currently in use mapped by package name
- private Map<String, Namespace> namespaces = new HashMap<String, Namespace>();
-
- /**
- * Creates a new namespace handler
- *
- * @param localPackage The local package
- */
- public NamespaceHandler(String localPackage)
- {
- this.localPackage = localPackage;
- addNamespace(new Namespace("", localPackage));
- }
-
- /**
- * Gets the used namespaces
- *
- * @return The namespaces
- */
- public Collection<Namespace> getNamespaces()
- {
- return namespaces.values();
- }
-
- /**
- * Gets the prefix for a package
- *
- * @param packageName The package name
- * @return The prefix
- */
- public String getPrefix(String packageName)
- {
- String shortName = getPackageName(packageName);
- if (namespaces.containsKey(shortName))
- {
- return namespaces.get(shortName).getPrefix();
- }
- else
- {
- throw new IllegalArgumentException("Package name " + packageName + " is not known to namespace handler of package " + localPackage);
- }
- }
-
- /**
- * Gets the last part of a package name
- *
- * @param packageName The package name
- * @return The part after the last dot
- */
- private String getPackageLastPart(String packageName)
- {
- int lastDot = packageName.lastIndexOf(".");
- return lastDot < 0 ? packageName : packageName.substring(lastDot + 1);
- }
-
- /**
- * Gets the package name of a FQCN
- *
- * @param FQCN The FQCN
- * @return The package part
- */
- private String getPackageName(String FQCN)
- {
- int lastDot = FQCN.lastIndexOf(".");
- return lastDot < 0 ? "nopak" : FQCN.substring(0, lastDot);
- }
-
- /**
- * Adds a package to the namespace handler
- *
- * @param packageName The package
- */
- public void addPackage(String packageName)
- {
- // Already handled, exit early
- if (namespaces.containsKey(packageName))
- {
- return;
- }
- String prefix = null;
- String URI = "java:urn:" + packageName;
- // The local package, prefix is blank and uri is package name
- if (localPackage.equals(packageName))
- {
- prefix = "";
- }
- // EE stuff, prefix is ee and urn is ee
- else if (URN_JAVA_EE.contains(packageName))
- {
- prefix = "ee";
- URI = "java:urn:ee";
- }
- // Another package, get available prefix
- else
- {
- prefix = getAvailablePrefix(packageName);
- }
- namespaces.put(packageName, new Namespace(prefix, URI));
- }
-
- /**
- * Gets an available namespace prefix for a package name
- *
- * @param packageName The package name to search prefix for
- * @return An available prefix
- */
- private String getAvailablePrefix(String packageName)
- {
- int suffix = 1;
- boolean found = false;
- /**
- * If we search for a prefix for com.acme.foo, we iterate over the namespaces and see
- * if "foo" is present, if so, we try with foo2 etc until it found to be available
- */
- while (true)
- {
- String prefix = getPackageLastPart(packageName) + (suffix == 1 ? "" : String.valueOf(suffix));
- for (Namespace namespace : namespaces.values())
- {
- if (namespace.getPrefix().equals(prefix))
- {
- found = true;
- break;
- }
- }
- if (!found)
- {
- return prefix;
- }
- else
- {
- suffix++;
- found = false;
- }
- }
- }
-
- /**
- * Adds a namespace to the map of known namespaces
- *
- * @param namespace The namespace to add
- */
- public void addNamespace(Namespace namespace)
- {
- namespaces.put(getNamespacePackage(namespace), namespace);
- }
-
- /**
- * Gets the package from a namespace
- *
- * @param namespace The namespace to examine
- * @return The package name
- */
- private String getNamespacePackage(Namespace namespace)
- {
- int urnJava = namespace.getURI().indexOf("urn:java:");
- if (urnJava >= 0)
- {
- return namespace.getURI().substring(urnJava);
- }
- else
- {
- return namespace.getURI();
- }
- }
-
- @Override
- public String toString()
- {
- return namespaces.toString();
- }
-
- public static void main(String[] x) {
- NamespaceHandler nh = new NamespaceHandler("foo");
- nh.addPackage("org.jboss.webbeans.xsd.test.test.test");
- nh.addPackage("org.jboss.webbeans.xsd.test.test.test");
- nh.addPackage("org.jboss.webbeans.xsd.test.test");
- nh.addPackage("org.jboss.webbeans.xsd.test.test");
- }
-
-}
Deleted: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java 2009-10-08 13:44:49 UTC (rev 3902)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java 2009-10-08 14:22:10 UTC (rev 3903)
@@ -1,173 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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.webbeans.xsd;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import javax.annotation.processing.AbstractProcessor;
-import javax.annotation.processing.ProcessingEnvironment;
-import javax.annotation.processing.RoundEnvironment;
-import javax.annotation.processing.SupportedAnnotationTypes;
-import javax.annotation.processing.SupportedSourceVersion;
-import javax.lang.model.SourceVersion;
-import javax.lang.model.element.Element;
-import javax.lang.model.element.ElementKind;
-import javax.lang.model.element.ExecutableElement;
-import javax.lang.model.element.Modifier;
-import javax.lang.model.element.TypeElement;
-import javax.lang.model.type.DeclaredType;
-import javax.lang.model.type.TypeKind;
-import javax.lang.model.util.ElementFilter;
-
-import org.jboss.webbeans.xsd.model.ClassModel;
-import org.jboss.webbeans.xsd.model.ConstructorModel;
-import org.jboss.webbeans.xsd.model.FieldModel;
-import org.jboss.webbeans.xsd.model.MethodModel;
-
-/**
- * An annotation processor that updates the package-level XSD for the packages
- * that have had their files compiled.
- *
- * @author Nicklas Karlsson
- *
- */
-(a)SupportedSourceVersion(SourceVersion.RELEASE_6)
-@SupportedAnnotationTypes("*")
-public class PackageSchemaGenerator extends AbstractProcessor
-{
- private static LogProvider log = Logging.getLogProvider(PackageSchemaGenerator.class);
-
- private Map<String, ClassModel> classModelCache;
- private Map<String, Schema> schemas;
-
- @Override
- public synchronized void init(ProcessingEnvironment processingEnvironment)
- {
- super.init(processingEnvironment);
- classModelCache = new HashMap<String, ClassModel>();
- schemas = new HashMap<String, Schema>();
- }
-
- @Override
- public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnvironment)
- {
- for (Element element : roundEnvironment.getRootElements())
- {
- if (ElementKind.CLASS.equals(element.getKind()) || ElementKind.ANNOTATION_TYPE.equals(element.getKind()))
- {
- ClassModel classModel = inspectClass(element);
- try
- {
- addClassToSchema(classModel);
- }
- catch (DocumentException e)
- {
- log.error("Could not read or create schema for package " + classModel.getPackage());
- }
- }
- }
- if (!roundEnvironment.processingOver())
- {
- for (Schema schema : schemas.values())
- {
- try
- {
- schema.rebuild().write(processingEnv.getFiler());
- }
- catch (IOException e)
- {
- log.error("Could not write schema.xsd for " + schema, e);
- }
- }
- }
- return true;
- }
-
- private void addClassToSchema(ClassModel classModel) throws DocumentException
- {
- String packageName = classModel.getPackage();
- Schema schema = schemas.get(packageName);
- if (schema == null)
- {
- schema = Schema.of(packageName, classModel.getPackageElement(), processingEnv.getFiler());
- schemas.put(packageName, schema);
- }
- schema.addClass(classModel);
- }
-
- private boolean isPublic(Element element)
- {
- return element.getModifiers().contains(Modifier.PUBLIC);
- }
-
- /**
- * Creates a class model from a class element
- *
- * @param element The element to analyze
- * @return The class model
- */
- private ClassModel inspectClass(Element element)
- {
- TypeElement typeElement = (TypeElement) element;
- ClassModel classModel = ClassModel.of(typeElement, processingEnv.getElementUtils().getPackageOf(typeElement));
-
- // If the class has superclass's, scan them recursively
- if (typeElement.getSuperclass().getKind() != TypeKind.NONE)
- {
- inspectClass(((DeclaredType) typeElement.getSuperclass()).asElement());
- }
-
- // Gets the parent from the cache. We know it's there since we has scanned
- // the hierarchy already
- classModel.setParent(classModelCache.get(typeElement.getSuperclass().toString()));
- // Filter out the fields and populate the model
- for (Element field : ElementFilter.fieldsIn(element.getEnclosedElements()))
- {
- if (!isPublic(field))
- {
- continue;
- }
- classModel.addField(FieldModel.of(field));
- }
- // Filter out the methods and populate the model
- for (ExecutableElement method : ElementFilter.methodsIn(element.getEnclosedElements()))
- {
- if (!isPublic(method))
- {
- continue;
- }
- classModel.addMethod(MethodModel.of(method));
- }
- // Filter out the constructors and populate the model
- for (ExecutableElement constructor : ElementFilter.constructorsIn(element.getEnclosedElements()))
- {
- if (!isPublic(constructor))
- {
- continue;
- }
- classModel.addConstructor(ConstructorModel.of(constructor));
- }
- // Place the new class model in the cache
- classModelCache.put(classModel.getName(), classModel);
- return classModel;
- }
-
-}
Deleted: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/Schema.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/Schema.java 2009-10-08 13:44:49 UTC (rev 3902)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/Schema.java 2009-10-08 14:22:10 UTC (rev 3903)
@@ -1,286 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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.webbeans.xsd;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.annotation.processing.Filer;
-import javax.lang.model.element.PackageElement;
-import javax.lang.model.element.TypeElement;
-import javax.tools.StandardLocation;
-import javax.xml.stream.events.Namespace;
-
-import org.jboss.webbeans.xsd.model.ClassModel;
-import org.jboss.webbeans.xsd.model.TypedModel;
-
-import com.sun.org.apache.xml.internal.serialize.OutputFormat;
-
-/**
- * A schema representation
- *
- * @author Nicklas Karlsson
- *
- */
-public class Schema
-{
- // The default namespace of the schema
- public static final List<Namespace> defaultNamespaces = new ArrayList<Namespace>();
-
- static
- {
- defaultNamespaces.add(new Namespace("wb", "http://seamframework.org/WebBeans"));
- defaultNamespaces.add(new Namespace("xsi", "http://www.w3.org/2001/XMLSchema-instance"));
- };
-
- // The name of the package
- private String packageName;
- // The XSD document
- private Document document;
- // The namespace handler
- private NamespaceHandler namespaceHandler;
- // The set of classes to update
- private Set<ClassModel> classModels;
- private PackageElement packageElement;
-
- /**
- * Creates a new package
- *
- * @param packageName The name of the package
- * @throws DocumentException
- */
- public Schema(String packageName, PackageElement packageElement, Filer filer) throws DocumentException
- {
- this.packageName = packageName;
- this.packageElement = packageElement;
- classModels = new HashSet<ClassModel>();
- namespaceHandler = new NamespaceHandler(packageName);
- try
- {
- document = readDocument(filer);
- } catch (IOException e) {
- // schema not found, safe to proceed
- }
- if (document == null)
- {
- document = createDocument();
- }
- init();
- }
-
- /**
- * Creates a new schema document
- *
- * @return The document
- */
- private Document createDocument()
- {
- Document document = DocumentHelper.createDocument();
- QName rootQName = DocumentFactory.getInstance().createQName("schema", "xs", "http://www.w3.org/2001/XMLSchema");
- Element rootElement = DocumentFactory.getInstance().createElement(rootQName);
- rootElement.addAttribute("elementFormDefault", "qualified");
- rootElement.addAttribute("targetNamespace", "urn:java:" + packageName);
- rootElement.addAttribute("elementFormDefault", "qualified");
- rootElement.addAttribute("xsi:schemaLocation", "http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd");
- document.setRootElement(rootElement);
- for (Namespace namespace : defaultNamespaces)
- {
- rootElement.add(namespace);
- }
- return document;
- }
-
- /**
- * Static factory method
- *
- * @param packageName The package name
- * @param packageElement The package content representation
- * @param filer The filer for resources
- *
- * @return A new schema instance
- *
- * @throws DocumentException If an existing schema could not be parsed
- */
- public static Schema of(String packageName, PackageElement packageElement, Filer filer) throws DocumentException
- {
- return new Schema(packageName, packageElement, filer);
- }
-
- /**
- * Reads a schema document
- *
- * @param filer The filer to be used for resource reading
- *
- * @return The schema documetn
- *
- * @throws IOException If the file could not be find or there was an error reading it
- * @throws DocumentException If the read document could not be parsed
- */
- private Document readDocument(Filer filer) throws IOException, DocumentException
- {
- InputStream in = filer.getResource(StandardLocation.CLASS_OUTPUT, packageName, "schema.xsd").openInputStream();
- return new SAXReader().read(in);
- }
-
- /**
- * Writes a schema back to disk
- *
- * @param filer The filer to be used for resource writing
- *
- * @throws IOException If the file could not be written
- */
- public void write(Filer filer) throws IOException
- {
- OutputFormat format = OutputFormat.createPrettyPrint();
- OutputStream out = filer.createResource(StandardLocation.CLASS_OUTPUT, packageName, "schema.xsd").openOutputStream();
- XMLWriter writer = new XMLWriter(out, format);
- writer.write(document);
- writer.flush();
- writer.close();
- }
-
- /**
- * Adds a class model to the working set and adds the referenced types to the
- * namespace handler
- *
- * @param classModel The class model
- */
- public void addClass(ClassModel classModel)
- {
- classModels.add(classModel);
- for (TypedModel reference : classModel.getTypeReferences())
- {
- namespaceHandler.addPackage(reference.getTypePackage());
- }
- }
-
- /**
- * Cleans out namespaces and XSD for files that are no longer present in the
- * package
- */
- private void init()
- {
- // Removes elements that are no longer in the package
- for (Object xsdClass : document.selectNodes("/xs:schema/xs:element"))
- {
- String FQN = packageName + "." + ((Element) xsdClass).attributeValue("name");
- if (!isClassInPackage(FQN))
- {
- ((Element) xsdClass).detach();
- }
- }
-
- // Collect namespaces that are references in the document
- Set<Namespace> referencedNamespaces = new HashSet<Namespace>(defaultNamespaces);
- for (Object attribute : document.getRootElement().selectNodes("//@type"))
- {
- String ref = ((Attribute) attribute).getValue();
- int colon = ref.indexOf(":");
- String prefix = colon < 0 ? "" : ref.substring(0, colon);
- referencedNamespaces.add(document.getRootElement().getNamespaceForPrefix(prefix));
- }
-
- // Register the namespaces with the namespace handler if they are present, otherwise
- // remove them from the document
- for (Object item : document.getRootElement().additionalNamespaces())
- {
- Namespace namespace = (Namespace) item;
- if (referencedNamespaces.contains(namespace))
- {
- namespaceHandler.addNamespace(namespace);
- }
- else
- {
- document.getRootElement().remove(namespace);
- }
- }
- }
-
- /**
- * Checks if a class is still in the package
- *
- * @param packageElement The package abstraction
- * @param FQN The full name of the class
- * @return True if present, false otherwise
- */
- private boolean isClassInPackage(String FQN)
- {
- for (javax.lang.model.element.Element classElement : packageElement.getEnclosedElements())
- {
- TypeElement typeElement = (TypeElement) classElement;
- if (typeElement.getQualifiedName().toString().equals(FQN))
- {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Rebuilds the schema document
- *
- * @param packageElement The package abstraction
- * @return the schema for fluent interface
- */
- public Schema rebuild()
- {
- // Adds new namespaces if they are not already present
- for (Namespace namespace : namespaceHandler.getNamespaces())
- {
- if (document.getRootElement().getNamespaceForPrefix(namespace.getPrefix()) == null)
- {
- document.getRootElement().add(namespace);
- }
- }
-
- // Remove old version of class xsd (if present) and add the fresh version
- for (ClassModel classModel : classModels)
- {
- for (Object previousClass : document.selectNodes("/xs:schema/xs:element[@name=\"" + classModel.getSimpleName() + "\"]"))
- {
- ((Element) previousClass).detach();
- }
- document.getRootElement().add(classModel.toXSD(namespaceHandler));
- }
- return this;
- }
-
- @Override
- public String toString()
- {
- StringBuilder buffer = new StringBuilder();
- buffer.append("Package: " + packageName + "\n");
- buffer.append("Used namespaces\n");
- for (Namespace namespace : namespaceHandler.getNamespaces())
- {
- buffer.append(" " + namespace + "\n");
- }
- buffer.append("Contained classes:\n");
- for (ClassModel classModel : classModels)
- {
- buffer.append(classModel + "\n");
- }
- return buffer.toString();
- }
-
-}
Deleted: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/sample-schema.xsd
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/sample-schema.xsd 2009-10-08 13:44:49 UTC (rev 3902)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/sample-schema.xsd 2009-10-08 14:22:10 UTC (rev 3903)
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- targetNamespace="urn:java:com.acme.foo"
- xmlns:foo="urn:java:com.acme.foo"
- xmlns:ee="urn:java:ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd"
- >
-
- <xs:element name="Foo">
- <xs:complexType>
- <xs:choice>
- <!-- Options to allow people to declare this class a binding type or stereotype - TODO only if an annotation -->
- <xs:element ref="ee:BindingType"/>
- <xs:element ref="ee:StereotypType"/>
- <!-- Somehow import all binding types known etc. to give people that option -->
- <xs:any /> <!-- Can't guess all types people want to put here -->
- </xs:choice>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="Bar">
-
- </xs:element>
-
-
-</xs:schema>
\ No newline at end of file
Deleted: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/Bar.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/Bar.java 2009-10-08 13:44:49 UTC (rev 3902)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/Bar.java 2009-10-08 14:22:10 UTC (rev 3903)
@@ -1,9 +0,0 @@
-package org.jboss.webbeans.xsd.test;
-
-public class Bar
-{
- public org.jboss.webbeans.xsd.test.test.Foo pong(org.jboss.webbeans.xsd.test.test.test.Foo foo)
- {
- return null;
- }
-}
Deleted: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/Foo.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/Foo.java 2009-10-08 13:44:49 UTC (rev 3902)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/Foo.java 2009-10-08 14:22:10 UTC (rev 3903)
@@ -1,16 +0,0 @@
-package org.jboss.webbeans.xsd.test;
-
-
-public class Foo extends Bar
-{
- public String foo;
- public int poo;
- public Bar bar;
- public org.jboss.webbeans.xsd.test.test.Foo foo2;
- public org.jboss.webbeans.xsd.test.test.test.Foo foo3;
-
- public void testy(org.jboss.webbeans.xsd.test.test.Foo a, org.jboss.webbeans.xsd.test.test.test.Foo b) {
-
- }
-
-}
Deleted: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/Test.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/Test.java 2009-10-08 13:44:49 UTC (rev 3902)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/Test.java 2009-10-08 14:22:10 UTC (rev 3903)
@@ -1,30 +0,0 @@
-package org.jboss.webbeans.xsd.test;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.annotation.processing.AbstractProcessor;
-import javax.tools.JavaCompiler;
-import javax.tools.JavaFileObject;
-import javax.tools.StandardJavaFileManager;
-import javax.tools.ToolProvider;
-import javax.tools.JavaCompiler.CompilationTask;
-
-import org.jboss.webbeans.xsd.PackageSchemaGenerator;
-
-public class Test
-{
-
- public static void main(String[] args)
- {
- JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
- StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null);
- Iterable<? extends JavaFileObject> compilationUnits = fileManager.getJavaFileObjects(args);
- CompilationTask task = compiler.getTask(null, fileManager, null, null, null, compilationUnits);
- List<AbstractProcessor> processors = new ArrayList<AbstractProcessor>();
- processors.add(new PackageSchemaGenerator());
- task.setProcessors(processors);
- task.call();
- }
-
-}
Deleted: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/test/Foo.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/test/Foo.java 2009-10-08 13:44:49 UTC (rev 3902)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/test/Foo.java 2009-10-08 14:22:10 UTC (rev 3903)
@@ -1,6 +0,0 @@
-package org.jboss.webbeans.xsd.test.test;
-
-public class Foo
-{
-
-}
Copied: extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/NamespaceHandler.java (from rev 3901, extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/NamespaceHandler.java)
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/NamespaceHandler.java (rev 0)
+++ extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/NamespaceHandler.java 2009-10-08 14:22:10 UTC (rev 3903)
@@ -0,0 +1,222 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.weld.xsd;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.dom4j.Namespace;
+
+/**
+ * Helper for generating and keeping track of namespaces in a schema
+ *
+ * @author Nicklas Karlsson
+ *
+ */
+public class NamespaceHandler
+{
+ // The packages that belong to urn:java:ee
+ private static final Set<String> URN_JAVA_EE = new HashSet<String>(Arrays.asList("java.lang", "java.util", "javax.annotation", "javax.inject", "javax.context", "javax.interceptor", "javax.decorator", "javax.event", "javax.ejb", "javax.persistence", "javax.xml.ws", "javax.jms", "javax.sql"));
+
+ // The package of the schema
+ private String localPackage;
+ // The namespaces currently in use mapped by package name
+ private Map<String, Namespace> namespaces = new HashMap<String, Namespace>();
+
+ /**
+ * Creates a new namespace handler
+ *
+ * @param localPackage The local package
+ */
+ public NamespaceHandler(String localPackage)
+ {
+ this.localPackage = localPackage;
+ addNamespace(new Namespace("", localPackage));
+ }
+
+ /**
+ * Gets the used namespaces
+ *
+ * @return The namespaces
+ */
+ public Collection<Namespace> getNamespaces()
+ {
+ return namespaces.values();
+ }
+
+ /**
+ * Gets the prefix for a package
+ *
+ * @param packageName The package name
+ * @return The prefix
+ */
+ public String getPrefix(String packageName)
+ {
+ String shortName = getPackageName(packageName);
+ if (namespaces.containsKey(shortName))
+ {
+ return namespaces.get(shortName).getPrefix();
+ }
+ else
+ {
+ throw new IllegalArgumentException("Package name " + packageName + " is not known to namespace handler of package " + localPackage);
+ }
+ }
+
+ /**
+ * Gets the last part of a package name
+ *
+ * @param packageName The package name
+ * @return The part after the last dot
+ */
+ private String getPackageLastPart(String packageName)
+ {
+ int lastDot = packageName.lastIndexOf(".");
+ return lastDot < 0 ? packageName : packageName.substring(lastDot + 1);
+ }
+
+ /**
+ * Gets the package name of a FQCN
+ *
+ * @param FQCN The FQCN
+ * @return The package part
+ */
+ private String getPackageName(String FQCN)
+ {
+ int lastDot = FQCN.lastIndexOf(".");
+ return lastDot < 0 ? "nopak" : FQCN.substring(0, lastDot);
+ }
+
+ /**
+ * Adds a package to the namespace handler
+ *
+ * @param packageName The package
+ */
+ public void addPackage(String packageName)
+ {
+ // Already handled, exit early
+ if (namespaces.containsKey(packageName))
+ {
+ return;
+ }
+ String prefix = null;
+ String URI = "java:urn:" + packageName;
+ // The local package, prefix is blank and uri is package name
+ if (localPackage.equals(packageName))
+ {
+ prefix = "";
+ }
+ // EE stuff, prefix is ee and urn is ee
+ else if (URN_JAVA_EE.contains(packageName))
+ {
+ prefix = "ee";
+ URI = "java:urn:ee";
+ }
+ // Another package, get available prefix
+ else
+ {
+ prefix = getAvailablePrefix(packageName);
+ }
+ namespaces.put(packageName, new Namespace(prefix, URI));
+ }
+
+ /**
+ * Gets an available namespace prefix for a package name
+ *
+ * @param packageName The package name to search prefix for
+ * @return An available prefix
+ */
+ private String getAvailablePrefix(String packageName)
+ {
+ int suffix = 1;
+ boolean found = false;
+ /**
+ * If we search for a prefix for com.acme.foo, we iterate over the namespaces and see
+ * if "foo" is present, if so, we try with foo2 etc until it found to be available
+ */
+ while (true)
+ {
+ String prefix = getPackageLastPart(packageName) + (suffix == 1 ? "" : String.valueOf(suffix));
+ for (Namespace namespace : namespaces.values())
+ {
+ if (namespace.getPrefix().equals(prefix))
+ {
+ found = true;
+ break;
+ }
+ }
+ if (!found)
+ {
+ return prefix;
+ }
+ else
+ {
+ suffix++;
+ found = false;
+ }
+ }
+ }
+
+ /**
+ * Adds a namespace to the map of known namespaces
+ *
+ * @param namespace The namespace to add
+ */
+ public void addNamespace(Namespace namespace)
+ {
+ namespaces.put(getNamespacePackage(namespace), namespace);
+ }
+
+ /**
+ * Gets the package from a namespace
+ *
+ * @param namespace The namespace to examine
+ * @return The package name
+ */
+ private String getNamespacePackage(Namespace namespace)
+ {
+ int urnJava = namespace.getURI().indexOf("urn:java:");
+ if (urnJava >= 0)
+ {
+ return namespace.getURI().substring(urnJava);
+ }
+ else
+ {
+ return namespace.getURI();
+ }
+ }
+
+ @Override
+ public String toString()
+ {
+ return namespaces.toString();
+ }
+
+ public static void main(String[] x) {
+ NamespaceHandler nh = new NamespaceHandler("foo");
+ nh.addPackage("org.jboss.webbeans.xsd.test.test.test");
+ nh.addPackage("org.jboss.webbeans.xsd.test.test.test");
+ nh.addPackage("org.jboss.webbeans.xsd.test.test");
+ nh.addPackage("org.jboss.webbeans.xsd.test.test");
+ }
+
+}
Copied: extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/PackageSchemaGenerator.java (from rev 3901, extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java)
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/PackageSchemaGenerator.java (rev 0)
+++ extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/PackageSchemaGenerator.java 2009-10-08 14:22:10 UTC (rev 3903)
@@ -0,0 +1,176 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.weld.xsd;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import javax.annotation.processing.AbstractProcessor;
+import javax.annotation.processing.ProcessingEnvironment;
+import javax.annotation.processing.RoundEnvironment;
+import javax.annotation.processing.SupportedAnnotationTypes;
+import javax.annotation.processing.SupportedSourceVersion;
+import javax.lang.model.SourceVersion;
+import javax.lang.model.element.Element;
+import javax.lang.model.element.ElementKind;
+import javax.lang.model.element.ExecutableElement;
+import javax.lang.model.element.Modifier;
+import javax.lang.model.element.TypeElement;
+import javax.lang.model.type.DeclaredType;
+import javax.lang.model.type.TypeKind;
+import javax.lang.model.util.ElementFilter;
+
+import org.dom4j.DocumentException;
+import org.jboss.weld.log.LogProvider;
+import org.jboss.weld.log.Logging;
+import org.jboss.weld.xsd.model.ClassModel;
+import org.jboss.weld.xsd.model.ConstructorModel;
+import org.jboss.weld.xsd.model.FieldModel;
+import org.jboss.weld.xsd.model.MethodModel;
+
+/**
+ * An annotation processor that updates the package-level XSD for the packages
+ * that have had their files compiled.
+ *
+ * @author Nicklas Karlsson
+ *
+ */
+(a)SupportedSourceVersion(SourceVersion.RELEASE_6)
+@SupportedAnnotationTypes("*")
+public class PackageSchemaGenerator extends AbstractProcessor
+{
+ private static LogProvider log = Logging.getLogProvider(PackageSchemaGenerator.class);
+
+ private Map<String, ClassModel> classModelCache;
+ private Map<String, Schema> schemas;
+
+ @Override
+ public synchronized void init(ProcessingEnvironment processingEnvironment)
+ {
+ super.init(processingEnvironment);
+ classModelCache = new HashMap<String, ClassModel>();
+ schemas = new HashMap<String, Schema>();
+ }
+
+ @Override
+ public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnvironment)
+ {
+ for (Element element : roundEnvironment.getRootElements())
+ {
+ if (ElementKind.CLASS.equals(element.getKind()) || ElementKind.ANNOTATION_TYPE.equals(element.getKind()))
+ {
+ ClassModel classModel = inspectClass(element);
+ try
+ {
+ addClassToSchema(classModel);
+ }
+ catch (DocumentException e)
+ {
+ log.error("Could not read or create schema for package " + classModel.getPackage());
+ }
+ }
+ }
+ if (!roundEnvironment.processingOver())
+ {
+ for (Schema schema : schemas.values())
+ {
+ try
+ {
+ schema.rebuild().write(processingEnv.getFiler());
+ }
+ catch (IOException e)
+ {
+ log.error("Could not write schema.xsd for " + schema, e);
+ }
+ }
+ }
+ return true;
+ }
+
+ private void addClassToSchema(ClassModel classModel) throws DocumentException
+ {
+ String packageName = classModel.getPackage();
+ Schema schema = schemas.get(packageName);
+ if (schema == null)
+ {
+ schema = Schema.of(packageName, classModel.getPackageElement(), processingEnv.getFiler());
+ schemas.put(packageName, schema);
+ }
+ schema.addClass(classModel);
+ }
+
+ private boolean isPublic(Element element)
+ {
+ return element.getModifiers().contains(Modifier.PUBLIC);
+ }
+
+ /**
+ * Creates a class model from a class element
+ *
+ * @param element The element to analyze
+ * @return The class model
+ */
+ private ClassModel inspectClass(Element element)
+ {
+ TypeElement typeElement = (TypeElement) element;
+ ClassModel classModel = ClassModel.of(typeElement, processingEnv.getElementUtils().getPackageOf(typeElement));
+
+ // If the class has superclass's, scan them recursively
+ if (typeElement.getSuperclass().getKind() != TypeKind.NONE)
+ {
+ inspectClass(((DeclaredType) typeElement.getSuperclass()).asElement());
+ }
+
+ // Gets the parent from the cache. We know it's there since we has scanned
+ // the hierarchy already
+ classModel.setParent(classModelCache.get(typeElement.getSuperclass().toString()));
+ // Filter out the fields and populate the model
+ for (Element field : ElementFilter.fieldsIn(element.getEnclosedElements()))
+ {
+ if (!isPublic(field))
+ {
+ continue;
+ }
+ classModel.addField(FieldModel.of(field));
+ }
+ // Filter out the methods and populate the model
+ for (ExecutableElement method : ElementFilter.methodsIn(element.getEnclosedElements()))
+ {
+ if (!isPublic(method))
+ {
+ continue;
+ }
+ classModel.addMethod(MethodModel.of(method));
+ }
+ // Filter out the constructors and populate the model
+ for (ExecutableElement constructor : ElementFilter.constructorsIn(element.getEnclosedElements()))
+ {
+ if (!isPublic(constructor))
+ {
+ continue;
+ }
+ classModel.addConstructor(ConstructorModel.of(constructor));
+ }
+ // Place the new class model in the cache
+ classModelCache.put(classModel.getName(), classModel);
+ return classModel;
+ }
+
+}
Copied: extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/Schema.java (from rev 3901, extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/Schema.java)
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/Schema.java (rev 0)
+++ extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/Schema.java 2009-10-08 14:22:10 UTC (rev 3903)
@@ -0,0 +1,294 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.weld.xsd;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.annotation.processing.Filer;
+import javax.lang.model.element.PackageElement;
+import javax.lang.model.element.TypeElement;
+import javax.tools.StandardLocation;
+
+import org.dom4j.Attribute;
+import org.dom4j.Document;
+import org.dom4j.DocumentException;
+import org.dom4j.DocumentFactory;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+import org.dom4j.Namespace;
+import org.dom4j.QName;
+import org.dom4j.io.OutputFormat;
+import org.dom4j.io.SAXReader;
+import org.dom4j.io.XMLWriter;
+import org.jboss.weld.xsd.model.ClassModel;
+import org.jboss.weld.xsd.model.TypedModel;
+
+/**
+ * A schema representation
+ *
+ * @author Nicklas Karlsson
+ *
+ */
+public class Schema
+{
+ // The default namespace of the schema
+ public static final List<Namespace> defaultNamespaces = new ArrayList<Namespace>();
+
+ static
+ {
+ defaultNamespaces.add(new Namespace("wb", "http://seamframework.org/WebBeans"));
+ defaultNamespaces.add(new Namespace("xsi", "http://www.w3.org/2001/XMLSchema-instance"));
+ };
+
+ // The name of the package
+ private String packageName;
+ // The XSD document
+ private Document document;
+ // The namespace handler
+ private NamespaceHandler namespaceHandler;
+ // The set of classes to update
+ private Set<ClassModel> classModels;
+ private PackageElement packageElement;
+
+ /**
+ * Creates a new package
+ *
+ * @param packageName The name of the package
+ * @throws DocumentException
+ */
+ public Schema(String packageName, PackageElement packageElement, Filer filer) throws DocumentException
+ {
+ this.packageName = packageName;
+ this.packageElement = packageElement;
+ classModels = new HashSet<ClassModel>();
+ namespaceHandler = new NamespaceHandler(packageName);
+ try
+ {
+ document = readDocument(filer);
+ } catch (IOException e) {
+ // schema not found, safe to proceed
+ }
+ if (document == null)
+ {
+ document = createDocument();
+ }
+ init();
+ }
+
+ /**
+ * Creates a new schema document
+ *
+ * @return The document
+ */
+ private Document createDocument()
+ {
+ Document document = DocumentHelper.createDocument();
+ QName rootQName = DocumentFactory.getInstance().createQName("schema", "xs", "http://www.w3.org/2001/XMLSchema");
+ Element rootElement = DocumentFactory.getInstance().createElement(rootQName);
+ rootElement.addAttribute("elementFormDefault", "qualified");
+ rootElement.addAttribute("targetNamespace", "urn:java:" + packageName);
+ rootElement.addAttribute("elementFormDefault", "qualified");
+ rootElement.addAttribute("xsi:schemaLocation", "http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd");
+ document.setRootElement(rootElement);
+ for (Namespace namespace : defaultNamespaces)
+ {
+ rootElement.add(namespace);
+ }
+ return document;
+ }
+
+ /**
+ * Static factory method
+ *
+ * @param packageName The package name
+ * @param packageElement The package content representation
+ * @param filer The filer for resources
+ *
+ * @return A new schema instance
+ *
+ * @throws DocumentException If an existing schema could not be parsed
+ */
+ public static Schema of(String packageName, PackageElement packageElement, Filer filer) throws DocumentException
+ {
+ return new Schema(packageName, packageElement, filer);
+ }
+
+ /**
+ * Reads a schema document
+ *
+ * @param filer The filer to be used for resource reading
+ *
+ * @return The schema documetn
+ *
+ * @throws IOException If the file could not be find or there was an error reading it
+ * @throws DocumentException If the read document could not be parsed
+ */
+ private Document readDocument(Filer filer) throws IOException, DocumentException
+ {
+ InputStream in = filer.getResource(StandardLocation.CLASS_OUTPUT, packageName, "schema.xsd").openInputStream();
+ return new SAXReader().read(in);
+ }
+
+ /**
+ * Writes a schema back to disk
+ *
+ * @param filer The filer to be used for resource writing
+ *
+ * @throws IOException If the file could not be written
+ */
+ public void write(Filer filer) throws IOException
+ {
+ OutputFormat format = OutputFormat.createPrettyPrint();
+ OutputStream out = filer.createResource(StandardLocation.CLASS_OUTPUT, packageName, "schema.xsd").openOutputStream();
+ XMLWriter writer = new XMLWriter(out, format);
+ writer.write(document);
+ writer.flush();
+ writer.close();
+ }
+
+ /**
+ * Adds a class model to the working set and adds the referenced types to the
+ * namespace handler
+ *
+ * @param classModel The class model
+ */
+ public void addClass(ClassModel classModel)
+ {
+ classModels.add(classModel);
+ for (TypedModel reference : classModel.getTypeReferences())
+ {
+ namespaceHandler.addPackage(reference.getTypePackage());
+ }
+ }
+
+ /**
+ * Cleans out namespaces and XSD for files that are no longer present in the
+ * package
+ */
+ private void init()
+ {
+ // Removes elements that are no longer in the package
+ for (Object xsdClass : document.selectNodes("/xs:schema/xs:element"))
+ {
+ String FQN = packageName + "." + ((Element) xsdClass).attributeValue("name");
+ if (!isClassInPackage(FQN))
+ {
+ ((Element) xsdClass).detach();
+ }
+ }
+
+ // Collect namespaces that are references in the document
+ Set<Namespace> referencedNamespaces = new HashSet<Namespace>(defaultNamespaces);
+ for (Object attribute : document.getRootElement().selectNodes("//@type"))
+ {
+ String ref = ((Attribute) attribute).getValue();
+ int colon = ref.indexOf(":");
+ String prefix = colon < 0 ? "" : ref.substring(0, colon);
+ referencedNamespaces.add(document.getRootElement().getNamespaceForPrefix(prefix));
+ }
+
+ // Register the namespaces with the namespace handler if they are present, otherwise
+ // remove them from the document
+ for (Object item : document.getRootElement().additionalNamespaces())
+ {
+ Namespace namespace = (Namespace) item;
+ if (referencedNamespaces.contains(namespace))
+ {
+ namespaceHandler.addNamespace(namespace);
+ }
+ else
+ {
+ document.getRootElement().remove(namespace);
+ }
+ }
+ }
+
+ /**
+ * Checks if a class is still in the package
+ *
+ * @param packageElement The package abstraction
+ * @param FQN The full name of the class
+ * @return True if present, false otherwise
+ */
+ private boolean isClassInPackage(String FQN)
+ {
+ for (javax.lang.model.element.Element classElement : packageElement.getEnclosedElements())
+ {
+ TypeElement typeElement = (TypeElement) classElement;
+ if (typeElement.getQualifiedName().toString().equals(FQN))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Rebuilds the schema document
+ *
+ * @param packageElement The package abstraction
+ * @return the schema for fluent interface
+ */
+ public Schema rebuild()
+ {
+ // Adds new namespaces if they are not already present
+ for (Namespace namespace : namespaceHandler.getNamespaces())
+ {
+ if (document.getRootElement().getNamespaceForPrefix(namespace.getPrefix()) == null)
+ {
+ document.getRootElement().add(namespace);
+ }
+ }
+
+ // Remove old version of class xsd (if present) and add the fresh version
+ for (ClassModel classModel : classModels)
+ {
+ for (Object previousClass : document.selectNodes("/xs:schema/xs:element[@name=\"" + classModel.getSimpleName() + "\"]"))
+ {
+ ((Element) previousClass).detach();
+ }
+ document.getRootElement().add(classModel.toXSD(namespaceHandler));
+ }
+ return this;
+ }
+
+ @Override
+ public String toString()
+ {
+ StringBuilder buffer = new StringBuilder();
+ buffer.append("Package: " + packageName + "\n");
+ buffer.append("Used namespaces\n");
+ for (Namespace namespace : namespaceHandler.getNamespaces())
+ {
+ buffer.append(" " + namespace + "\n");
+ }
+ buffer.append("Contained classes:\n");
+ for (ClassModel classModel : classModels)
+ {
+ buffer.append(classModel + "\n");
+ }
+ return buffer.toString();
+ }
+
+}
Copied: extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/model (from rev 3901, extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model)
Modified: extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/model/ClassModel.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/ClassModel.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/model/ClassModel.java 2009-10-08 14:22:10 UTC (rev 3903)
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.jboss.webbeans.xsd.model;
+package org.jboss.weld.xsd.model;
import java.util.ArrayList;
import java.util.HashSet;
@@ -26,7 +26,9 @@
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
-import org.jboss.webbeans.xsd.NamespaceHandler;
+import org.dom4j.DocumentFactory;
+import org.dom4j.Element;
+import org.jboss.weld.xsd.NamespaceHandler;
/**
* A model of a class
Modified: extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/model/ConstructorModel.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/ConstructorModel.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/model/ConstructorModel.java 2009-10-08 14:22:10 UTC (rev 3903)
@@ -15,11 +15,13 @@
* limitations under the License.
*/
-package org.jboss.webbeans.xsd.model;
+package org.jboss.weld.xsd.model;
import javax.lang.model.element.ExecutableElement;
-import org.jboss.webbeans.xsd.NamespaceHandler;
+import org.dom4j.DocumentFactory;
+import org.dom4j.Element;
+import org.jboss.weld.xsd.NamespaceHandler;
/**
* The model of a method
Modified: extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/model/FieldModel.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/FieldModel.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/model/FieldModel.java 2009-10-08 14:22:10 UTC (rev 3903)
@@ -15,11 +15,11 @@
* limitations under the License.
*/
-package org.jboss.webbeans.xsd.model;
+package org.jboss.weld.xsd.model;
import javax.lang.model.element.Element;
-import org.jboss.webbeans.xsd.NamespaceHandler;
+import org.jboss.weld.xsd.NamespaceHandler;
/**
* The model of a field
Modified: extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/model/MethodModel.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/MethodModel.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/model/MethodModel.java 2009-10-08 14:22:10 UTC (rev 3903)
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.jboss.webbeans.xsd.model;
+package org.jboss.weld.xsd.model;
import java.util.ArrayList;
import java.util.HashMap;
@@ -25,7 +25,8 @@
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.VariableElement;
-import org.jboss.webbeans.xsd.NamespaceHandler;
+import org.dom4j.Element;
+import org.jboss.weld.xsd.NamespaceHandler;
/**
* The model of a method
Modified: extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/model/NamedModel.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/NamedModel.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/model/NamedModel.java 2009-10-08 14:22:10 UTC (rev 3903)
@@ -15,9 +15,11 @@
* limitations under the License.
*/
-package org.jboss.webbeans.xsd.model;
+package org.jboss.weld.xsd.model;
-import org.jboss.webbeans.xsd.NamespaceHandler;
+import org.dom4j.DocumentFactory;
+import org.dom4j.Element;
+import org.jboss.weld.xsd.NamespaceHandler;
/**
* A superclass for named models
Modified: extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/model/TypedModel.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/TypedModel.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/model/TypedModel.java 2009-10-08 14:22:10 UTC (rev 3903)
@@ -15,9 +15,11 @@
* limitations under the License.
*/
-package org.jboss.webbeans.xsd.model;
+package org.jboss.weld.xsd.model;
-import org.jboss.webbeans.xsd.NamespaceHandler;
+import org.dom4j.DocumentFactory;
+import org.dom4j.Element;
+import org.jboss.weld.xsd.NamespaceHandler;
/**
* The model of a typed member
Copied: extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/sample-schema.xsd (from rev 3901, extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/sample-schema.xsd)
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/sample-schema.xsd (rev 0)
+++ extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/sample-schema.xsd 2009-10-08 14:22:10 UTC (rev 3903)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ targetNamespace="urn:java:com.acme.foo"
+ xmlns:foo="urn:java:com.acme.foo"
+ xmlns:ee="urn:java:ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd"
+ >
+
+ <xs:element name="Foo">
+ <xs:complexType>
+ <xs:choice>
+ <!-- Options to allow people to declare this class a binding type or stereotype - TODO only if an annotation -->
+ <xs:element ref="ee:BindingType"/>
+ <xs:element ref="ee:StereotypType"/>
+ <!-- Somehow import all binding types known etc. to give people that option -->
+ <xs:any /> <!-- Can't guess all types people want to put here -->
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="Bar">
+
+ </xs:element>
+
+
+</xs:schema>
\ No newline at end of file
Copied: extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/test/Bar.java (from rev 3901, extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/Bar.java)
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/test/Bar.java (rev 0)
+++ extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/test/Bar.java 2009-10-08 14:22:10 UTC (rev 3903)
@@ -0,0 +1,9 @@
+package org.jboss.weld.xsd.test;
+
+public class Bar
+{
+ public org.jboss.weld.xsd.test.test.Foo pong(org.jboss.weld.xsd.test.test.test.Foo foo)
+ {
+ return null;
+ }
+}
Copied: extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/test/Foo.java (from rev 3901, extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/Foo.java)
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/test/Foo.java (rev 0)
+++ extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/test/Foo.java 2009-10-08 14:22:10 UTC (rev 3903)
@@ -0,0 +1,16 @@
+package org.jboss.weld.xsd.test;
+
+
+public class Foo extends Bar
+{
+ public String foo;
+ public int poo;
+ public Bar bar;
+ public org.jboss.weld.xsd.test.test.Foo foo2;
+ public org.jboss.weld.xsd.test.test.test.Foo foo3;
+
+ public void testy(org.jboss.weld.xsd.test.test.Foo a, org.jboss.weld.xsd.test.test.test.Foo b) {
+
+ }
+
+}
Copied: extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/test/Test.java (from rev 3901, extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/Test.java)
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/test/Test.java (rev 0)
+++ extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/test/Test.java 2009-10-08 14:22:10 UTC (rev 3903)
@@ -0,0 +1,30 @@
+package org.jboss.weld.xsd.test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.processing.AbstractProcessor;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.ToolProvider;
+import javax.tools.JavaCompiler.CompilationTask;
+
+import org.jboss.weld.xsd.PackageSchemaGenerator;
+
+public class Test
+{
+
+ public static void main(String[] args)
+ {
+ JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
+ StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null);
+ Iterable<? extends JavaFileObject> compilationUnits = fileManager.getJavaFileObjects(args);
+ CompilationTask task = compiler.getTask(null, fileManager, null, null, null, compilationUnits);
+ List<AbstractProcessor> processors = new ArrayList<AbstractProcessor>();
+ processors.add(new PackageSchemaGenerator());
+ task.setProcessors(processors);
+ task.call();
+ }
+
+}
Copied: extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/test/test/Foo.java (from rev 3901, extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/test/Foo.java)
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/test/test/Foo.java (rev 0)
+++ extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/test/test/Foo.java 2009-10-08 14:22:10 UTC (rev 3903)
@@ -0,0 +1,6 @@
+package org.jboss.weld.xsd.test.test;
+
+public class Foo
+{
+
+}
Copied: extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/test/test/test (from rev 3901, extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/test/test)
Modified: extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/test/test/test/Foo.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/test/test/Foo.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/xsd/src/main/java/org/jboss/weld/xsd/test/test/test/Foo.java 2009-10-08 14:22:10 UTC (rev 3903)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.xsd.test.test.test;
+package org.jboss.weld.xsd.test.test.test;
public class Foo
{
15 years, 1 month
Weld SVN: r3902 - in extensions/trunk: bean-utils and 59 other directories.
by weld-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-10-08 09:44:49 -0400 (Thu, 08 Oct 2009)
New Revision: 3902
Added:
extensions/trunk/se/src/main/java/org/jboss/weld/
extensions/trunk/se/src/main/java/org/jboss/weld/environment/
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/ShutdownManager.java
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/StartMain.java
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/beans/
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/bindings/
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEWeldDeployment.java
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEWeldDiscovery.java
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/events/
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/util/
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/util/WeldManagerUtils.java
extensions/trunk/se/src/test/java/org/jboss/weld/
extensions/trunk/se/src/test/java/org/jboss/weld/environment/
extensions/trunk/se/src/test/java/org/jboss/weld/environment/se/
extensions/trunk/se/src/test/java/org/jboss/weld/environment/se/test/
extensions/trunk/se/src/test/java/org/jboss/weld/environment/se/test/StartMainTest.java
extensions/trunk/se/src/test/java/org/jboss/weld/environment/se/test/beans/
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/Listener.java
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/deployment/
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/WeldApplication.java
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/services/
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/util/
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/tomcat/
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/tomcat/WeldAnnotationProcessor.java
extensions/trunk/servlet/support/src/main/java/org/jboss/weld/
extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/
extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/
extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/ForwardingAnnotationProcessor.java
extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/ForwardingJspApplicationContextImpl.java
extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/JspInitialization.java
extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/WeldLifecycleListener.java
extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/util/
extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/
extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/environment/
extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/environment/servlet/
extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/environment/servlet/discovery/
extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/environment/servlet/discovery/ServletWeldDiscoveryTest.java
extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/
extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/
extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/
extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/lookup/
extensions/trunk/wicket/src/main/java/org/jboss/weld/
extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/
extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldApplication.java
extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldComponentInstantiationListener.java
extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldMetaData.java
extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldRequestCycle.java
extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldWebRequestCycleProcessor.java
Removed:
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/ShutdownManager.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/beans/
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/bindings/
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/events/
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEWebBeanDiscovery.java
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEWebBeansDeployment.java
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/util/WebBeansManagerUtils.java
extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/StartMainTest.java
extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/beans/
extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/Listener.java
extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/deployment/
extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/jsf/
extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/services/
extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/util/
extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/tomcat/
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/WebBeansApplication.java
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/tomcat/WebBeansAnnotationProcessor.java
extensions/trunk/servlet/support/src/main/java/org/jboss/webbeans/environment/tomcat/ForwardingAnnotationProcessor.java
extensions/trunk/servlet/support/src/main/java/org/jboss/webbeans/environment/tomcat/ForwardingJspApplicationContextImpl.java
extensions/trunk/servlet/support/src/main/java/org/jboss/webbeans/environment/tomcat/JspInitialization.java
extensions/trunk/servlet/support/src/main/java/org/jboss/webbeans/environment/tomcat/WebBeansLifecycleListener.java
extensions/trunk/servlet/support/src/main/java/org/jboss/webbeans/environment/tomcat/util/
extensions/trunk/servlet/tests/src/test/java/org/jboss/webbeans/environment/servlet/discovery/
extensions/trunk/servlet/tests/src/test/java/org/jboss/webbeans/test/tomcat/examples/
extensions/trunk/servlet/tests/src/test/java/org/jboss/webbeans/test/tomcat/lookup/
extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/environment/servlet/discovery/ServletWebBeanDiscoveryTest.java
extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/
extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WebBeansApplication.java
extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WebBeansComponentInstantiationListener.java
extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WebBeansMetaData.java
extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WebBeansRequestCycle.java
extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WebBeansWebRequestCycleProcessor.java
Modified:
extensions/trunk/bean-utils/pom.xml
extensions/trunk/logger/pom.xml
extensions/trunk/pom.xml
extensions/trunk/se/pom.xml
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/beans/ParametersFactory.java
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/bindings/Parameters.java
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/AbstractScanner.java
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEBeanDeploymentArchive.java
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/Scanner.java
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/URLScanner.java
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/events/ContainerInitialized.java
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/events/Shutdown.java
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/util/Reflections.java
extensions/trunk/se/src/main/resources/log4j.xml
extensions/trunk/se/src/test/java/org/jboss/weld/environment/se/test/beans/CustomEvent.java
extensions/trunk/se/src/test/java/org/jboss/weld/environment/se/test/beans/InitObserverTestBean.java
extensions/trunk/se/src/test/java/org/jboss/weld/environment/se/test/beans/MainTestBean.java
extensions/trunk/se/src/test/java/org/jboss/weld/environment/se/test/beans/ObserverTestBean.java
extensions/trunk/se/src/test/java/org/jboss/weld/environment/se/test/beans/ParametersTestBean.java
extensions/trunk/servlet/build/pom.xml
extensions/trunk/servlet/int/pom.xml
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/deployment/AbstractScanner.java
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/deployment/Scanner.java
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/deployment/ServletDeployment.java
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/deployment/URLScanner.java
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/deployment/WebAppBeanDeploymentArchive.java
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/ForwardingApplication.java
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/ForwardingApplicationFactory.java
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/WebBeansApplicationFactory.java
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/services/ServletResourceInjectionServices.java
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/services/ServletServicesImpl.java
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/util/Reflections.java
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/util/Servlets.java
extensions/trunk/servlet/pom.xml
extensions/trunk/servlet/support/pom.xml
extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/util/Reflections.java
extensions/trunk/servlet/tests/pom.xml
extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/ExampleTest.java
extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/Game.java
extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/Generator.java
extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/MockExampleTest.java
extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/MockSentenceTranslator.java
extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/Random.java
extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/SentenceParser.java
extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/SentenceTranslator.java
extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/TextTranslator.java
extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/Translator.java
extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/lookup/LookupTest.java
extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/lookup/Mouse.java
extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/lookup/RatServlet.java
extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/lookup/ServletInjectionTest.java
extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/lookup/Sewer.java
extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/lookup/Vole.java
extensions/trunk/wicket/pom.xml
extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/BeanManagerLookup.java
extensions/trunk/xsd/pom.xml
Log:
code refactoring
Modified: extensions/trunk/bean-utils/pom.xml
===================================================================
--- extensions/trunk/bean-utils/pom.xml 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/bean-utils/pom.xml 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,14 +1,14 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
- <artifactId>webbeans-parent</artifactId>
- <groupId>org.jboss.webbeans</groupId>
+ <artifactId>weld-parent</artifactId>
+ <groupId>org.jboss.weld</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-bean-utils</artifactId>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-bean-utils</artifactId>
<version>1.0.0-SNAPSHOT</version>
- <name>Web Beans Utilities For Managing Beans</name>
+ <name>Weld Utilities For Managing Beans</name>
<dependencies>
@@ -26,19 +26,19 @@
</dependency>
<dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-logging</artifactId>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-logging</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-core</artifactId>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-core-test</artifactId>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-core-test</artifactId>
<scope>test</scope>
</dependency>
@@ -65,9 +65,9 @@
</dependencies>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/webbeans/extensions</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/webbeans/extensions</developerConnection>
- <url>http://viewvc.jboss.org/cgi-bin/viewvc.cgi/webbeans/extensions</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/weld/extensions</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/weld/extensions</developerConnection>
+ <url>http://viewvc.jboss.org/cgi-bin/viewvc.cgi/weld/extensions</url>
</scm>
<build>
@@ -77,7 +77,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<configuration>
- <tagBase>https://svn.jboss.org/repos/webbeans/extensions/tags</tagBase>
+ <tagBase>https://svn.jboss.org/repos/weld/extensions/tags</tagBase>
<autoVersionSubmodules>true</autoVersionSubmodules>
</configuration>
</plugin>
Modified: extensions/trunk/logger/pom.xml
===================================================================
--- extensions/trunk/logger/pom.xml 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/logger/pom.xml 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,14 +1,14 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
- <artifactId>webbeans-parent</artifactId>
- <groupId>org.jboss.webbeans</groupId>
+ <artifactId>weld-parent</artifactId>
+ <groupId>org.jboss.weld</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-logger</artifactId>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-logger</artifactId>
<version>1.0.0-SNAPSHOT</version>
- <name>Web Beans Injectable Logger</name>
+ <name>Weld Injectable Logger</name>
<dependencies>
@@ -26,13 +26,13 @@
</dependency>
<dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-logging</artifactId>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-logging</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>jsr299-api</artifactId>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
<scope>provided</scope>
</dependency>
@@ -49,14 +49,14 @@
</dependency>
<dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-core</artifactId>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-core-test</artifactId>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-core-test</artifactId>
<scope>test</scope>
</dependency>
@@ -83,9 +83,9 @@
</dependencies>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/webbeans/extensions</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/webbeans/extensions</developerConnection>
- <url>http://viewvc.jboss.org/cgi-bin/viewvc.cgi/webbeans/extensions</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/weld/extensions</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/weld/extensions</developerConnection>
+ <url>http://viewvc.jboss.org/cgi-bin/viewvc.cgi/weld/extensions</url>
</scm>
<build>
@@ -95,7 +95,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<configuration>
- <tagBase>https://svn.jboss.org/repos/webbeans/extensions/tags</tagBase>
+ <tagBase>https://svn.jboss.org/repos/weld/extensions/tags</tagBase>
<autoVersionSubmodules>true</autoVersionSubmodules>
</configuration>
</plugin>
Modified: extensions/trunk/pom.xml
===================================================================
--- extensions/trunk/pom.xml 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/pom.xml 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,18 +1,18 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-extensions-parent</artifactId>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-extensions-parent</artifactId>
<packaging>pom</packaging>
<version>1.0.0-SNAPSHOT</version>
<parent>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-version-matrix</artifactId>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-version-matrix</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
- <name>Web Beans Extensions aggregator</name>
- <url>http://www.seamframework.org/WebBeans</url>
+ <name>Weld Extensions aggregator</name>
+ <url>http://www.seamframework.org/Weld</url>
<modules>
<module>servlet</module>
Modified: extensions/trunk/se/pom.xml
===================================================================
--- extensions/trunk/se/pom.xml 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/se/pom.xml 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
- <artifactId>webbeans-parent</artifactId>
- <groupId>org.jboss.webbeans</groupId>
+ <artifactId>weld-parent</artifactId>
+ <groupId>org.jboss.weld</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-se</artifactId>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-se</artifactId>
<packaging>jar</packaging>
- <name>Web Beans SE Module</name>
+ <name>Weld SE Module</name>
<url>http://maven.apache.org</url>
<build>
<plugins>
@@ -25,7 +25,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<configuration>
- <tagBase>https://svn.jboss.org/repos/webbeans/extensions/tags</tagBase>
+ <tagBase>https://svn.jboss.org/repos/weld/extensions/tags</tagBase>
<autoVersionSubmodules>true</autoVersionSubmodules>
</configuration>
</plugin>
@@ -47,8 +47,8 @@
</dependency>
<dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-spi</artifactId>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-spi</artifactId>
<exclusions>
<exclusion>
<groupId>javax.jms</groupId>
@@ -65,21 +65,21 @@
</exclusions>
</dependency>
<dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-core</artifactId>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
- <artifactId>inject-api</artifactId>
+ <artifactId>javax.inject</artifactId>
</dependency>
</dependencies>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/webbeans/extensions</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/webbeans/extensions</developerConnection>
- <url>http://fisheye.jboss.org/browse/WebBeans/extensions</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/weld/extensions</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/weld/extensions</developerConnection>
+ <url>http://fisheye.jboss.org/browse/Weld/extensions</url>
</scm>
</project>
Deleted: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/ShutdownManager.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/ShutdownManager.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/ShutdownManager.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,81 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, 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.webbeans.environment.se;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.event.Observes;
-import javax.enterprise.inject.spi.BeanManager;
-
-import javax.inject.Inject;
-import org.jboss.webbeans.bootstrap.api.Bootstrap;
-import org.jboss.webbeans.environment.se.events.Shutdown;
-import org.jboss.webbeans.log.LogProvider;
-import org.jboss.webbeans.log.Logging;
-import org.jboss.webbeans.manager.api.WebBeansManager;
-
-@ApplicationScoped
-public class ShutdownManager
-{
-
- private static LogProvider log = Logging.getLogProvider(ShutdownManager.class);
-
- @Inject
- private WebBeansManager manager;
-
- private boolean hasShutdownBeenCalled = false;
-
- private Bootstrap bootstrap;
-
- /**
- * The observer of the optional shutdown request which will in turn fire the
- * Shutdown event.
- *
- * @param shutdownRequest
- */
- public void shutdown(@Observes @Shutdown BeanManager shutdownRequest)
- {
- synchronized (this)
- {
-
- if (!hasShutdownBeenCalled)
- {
- hasShutdownBeenCalled = true;
- bootstrap.shutdown();
- }
- else
- {
- log.debug("Skipping spurious call to shutdown");
- log.trace(Thread.currentThread().getStackTrace());
- }
- }
- }
-
- /**
- * Shutdown WebBeans SE gracefully (call this as an alternative to firing the
- * "@Shutdown Manager" event.
- */
- public void shutdown()
- {
- shutdown(manager);
- }
-
- public void setBootstrap(Bootstrap bootstrap)
- {
- this.bootstrap = bootstrap;
- }
-
-}
Deleted: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,98 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, 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.webbeans.environment.se;
-
-import javax.enterprise.inject.spi.BeanManager;
-
-import org.jboss.webbeans.bootstrap.api.Bootstrap;
-import org.jboss.webbeans.bootstrap.api.Environments;
-import org.jboss.webbeans.bootstrap.spi.BeanDeploymentArchive;
-import org.jboss.webbeans.context.api.BeanStore;
-import org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore;
-import org.jboss.webbeans.environment.se.discovery.SEWebBeansDeployment;
-import org.jboss.webbeans.environment.se.events.ContainerInitialized;
-import org.jboss.webbeans.environment.se.util.Reflections;
-import org.jboss.webbeans.environment.se.util.WebBeansManagerUtils;
-import org.jboss.webbeans.manager.api.WebBeansManager;
-
-/**
- * This is the main class that should always be called from the command line for
- * a WebBEans SE app. Something like: <code>
- * java -jar MyApp.jar org.jboss.webbeans.environment.se.StarMain arguments
- * </code>
- *
- * @author Peter Royle
- * @author Pete Muir
- */
-public class StartMain
-{
-
- private static final String BOOTSTRAP_IMPL_CLASS_NAME = "org.jboss.webbeans.bootstrap.WebBeansBootstrap";
- private final Bootstrap bootstrap;
- private final BeanStore applicationBeanStore;
- public static String[] PARAMETERS;
- private WebBeansManager manager;
-
- public StartMain(String[] commandLineArgs)
- {
- PARAMETERS = commandLineArgs;
- try
- {
- bootstrap = Reflections.newInstance(BOOTSTRAP_IMPL_CLASS_NAME, Bootstrap.class);
- }
- catch (Exception e)
- {
- throw new IllegalStateException("Error loading Web Beans bootstrap, check that Web Beans is on the classpath", e);
- }
- this.applicationBeanStore = new ConcurrentHashMapBeanStore();
- }
-
- public BeanManager go()
- {
- SEWebBeansDeployment deployment = new SEWebBeansDeployment()
- {
- };
- bootstrap.startContainer(Environments.SE, deployment, this.applicationBeanStore);
- final BeanDeploymentArchive mainBeanDepArch = deployment.getBeanDeploymentArchives().get(0);
- this.manager = bootstrap.getManager(mainBeanDepArch);
- bootstrap.startInitialization();
- bootstrap.deployBeans();
- WebBeansManagerUtils.getInstanceByType(manager, ShutdownManager.class).setBootstrap(bootstrap);
- bootstrap.validateBeans();
- bootstrap.endInitialization();
-
- this.manager.fireEvent(new ContainerInitialized());
- return this.manager;
- }
-
- /**
- * The main method called from the command line.
- *
- * @param args the command line arguments
- */
- public static void main(String[] args)
- {
- new StartMain(args).go();
- }
-
- public static String[] getParameters()
- {
- // TODO(PR): make immutable
- return PARAMETERS;
- }
-
-}
Copied: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/ShutdownManager.java (from rev 3901, extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/ShutdownManager.java)
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/ShutdownManager.java (rev 0)
+++ extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/ShutdownManager.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -0,0 +1,81 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, 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.weld.environment.se;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.BeanManager;
+
+import javax.inject.Inject;
+import org.jboss.weld.bootstrap.api.Bootstrap;
+import org.jboss.weld.log.LogProvider;
+import org.jboss.weld.log.Logging;
+import org.jboss.weld.manager.api.WeldManager;
+import org.jboss.weld.environment.se.events.Shutdown;
+
+@ApplicationScoped
+public class ShutdownManager
+{
+
+ private static LogProvider log = Logging.getLogProvider(ShutdownManager.class);
+
+ @Inject
+ private WeldManager manager;
+
+ private boolean hasShutdownBeenCalled = false;
+
+ private Bootstrap bootstrap;
+
+ /**
+ * The observer of the optional shutdown request which will in turn fire the
+ * Shutdown event.
+ *
+ * @param shutdownRequest
+ */
+ public void shutdown(@Observes @Shutdown BeanManager shutdownRequest)
+ {
+ synchronized (this)
+ {
+
+ if (!hasShutdownBeenCalled)
+ {
+ hasShutdownBeenCalled = true;
+ bootstrap.shutdown();
+ }
+ else
+ {
+ log.debug("Skipping spurious call to shutdown");
+ log.trace(Thread.currentThread().getStackTrace());
+ }
+ }
+ }
+
+ /**
+ * Shutdown WebBeans SE gracefully (call this as an alternative to firing the
+ * "@Shutdown Manager" event.
+ */
+ public void shutdown()
+ {
+ shutdown(manager);
+ }
+
+ public void setBootstrap(Bootstrap bootstrap)
+ {
+ this.bootstrap = bootstrap;
+ }
+
+}
Copied: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/StartMain.java (from rev 3901, extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java)
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/StartMain.java (rev 0)
+++ extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/StartMain.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -0,0 +1,98 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, 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.weld.environment.se;
+
+import javax.enterprise.inject.spi.BeanManager;
+
+import org.jboss.weld.bootstrap.api.Bootstrap;
+import org.jboss.weld.bootstrap.api.Environments;
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.context.api.BeanStore;
+import org.jboss.weld.context.api.helpers.ConcurrentHashMapBeanStore;
+import org.jboss.weld.manager.api.WeldManager;
+import org.jboss.weld.environment.se.discovery.SEWeldDeployment;
+import org.jboss.weld.environment.se.events.ContainerInitialized;
+import org.jboss.weld.environment.se.util.Reflections;
+import org.jboss.weld.environment.se.util.WeldManagerUtils;
+
+/**
+ * This is the main class that should always be called from the command line for
+ * a WebBEans SE app. Something like: <code>
+ * java -jar MyApp.jar org.jboss.webbeans.environment.se.StarMain arguments
+ * </code>
+ *
+ * @author Peter Royle
+ * @author Pete Muir
+ */
+public class StartMain
+{
+
+ private static final String BOOTSTRAP_IMPL_CLASS_NAME = "org.jboss.webbeans.bootstrap.WebBeansBootstrap";
+ private final Bootstrap bootstrap;
+ private final BeanStore applicationBeanStore;
+ public static String[] PARAMETERS;
+ private WeldManager manager;
+
+ public StartMain(String[] commandLineArgs)
+ {
+ PARAMETERS = commandLineArgs;
+ try
+ {
+ bootstrap = Reflections.newInstance(BOOTSTRAP_IMPL_CLASS_NAME, Bootstrap.class);
+ }
+ catch (Exception e)
+ {
+ throw new IllegalStateException("Error loading Web Beans bootstrap, check that Web Beans is on the classpath", e);
+ }
+ this.applicationBeanStore = new ConcurrentHashMapBeanStore();
+ }
+
+ public BeanManager go()
+ {
+ SEWeldDeployment deployment = new SEWeldDeployment()
+ {
+ };
+ bootstrap.startContainer(Environments.SE, deployment, this.applicationBeanStore);
+ final BeanDeploymentArchive mainBeanDepArch = deployment.getBeanDeploymentArchives().get(0);
+ this.manager = bootstrap.getManager(mainBeanDepArch);
+ bootstrap.startInitialization();
+ bootstrap.deployBeans();
+ WeldManagerUtils.getInstanceByType(manager, ShutdownManager.class).setBootstrap(bootstrap);
+ bootstrap.validateBeans();
+ bootstrap.endInitialization();
+
+ this.manager.fireEvent(new ContainerInitialized());
+ return this.manager;
+ }
+
+ /**
+ * The main method called from the command line.
+ *
+ * @param args the command line arguments
+ */
+ public static void main(String[] args)
+ {
+ new StartMain(args).go();
+ }
+
+ public static String[] getParameters()
+ {
+ // TODO(PR): make immutable
+ return PARAMETERS;
+ }
+
+}
Copied: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/beans (from rev 3901, extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/beans)
Modified: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/beans/ParametersFactory.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/beans/ParametersFactory.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/beans/ParametersFactory.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.se.beans;
+package org.jboss.weld.environment.se.beans;
import java.util.ArrayList;
import java.util.Arrays;
@@ -24,8 +24,8 @@
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Produces;
-import org.jboss.webbeans.environment.se.StartMain;
-import org.jboss.webbeans.environment.se.bindings.Parameters;
+import org.jboss.weld.environment.se.StartMain;
+import org.jboss.weld.environment.se.bindings.Parameters;
/**
* The simple bean that will hold the command line arguments and make them
Copied: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/bindings (from rev 3901, extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/bindings)
Modified: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/bindings/Parameters.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/bindings/Parameters.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/bindings/Parameters.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.se.bindings;
+package org.jboss.weld.environment.se.bindings;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Copied: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery (from rev 3901, extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery)
Modified: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/AbstractScanner.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/AbstractScanner.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/AbstractScanner.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -14,12 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.se.discovery;
+package org.jboss.weld.environment.se.discovery;
import java.net.URL;
-import org.jboss.webbeans.log.LogProvider;
-import org.jboss.webbeans.log.Logging;
+import org.jboss.weld.log.LogProvider;
+import org.jboss.weld.log.Logging;
/**
* Abstract base class for {@link Scanner} providing common functionality
@@ -34,9 +34,9 @@
private static final LogProvider log = Logging.getLogProvider(Scanner.class);
private final ClassLoader classLoader;
- private final SEWebBeanDiscovery webBeanDiscovery;
+ private final SEWeldDiscovery webBeanDiscovery;
- public AbstractScanner(ClassLoader classLoader, SEWebBeanDiscovery webBeanDiscovery)
+ public AbstractScanner(ClassLoader classLoader, SEWeldDiscovery webBeanDiscovery)
{
this.classLoader = classLoader;
this.webBeanDiscovery = webBeanDiscovery;
Modified: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEBeanDeploymentArchive.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEBeanDeploymentArchive.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEBeanDeploymentArchive.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -14,17 +14,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.se.discovery;
+package org.jboss.weld.environment.se.discovery;
import java.net.URL;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
-import org.jboss.webbeans.bootstrap.api.ServiceRegistry;
-import org.jboss.webbeans.bootstrap.api.helpers.SimpleServiceRegistry;
-import org.jboss.webbeans.bootstrap.spi.BeanDeploymentArchive;
-import org.jboss.webbeans.ejb.spi.EjbDescriptor;
+import org.jboss.weld.bootstrap.api.ServiceRegistry;
+import org.jboss.weld.bootstrap.api.helpers.SimpleServiceRegistry;
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.ejb.spi.EjbDescriptor;
/**
* A Java SE implementation of BeanDeploymentArchive. It is essentially an
@@ -36,12 +36,12 @@
*/
public class SEBeanDeploymentArchive implements BeanDeploymentArchive
{
- private final SEWebBeanDiscovery wbDiscovery;
+ private final SEWeldDiscovery wbDiscovery;
private final ServiceRegistry serviceRegistry;
public SEBeanDeploymentArchive()
{
- wbDiscovery = new SEWebBeanDiscovery()
+ wbDiscovery = new SEWeldDiscovery()
{
};
serviceRegistry = new SimpleServiceRegistry();
Deleted: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEWebBeanDiscovery.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEWebBeanDiscovery.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEWebBeanDiscovery.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,74 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, 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.webbeans.environment.se.discovery;
-
-import java.net.URL;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.jboss.webbeans.environment.se.util.Reflections;
-
-/**
- * The means by which Web Beans are discovered on the classpath. This will only
- * discover simple web beans - there is no EJB/Servlet/JPA integration.
- *
- * @author Peter Royle
- * @author Pete Muir
- * @author Ales Justin
- */
-public abstract class SEWebBeanDiscovery
-{
-
- private final Set<Class<?>> wbClasses;
- private final Set<URL> wbUrls;
-
- public SEWebBeanDiscovery()
- {
- this.wbClasses = new HashSet<Class<?>>();
- this.wbUrls = new HashSet<URL>();
- scan();
- }
-
- public Iterable<Class<?>> discoverWebBeanClasses()
- {
- return Collections.unmodifiableSet(wbClasses);
- }
-
- public Collection<URL> discoverWebBeansXml()
- {
- return Collections.unmodifiableSet(wbUrls);
- }
-
- public Set<Class<?>> getWbClasses()
- {
- return wbClasses;
- }
-
- public Set<URL> getWbUrls()
- {
- return wbUrls;
- }
-
- private void scan()
- {
- Scanner scanner = new URLScanner(Reflections.getClassLoader(), this);
- scanner.scanResources(new String[] { "META-INF/beans.xml" });
- }
-
-}
Deleted: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEWebBeansDeployment.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEWebBeansDeployment.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEWebBeansDeployment.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,69 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, 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.webbeans.environment.se.discovery;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.jboss.webbeans.bootstrap.api.ServiceRegistry;
-import org.jboss.webbeans.bootstrap.spi.BeanDeploymentArchive;
-import org.jboss.webbeans.bootstrap.spi.Deployment;
-
-/**
- * WebBeans Deployment for Java SE environment.
- *
- * @author Peter Royle
- */
-public abstract class SEWebBeansDeployment implements Deployment
-{
- private final BeanDeploymentArchive beanDeploymentArchive;
- private final List<BeanDeploymentArchive> archInCollection;
-
- public SEWebBeansDeployment()
- {
- this.beanDeploymentArchive = new SEBeanDeploymentArchive();
- this.archInCollection = new ArrayList<BeanDeploymentArchive>(1);
- this.archInCollection.add(this.beanDeploymentArchive);
- }
-
- /**
- * {@inheritDoc}
- *
- * @return A collection containing the singular logical BeanDeploymentArchive
- * consisting of all Bean classes and beans.xml descriptors in the
- * current classpath.
- */
- public List<BeanDeploymentArchive> getBeanDeploymentArchives()
- {
- return this.archInCollection;
- }
-
- /**
- * {@inheritDoc}
- *
- * @return The singular logical BeanDeploymentArchive consisting of all which
- * contains all Beans classes.
- */
- public BeanDeploymentArchive loadBeanDeploymentArchive(Class<?> beanClass)
- {
- return this.beanDeploymentArchive;
- }
-
- public ServiceRegistry getServices()
- {
- return this.beanDeploymentArchive.getServices();
- }
-}
Copied: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEWeldDeployment.java (from rev 3901, extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEWebBeansDeployment.java)
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEWeldDeployment.java (rev 0)
+++ extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEWeldDeployment.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -0,0 +1,69 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, 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.weld.environment.se.discovery;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.jboss.weld.bootstrap.api.ServiceRegistry;
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.bootstrap.spi.Deployment;
+
+/**
+ * WebBeans Deployment for Java SE environment.
+ *
+ * @author Peter Royle
+ */
+public abstract class SEWeldDeployment implements Deployment
+{
+ private final BeanDeploymentArchive beanDeploymentArchive;
+ private final List<BeanDeploymentArchive> archInCollection;
+
+ public SEWeldDeployment()
+ {
+ this.beanDeploymentArchive = new SEBeanDeploymentArchive();
+ this.archInCollection = new ArrayList<BeanDeploymentArchive>(1);
+ this.archInCollection.add(this.beanDeploymentArchive);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @return A collection containing the singular logical BeanDeploymentArchive
+ * consisting of all Bean classes and beans.xml descriptors in the
+ * current classpath.
+ */
+ public List<BeanDeploymentArchive> getBeanDeploymentArchives()
+ {
+ return this.archInCollection;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @return The singular logical BeanDeploymentArchive consisting of all which
+ * contains all Beans classes.
+ */
+ public BeanDeploymentArchive loadBeanDeploymentArchive(Class<?> beanClass)
+ {
+ return this.beanDeploymentArchive;
+ }
+
+ public ServiceRegistry getServices()
+ {
+ return this.beanDeploymentArchive.getServices();
+ }
+}
Copied: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEWeldDiscovery.java (from rev 3901, extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEWebBeanDiscovery.java)
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEWeldDiscovery.java (rev 0)
+++ extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/SEWeldDiscovery.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -0,0 +1,74 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, 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.weld.environment.se.discovery;
+
+import java.net.URL;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jboss.weld.environment.se.util.Reflections;
+
+/**
+ * The means by which Web Beans are discovered on the classpath. This will only
+ * discover simple web beans - there is no EJB/Servlet/JPA integration.
+ *
+ * @author Peter Royle
+ * @author Pete Muir
+ * @author Ales Justin
+ */
+public abstract class SEWeldDiscovery
+{
+
+ private final Set<Class<?>> wbClasses;
+ private final Set<URL> wbUrls;
+
+ public SEWeldDiscovery()
+ {
+ this.wbClasses = new HashSet<Class<?>>();
+ this.wbUrls = new HashSet<URL>();
+ scan();
+ }
+
+ public Iterable<Class<?>> discoverWebBeanClasses()
+ {
+ return Collections.unmodifiableSet(wbClasses);
+ }
+
+ public Collection<URL> discoverWebBeansXml()
+ {
+ return Collections.unmodifiableSet(wbUrls);
+ }
+
+ public Set<Class<?>> getWbClasses()
+ {
+ return wbClasses;
+ }
+
+ public Set<URL> getWbUrls()
+ {
+ return wbUrls;
+ }
+
+ private void scan()
+ {
+ Scanner scanner = new URLScanner(Reflections.getClassLoader(), this);
+ scanner.scanResources(new String[] { "META-INF/beans.xml" });
+ }
+
+}
Modified: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/Scanner.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/Scanner.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/Scanner.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.se.discovery;
+package org.jboss.weld.environment.se.discovery;
import java.io.File;
Modified: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/URLScanner.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/URLScanner.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/discovery/URLScanner.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.se.discovery;
+package org.jboss.weld.environment.se.discovery;
import java.io.File;
import java.io.IOException;
@@ -29,8 +29,8 @@
import java.util.zip.ZipException;
import java.util.zip.ZipFile;
-import org.jboss.webbeans.log.LogProvider;
-import org.jboss.webbeans.log.Logging;
+import org.jboss.weld.log.LogProvider;
+import org.jboss.weld.log.Logging;
/**
* Implementation of {@link Scanner} which can scan a {@link URLClassLoader}
@@ -45,7 +45,7 @@
{
private static final LogProvider log = Logging.getLogProvider(URLScanner.class);
- public URLScanner(ClassLoader classLoader, SEWebBeanDiscovery webBeanDiscovery)
+ public URLScanner(ClassLoader classLoader, SEWeldDiscovery webBeanDiscovery)
{
super(classLoader, webBeanDiscovery);
}
Copied: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/events (from rev 3901, extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/events)
Modified: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/events/ContainerInitialized.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/events/ContainerInitialized.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/events/ContainerInitialized.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.se.events;
+package org.jboss.weld.environment.se.events;
/**
* The event that is fired when the WebBeans CDI container is initialized and
Modified: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/events/Shutdown.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/events/Shutdown.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/events/Shutdown.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.se.events;
+package org.jboss.weld.environment.se.events;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Copied: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/util (from rev 3901, extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util)
Modified: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/util/Reflections.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/Reflections.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/util/Reflections.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.se.util;
+package org.jboss.weld.environment.se.util;
/**
* Reflection utilities
Deleted: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/util/WebBeansManagerUtils.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/WebBeansManagerUtils.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/util/WebBeansManagerUtils.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,43 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, 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.webbeans.environment.se.util;
-
-import java.lang.annotation.Annotation;
-
-import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.BeanManager;
-
-/**
- *
- * @author Peter Royle
- */
-public class WebBeansManagerUtils
-{
-
- public static <T> T getInstanceByType(BeanManager manager, Class<T> type, Annotation... bindings)
- {
- final Bean<?> bean = manager.getBeans(type).iterator().next();
- CreationalContext cc = manager.createCreationalContext(bean);
- return (T) manager.getReference(bean, type, cc);
- }
-
- public static <T> T getInstanceByType(BeanManager manager, Class<T> type, CreationalContext cc, Annotation... bindings)
- {
- return (T) manager.getReference(manager.getBeans(type).iterator().next(), type, cc);
- }
-}
Copied: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/util/WeldManagerUtils.java (from rev 3901, extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/WebBeansManagerUtils.java)
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/util/WeldManagerUtils.java (rev 0)
+++ extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/util/WeldManagerUtils.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -0,0 +1,43 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, 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.weld.environment.se.util;
+
+import java.lang.annotation.Annotation;
+
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+
+/**
+ *
+ * @author Peter Royle
+ */
+public class WeldManagerUtils
+{
+
+ public static <T> T getInstanceByType(BeanManager manager, Class<T> type, Annotation... bindings)
+ {
+ final Bean<?> bean = manager.getBeans(type).iterator().next();
+ CreationalContext cc = manager.createCreationalContext(bean);
+ return (T) manager.getReference(bean, type, cc);
+ }
+
+ public static <T> T getInstanceByType(BeanManager manager, Class<T> type, CreationalContext cc, Annotation... bindings)
+ {
+ return (T) manager.getReference(manager.getBeans(type).iterator().next(), type, cc);
+ }
+}
Modified: extensions/trunk/se/src/main/resources/log4j.xml
===================================================================
--- extensions/trunk/se/src/main/resources/log4j.xml 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/se/src/main/resources/log4j.xml 2009-10-08 13:44:49 UTC (rev 3902)
@@ -32,9 +32,9 @@
</filter>
</appender>
- <!-- ############### Web Beans logging ################### -->
+ <!-- ############### Weld logging ################### -->
- <category name="org.jboss.webbeans">
+ <category name="org.jboss.weld">
<priority value="INFO"/>
</category>
Deleted: extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/StartMainTest.java
===================================================================
--- extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/StartMainTest.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/StartMainTest.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,118 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, 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.webbeans.environment.se.test;
-
-import javax.enterprise.inject.AnnotationLiteral;
-import javax.enterprise.inject.spi.BeanManager;
-
-import org.jboss.webbeans.environment.se.StartMain;
-import org.jboss.webbeans.environment.se.events.Shutdown;
-import org.jboss.webbeans.environment.se.test.beans.CustomEvent;
-import org.jboss.webbeans.environment.se.test.beans.InitObserverTestBean;
-import org.jboss.webbeans.environment.se.test.beans.MainTestBean;
-import org.jboss.webbeans.environment.se.test.beans.ObserverTestBean;
-import org.jboss.webbeans.environment.se.test.beans.ParametersTestBean;
-import org.jboss.webbeans.environment.se.util.WebBeansManagerUtils;
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author Peter Royle
- */
-public class StartMainTest
-{
-
- public static String[] ARGS = new String[] { "arg1", "arg2", "arg3" };
- public static String[] ARGS_EMPTY = new String[] {};
-
- /**
- * Test of main method, of class StartMain. Checks that the beans found in
- * the org.jboss.webbeans.environment.se.beans package are initialised as
- * expected.
- */
- @Test
- public void testMain()
- {
- String[] args = ARGS;
- BeanManager manager = new StartMain(args).go();
-
- MainTestBean mainTestBean = WebBeansManagerUtils.getInstanceByType(manager, MainTestBean.class);
- Assert.assertNotNull(mainTestBean);
-
- ParametersTestBean paramsBean = mainTestBean.getParametersTestBean();
- Assert.assertNotNull(paramsBean);
- Assert.assertNotNull(paramsBean.getParameters());
- Assert.assertNotNull(paramsBean.getParameters().get(0));
- Assert.assertEquals(ARGS[0], paramsBean.getParameters().get(0));
- Assert.assertNotNull(paramsBean.getParameters().get(1));
- Assert.assertEquals(ARGS[1], paramsBean.getParameters().get(1));
- Assert.assertNotNull(paramsBean.getParameters().get(2));
- Assert.assertEquals(ARGS[2], paramsBean.getParameters().get(2));
-
- shutdownManager(manager);
- }
-
- /**
- * Test of main method, of class StartMain when no command-line args are
- * provided.
- */
- @Test
- public void testMainEmptyArgs()
- {
- BeanManager manager = new StartMain(ARGS_EMPTY).go();
-
- MainTestBean mainTestBean = WebBeansManagerUtils.getInstanceByType(manager, MainTestBean.class);
- Assert.assertNotNull(mainTestBean);
-
- ParametersTestBean paramsBean = mainTestBean.getParametersTestBean();
- Assert.assertNotNull(paramsBean);
- Assert.assertNotNull(paramsBean.getParameters());
-
- shutdownManager(manager);
- }
-
- @Test
- public void testObservers()
- {
- InitObserverTestBean.reset();
- ObserverTestBean.reset();
-
- BeanManager manager = new StartMain(ARGS_EMPTY).go();
- manager.fireEvent(new CustomEvent());
-
- Assert.assertTrue(ObserverTestBean.isBuiltInObserved());
- Assert.assertTrue(ObserverTestBean.isCustomObserved());
- Assert.assertTrue(ObserverTestBean.isInitObserved());
-
- Assert.assertTrue(InitObserverTestBean.isInitObserved());
- }
-
- private void shutdownManager(BeanManager manager)
- {
- manager.fireEvent(manager, new ShutdownAnnotation());
- }
-
- private static class ShutdownAnnotation extends AnnotationLiteral<Shutdown>
- {
-
- public ShutdownAnnotation()
- {
- }
- }
-
-}
Copied: extensions/trunk/se/src/test/java/org/jboss/weld/environment/se/test/StartMainTest.java (from rev 3901, extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/StartMainTest.java)
===================================================================
--- extensions/trunk/se/src/test/java/org/jboss/weld/environment/se/test/StartMainTest.java (rev 0)
+++ extensions/trunk/se/src/test/java/org/jboss/weld/environment/se/test/StartMainTest.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -0,0 +1,118 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, 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.weld.environment.se.test;
+
+import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.spi.BeanManager;
+
+import org.jboss.weld.environment.se.StartMain;
+import org.jboss.weld.environment.se.events.Shutdown;
+import org.jboss.weld.environment.se.test.beans.CustomEvent;
+import org.jboss.weld.environment.se.test.beans.InitObserverTestBean;
+import org.jboss.weld.environment.se.test.beans.MainTestBean;
+import org.jboss.weld.environment.se.test.beans.ObserverTestBean;
+import org.jboss.weld.environment.se.test.beans.ParametersTestBean;
+import org.jboss.weld.environment.se.util.WeldManagerUtils;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * @author Peter Royle
+ */
+public class StartMainTest
+{
+
+ public static String[] ARGS = new String[] { "arg1", "arg2", "arg3" };
+ public static String[] ARGS_EMPTY = new String[] {};
+
+ /**
+ * Test of main method, of class StartMain. Checks that the beans found in
+ * the org.jboss.weld.environment.se.beans package are initialised as
+ * expected.
+ */
+ @Test
+ public void testMain()
+ {
+ String[] args = ARGS;
+ BeanManager manager = new StartMain(args).go();
+
+ MainTestBean mainTestBean = WeldManagerUtils.getInstanceByType(manager, MainTestBean.class);
+ Assert.assertNotNull(mainTestBean);
+
+ ParametersTestBean paramsBean = mainTestBean.getParametersTestBean();
+ Assert.assertNotNull(paramsBean);
+ Assert.assertNotNull(paramsBean.getParameters());
+ Assert.assertNotNull(paramsBean.getParameters().get(0));
+ Assert.assertEquals(ARGS[0], paramsBean.getParameters().get(0));
+ Assert.assertNotNull(paramsBean.getParameters().get(1));
+ Assert.assertEquals(ARGS[1], paramsBean.getParameters().get(1));
+ Assert.assertNotNull(paramsBean.getParameters().get(2));
+ Assert.assertEquals(ARGS[2], paramsBean.getParameters().get(2));
+
+ shutdownManager(manager);
+ }
+
+ /**
+ * Test of main method, of class StartMain when no command-line args are
+ * provided.
+ */
+ @Test
+ public void testMainEmptyArgs()
+ {
+ BeanManager manager = new StartMain(ARGS_EMPTY).go();
+
+ MainTestBean mainTestBean = WeldManagerUtils.getInstanceByType(manager, MainTestBean.class);
+ Assert.assertNotNull(mainTestBean);
+
+ ParametersTestBean paramsBean = mainTestBean.getParametersTestBean();
+ Assert.assertNotNull(paramsBean);
+ Assert.assertNotNull(paramsBean.getParameters());
+
+ shutdownManager(manager);
+ }
+
+ @Test
+ public void testObservers()
+ {
+ InitObserverTestBean.reset();
+ ObserverTestBean.reset();
+
+ BeanManager manager = new StartMain(ARGS_EMPTY).go();
+ manager.fireEvent(new CustomEvent());
+
+ Assert.assertTrue(ObserverTestBean.isBuiltInObserved());
+ Assert.assertTrue(ObserverTestBean.isCustomObserved());
+ Assert.assertTrue(ObserverTestBean.isInitObserved());
+
+ Assert.assertTrue(InitObserverTestBean.isInitObserved());
+ }
+
+ private void shutdownManager(BeanManager manager)
+ {
+ manager.fireEvent(manager, new ShutdownAnnotation());
+ }
+
+ private static class ShutdownAnnotation extends AnnotationLiteral<Shutdown>
+ {
+
+ public ShutdownAnnotation()
+ {
+ }
+ }
+
+}
Copied: extensions/trunk/se/src/test/java/org/jboss/weld/environment/se/test/beans (from rev 3901, extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/beans)
Modified: extensions/trunk/se/src/test/java/org/jboss/weld/environment/se/test/beans/CustomEvent.java
===================================================================
--- extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/beans/CustomEvent.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/se/src/test/java/org/jboss/weld/environment/se/test/beans/CustomEvent.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.se.test.beans;
+package org.jboss.weld.environment.se.test.beans;
/**
* A custom event fired and observed by one of the tests, to test
Modified: extensions/trunk/se/src/test/java/org/jboss/weld/environment/se/test/beans/InitObserverTestBean.java
===================================================================
--- extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/beans/InitObserverTestBean.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/se/src/test/java/org/jboss/weld/environment/se/test/beans/InitObserverTestBean.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -14,12 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.se.test.beans;
+package org.jboss.weld.environment.se.test.beans;
import javax.enterprise.event.Observes;
import javax.inject.Inject;
-import org.jboss.webbeans.environment.se.events.ContainerInitialized;
+import org.jboss.weld.environment.se.events.ContainerInitialized;
+
/**
* Tests the observing of both built-in and application-specific events.
*
Modified: extensions/trunk/se/src/test/java/org/jboss/weld/environment/se/test/beans/MainTestBean.java
===================================================================
--- extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/beans/MainTestBean.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/se/src/test/java/org/jboss/weld/environment/se/test/beans/MainTestBean.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.se.test.beans;
+package org.jboss.weld.environment.se.test.beans;
import java.io.Serializable;
import javax.enterprise.context.ApplicationScoped;
Modified: extensions/trunk/se/src/test/java/org/jboss/weld/environment/se/test/beans/ObserverTestBean.java
===================================================================
--- extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/beans/ObserverTestBean.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/se/src/test/java/org/jboss/weld/environment/se/test/beans/ObserverTestBean.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -14,14 +14,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.se.test.beans;
+package org.jboss.weld.environment.se.test.beans;
import javax.enterprise.event.Observes;
import javax.enterprise.inject.spi.AfterDeploymentValidation;
import javax.enterprise.inject.spi.Extension;
import javax.inject.Inject;
-import org.jboss.webbeans.environment.se.events.ContainerInitialized;
+import org.jboss.weld.environment.se.events.ContainerInitialized;
+
/**
* Tests the observing of both built-in and application-specific events.
*
Modified: extensions/trunk/se/src/test/java/org/jboss/weld/environment/se/test/beans/ParametersTestBean.java
===================================================================
--- extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/beans/ParametersTestBean.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/se/src/test/java/org/jboss/weld/environment/se/test/beans/ParametersTestBean.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.jboss.webbeans.environment.se.test.beans;
+package org.jboss.weld.environment.se.test.beans;
import java.io.Serializable;
import java.util.List;
@@ -23,7 +23,8 @@
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
-import org.jboss.webbeans.environment.se.bindings.Parameters;
+
+import org.jboss.weld.environment.se.bindings.Parameters;
import org.testng.Assert;
/**
Modified: extensions/trunk/servlet/build/pom.xml
===================================================================
--- extensions/trunk/servlet/build/pom.xml 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/build/pom.xml 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,30 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
- <artifactId>webbeans-servlet-parent</artifactId>
- <groupId>org.jboss.webbeans.servlet</groupId>
+ <artifactId>weld-servlet-parent</artifactId>
+ <groupId>org.jboss.weld.servlet</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.webbeans.servlet</groupId>
- <artifactId>webbeans-servlet</artifactId>
+ <groupId>org.jboss.weld.servlet</groupId>
+ <artifactId>weld-servlet</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
- <name>Web Beans Servlet module</name>
- <url>http://www.seamframework.org/WebBeans</url>
+ <name>Weld Servlet module</name>
+ <url>http://www.seamframework.org/Weld</url>
<dependencies>
<dependency>
- <groupId>org.jboss.webbeans.servlet</groupId>
- <artifactId>webbeans-servlet-int</artifactId>
+ <groupId>org.jboss.weld.servlet</groupId>
+ <artifactId>weld-servlet-int</artifactId>
<optional>true</optional>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-core</artifactId>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-core</artifactId>
<optional>true</optional>
<version>1.0.0-SNAPSHOT</version>
</dependency>
Modified: extensions/trunk/servlet/int/pom.xml
===================================================================
--- extensions/trunk/servlet/int/pom.xml 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/int/pom.xml 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
- <artifactId>webbeans-servlet-parent</artifactId>
- <groupId>org.jboss.webbeans.servlet</groupId>
+ <artifactId>weld-servlet-parent</artifactId>
+ <groupId>org.jboss.weld.servlet</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.webbeans.servlet</groupId>
- <artifactId>webbeans-servlet-int</artifactId>
+ <groupId>org.jboss.weld.servlet</groupId>
+ <artifactId>weld-servlet-int</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
- <name>Web Beans Servlet Integration</name>
- <url>http://www.seamframework.org/WebBeans</url>
+ <name>Weld Servlet Integration</name>
+ <url>http://www.seamframework.org/Weld</url>
<dependencies>
<dependency>
@@ -28,8 +28,8 @@
</dependency>
<dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-spi</artifactId>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-spi</artifactId>
</dependency>
<dependency>
@@ -39,8 +39,8 @@
</dependency>
<dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-logging</artifactId>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-logging</artifactId>
</dependency>
<dependency>
Deleted: extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/Listener.java
===================================================================
--- extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/Listener.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/Listener.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,165 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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.webbeans.environment.servlet;
-
-import javax.el.ELContextListener;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.servlet.ServletContextEvent;
-import javax.servlet.jsp.JspApplicationContext;
-import javax.servlet.jsp.JspFactory;
-
-import org.jboss.webbeans.bootstrap.api.Bootstrap;
-import org.jboss.webbeans.bootstrap.api.Environments;
-import org.jboss.webbeans.context.api.BeanStore;
-import org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore;
-import org.jboss.webbeans.environment.servlet.deployment.ServletDeployment;
-import org.jboss.webbeans.environment.servlet.services.ServletResourceInjectionServices;
-import org.jboss.webbeans.environment.servlet.services.ServletServicesImpl;
-import org.jboss.webbeans.environment.servlet.util.Reflections;
-import org.jboss.webbeans.environment.tomcat.WebBeansAnnotationProcessor;
-import org.jboss.webbeans.injection.spi.ResourceInjectionServices;
-import org.jboss.webbeans.log.Log;
-import org.jboss.webbeans.log.Logging;
-import org.jboss.webbeans.manager.api.WebBeansManager;
-import org.jboss.webbeans.servlet.api.ServletListener;
-import org.jboss.webbeans.servlet.api.ServletServices;
-import org.jboss.webbeans.servlet.api.helpers.ForwardingServletListener;
-
-/**
- * @author Pete Muir
- */
-public class Listener extends ForwardingServletListener
-{
-
- private static final Log log = Logging.getLog(Listener.class);
-
- private static final String BOOTSTRAP_IMPL_CLASS_NAME = "org.jboss.webbeans.bootstrap.WebBeansBootstrap";
- private static final String WEB_BEANS_LISTENER_CLASS_NAME = "org.jboss.webbeans.servlet.WebBeansListener";
- private static final String APPLICATION_BEAN_STORE_ATTRIBUTE_NAME = Listener.class.getName() + ".applicationBeanStore";
- private static final String EXPRESSION_FACTORY_NAME = "org.jboss.webbeans.el.ExpressionFactory";
-
- private final transient Bootstrap bootstrap;
- private final transient ServletListener webBeansListener;
- private WebBeansManager manager;
-
- public Listener()
- {
- try
- {
- bootstrap = Reflections.newInstance(BOOTSTRAP_IMPL_CLASS_NAME);
- }
- catch (IllegalArgumentException e)
- {
- throw new IllegalStateException("Error loading Web Beans bootstrap, check that Web Beans is on the classpath", e);
- }
- try
- {
- webBeansListener = Reflections.newInstance(WEB_BEANS_LISTENER_CLASS_NAME);
- }
- catch (IllegalArgumentException e)
- {
- throw new IllegalStateException("Error loading Web Beans listener, check that Web Beans is on the classpath", e);
- }
- }
-
- @Override
- public void contextDestroyed(ServletContextEvent sce)
- {
- bootstrap.shutdown();
- super.contextDestroyed(sce);
- }
-
- @Override
- public void contextInitialized(ServletContextEvent sce)
- {
- BeanStore applicationBeanStore = new ConcurrentHashMapBeanStore();
- sce.getServletContext().setAttribute(APPLICATION_BEAN_STORE_ATTRIBUTE_NAME, applicationBeanStore);
-
-
-
- ServletDeployment deployment = new ServletDeployment(sce.getServletContext());
- try
- {
- deployment.getWebAppBeanDeploymentArchive().getServices().add(ResourceInjectionServices.class, new ServletResourceInjectionServices() {});
- }
- catch (NoClassDefFoundError e)
- {
- // Support GAE
- log.warn("@Resource injection not available in simple beans");
- }
-
- deployment.getServices().add(ServletServices.class, new ServletServicesImpl(deployment.getWebAppBeanDeploymentArchive()));
-
- bootstrap.startContainer(Environments.SERVLET, deployment, applicationBeanStore).startInitialization();
- manager = bootstrap.getManager(deployment.getWebAppBeanDeploymentArchive());
-
- boolean tomcat = true;
- try
- {
- Reflections.classForName("org.apache.AnnotationProcessor");
- }
- catch (IllegalArgumentException e)
- {
- log.info("JSR-299 injection will not be available in Servlets, Filters etc. This facility is only available in Tomcat");
- tomcat = false;
- }
-
- if (tomcat)
- {
- // Try pushing a Tomcat AnnotationProcessor into the servlet context
- try
- {
- Class<?> clazz = Reflections.classForName(WebBeansAnnotationProcessor.class.getName());
- Object annotationProcessor = clazz.getConstructor(WebBeansManager.class).newInstance(manager);
- sce.getServletContext().setAttribute(WebBeansAnnotationProcessor.class.getName(), annotationProcessor);
- }
- catch (Exception e)
- {
- log.error("Unable to create Tomcat AnnotationProcessor. JSR-299 injection will not be available in Servlets, Filters etc.", e);
- }
- }
-
- // Push the manager into the servlet context so we can access in JSF
- sce.getServletContext().setAttribute(BeanManager.class.getName(), manager);
-
- if (JspFactory.getDefaultFactory() != null)
- {
- JspApplicationContext jspApplicationContext = JspFactory.getDefaultFactory().getJspApplicationContext(sce.getServletContext());
-
- // Register the ELResolver with JSP
- jspApplicationContext.addELResolver(manager.getELResolver());
-
- // Register ELContextListener with JSP
- jspApplicationContext.addELContextListener(Reflections.<ELContextListener>newInstance("org.jboss.webbeans.el.WebBeansELContextListener"));
-
- // Push the wrapped expression factory into the servlet context so that Tomcat or Jetty can hook it in using a container code
- sce.getServletContext().setAttribute(EXPRESSION_FACTORY_NAME, manager.wrapExpressionFactory(jspApplicationContext.getExpressionFactory()));
- }
-
- bootstrap.deployBeans().validateBeans().endInitialization();
- super.contextInitialized(sce);
- }
-
-
-
- @Override
- protected ServletListener delegate()
- {
- return webBeansListener;
- }
-
-}
Copied: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/Listener.java (from rev 3901, extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/Listener.java)
===================================================================
--- extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/Listener.java (rev 0)
+++ extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/Listener.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -0,0 +1,165 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.weld.environment.servlet;
+
+import javax.el.ELContextListener;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.jsp.JspApplicationContext;
+import javax.servlet.jsp.JspFactory;
+
+import org.jboss.weld.bootstrap.api.Bootstrap;
+import org.jboss.weld.bootstrap.api.Environments;
+import org.jboss.weld.context.api.BeanStore;
+import org.jboss.weld.context.api.helpers.ConcurrentHashMapBeanStore;
+import org.jboss.weld.injection.spi.ResourceInjectionServices;
+import org.jboss.weld.log.Log;
+import org.jboss.weld.log.Logging;
+import org.jboss.weld.manager.api.WeldManager;
+import org.jboss.weld.servlet.api.ServletListener;
+import org.jboss.weld.servlet.api.ServletServices;
+import org.jboss.weld.servlet.api.helpers.ForwardingServletListener;
+import org.jboss.weld.environment.servlet.deployment.ServletDeployment;
+import org.jboss.weld.environment.servlet.services.ServletResourceInjectionServices;
+import org.jboss.weld.environment.servlet.services.ServletServicesImpl;
+import org.jboss.weld.environment.servlet.util.Reflections;
+import org.jboss.weld.environment.tomcat.WeldAnnotationProcessor;
+
+/**
+ * @author Pete Muir
+ */
+public class Listener extends ForwardingServletListener
+{
+
+ private static final Log log = Logging.getLog(Listener.class);
+
+ private static final String BOOTSTRAP_IMPL_CLASS_NAME = "org.jboss.webbeans.bootstrap.WebBeansBootstrap";
+ private static final String WEB_BEANS_LISTENER_CLASS_NAME = "org.jboss.webbeans.servlet.WebBeansListener";
+ private static final String APPLICATION_BEAN_STORE_ATTRIBUTE_NAME = Listener.class.getName() + ".applicationBeanStore";
+ private static final String EXPRESSION_FACTORY_NAME = "org.jboss.webbeans.el.ExpressionFactory";
+
+ private final transient Bootstrap bootstrap;
+ private final transient ServletListener webBeansListener;
+ private WeldManager manager;
+
+ public Listener()
+ {
+ try
+ {
+ bootstrap = Reflections.newInstance(BOOTSTRAP_IMPL_CLASS_NAME);
+ }
+ catch (IllegalArgumentException e)
+ {
+ throw new IllegalStateException("Error loading Web Beans bootstrap, check that Web Beans is on the classpath", e);
+ }
+ try
+ {
+ webBeansListener = Reflections.newInstance(WEB_BEANS_LISTENER_CLASS_NAME);
+ }
+ catch (IllegalArgumentException e)
+ {
+ throw new IllegalStateException("Error loading Web Beans listener, check that Web Beans is on the classpath", e);
+ }
+ }
+
+ @Override
+ public void contextDestroyed(ServletContextEvent sce)
+ {
+ bootstrap.shutdown();
+ super.contextDestroyed(sce);
+ }
+
+ @Override
+ public void contextInitialized(ServletContextEvent sce)
+ {
+ BeanStore applicationBeanStore = new ConcurrentHashMapBeanStore();
+ sce.getServletContext().setAttribute(APPLICATION_BEAN_STORE_ATTRIBUTE_NAME, applicationBeanStore);
+
+
+
+ ServletDeployment deployment = new ServletDeployment(sce.getServletContext());
+ try
+ {
+ deployment.getWebAppBeanDeploymentArchive().getServices().add(ResourceInjectionServices.class, new ServletResourceInjectionServices() {});
+ }
+ catch (NoClassDefFoundError e)
+ {
+ // Support GAE
+ log.warn("@Resource injection not available in simple beans");
+ }
+
+ deployment.getServices().add(ServletServices.class, new ServletServicesImpl(deployment.getWebAppBeanDeploymentArchive()));
+
+ bootstrap.startContainer(Environments.SERVLET, deployment, applicationBeanStore).startInitialization();
+ manager = bootstrap.getManager(deployment.getWebAppBeanDeploymentArchive());
+
+ boolean tomcat = true;
+ try
+ {
+ Reflections.classForName("org.apache.AnnotationProcessor");
+ }
+ catch (IllegalArgumentException e)
+ {
+ log.info("JSR-299 injection will not be available in Servlets, Filters etc. This facility is only available in Tomcat");
+ tomcat = false;
+ }
+
+ if (tomcat)
+ {
+ // Try pushing a Tomcat AnnotationProcessor into the servlet context
+ try
+ {
+ Class<?> clazz = Reflections.classForName(WeldAnnotationProcessor.class.getName());
+ Object annotationProcessor = clazz.getConstructor(WeldManager.class).newInstance(manager);
+ sce.getServletContext().setAttribute(WeldAnnotationProcessor.class.getName(), annotationProcessor);
+ }
+ catch (Exception e)
+ {
+ log.error("Unable to create Tomcat AnnotationProcessor. JSR-299 injection will not be available in Servlets, Filters etc.", e);
+ }
+ }
+
+ // Push the manager into the servlet context so we can access in JSF
+ sce.getServletContext().setAttribute(BeanManager.class.getName(), manager);
+
+ if (JspFactory.getDefaultFactory() != null)
+ {
+ JspApplicationContext jspApplicationContext = JspFactory.getDefaultFactory().getJspApplicationContext(sce.getServletContext());
+
+ // Register the ELResolver with JSP
+ jspApplicationContext.addELResolver(manager.getELResolver());
+
+ // Register ELContextListener with JSP
+ jspApplicationContext.addELContextListener(Reflections.<ELContextListener>newInstance("org.jboss.webbeans.el.WebBeansELContextListener"));
+
+ // Push the wrapped expression factory into the servlet context so that Tomcat or Jetty can hook it in using a container code
+ sce.getServletContext().setAttribute(EXPRESSION_FACTORY_NAME, manager.wrapExpressionFactory(jspApplicationContext.getExpressionFactory()));
+ }
+
+ bootstrap.deployBeans().validateBeans().endInitialization();
+ super.contextInitialized(sce);
+ }
+
+
+
+ @Override
+ protected ServletListener delegate()
+ {
+ return webBeansListener;
+ }
+
+}
Copied: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/deployment (from rev 3901, extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/deployment)
Modified: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/deployment/AbstractScanner.java
===================================================================
--- extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/deployment/AbstractScanner.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/deployment/AbstractScanner.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -14,12 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.servlet.deployment;
+package org.jboss.weld.environment.servlet.deployment;
import java.net.URL;
-import org.jboss.webbeans.log.Log;
-import org.jboss.webbeans.log.Logging;
+import org.jboss.weld.log.Log;
+import org.jboss.weld.log.Logging;
/**
* Abstract base class for {@link Scanner} providing common functionality
Modified: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/deployment/Scanner.java
===================================================================
--- extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/deployment/Scanner.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/deployment/Scanner.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.servlet.deployment;
+package org.jboss.weld.environment.servlet.deployment;
import java.io.File;
Modified: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/deployment/ServletDeployment.java
===================================================================
--- extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/deployment/ServletDeployment.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/deployment/ServletDeployment.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,14 +1,14 @@
-package org.jboss.webbeans.environment.servlet.deployment;
+package org.jboss.weld.environment.servlet.deployment;
import java.util.ArrayList;
import java.util.Collection;
import javax.servlet.ServletContext;
-import org.jboss.webbeans.bootstrap.api.ServiceRegistry;
-import org.jboss.webbeans.bootstrap.api.helpers.SimpleServiceRegistry;
-import org.jboss.webbeans.bootstrap.spi.BeanDeploymentArchive;
-import org.jboss.webbeans.bootstrap.spi.Deployment;
+import org.jboss.weld.bootstrap.api.ServiceRegistry;
+import org.jboss.weld.bootstrap.api.helpers.SimpleServiceRegistry;
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.bootstrap.spi.Deployment;
public class ServletDeployment implements Deployment
{
Modified: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/deployment/URLScanner.java
===================================================================
--- extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/deployment/URLScanner.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/deployment/URLScanner.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.servlet.deployment;
+package org.jboss.weld.environment.servlet.deployment;
import java.io.File;
import java.io.IOException;
@@ -29,8 +29,8 @@
import java.util.zip.ZipException;
import java.util.zip.ZipFile;
-import org.jboss.webbeans.log.Log;
-import org.jboss.webbeans.log.Logging;
+import org.jboss.weld.log.Log;
+import org.jboss.weld.log.Logging;
/**
* Implementation of {@link Scanner} which can scan a {@link URLClassLoader}
Modified: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/deployment/WebAppBeanDeploymentArchive.java
===================================================================
--- extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/deployment/WebAppBeanDeploymentArchive.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/deployment/WebAppBeanDeploymentArchive.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.servlet.deployment;
+package org.jboss.weld.environment.servlet.deployment;
import java.io.File;
import java.net.MalformedURLException;
@@ -26,12 +26,12 @@
import javax.servlet.ServletContext;
-import org.jboss.webbeans.bootstrap.api.ServiceRegistry;
-import org.jboss.webbeans.bootstrap.api.helpers.SimpleServiceRegistry;
-import org.jboss.webbeans.bootstrap.spi.BeanDeploymentArchive;
-import org.jboss.webbeans.ejb.spi.EjbDescriptor;
-import org.jboss.webbeans.environment.servlet.util.Reflections;
-import org.jboss.webbeans.environment.servlet.util.Servlets;
+import org.jboss.weld.bootstrap.api.ServiceRegistry;
+import org.jboss.weld.bootstrap.api.helpers.SimpleServiceRegistry;
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.ejb.spi.EjbDescriptor;
+import org.jboss.weld.environment.servlet.util.Reflections;
+import org.jboss.weld.environment.servlet.util.Servlets;
/**
* The means by which Web Beans are discovered on the classpath. This will only
Copied: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf (from rev 3901, extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/jsf)
Modified: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/ForwardingApplication.java
===================================================================
--- extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/jsf/ForwardingApplication.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/ForwardingApplication.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.servlet.jsf;
+package org.jboss.weld.environment.servlet.jsf;
import java.util.Collection;
import java.util.Iterator;
Modified: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/ForwardingApplicationFactory.java
===================================================================
--- extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/jsf/ForwardingApplicationFactory.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/ForwardingApplicationFactory.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.servlet.jsf;
+package org.jboss.weld.environment.servlet.jsf;
import javax.faces.application.Application;
import javax.faces.application.ApplicationFactory;
Deleted: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/WebBeansApplication.java
===================================================================
--- extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/jsf/WebBeansApplication.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/WebBeansApplication.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,97 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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.webbeans.environment.servlet.jsf;
-
-import javax.el.ELContextListener;
-import javax.el.ExpressionFactory;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.faces.application.Application;
-import javax.faces.context.FacesContext;
-import javax.servlet.ServletContext;
-
-import org.jboss.webbeans.environment.servlet.util.Reflections;
-import org.jboss.webbeans.manager.api.WebBeansManager;
-
-/**
- * @author pmuir
- *
- */
-public class WebBeansApplication extends ForwardingApplication
-{
-
- private static final ELContextListener[] EMPTY_LISTENERS = {};
-
- private final Application application;
- private ExpressionFactory expressionFactory;
-
- public WebBeansApplication(Application application)
- {
- this.application = application;
- BeanManager beanManager = getBeanManager();
- if (beanManager != null)
- {
- application.addELContextListener(Reflections.<ELContextListener>newInstance("org.jboss.webbeans.el.WebBeansELContextListener"));
- application.addELResolver(beanManager.getELResolver());
- }
- }
-
- @Override
- protected Application delegate()
- {
- return application;
- }
-
- @Override
- public ExpressionFactory getExpressionFactory()
- {
- // Application is multi-threaded, but no need to guard against races (re-
- // creating the cached expression factory doesn't matter) or liveness
- // (the value read by all threads will be the same)
- // We have to do this lazily as Mojarra hasn't set the ExpressionFactory
- // when the object is created
- if (this.expressionFactory == null)
- {
- BeanManager beanManager = getBeanManager();
- if (beanManager != null)
- {
- this.expressionFactory = beanManager.wrapExpressionFactory(delegate().getExpressionFactory());
- }
- else
- {
- // WB failed to initialize properly
- this.expressionFactory = delegate().getExpressionFactory();
- }
- }
- return expressionFactory;
- }
-
- private static WebBeansManager getBeanManager()
- {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- if (!(facesContext.getExternalContext().getContext() instanceof ServletContext))
- {
- throw new IllegalStateException("Not in a servlet environment!");
- }
- ServletContext ctx = (ServletContext) facesContext.getExternalContext().getContext();
- if (ctx.getAttribute(BeanManager.class.getName()) == null)
- {
- throw new IllegalStateException("BeanManager has not been pushed into the ServletContext");
- }
- return (WebBeansManager) ctx.getAttribute(BeanManager.class.getName());
- }
-
-}
Modified: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/WebBeansApplicationFactory.java
===================================================================
--- extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/jsf/WebBeansApplicationFactory.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/WebBeansApplicationFactory.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.servlet.jsf;
+package org.jboss.weld.environment.servlet.jsf;
import javax.faces.application.Application;
import javax.faces.application.ApplicationFactory;
@@ -47,7 +47,7 @@
{
if (application == null)
{
- application = new WebBeansApplication(delegate().getApplication());
+ application = new WeldApplication(delegate().getApplication());
}
return application;
}
Copied: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/WeldApplication.java (from rev 3901, extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/jsf/WebBeansApplication.java)
===================================================================
--- extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/WeldApplication.java (rev 0)
+++ extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/WeldApplication.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -0,0 +1,97 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.weld.environment.servlet.jsf;
+
+import javax.el.ELContextListener;
+import javax.el.ExpressionFactory;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.faces.application.Application;
+import javax.faces.context.FacesContext;
+import javax.servlet.ServletContext;
+
+import org.jboss.weld.manager.api.WeldManager;
+import org.jboss.weld.environment.servlet.util.Reflections;
+
+/**
+ * @author pmuir
+ *
+ */
+public class WeldApplication extends ForwardingApplication
+{
+
+ private static final ELContextListener[] EMPTY_LISTENERS = {};
+
+ private final Application application;
+ private ExpressionFactory expressionFactory;
+
+ public WeldApplication(Application application)
+ {
+ this.application = application;
+ BeanManager beanManager = getBeanManager();
+ if (beanManager != null)
+ {
+ application.addELContextListener(Reflections.<ELContextListener>newInstance("org.jboss.weld.el.WeldELContextListener"));
+ application.addELResolver(beanManager.getELResolver());
+ }
+ }
+
+ @Override
+ protected Application delegate()
+ {
+ return application;
+ }
+
+ @Override
+ public ExpressionFactory getExpressionFactory()
+ {
+ // Application is multi-threaded, but no need to guard against races (re-
+ // creating the cached expression factory doesn't matter) or liveness
+ // (the value read by all threads will be the same)
+ // We have to do this lazily as Mojarra hasn't set the ExpressionFactory
+ // when the object is created
+ if (this.expressionFactory == null)
+ {
+ BeanManager beanManager = getBeanManager();
+ if (beanManager != null)
+ {
+ this.expressionFactory = beanManager.wrapExpressionFactory(delegate().getExpressionFactory());
+ }
+ else
+ {
+ // WB failed to initialize properly
+ this.expressionFactory = delegate().getExpressionFactory();
+ }
+ }
+ return expressionFactory;
+ }
+
+ private static WeldManager getBeanManager()
+ {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ if (!(facesContext.getExternalContext().getContext() instanceof ServletContext))
+ {
+ throw new IllegalStateException("Not in a servlet environment!");
+ }
+ ServletContext ctx = (ServletContext) facesContext.getExternalContext().getContext();
+ if (ctx.getAttribute(BeanManager.class.getName()) == null)
+ {
+ throw new IllegalStateException("BeanManager has not been pushed into the ServletContext");
+ }
+ return (WeldManager) ctx.getAttribute(BeanManager.class.getName());
+ }
+
+}
Copied: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/services (from rev 3901, extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/services)
Modified: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/services/ServletResourceInjectionServices.java
===================================================================
--- extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/services/ServletResourceInjectionServices.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/services/ServletResourceInjectionServices.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,11 +1,11 @@
-package org.jboss.webbeans.environment.servlet.services;
+package org.jboss.weld.environment.servlet.services;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
-import org.jboss.webbeans.injection.spi.ResourceInjectionServices;
-import org.jboss.webbeans.injection.spi.helpers.AbstractResourceServices;
+import org.jboss.weld.injection.spi.ResourceInjectionServices;
+import org.jboss.weld.injection.spi.helpers.AbstractResourceServices;
public abstract class ServletResourceInjectionServices extends AbstractResourceServices implements ResourceInjectionServices
{
Modified: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/services/ServletServicesImpl.java
===================================================================
--- extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/services/ServletServicesImpl.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/services/ServletServicesImpl.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,9 +1,9 @@
-package org.jboss.webbeans.environment.servlet.services;
+package org.jboss.weld.environment.servlet.services;
import javax.servlet.ServletContext;
-import org.jboss.webbeans.bootstrap.spi.BeanDeploymentArchive;
-import org.jboss.webbeans.servlet.api.ServletServices;
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.servlet.api.ServletServices;
public class ServletServicesImpl implements ServletServices
{
Copied: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/util (from rev 3901, extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/util)
Modified: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/util/Reflections.java
===================================================================
--- extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/util/Reflections.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/util/Reflections.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.servlet.util;
+package org.jboss.weld.environment.servlet.util;
/**
Modified: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/util/Servlets.java
===================================================================
--- extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/util/Servlets.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/util/Servlets.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.environment.servlet.util;
+package org.jboss.weld.environment.servlet.util;
import java.io.File;
import java.net.MalformedURLException;
Copied: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/tomcat (from rev 3901, extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/tomcat)
Deleted: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/tomcat/WebBeansAnnotationProcessor.java
===================================================================
--- extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/tomcat/WebBeansAnnotationProcessor.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/tomcat/WebBeansAnnotationProcessor.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,53 +0,0 @@
-package org.jboss.webbeans.environment.tomcat;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.inject.spi.InjectionTarget;
-import javax.naming.NamingException;
-
-import org.apache.AnnotationProcessor;
-import org.jboss.webbeans.manager.api.WebBeansManager;
-
-public class WebBeansAnnotationProcessor implements AnnotationProcessor
-{
-
- private final Map<Class<?>, InjectionTarget<?>> injectionTargets;
-
- private final WebBeansManager manager;
-
- public WebBeansAnnotationProcessor(WebBeansManager manager)
- {
- this.manager = manager;
- this.injectionTargets = new ConcurrentHashMap<Class<?>, InjectionTarget<?>>();
- }
-
- public void processAnnotations(Object instance) throws IllegalAccessException, InvocationTargetException, NamingException
- {
- // not data-race safe, however doesn't matter, as the injection target created for class A is interchangable for another injection target created for class A
- // TODO Make this a concurrent cache when we switch to google collections
- Class<?> clazz = instance.getClass();
- if (!injectionTargets.containsKey(clazz))
- {
- injectionTargets.put(clazz, manager.createInjectionTarget(manager.createAnnotatedType(clazz)));
- }
- CreationalContext<Object> cc = manager.createCreationalContext(null);
- InjectionTarget<Object> it = (InjectionTarget<Object>) injectionTargets.get(clazz);
- it.inject(instance, cc);
- }
-
- public void postConstruct(Object arg0) throws IllegalAccessException, InvocationTargetException
- {
- // TODO Auto-generated method stub
-
- }
-
- public void preDestroy(Object arg0) throws IllegalAccessException, InvocationTargetException
- {
- // TODO Auto-generated method stub
-
- }
-
-}
Copied: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/tomcat/WeldAnnotationProcessor.java (from rev 3901, extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/tomcat/WebBeansAnnotationProcessor.java)
===================================================================
--- extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/tomcat/WeldAnnotationProcessor.java (rev 0)
+++ extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/tomcat/WeldAnnotationProcessor.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -0,0 +1,53 @@
+package org.jboss.weld.environment.tomcat;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.InjectionTarget;
+import javax.naming.NamingException;
+
+import org.apache.AnnotationProcessor;
+import org.jboss.weld.manager.api.WeldManager;
+
+public class WeldAnnotationProcessor implements AnnotationProcessor
+{
+
+ private final Map<Class<?>, InjectionTarget<?>> injectionTargets;
+
+ private final WeldManager manager;
+
+ public WeldAnnotationProcessor(WeldManager manager)
+ {
+ this.manager = manager;
+ this.injectionTargets = new ConcurrentHashMap<Class<?>, InjectionTarget<?>>();
+ }
+
+ public void processAnnotations(Object instance) throws IllegalAccessException, InvocationTargetException, NamingException
+ {
+ // not data-race safe, however doesn't matter, as the injection target created for class A is interchangable for another injection target created for class A
+ // TODO Make this a concurrent cache when we switch to google collections
+ Class<?> clazz = instance.getClass();
+ if (!injectionTargets.containsKey(clazz))
+ {
+ injectionTargets.put(clazz, manager.createInjectionTarget(manager.createAnnotatedType(clazz)));
+ }
+ CreationalContext<Object> cc = manager.createCreationalContext(null);
+ InjectionTarget<Object> it = (InjectionTarget<Object>) injectionTargets.get(clazz);
+ it.inject(instance, cc);
+ }
+
+ public void postConstruct(Object arg0) throws IllegalAccessException, InvocationTargetException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void preDestroy(Object arg0) throws IllegalAccessException, InvocationTargetException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Modified: extensions/trunk/servlet/pom.xml
===================================================================
--- extensions/trunk/servlet/pom.xml 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/pom.xml 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,18 +1,18 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.webbeans.servlet</groupId>
- <artifactId>webbeans-servlet-parent</artifactId>
+ <groupId>org.jboss.weld.servlet</groupId>
+ <artifactId>weld-servlet-parent</artifactId>
<packaging>pom</packaging>
<version>1.0.0-SNAPSHOT</version>
<parent>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-version-matrix</artifactId>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-version-matrix</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
- <name>Web Beans Servlet aggregator</name>
- <url>http://www.seamframework.org/WebBeans</url>
+ <name>Weld Servlet aggregator</name>
+ <url>http://www.seamframework.org/Weld</url>
<modules>
<module>int</module>
@@ -22,7 +22,7 @@
</modules>
<description>
- Support for Web Beans in Servlet Containers
+ Support for Weld in Servlet Containers
</description>
<developers>
@@ -61,7 +61,7 @@
<artifactId>maven-release-plugin</artifactId>
<version>2.0-beta-8</version>
<configuration>
- <tagBase>https://svn.jboss.org/repos/webbeans/extensions/tags</tagBase>
+ <tagBase>https://svn.jboss.org/repos/weld/extensions/tags</tagBase>
<autoVersionSubmodules>true</autoVersionSubmodules>
</configuration>
</plugin>
@@ -136,9 +136,9 @@
</licenses>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/webbeans/extensions</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/webbeans/extensions</developerConnection>
- <url>http://fisheye.jboss.org/browse/WebBeans/extensions</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/weld/extensions</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/weld/extensions</developerConnection>
+ <url>http://fisheye.jboss.org/browse/Weld/extensions</url>
</scm>
<distributionManagement>
Modified: extensions/trunk/servlet/support/pom.xml
===================================================================
--- extensions/trunk/servlet/support/pom.xml 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/support/pom.xml 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
- <artifactId>webbeans-servlet-parent</artifactId>
- <groupId>org.jboss.webbeans.servlet</groupId>
+ <artifactId>weld-servlet-parent</artifactId>
+ <groupId>org.jboss.weld.servlet</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.webbeans.servlet</groupId>
- <artifactId>webbeans-tomcat-support</artifactId>
+ <groupId>org.jboss.weld.servlet</groupId>
+ <artifactId>weld-tomcat-support</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
- <name>Web Beans Servlet Integration: Tomcat Support</name>
+ <name>Weld Servlet Integration: Tomcat Support</name>
<url>http://www.seamframework.org/WebBeans</url>
<dependencies>
Deleted: extensions/trunk/servlet/support/src/main/java/org/jboss/webbeans/environment/tomcat/ForwardingAnnotationProcessor.java
===================================================================
--- extensions/trunk/servlet/support/src/main/java/org/jboss/webbeans/environment/tomcat/ForwardingAnnotationProcessor.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/support/src/main/java/org/jboss/webbeans/environment/tomcat/ForwardingAnnotationProcessor.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,29 +0,0 @@
-package org.jboss.webbeans.environment.tomcat;
-
-import java.lang.reflect.InvocationTargetException;
-
-import javax.naming.NamingException;
-
-import org.apache.AnnotationProcessor;
-
-public abstract class ForwardingAnnotationProcessor implements AnnotationProcessor
-{
-
- protected abstract AnnotationProcessor delegate();
-
- public void postConstruct(Object instance) throws IllegalAccessException, InvocationTargetException
- {
- delegate().postConstruct(instance);
- }
-
- public void preDestroy(Object instance) throws IllegalAccessException, InvocationTargetException
- {
- delegate().preDestroy(instance);
- }
-
- public void processAnnotations(Object instance) throws IllegalAccessException, InvocationTargetException, NamingException
- {
- delegate().processAnnotations(instance);
- }
-
-}
Deleted: extensions/trunk/servlet/support/src/main/java/org/jboss/webbeans/environment/tomcat/ForwardingJspApplicationContextImpl.java
===================================================================
--- extensions/trunk/servlet/support/src/main/java/org/jboss/webbeans/environment/tomcat/ForwardingJspApplicationContextImpl.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/support/src/main/java/org/jboss/webbeans/environment/tomcat/ForwardingJspApplicationContextImpl.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,78 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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.webbeans.environment.tomcat;
-
-import javax.el.ELContextListener;
-import javax.el.ELResolver;
-import javax.el.ExpressionFactory;
-import javax.servlet.jsp.JspContext;
-
-import org.apache.jasper.el.ELContextImpl;
-import org.apache.jasper.runtime.JspApplicationContextImpl;
-
-/**
- * @author pmuir
- *
- */
-public abstract class ForwardingJspApplicationContextImpl extends JspApplicationContextImpl
-{
-
- protected abstract JspApplicationContextImpl delegate();
-
- @Override
- public void addELContextListener(ELContextListener listener)
- {
- delegate().addELContextListener(listener);
- }
-
- @Override
- public void addELResolver(ELResolver resolver) throws IllegalStateException
- {
- delegate().addELResolver(resolver);
- }
-
- @Override
- public ELContextImpl createELContext(JspContext arg0)
- {
- return delegate().createELContext(arg0);
- }
-
- @Override
- public ExpressionFactory getExpressionFactory()
- {
- return delegate().getExpressionFactory();
- }
-
- @Override
- public boolean equals(Object obj)
- {
- return this == obj || delegate().equals(obj);
- }
-
- @Override
- public int hashCode()
- {
- return delegate().hashCode();
- }
-
- @Override
- public String toString()
- {
- return delegate().toString();
- }
-
-}
Deleted: extensions/trunk/servlet/support/src/main/java/org/jboss/webbeans/environment/tomcat/JspInitialization.java
===================================================================
--- extensions/trunk/servlet/support/src/main/java/org/jboss/webbeans/environment/tomcat/JspInitialization.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/support/src/main/java/org/jboss/webbeans/environment/tomcat/JspInitialization.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,86 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- *
- * Use is subject to license terms.
- *
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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.webbeans.environment.tomcat;
-
-import javax.el.ELContextListener;
-import javax.el.ELResolver;
-import javax.el.ExpressionFactory;
-import javax.servlet.ServletContext;
-import javax.servlet.jsp.JspApplicationContext;
-import javax.servlet.jsp.JspFactory;
-
-import org.apache.jasper.runtime.JspApplicationContextImpl;
-import org.jboss.webbeans.environment.tomcat.util.Reflections;
-
-/**
- * The Web Beans JSP initialization listener
- *
- *
- * @author Pete Muir
- *
- */
-public class JspInitialization
-{
-
- private static final String EXPRESSION_FACTORY_NAME = "org.jboss.webbeans.el.ExpressionFactory";
-
- private static class WebBeansJspApplicationContextImpl extends ForwardingJspApplicationContextImpl
- {
- private final JspApplicationContextImpl delegate;
- private final ExpressionFactory expressionFactory;
-
- public WebBeansJspApplicationContextImpl(JspApplicationContextImpl delegate, ExpressionFactory expressionFactory)
- {
- this.delegate = delegate;
- this.expressionFactory = expressionFactory;
- }
-
- @Override
- protected JspApplicationContextImpl delegate()
- {
- return delegate;
- }
-
- @Override
- public ExpressionFactory getExpressionFactory()
- {
- return expressionFactory;
- }
-
- }
-
- public void initialize(ServletContext context)
- {
- // get JspApplicationContext.
- JspApplicationContext jspAppContext = JspFactory.getDefaultFactory().getJspApplicationContext(context);
-
- if (context.getAttribute(EXPRESSION_FACTORY_NAME) != null)
- {
- ExpressionFactory expressionFactory = (ExpressionFactory) context.getAttribute(EXPRESSION_FACTORY_NAME);
- // Hack into JBoss Web/Catalina to replace the ExpressionFactory
- JspApplicationContextImpl wrappedJspApplicationContextImpl = new WebBeansJspApplicationContextImpl(JspApplicationContextImpl.getInstance(context), expressionFactory);
- context.setAttribute(JspApplicationContextImpl.class.getName(), wrappedJspApplicationContextImpl);
- }
- // otherwise something went wrong starting WB, so don't register with JSP
- }
-}
Deleted: extensions/trunk/servlet/support/src/main/java/org/jboss/webbeans/environment/tomcat/WebBeansLifecycleListener.java
===================================================================
--- extensions/trunk/servlet/support/src/main/java/org/jboss/webbeans/environment/tomcat/WebBeansLifecycleListener.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/support/src/main/java/org/jboss/webbeans/environment/tomcat/WebBeansLifecycleListener.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,89 +0,0 @@
-package org.jboss.webbeans.environment.tomcat;
-
-import java.lang.reflect.InvocationTargetException;
-
-import javax.naming.NamingException;
-import javax.servlet.ServletContext;
-
-import org.apache.AnnotationProcessor;
-import org.apache.catalina.LifecycleEvent;
-import org.apache.catalina.LifecycleListener;
-import org.apache.catalina.core.StandardContext;
-
-public class WebBeansLifecycleListener implements LifecycleListener
-{
-
- private static final AnnotationProcessor DUMMY_PROCESSOR = new AnnotationProcessor()
- {
-
- public void postConstruct(Object arg0) throws IllegalAccessException, InvocationTargetException {}
-
- public void preDestroy(Object arg0) throws IllegalAccessException, InvocationTargetException {}
-
- public void processAnnotations(Object arg0) throws IllegalAccessException, InvocationTargetException, NamingException {}
-
- };
-
- public void lifecycleEvent(LifecycleEvent event)
- {
- if (event.getType().equals("after_start") && event.getLifecycle() instanceof StandardContext)
- {
- StandardContext context = (StandardContext) event.getLifecycle();
- final ServletContext servletContext = context.getServletContext();
-
- // Initialize servlet injection
- final AnnotationProcessor originalAnnotationProcessor = context.getAnnotationProcessor();
- context.setAnnotationProcessor(new ForwardingAnnotationProcessor()
- {
-
- private AnnotationProcessor processor;
-
- @Override
- protected AnnotationProcessor delegate()
- {
- return originalAnnotationProcessor;
- }
-
- @Override
- public void processAnnotations(Object instance) throws IllegalAccessException, InvocationTargetException, NamingException
- {
- super.processAnnotations(instance);
- getProcessor().processAnnotations(instance);
- }
-
- @Override
- public void postConstruct(Object instance) throws IllegalAccessException, InvocationTargetException
- {
- super.postConstruct(instance);
- getProcessor().postConstruct(instance);
- }
-
- @Override
- public void preDestroy(Object instance) throws IllegalAccessException, InvocationTargetException
- {
- super.preDestroy(instance);
- getProcessor().preDestroy(instance);
- }
-
- private AnnotationProcessor getProcessor()
- {
- if (processor == null)
- {
- Object o = servletContext.getAttribute("org.jboss.webbeans.environment.tomcat.WebBeansAnnotationProcessor");
- if (o instanceof AnnotationProcessor)
- {
- processor = (AnnotationProcessor) o;
- }
- else
- {
- return DUMMY_PROCESSOR;
- }
- }
- return processor;
- }
-
- });
- }
- }
-
-}
Copied: extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/ForwardingAnnotationProcessor.java (from rev 3901, extensions/trunk/servlet/support/src/main/java/org/jboss/webbeans/environment/tomcat/ForwardingAnnotationProcessor.java)
===================================================================
--- extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/ForwardingAnnotationProcessor.java (rev 0)
+++ extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/ForwardingAnnotationProcessor.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -0,0 +1,29 @@
+package org.jboss.weld.environment.tomcat;
+
+import java.lang.reflect.InvocationTargetException;
+
+import javax.naming.NamingException;
+
+import org.apache.AnnotationProcessor;
+
+public abstract class ForwardingAnnotationProcessor implements AnnotationProcessor
+{
+
+ protected abstract AnnotationProcessor delegate();
+
+ public void postConstruct(Object instance) throws IllegalAccessException, InvocationTargetException
+ {
+ delegate().postConstruct(instance);
+ }
+
+ public void preDestroy(Object instance) throws IllegalAccessException, InvocationTargetException
+ {
+ delegate().preDestroy(instance);
+ }
+
+ public void processAnnotations(Object instance) throws IllegalAccessException, InvocationTargetException, NamingException
+ {
+ delegate().processAnnotations(instance);
+ }
+
+}
Copied: extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/ForwardingJspApplicationContextImpl.java (from rev 3901, extensions/trunk/servlet/support/src/main/java/org/jboss/webbeans/environment/tomcat/ForwardingJspApplicationContextImpl.java)
===================================================================
--- extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/ForwardingJspApplicationContextImpl.java (rev 0)
+++ extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/ForwardingJspApplicationContextImpl.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.weld.environment.tomcat;
+
+import javax.el.ELContextListener;
+import javax.el.ELResolver;
+import javax.el.ExpressionFactory;
+import javax.servlet.jsp.JspContext;
+
+import org.apache.jasper.el.ELContextImpl;
+import org.apache.jasper.runtime.JspApplicationContextImpl;
+
+/**
+ * @author pmuir
+ *
+ */
+public abstract class ForwardingJspApplicationContextImpl extends JspApplicationContextImpl
+{
+
+ protected abstract JspApplicationContextImpl delegate();
+
+ @Override
+ public void addELContextListener(ELContextListener listener)
+ {
+ delegate().addELContextListener(listener);
+ }
+
+ @Override
+ public void addELResolver(ELResolver resolver) throws IllegalStateException
+ {
+ delegate().addELResolver(resolver);
+ }
+
+ @Override
+ public ELContextImpl createELContext(JspContext arg0)
+ {
+ return delegate().createELContext(arg0);
+ }
+
+ @Override
+ public ExpressionFactory getExpressionFactory()
+ {
+ return delegate().getExpressionFactory();
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ return this == obj || delegate().equals(obj);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return delegate().hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ return delegate().toString();
+ }
+
+}
Copied: extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/JspInitialization.java (from rev 3901, extensions/trunk/servlet/support/src/main/java/org/jboss/webbeans/environment/tomcat/JspInitialization.java)
===================================================================
--- extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/JspInitialization.java (rev 0)
+++ extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/JspInitialization.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -0,0 +1,86 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * Use is subject to license terms.
+ *
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.weld.environment.tomcat;
+
+import javax.el.ELContextListener;
+import javax.el.ELResolver;
+import javax.el.ExpressionFactory;
+import javax.servlet.ServletContext;
+import javax.servlet.jsp.JspApplicationContext;
+import javax.servlet.jsp.JspFactory;
+
+import org.apache.jasper.runtime.JspApplicationContextImpl;
+import org.jboss.weld.environment.tomcat.util.Reflections;
+
+/**
+ * The Web Beans JSP initialization listener
+ *
+ *
+ * @author Pete Muir
+ *
+ */
+public class JspInitialization
+{
+
+ private static final String EXPRESSION_FACTORY_NAME = "org.jboss.webbeans.el.ExpressionFactory";
+
+ private static class WebBeansJspApplicationContextImpl extends ForwardingJspApplicationContextImpl
+ {
+ private final JspApplicationContextImpl delegate;
+ private final ExpressionFactory expressionFactory;
+
+ public WebBeansJspApplicationContextImpl(JspApplicationContextImpl delegate, ExpressionFactory expressionFactory)
+ {
+ this.delegate = delegate;
+ this.expressionFactory = expressionFactory;
+ }
+
+ @Override
+ protected JspApplicationContextImpl delegate()
+ {
+ return delegate;
+ }
+
+ @Override
+ public ExpressionFactory getExpressionFactory()
+ {
+ return expressionFactory;
+ }
+
+ }
+
+ public void initialize(ServletContext context)
+ {
+ // get JspApplicationContext.
+ JspApplicationContext jspAppContext = JspFactory.getDefaultFactory().getJspApplicationContext(context);
+
+ if (context.getAttribute(EXPRESSION_FACTORY_NAME) != null)
+ {
+ ExpressionFactory expressionFactory = (ExpressionFactory) context.getAttribute(EXPRESSION_FACTORY_NAME);
+ // Hack into JBoss Web/Catalina to replace the ExpressionFactory
+ JspApplicationContextImpl wrappedJspApplicationContextImpl = new WebBeansJspApplicationContextImpl(JspApplicationContextImpl.getInstance(context), expressionFactory);
+ context.setAttribute(JspApplicationContextImpl.class.getName(), wrappedJspApplicationContextImpl);
+ }
+ // otherwise something went wrong starting WB, so don't register with JSP
+ }
+}
Copied: extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/WeldLifecycleListener.java (from rev 3901, extensions/trunk/servlet/support/src/main/java/org/jboss/webbeans/environment/tomcat/WebBeansLifecycleListener.java)
===================================================================
--- extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/WeldLifecycleListener.java (rev 0)
+++ extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/WeldLifecycleListener.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -0,0 +1,89 @@
+package org.jboss.weld.environment.tomcat;
+
+import java.lang.reflect.InvocationTargetException;
+
+import javax.naming.NamingException;
+import javax.servlet.ServletContext;
+
+import org.apache.AnnotationProcessor;
+import org.apache.catalina.LifecycleEvent;
+import org.apache.catalina.LifecycleListener;
+import org.apache.catalina.core.StandardContext;
+
+public class WeldLifecycleListener implements LifecycleListener
+{
+
+ private static final AnnotationProcessor DUMMY_PROCESSOR = new AnnotationProcessor()
+ {
+
+ public void postConstruct(Object arg0) throws IllegalAccessException, InvocationTargetException {}
+
+ public void preDestroy(Object arg0) throws IllegalAccessException, InvocationTargetException {}
+
+ public void processAnnotations(Object arg0) throws IllegalAccessException, InvocationTargetException, NamingException {}
+
+ };
+
+ public void lifecycleEvent(LifecycleEvent event)
+ {
+ if (event.getType().equals("after_start") && event.getLifecycle() instanceof StandardContext)
+ {
+ StandardContext context = (StandardContext) event.getLifecycle();
+ final ServletContext servletContext = context.getServletContext();
+
+ // Initialize servlet injection
+ final AnnotationProcessor originalAnnotationProcessor = context.getAnnotationProcessor();
+ context.setAnnotationProcessor(new ForwardingAnnotationProcessor()
+ {
+
+ private AnnotationProcessor processor;
+
+ @Override
+ protected AnnotationProcessor delegate()
+ {
+ return originalAnnotationProcessor;
+ }
+
+ @Override
+ public void processAnnotations(Object instance) throws IllegalAccessException, InvocationTargetException, NamingException
+ {
+ super.processAnnotations(instance);
+ getProcessor().processAnnotations(instance);
+ }
+
+ @Override
+ public void postConstruct(Object instance) throws IllegalAccessException, InvocationTargetException
+ {
+ super.postConstruct(instance);
+ getProcessor().postConstruct(instance);
+ }
+
+ @Override
+ public void preDestroy(Object instance) throws IllegalAccessException, InvocationTargetException
+ {
+ super.preDestroy(instance);
+ getProcessor().preDestroy(instance);
+ }
+
+ private AnnotationProcessor getProcessor()
+ {
+ if (processor == null)
+ {
+ Object o = servletContext.getAttribute("org.jboss.webbeans.environment.tomcat.WebBeansAnnotationProcessor");
+ if (o instanceof AnnotationProcessor)
+ {
+ processor = (AnnotationProcessor) o;
+ }
+ else
+ {
+ return DUMMY_PROCESSOR;
+ }
+ }
+ return processor;
+ }
+
+ });
+ }
+ }
+
+}
Copied: extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/util (from rev 3901, extensions/trunk/servlet/support/src/main/java/org/jboss/webbeans/environment/tomcat/util)
Modified: extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/util/Reflections.java
===================================================================
--- extensions/trunk/servlet/support/src/main/java/org/jboss/webbeans/environment/tomcat/util/Reflections.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/support/src/main/java/org/jboss/weld/environment/tomcat/util/Reflections.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.tomcat.util;
+package org.jboss.weld.environment.tomcat.util;
/**
Modified: extensions/trunk/servlet/tests/pom.xml
===================================================================
--- extensions/trunk/servlet/tests/pom.xml 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/tests/pom.xml 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
- <artifactId>webbeans-servlet-parent</artifactId>
- <groupId>org.jboss.webbeans.servlet</groupId>
+ <artifactId>weld-servlet-parent</artifactId>
+ <groupId>org.jboss.weld.servlet</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.webbeans.servlet</groupId>
- <artifactId>webbeans-servlet-test</artifactId>
+ <groupId>org.jboss.weld.servlet</groupId>
+ <artifactId>weld-servlet-test</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
- <name>Web Beans Servlet Integration Tests</name>
- <url>http://www.seamframework.org/WebBeans</url>
+ <name>Weld Servlet Integration Tests</name>
+ <url>http://www.seamframework.org/Weld</url>
<dependencies>
<dependency>
@@ -54,8 +54,8 @@
</dependency>
<dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-core-test</artifactId>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-core-test</artifactId>
<scope>test</scope>
<version>1.0.0-SNAPSHOT</version> <!-- waiting on >= 1.0.0.PREVIEW2 -->
</dependency>
@@ -72,20 +72,20 @@
</dependency>
<dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-core</artifactId>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-spi</artifactId>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-spi</artifactId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.jboss.webbeans.servlet</groupId>
- <artifactId>webbeans-servlet-int</artifactId>
+ <groupId>org.jboss.weld.servlet</groupId>
+ <artifactId>weld-servlet-int</artifactId>
<scope>test</scope>
<version>1.0.0-SNAPSHOT</version> <!-- waiting on >= 1.0.0.CR2 -->
</dependency>
@@ -189,8 +189,8 @@
<outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
</artifactItem>
<artifactItem>
- <groupId>org.jboss.webbeans.servlet</groupId>
- <artifactId>webbeans-servlet</artifactId>
+ <groupId>org.jboss.weld.servlet</groupId>
+ <artifactId>weld-servlet</artifactId>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
</artifactItem>
Copied: extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/environment/servlet/discovery (from rev 3901, extensions/trunk/servlet/tests/src/test/java/org/jboss/webbeans/environment/servlet/discovery)
Deleted: extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/environment/servlet/discovery/ServletWebBeanDiscoveryTest.java
===================================================================
--- extensions/trunk/servlet/tests/src/test/java/org/jboss/webbeans/environment/servlet/discovery/ServletWebBeanDiscoveryTest.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/environment/servlet/discovery/ServletWebBeanDiscoveryTest.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,43 +0,0 @@
-package org.jboss.webbeans.environment.servlet.discovery;
-
-import java.net.URL;
-import java.util.Set;
-
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.webbeans.environment.servlet.deployment.WebAppBeanDeploymentArchive;
-import org.jboss.webbeans.mock.MockServletContext;
-import org.jboss.webbeans.test.AbstractWebBeansTest;
-import org.testng.annotations.Test;
-
-/**
- * A set of tests to verify the discovery of JSR-299 resources in a servlet environment.
- *
- * @author Dan Allen
- */
-@Artifact
-// for now we are just going to look for the one in test-classes/META-INF/beans.xml using standalone mode
-//@Resources(
-// @Resource(source = "beans.xml", destination = "WEB-INF/classes/META-INF/beans.xml")
-//)
-public class ServletWebBeanDiscoveryTest extends AbstractWebBeansTest
-{
- /**
- * Verify that the scanner properly locates any META-INF/beans.xml. To prevent a brittle test,
- * assume that there is at least one found and that the path ends with META-INF/beans.xml. Technically,
- * META-INF would need to be the root of the classpath.
- */
- @Test
- public void testDiscoverMetaInfBeansXml()
- {
- WebAppBeanDeploymentArchive discovery = new WebAppBeanDeploymentArchive(new MockServletContext("."))
- {
- };
-
- Set<URL> beansXmls = discovery.getWbUrls();
- assert beansXmls.size() >= 1 : "Expecting to find at least one META-INF/beans.xml resource on the test classpath";
- for (URL beansXml : beansXmls)
- {
- assert beansXml.getPath().endsWith("META-INF/beans.xml") : beansXml.getPath() + " does not end with META-INF/beans.xml as expected";
- }
- }
-}
Copied: extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/environment/servlet/discovery/ServletWeldDiscoveryTest.java (from rev 3901, extensions/trunk/servlet/tests/src/test/java/org/jboss/webbeans/environment/servlet/discovery/ServletWebBeanDiscoveryTest.java)
===================================================================
--- extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/environment/servlet/discovery/ServletWeldDiscoveryTest.java (rev 0)
+++ extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/environment/servlet/discovery/ServletWeldDiscoveryTest.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -0,0 +1,43 @@
+package org.jboss.weld.environment.servlet.discovery;
+
+import java.net.URL;
+import java.util.Set;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.weld.environment.servlet.deployment.WebAppBeanDeploymentArchive;
+import org.jboss.weld.mock.MockServletContext;
+import org.jboss.weld.test.AbstractWeldTest;
+import org.testng.annotations.Test;
+
+/**
+ * A set of tests to verify the discovery of JSR-299 resources in a servlet environment.
+ *
+ * @author Dan Allen
+ */
+@Artifact
+// for now we are just going to look for the one in test-classes/META-INF/beans.xml using standalone mode
+//@Resources(
+// @Resource(source = "beans.xml", destination = "WEB-INF/classes/META-INF/beans.xml")
+//)
+public class ServletWeldDiscoveryTest extends AbstractWeldTest
+{
+ /**
+ * Verify that the scanner properly locates any META-INF/beans.xml. To prevent a brittle test,
+ * assume that there is at least one found and that the path ends with META-INF/beans.xml. Technically,
+ * META-INF would need to be the root of the classpath.
+ */
+ @Test
+ public void testDiscoverMetaInfBeansXml()
+ {
+ WebAppBeanDeploymentArchive discovery = new WebAppBeanDeploymentArchive(new MockServletContext("."))
+ {
+ };
+
+ Set<URL> beansXmls = discovery.getWbUrls();
+ assert beansXmls.size() >= 1 : "Expecting to find at least one META-INF/beans.xml resource on the test classpath";
+ for (URL beansXml : beansXmls)
+ {
+ assert beansXml.getPath().endsWith("META-INF/beans.xml") : beansXml.getPath() + " does not end with META-INF/beans.xml as expected";
+ }
+ }
+}
Copied: extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples (from rev 3901, extensions/trunk/servlet/tests/src/test/java/org/jboss/webbeans/test/tomcat/examples)
Modified: extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/ExampleTest.java
===================================================================
--- extensions/trunk/servlet/tests/src/test/java/org/jboss/webbeans/test/tomcat/examples/ExampleTest.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/ExampleTest.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,13 +1,13 @@
-package org.jboss.webbeans.test.tomcat.examples;
+package org.jboss.weld.test.tomcat.examples;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.webbeans.test.AbstractWebBeansTest;
-import org.jboss.webbeans.test.harness.ServletLifecycleContainersImpl;
+import org.jboss.weld.test.AbstractWeldTest;
+import org.jboss.weld.test.harness.ServletLifecycleContainersImpl;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Artifact
-public class ExampleTest extends AbstractWebBeansTest
+public class ExampleTest extends AbstractWeldTest
{
@Test
Modified: extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/Game.java
===================================================================
--- extensions/trunk/servlet/tests/src/test/java/org/jboss/webbeans/test/tomcat/examples/Game.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/Game.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.test.tomcat.examples;
+package org.jboss.weld.test.tomcat.examples;
import javax.inject.Inject;
Modified: extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/Generator.java
===================================================================
--- extensions/trunk/servlet/tests/src/test/java/org/jboss/webbeans/test/tomcat/examples/Generator.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/Generator.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.test.tomcat.examples;
+package org.jboss.weld.test.tomcat.examples;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Produces;
Modified: extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/MockExampleTest.java
===================================================================
--- extensions/trunk/servlet/tests/src/test/java/org/jboss/webbeans/test/tomcat/examples/MockExampleTest.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/MockExampleTest.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,13 +1,13 @@
-package org.jboss.webbeans.test.tomcat.examples;
+package org.jboss.weld.test.tomcat.examples;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
-import org.jboss.webbeans.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
@BeansXml("beans.xml")
-public class MockExampleTest extends AbstractWebBeansTest
+public class MockExampleTest extends AbstractWeldTest
{
@Test
Modified: extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/MockSentenceTranslator.java
===================================================================
--- extensions/trunk/servlet/tests/src/test/java/org/jboss/webbeans/test/tomcat/examples/MockSentenceTranslator.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/MockSentenceTranslator.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.test.tomcat.examples;
+package org.jboss.weld.test.tomcat.examples;
import javax.enterprise.inject.Alternative;
Modified: extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/Random.java
===================================================================
--- extensions/trunk/servlet/tests/src/test/java/org/jboss/webbeans/test/tomcat/examples/Random.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/Random.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.test.tomcat.examples;
+package org.jboss.weld.test.tomcat.examples;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
Modified: extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/SentenceParser.java
===================================================================
--- extensions/trunk/servlet/tests/src/test/java/org/jboss/webbeans/test/tomcat/examples/SentenceParser.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/SentenceParser.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.test.tomcat.examples;
+package org.jboss.weld.test.tomcat.examples;
import java.util.Arrays;
import java.util.List;
Modified: extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/SentenceTranslator.java
===================================================================
--- extensions/trunk/servlet/tests/src/test/java/org/jboss/webbeans/test/tomcat/examples/SentenceTranslator.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/SentenceTranslator.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.test.tomcat.examples;
+package org.jboss.weld.test.tomcat.examples;
public class SentenceTranslator implements Translator
{
Modified: extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/TextTranslator.java
===================================================================
--- extensions/trunk/servlet/tests/src/test/java/org/jboss/webbeans/test/tomcat/examples/TextTranslator.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/TextTranslator.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.test.tomcat.examples;
+package org.jboss.weld.test.tomcat.examples;
import javax.inject.Inject;
Modified: extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/Translator.java
===================================================================
--- extensions/trunk/servlet/tests/src/test/java/org/jboss/webbeans/test/tomcat/examples/Translator.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/examples/Translator.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.test.tomcat.examples;
+package org.jboss.weld.test.tomcat.examples;
public interface Translator
Copied: extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/lookup (from rev 3901, extensions/trunk/servlet/tests/src/test/java/org/jboss/webbeans/test/tomcat/lookup)
Modified: extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/lookup/LookupTest.java
===================================================================
--- extensions/trunk/servlet/tests/src/test/java/org/jboss/webbeans/test/tomcat/lookup/LookupTest.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/lookup/LookupTest.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.test.tomcat.lookup;
+package org.jboss.weld.test.tomcat.lookup;
@@ -7,7 +7,7 @@
import org.jboss.testharness.impl.packaging.IntegrationTest;
import org.jboss.testharness.impl.packaging.Resource;
import org.jboss.testharness.impl.packaging.Resources;
-import org.jboss.webbeans.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact(addCurrentPackage=false)
@@ -16,7 +16,7 @@
@Resource(source="context.xml", destination="/META-INF/context.xml")
})
@Classes({Mouse.class, Vole.class, LookupTest.class})
-public class LookupTest extends AbstractWebBeansTest
+public class LookupTest extends AbstractWeldTest
{
@Test
Modified: extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/lookup/Mouse.java
===================================================================
--- extensions/trunk/servlet/tests/src/test/java/org/jboss/webbeans/test/tomcat/lookup/Mouse.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/lookup/Mouse.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.test.tomcat.lookup;
+package org.jboss.weld.test.tomcat.lookup;
import javax.enterprise.inject.spi.BeanManager;
import javax.naming.InitialContext;
Modified: extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/lookup/RatServlet.java
===================================================================
--- extensions/trunk/servlet/tests/src/test/java/org/jboss/webbeans/test/tomcat/lookup/RatServlet.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/lookup/RatServlet.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.test.tomcat.lookup;
+package org.jboss.weld.test.tomcat.lookup;
import java.io.IOException;
Modified: extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/lookup/ServletInjectionTest.java
===================================================================
--- extensions/trunk/servlet/tests/src/test/java/org/jboss/webbeans/test/tomcat/lookup/ServletInjectionTest.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/lookup/ServletInjectionTest.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.test.tomcat.lookup;
+package org.jboss.weld.test.tomcat.lookup;
@@ -13,7 +13,7 @@
import org.jboss.testharness.impl.packaging.IntegrationTest;
import org.jboss.testharness.impl.packaging.Resource;
import org.jboss.testharness.impl.packaging.Resources;
-import org.jboss.webbeans.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@@ -27,7 +27,7 @@
RatServlet.class,
Sewer.class
})
-public class ServletInjectionTest extends AbstractWebBeansTest
+public class ServletInjectionTest extends AbstractWeldTest
{
private static final Logger log = Logger.getLogger(ServletInjectionTest.class);
Modified: extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/lookup/Sewer.java
===================================================================
--- extensions/trunk/servlet/tests/src/test/java/org/jboss/webbeans/test/tomcat/lookup/Sewer.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/lookup/Sewer.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.test.tomcat.lookup;
+package org.jboss.weld.test.tomcat.lookup;
public class Sewer
{
Modified: extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/lookup/Vole.java
===================================================================
--- extensions/trunk/servlet/tests/src/test/java/org/jboss/webbeans/test/tomcat/lookup/Vole.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/lookup/Vole.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.test.tomcat.lookup;
+package org.jboss.weld.test.tomcat.lookup;
import javax.annotation.Resource;
import javax.enterprise.inject.spi.BeanManager;
Modified: extensions/trunk/wicket/pom.xml
===================================================================
--- extensions/trunk/wicket/pom.xml 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/wicket/pom.xml 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,15 +1,15 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-version-matrix</artifactId>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-version-matrix</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-wicket</artifactId>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-wicket</artifactId>
<version>1.0.0-SNAPSHOT</version>
- <name>Web Beans Wicket Integration</name>
+ <name>Weld Wicket Integration</name>
<dependencies>
<dependency>
@@ -25,12 +25,12 @@
</exclusions>
</dependency>
<dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>jsr299-api</artifactId>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-core</artifactId>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
@@ -52,7 +52,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<configuration>
- <tagBase>https://svn.jboss.org/repos/webbeans/extensions/tags</tagBase>
+ <tagBase>https://svn.jboss.org/repos/weld/extensions/tags</tagBase>
<autoVersionSubmodules>true</autoVersionSubmodules>
</configuration>
</plugin>
@@ -60,9 +60,9 @@
</build>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/webbeans/extensions</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/webbeans/extensions</developerConnection>
- <url>http://viewvc.jboss.org/cgi-bin/viewvc.cgi/webbeans/extensions</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/weld/extensions</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/weld/extensions</developerConnection>
+ <url>http://viewvc.jboss.org/cgi-bin/viewvc.cgi/weld/extensions</url>
</scm>
</project>
Copied: extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket (from rev 3901, extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket)
Modified: extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/BeanManagerLookup.java
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/BeanManagerLookup.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/BeanManagerLookup.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.wicket;
+package org.jboss.weld.wicket;
import javax.enterprise.inject.spi.BeanManager;
import javax.naming.Context;
Deleted: extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WebBeansApplication.java
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansApplication.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WebBeansApplication.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,97 +0,0 @@
-package org.jboss.webbeans.wicket;
-
-import java.lang.reflect.Type;
-import java.util.Set;
-
-import javax.enterprise.inject.AmbiguousResolutionException;
-import javax.enterprise.inject.UnsatisfiedResolutionException;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.BeanManager;
-
-import org.apache.wicket.Request;
-import org.apache.wicket.RequestCycle;
-import org.apache.wicket.Response;
-import org.apache.wicket.protocol.http.WebApplication;
-import org.apache.wicket.protocol.http.WebRequest;
-import org.apache.wicket.protocol.http.WebResponse;
-import org.apache.wicket.request.IRequestCycleProcessor;
-
-/**
- * A convenience subclass of wicket's WebApplication which adds the hooks
- * necessary to use JSR-299 injections in wicket components, as well as manage
- * JSR-299 conversation scopes with Wicket page metadata. If you have your own
- * WebApplication subclass, and can't subclass this class, you just need to do
- * the three things that this class does, i.e. register the
- * WebBeansComponentInstantiationListener, and override the two methods below to
- * return the RequestCycle and IRequestCycleProcessor subclasses specific to
- * WebBeans, or your subclasses of those classes.
- *
- * @author cpopetz
- *
- * @see WebApplication
- * @see WebBeansWebRequestCycleProcessor
- * @see WebBeansRequestCycle
- */
-public abstract class WebBeansApplication extends WebApplication
-{
-
- private <T> T getInstanceByType(Class<T> beanType)
- {
- BeanManager manager = BeanManagerLookup.getBeanManager();
- Bean<T> bean = (Bean<T>) ensureUniqueBean(beanType, manager.getBeans(beanType));
- return (T) manager.getReference(bean, beanType, manager.createCreationalContext(bean));
- }
-
- private static Bean<?> ensureUniqueBean(Type type, Set<Bean<?>> beans)
- {
- if (beans.size() == 0)
- {
- throw new UnsatisfiedResolutionException("Unable to resolve any Web Beans of " + type);
- }
- else if (beans.size() > 1)
- {
- throw new AmbiguousResolutionException("More than one bean available for type " + type);
- }
- return beans.iterator().next();
- }
-
- /**
- */
- public WebBeansApplication()
- {
- }
-
- /**
- * Add our component instantiation listener
- *
- * @see WebBeansComponentInstantiationListener
- */
- protected void internalInit()
- {
- super.internalInit();
- addComponentInstantiationListener(getInstanceByType(WebBeansComponentInstantiationListener.class));
- }
-
-
- /**
- * Override to return our WebBeans-specific request cycle processor
- *
- * @see WebBeansWebRequestCycleProcessor
- */
- @Override
- protected IRequestCycleProcessor newRequestCycleProcessor()
- {
- return getInstanceByType(WebBeansWebRequestCycleProcessor.class);
- }
-
- /**
- * Override to return our WebBeans-specific request cycle
- *
- * @see WebBeansRequestCycle
- */
- @Override
- public RequestCycle newRequestCycle(final Request request, final Response response)
- {
- return new WebBeansRequestCycle(this, (WebRequest) request, (WebResponse) response);
- }
-}
Deleted: extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WebBeansComponentInstantiationListener.java
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansComponentInstantiationListener.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WebBeansComponentInstantiationListener.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,31 +0,0 @@
-package org.jboss.webbeans.wicket;
-
-import javax.enterprise.inject.spi.BeanManager;
-import javax.inject.Inject;
-
-import org.apache.wicket.Component;
-import org.apache.wicket.application.IComponentInstantiationListener;
-
-/**
- * This listener uses the BeanManager to handle injections for all wicket components.
- *
- * @author cpopetz
- *
- */
-public class WebBeansComponentInstantiationListener implements IComponentInstantiationListener
-{
- @Inject
- BeanManager manager;
-
- public void onInstantiation(Component component)
- {
- /*
- * The manager could be null in unit testing environments
- */
- if (manager != null)
- {
- manager.createInjectionTarget(manager.createAnnotatedType((Class) component.getClass()))
- .inject(component, manager.createCreationalContext(null));
- }
- }
-}
\ No newline at end of file
Deleted: extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WebBeansMetaData.java
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansMetaData.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WebBeansMetaData.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,23 +0,0 @@
-package org.jboss.webbeans.wicket;
-
-import org.apache.wicket.MetaDataKey;
-
-/**
- * Public storage for the metadata key used by the WebBeans integration to store
- * conversation ids in wicket page metadata.
- *
- * @author cpopetz
- *
- */
-public class WebBeansMetaData
-{
-
- /**
- * This is the key we will use to to store the conversation metadata in the
- * wicket page.
- */
- public static final MetaDataKey CID = new MetaDataKey<String>()
- {
- private static final long serialVersionUID = -8788010688731927318L;
- };
-}
Deleted: extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WebBeansRequestCycle.java
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansRequestCycle.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WebBeansRequestCycle.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,150 +0,0 @@
-package org.jboss.webbeans.wicket;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.Set;
-
-import javax.enterprise.context.Conversation;
-import javax.enterprise.inject.AmbiguousResolutionException;
-import javax.enterprise.inject.UnsatisfiedResolutionException;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.BeanManager;
-
-import org.apache.wicket.IRequestTarget;
-import org.apache.wicket.Page;
-import org.apache.wicket.Response;
-import org.apache.wicket.protocol.http.WebApplication;
-import org.apache.wicket.protocol.http.WebRequest;
-import org.apache.wicket.protocol.http.WebRequestCycle;
-import org.apache.wicket.request.target.component.BookmarkablePageRequestTarget;
-import org.apache.wicket.request.target.component.IPageRequestTarget;
-import org.jboss.webbeans.Container;
-import org.jboss.webbeans.context.ContextLifecycle;
-import org.jboss.webbeans.context.ConversationContext;
-import org.jboss.webbeans.conversation.ConversationManager;
-import org.jboss.webbeans.servlet.ConversationBeanStore;
-
-/**
- * WebBeansRequestCycle is a subclass of the standard wicket WebRequestCycle
- * which:
- * <ul>
- * <li>restores long-running conversations specified in wicket page metadata
- * when a page target is first used.
- * <li>propagates long running conversations to new page targets by specifying
- * the above metadata
- * <li>propagates long running conversations across redirects through the use of
- * a request parameter if the redirect is handled with a BookmarkablePageRequest
- * <li>Sets up the conversational context
- * </ul>
- *
- * @see WebBeansWebRequestCycleProcessor Which handles propogation of
- * conversation data for newly-started long running conversations, by
- * storing their ids in the page metadata
- * @author cpopetz
- *
- */
-public class WebBeansRequestCycle extends WebRequestCycle
-{
-
- public WebBeansRequestCycle(WebApplication application, WebRequest request, Response response)
- {
- super(application, request, response);
- }
-
- /**
- * Override to set up the conversation context and to choose the conversation
- * if a conversation id is present in target metadata.
- */
- @Override
- protected void onRequestTargetSet(IRequestTarget target)
- {
- super.onRequestTargetSet(target);
-
- Page page = null;
- if (target instanceof IPageRequestTarget)
- {
- page = ((IPageRequestTarget) target).getPage();
- }
-
- // Two possible specifications of cid: page metadata or request url; the
- // latter is used to propagate the conversation to mounted (bookmarkable)
- // paths after a redirect
-
- String specifiedCid = null;
- if (page != null)
- {
- specifiedCid = (String) page.getMetaData(WebBeansMetaData.CID);
- }
- else
- {
- specifiedCid = request.getParameter("cid");
- }
-
- BeanManager manager = BeanManagerLookup.getBeanManager();
-
- Conversation conversation = getInstanceByType(manager, Conversation.class);
-
- // restore a conversation if it exists
- if (specifiedCid != null)
- {
- // Restore this conversation
- getInstanceByType(manager, ConversationManager.class).beginOrRestoreConversation(specifiedCid);
- }
-
- // handle propagation of existing long running converstaions to new
- // targets
- if (conversation.isLongRunning())
- {
- // Note that we can't propagate conversations with other redirect
- // targets like RequestRedirectTarget through this mechanism, because
- // it does not provide an interface to modify its target URL. If
- // propagation with those targets is to be supported, it needs a custom
- // Response subclass.
- if (isRedirect() && target instanceof BookmarkablePageRequestTarget)
- {
- BookmarkablePageRequestTarget bookmark = (BookmarkablePageRequestTarget) target;
- // if a cid has already been specified, don't override it
- if (!bookmark.getPageParameters().containsKey("cid"))
- bookmark.getPageParameters().add("cid", conversation.getId());
- }
-
- // If we have a target page, propagate the conversation to the page's
- // metadata
- if (page != null)
- {
- page.setMetaData(WebBeansMetaData.CID, conversation.getId());
- }
- }
-
- ConversationContext conversationContext = Container.instance().deploymentServices().get(
- ContextLifecycle.class).getConversationContext();
- // Now set up the conversational context if it isn't already
- if (!conversationContext.isActive())
- {
- conversationContext.setBeanStore(new ConversationBeanStore(((WebRequest) request)
- .getHttpServletRequest().getSession(), conversation.getId()));
- conversationContext.setActive(true);
- }
- }
-
- @SuppressWarnings("unchecked")
- private <T> T getInstanceByType(BeanManager manager, Class<T> beanType, Annotation... bindings)
- {
- Bean<T> bean = (Bean<T>) ensureUniqueBean(beanType, manager.getBeans(beanType, bindings));
- return (T) manager.getReference(bean, beanType, manager.createCreationalContext(bean));
- }
-
- private static Bean<?> ensureUniqueBean(Type type, Set<Bean<?>> beans)
- {
- if (beans.size() == 0)
- {
- throw new UnsatisfiedResolutionException("Unable to resolve any Web Beans of " + type);
- }
- else if (beans.size() > 1)
- {
- throw new AmbiguousResolutionException("More than one bean available for type " + type);
- }
- return beans.iterator().next();
- }
-
-}
\ No newline at end of file
Deleted: extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WebBeansWebRequestCycleProcessor.java
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansWebRequestCycleProcessor.java 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WebBeansWebRequestCycleProcessor.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,54 +0,0 @@
-package org.jboss.webbeans.wicket;
-
-import javax.enterprise.context.Conversation;
-import javax.inject.Inject;
-
-import org.apache.wicket.Page;
-import org.apache.wicket.RequestCycle;
-import org.apache.wicket.protocol.http.WebRequestCycleProcessor;
-import org.jboss.webbeans.Container;
-import org.jboss.webbeans.context.ContextLifecycle;
-import org.jboss.webbeans.context.ConversationContext;
-import org.jboss.webbeans.conversation.ConversationManager;
-
-/**
- * WebBeansWebRequestCycleProcessor is a subclass of the standard wicket
- * WebRequestCycleProcessor which saves the conversation id of any long-running
- * cornversation in wicket page metadata. It also cleans up the conversation
- * context.
- *
- * @author cpopetz
- *
- */
-public class WebBeansWebRequestCycleProcessor extends WebRequestCycleProcessor
-{
- @Inject
- Conversation conversation;
- @Inject
- ConversationManager conversationManager;
-
- /**
- * If a long running conversation has been started, store its id into page
- * metadata
- */
- @Override
- public void respond(RequestCycle requestCycle)
- {
- super.respond(requestCycle);
- if (conversation.isLongRunning())
- {
- Page page = RequestCycle.get().getResponsePage();
- if (page != null)
- {
- page.setMetaData(WebBeansMetaData.CID, conversation.getId());
- }
- }
-
- //cleanup and deactivate the conversation context
- conversationManager.cleanupConversation();
-
- ConversationContext conversationContext = Container.instance().deploymentServices().get(
- ContextLifecycle.class).getConversationContext();
- conversationContext.setActive(false);
- }
-}
\ No newline at end of file
Copied: extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldApplication.java (from rev 3901, extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansApplication.java)
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldApplication.java (rev 0)
+++ extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldApplication.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -0,0 +1,97 @@
+package org.jboss.weld.wicket;
+
+import java.lang.reflect.Type;
+import java.util.Set;
+
+import javax.enterprise.inject.AmbiguousResolutionException;
+import javax.enterprise.inject.UnsatisfiedResolutionException;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+
+import org.apache.wicket.Request;
+import org.apache.wicket.RequestCycle;
+import org.apache.wicket.Response;
+import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.protocol.http.WebRequest;
+import org.apache.wicket.protocol.http.WebResponse;
+import org.apache.wicket.request.IRequestCycleProcessor;
+
+/**
+ * A convenience subclass of wicket's WebApplication which adds the hooks
+ * necessary to use JSR-299 injections in wicket components, as well as manage
+ * JSR-299 conversation scopes with Wicket page metadata. If you have your own
+ * WebApplication subclass, and can't subclass this class, you just need to do
+ * the three things that this class does, i.e. register the
+ * WebBeansComponentInstantiationListener, and override the two methods below to
+ * return the RequestCycle and IRequestCycleProcessor subclasses specific to
+ * WebBeans, or your subclasses of those classes.
+ *
+ * @author cpopetz
+ *
+ * @see WebApplication
+ * @see WeldWebRequestCycleProcessor
+ * @see WeldRequestCycle
+ */
+public abstract class WeldApplication extends WebApplication
+{
+
+ private <T> T getInstanceByType(Class<T> beanType)
+ {
+ BeanManager manager = BeanManagerLookup.getBeanManager();
+ Bean<T> bean = (Bean<T>) ensureUniqueBean(beanType, manager.getBeans(beanType));
+ return (T) manager.getReference(bean, beanType, manager.createCreationalContext(bean));
+ }
+
+ private static Bean<?> ensureUniqueBean(Type type, Set<Bean<?>> beans)
+ {
+ if (beans.size() == 0)
+ {
+ throw new UnsatisfiedResolutionException("Unable to resolve any Web Beans of " + type);
+ }
+ else if (beans.size() > 1)
+ {
+ throw new AmbiguousResolutionException("More than one bean available for type " + type);
+ }
+ return beans.iterator().next();
+ }
+
+ /**
+ */
+ public WeldApplication()
+ {
+ }
+
+ /**
+ * Add our component instantiation listener
+ *
+ * @see WebBeansComponentInstantiationListener
+ */
+ protected void internalInit()
+ {
+ super.internalInit();
+ addComponentInstantiationListener(getInstanceByType(WeldComponentInstantiationListener.class));
+ }
+
+
+ /**
+ * Override to return our WebBeans-specific request cycle processor
+ *
+ * @see WeldWebRequestCycleProcessor
+ */
+ @Override
+ protected IRequestCycleProcessor newRequestCycleProcessor()
+ {
+ return getInstanceByType(WeldWebRequestCycleProcessor.class);
+ }
+
+ /**
+ * Override to return our WebBeans-specific request cycle
+ *
+ * @see WeldRequestCycle
+ */
+ @Override
+ public RequestCycle newRequestCycle(final Request request, final Response response)
+ {
+ return new WeldRequestCycle(this, (WebRequest) request, (WebResponse) response);
+ }
+}
Copied: extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldComponentInstantiationListener.java (from rev 3901, extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansComponentInstantiationListener.java)
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldComponentInstantiationListener.java (rev 0)
+++ extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldComponentInstantiationListener.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -0,0 +1,31 @@
+package org.jboss.weld.wicket;
+
+import javax.enterprise.inject.spi.BeanManager;
+import javax.inject.Inject;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.application.IComponentInstantiationListener;
+
+/**
+ * This listener uses the BeanManager to handle injections for all wicket components.
+ *
+ * @author cpopetz
+ *
+ */
+public class WeldComponentInstantiationListener implements IComponentInstantiationListener
+{
+ @Inject
+ BeanManager manager;
+
+ public void onInstantiation(Component component)
+ {
+ /*
+ * The manager could be null in unit testing environments
+ */
+ if (manager != null)
+ {
+ manager.createInjectionTarget(manager.createAnnotatedType((Class) component.getClass()))
+ .inject(component, manager.createCreationalContext(null));
+ }
+ }
+}
\ No newline at end of file
Copied: extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldMetaData.java (from rev 3901, extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansMetaData.java)
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldMetaData.java (rev 0)
+++ extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldMetaData.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -0,0 +1,23 @@
+package org.jboss.weld.wicket;
+
+import org.apache.wicket.MetaDataKey;
+
+/**
+ * Public storage for the metadata key used by the WebBeans integration to store
+ * conversation ids in wicket page metadata.
+ *
+ * @author cpopetz
+ *
+ */
+public class WeldMetaData
+{
+
+ /**
+ * This is the key we will use to to store the conversation metadata in the
+ * wicket page.
+ */
+ public static final MetaDataKey CID = new MetaDataKey<String>()
+ {
+ private static final long serialVersionUID = -8788010688731927318L;
+ };
+}
Copied: extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldRequestCycle.java (from rev 3901, extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansRequestCycle.java)
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldRequestCycle.java (rev 0)
+++ extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldRequestCycle.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -0,0 +1,150 @@
+package org.jboss.weld.wicket;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Set;
+
+import javax.enterprise.context.Conversation;
+import javax.enterprise.inject.AmbiguousResolutionException;
+import javax.enterprise.inject.UnsatisfiedResolutionException;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+
+import org.apache.wicket.IRequestTarget;
+import org.apache.wicket.Page;
+import org.apache.wicket.Response;
+import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.protocol.http.WebRequest;
+import org.apache.wicket.protocol.http.WebRequestCycle;
+import org.apache.wicket.request.target.component.BookmarkablePageRequestTarget;
+import org.apache.wicket.request.target.component.IPageRequestTarget;
+import org.jboss.weld.Container;
+import org.jboss.weld.context.ContextLifecycle;
+import org.jboss.weld.context.ConversationContext;
+import org.jboss.weld.conversation.ConversationManager;
+import org.jboss.weld.servlet.ConversationBeanStore;
+
+/**
+ * WebBeansRequestCycle is a subclass of the standard wicket WebRequestCycle
+ * which:
+ * <ul>
+ * <li>restores long-running conversations specified in wicket page metadata
+ * when a page target is first used.
+ * <li>propagates long running conversations to new page targets by specifying
+ * the above metadata
+ * <li>propagates long running conversations across redirects through the use of
+ * a request parameter if the redirect is handled with a BookmarkablePageRequest
+ * <li>Sets up the conversational context
+ * </ul>
+ *
+ * @see WeldWebRequestCycleProcessor Which handles propogation of
+ * conversation data for newly-started long running conversations, by
+ * storing their ids in the page metadata
+ * @author cpopetz
+ *
+ */
+public class WeldRequestCycle extends WebRequestCycle
+{
+
+ public WeldRequestCycle(WebApplication application, WebRequest request, Response response)
+ {
+ super(application, request, response);
+ }
+
+ /**
+ * Override to set up the conversation context and to choose the conversation
+ * if a conversation id is present in target metadata.
+ */
+ @Override
+ protected void onRequestTargetSet(IRequestTarget target)
+ {
+ super.onRequestTargetSet(target);
+
+ Page page = null;
+ if (target instanceof IPageRequestTarget)
+ {
+ page = ((IPageRequestTarget) target).getPage();
+ }
+
+ // Two possible specifications of cid: page metadata or request url; the
+ // latter is used to propagate the conversation to mounted (bookmarkable)
+ // paths after a redirect
+
+ String specifiedCid = null;
+ if (page != null)
+ {
+ specifiedCid = (String) page.getMetaData(WeldMetaData.CID);
+ }
+ else
+ {
+ specifiedCid = request.getParameter("cid");
+ }
+
+ BeanManager manager = BeanManagerLookup.getBeanManager();
+
+ Conversation conversation = getInstanceByType(manager, Conversation.class);
+
+ // restore a conversation if it exists
+ if (specifiedCid != null)
+ {
+ // Restore this conversation
+ getInstanceByType(manager, ConversationManager.class).beginOrRestoreConversation(specifiedCid);
+ }
+
+ // handle propagation of existing long running converstaions to new
+ // targets
+ if (conversation.isLongRunning())
+ {
+ // Note that we can't propagate conversations with other redirect
+ // targets like RequestRedirectTarget through this mechanism, because
+ // it does not provide an interface to modify its target URL. If
+ // propagation with those targets is to be supported, it needs a custom
+ // Response subclass.
+ if (isRedirect() && target instanceof BookmarkablePageRequestTarget)
+ {
+ BookmarkablePageRequestTarget bookmark = (BookmarkablePageRequestTarget) target;
+ // if a cid has already been specified, don't override it
+ if (!bookmark.getPageParameters().containsKey("cid"))
+ bookmark.getPageParameters().add("cid", conversation.getId());
+ }
+
+ // If we have a target page, propagate the conversation to the page's
+ // metadata
+ if (page != null)
+ {
+ page.setMetaData(WeldMetaData.CID, conversation.getId());
+ }
+ }
+
+ ConversationContext conversationContext = Container.instance().deploymentServices().get(
+ ContextLifecycle.class).getConversationContext();
+ // Now set up the conversational context if it isn't already
+ if (!conversationContext.isActive())
+ {
+ conversationContext.setBeanStore(new ConversationBeanStore(((WebRequest) request)
+ .getHttpServletRequest().getSession(), conversation.getId()));
+ conversationContext.setActive(true);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private <T> T getInstanceByType(BeanManager manager, Class<T> beanType, Annotation... bindings)
+ {
+ Bean<T> bean = (Bean<T>) ensureUniqueBean(beanType, manager.getBeans(beanType, bindings));
+ return (T) manager.getReference(bean, beanType, manager.createCreationalContext(bean));
+ }
+
+ private static Bean<?> ensureUniqueBean(Type type, Set<Bean<?>> beans)
+ {
+ if (beans.size() == 0)
+ {
+ throw new UnsatisfiedResolutionException("Unable to resolve any Web Beans of " + type);
+ }
+ else if (beans.size() > 1)
+ {
+ throw new AmbiguousResolutionException("More than one bean available for type " + type);
+ }
+ return beans.iterator().next();
+ }
+
+}
\ No newline at end of file
Copied: extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldWebRequestCycleProcessor.java (from rev 3901, extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansWebRequestCycleProcessor.java)
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldWebRequestCycleProcessor.java (rev 0)
+++ extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldWebRequestCycleProcessor.java 2009-10-08 13:44:49 UTC (rev 3902)
@@ -0,0 +1,54 @@
+package org.jboss.weld.wicket;
+
+import javax.enterprise.context.Conversation;
+import javax.inject.Inject;
+
+import org.apache.wicket.Page;
+import org.apache.wicket.RequestCycle;
+import org.apache.wicket.protocol.http.WebRequestCycleProcessor;
+import org.jboss.weld.Container;
+import org.jboss.weld.context.ContextLifecycle;
+import org.jboss.weld.context.ConversationContext;
+import org.jboss.weld.conversation.ConversationManager;
+
+/**
+ * WebBeansWebRequestCycleProcessor is a subclass of the standard wicket
+ * WebRequestCycleProcessor which saves the conversation id of any long-running
+ * cornversation in wicket page metadata. It also cleans up the conversation
+ * context.
+ *
+ * @author cpopetz
+ *
+ */
+public class WeldWebRequestCycleProcessor extends WebRequestCycleProcessor
+{
+ @Inject
+ Conversation conversation;
+ @Inject
+ ConversationManager conversationManager;
+
+ /**
+ * If a long running conversation has been started, store its id into page
+ * metadata
+ */
+ @Override
+ public void respond(RequestCycle requestCycle)
+ {
+ super.respond(requestCycle);
+ if (conversation.isLongRunning())
+ {
+ Page page = RequestCycle.get().getResponsePage();
+ if (page != null)
+ {
+ page.setMetaData(WeldMetaData.CID, conversation.getId());
+ }
+ }
+
+ //cleanup and deactivate the conversation context
+ conversationManager.cleanupConversation();
+
+ ConversationContext conversationContext = Container.instance().deploymentServices().get(
+ ContextLifecycle.class).getConversationContext();
+ conversationContext.setActive(false);
+ }
+}
\ No newline at end of file
Modified: extensions/trunk/xsd/pom.xml
===================================================================
--- extensions/trunk/xsd/pom.xml 2009-10-08 10:48:12 UTC (rev 3901)
+++ extensions/trunk/xsd/pom.xml 2009-10-08 13:44:49 UTC (rev 3902)
@@ -1,24 +1,24 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
- <artifactId>webbeans-parent</artifactId>
- <groupId>org.jboss.webbeans</groupId>
+ <artifactId>weld-parent</artifactId>
+ <groupId>org.jboss.weld</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-xsd-generator</artifactId>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-xsd-generator</artifactId>
<version>1.0.0-SNAPSHOT</version>
- <name>Web Beans XSD generator</name>
+ <name>Weld XSD generator</name>
<dependencies>
<dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-logging</artifactId>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-logging</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>jsr299-api</artifactId>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
</dependency>
<dependency>
15 years, 1 month
Weld SVN: r3901 - in cdi-tck/trunk: api and 3 other directories.
by weld-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-10-08 06:48:12 -0400 (Thu, 08 Oct 2009)
New Revision: 3901
Modified:
cdi-tck/trunk/api/pom.xml
cdi-tck/trunk/impl/pom.xml
cdi-tck/trunk/interceptor/pom.xml
cdi-tck/trunk/pom.xml
cdi-tck/trunk/xml/pom.xml
Log:
use new cdi-api
Modified: cdi-tck/trunk/api/pom.xml
===================================================================
--- cdi-tck/trunk/api/pom.xml 2009-10-08 10:38:46 UTC (rev 3900)
+++ cdi-tck/trunk/api/pom.xml 2009-10-08 10:48:12 UTC (rev 3901)
@@ -35,8 +35,8 @@
<dependencies>
<dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>jsr299-api</artifactId>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
</dependency>
<dependency>
Modified: cdi-tck/trunk/impl/pom.xml
===================================================================
--- cdi-tck/trunk/impl/pom.xml 2009-10-08 10:38:46 UTC (rev 3900)
+++ cdi-tck/trunk/impl/pom.xml 2009-10-08 10:48:12 UTC (rev 3901)
@@ -13,8 +13,8 @@
<dependencies>
<dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>jsr299-api</artifactId>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
</dependency>
<dependency>
Modified: cdi-tck/trunk/interceptor/pom.xml
===================================================================
--- cdi-tck/trunk/interceptor/pom.xml 2009-10-08 10:38:46 UTC (rev 3900)
+++ cdi-tck/trunk/interceptor/pom.xml 2009-10-08 10:48:12 UTC (rev 3901)
@@ -13,8 +13,8 @@
<dependencies>
<dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>jsr299-api</artifactId>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
</dependency>
<dependency>
Modified: cdi-tck/trunk/pom.xml
===================================================================
--- cdi-tck/trunk/pom.xml 2009-10-08 10:38:46 UTC (rev 3900)
+++ cdi-tck/trunk/pom.xml 2009-10-08 10:48:12 UTC (rev 3901)
@@ -140,8 +140,8 @@
<version>2.1</version>
</dependency>
<dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>jsr299-api</artifactId>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
@@ -215,7 +215,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<configuration>
- <tagBase>https://svn.jboss.org/repos/webbeans/tck/tags</tagBase>
+ <tagBase>https://svn.jboss.org/repos/weld/cdi-tck/tags</tagBase>
<autoVersionSubmodules>true</autoVersionSubmodules>
<allowTimestampedSnapshots>true</allowTimestampedSnapshots>
</configuration>
@@ -420,11 +420,11 @@
</licenses>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/webbeans/tck/trunk</connection>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/weld/cdi-tck/trunk</connection>
<developerConnection>
- scm:svn:https://svn.jboss.org/repos/webbeans/tck/trunk
+ scm:svn:https://svn.jboss.org/repos/weld/cdi-tck/trunk
</developerConnection>
- <url>http://fisheye.jboss.org/browse/WebBeans</url>
+ <url>http://fisheye.jboss.org/browse/Weld</url>
</scm>
<distributionManagement>
Modified: cdi-tck/trunk/xml/pom.xml
===================================================================
--- cdi-tck/trunk/xml/pom.xml 2009-10-08 10:38:46 UTC (rev 3900)
+++ cdi-tck/trunk/xml/pom.xml 2009-10-08 10:48:12 UTC (rev 3901)
@@ -13,8 +13,8 @@
<dependencies>
<dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>jsr299-api</artifactId>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
</dependency>
<dependency>
15 years, 1 month
Weld SVN: r3900 - in core/trunk: cdi-api and 6 other directories.
by weld-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-10-08 06:38:46 -0400 (Thu, 08 Oct 2009)
New Revision: 3900
Modified:
core/trunk/cdi-api/pom.xml
core/trunk/core-api/pom.xml
core/trunk/impl/pom.xml
core/trunk/jboss-tck-runner/pom.xml
core/trunk/pom.xml
core/trunk/porting-package/pom.xml
core/trunk/spi/pom.xml
core/trunk/version-matrix/pom.xml
Log:
WELD-67
Modified: core/trunk/cdi-api/pom.xml
===================================================================
--- core/trunk/cdi-api/pom.xml 2009-10-08 10:24:21 UTC (rev 3899)
+++ core/trunk/cdi-api/pom.xml 2009-10-08 10:38:46 UTC (rev 3900)
@@ -7,11 +7,11 @@
<version>1.0.0-SNAPSHOT</version>
</parent>
- <groupId>org.jboss.weld</groupId>
- <artifactId>jsr299-api</artifactId>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
- <name>JSR-299 API</name>
+ <name>CDI API</name>
<url>http://www.seamframework.org/Weld</url>
<dependencies>
Modified: core/trunk/core-api/pom.xml
===================================================================
--- core/trunk/core-api/pom.xml 2009-10-08 10:24:21 UTC (rev 3899)
+++ core/trunk/core-api/pom.xml 2009-10-08 10:38:46 UTC (rev 3900)
@@ -12,8 +12,8 @@
<dependencies>
<dependency>
- <groupId>org.jboss.weld</groupId>
- <artifactId>jsr299-api</artifactId>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
</dependency>
</dependencies>
Modified: core/trunk/impl/pom.xml
===================================================================
--- core/trunk/impl/pom.xml 2009-10-08 10:24:21 UTC (rev 3899)
+++ core/trunk/impl/pom.xml 2009-10-08 10:38:46 UTC (rev 3900)
@@ -12,8 +12,8 @@
<dependencies>
<dependency>
- <groupId>org.jboss.weld</groupId>
- <artifactId>jsr299-api</artifactId>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
</dependency>
<dependency>
Modified: core/trunk/jboss-tck-runner/pom.xml
===================================================================
--- core/trunk/jboss-tck-runner/pom.xml 2009-10-08 10:24:21 UTC (rev 3899)
+++ core/trunk/jboss-tck-runner/pom.xml 2009-10-08 10:38:46 UTC (rev 3900)
@@ -12,10 +12,9 @@
<description>Aggregates dependencies and run's the JSR-299 TCK on JBoss AS</description>
<dependencies>
-
<dependency>
- <groupId>org.jboss.weld</groupId>
- <artifactId>jsr299-api</artifactId>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
</dependency>
<dependency>
Modified: core/trunk/pom.xml
===================================================================
--- core/trunk/pom.xml 2009-10-08 10:24:21 UTC (rev 3899)
+++ core/trunk/pom.xml 2009-10-08 10:38:46 UTC (rev 3900)
@@ -38,7 +38,7 @@
<modules>
<module>version-matrix</module>
<module>parent</module>
- <module>api</module>
+ <module>cdi-api</module>
<module>spi</module>
<module>core-api</module>
</modules>
@@ -51,7 +51,7 @@
<modules>
<module>version-matrix</module>
<module>parent</module>
- <module>api</module>
+ <module>cdi-api</module>
<module>spi</module>
<module>core-api</module>
<module>logging</module>
Modified: core/trunk/porting-package/pom.xml
===================================================================
--- core/trunk/porting-package/pom.xml 2009-10-08 10:24:21 UTC (rev 3899)
+++ core/trunk/porting-package/pom.xml 2009-10-08 10:38:46 UTC (rev 3900)
@@ -12,8 +12,8 @@
<dependencies>
<dependency>
- <groupId>org.jboss.weld</groupId>
- <artifactId>jsr299-api</artifactId>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
</dependency>
<dependency>
Modified: core/trunk/spi/pom.xml
===================================================================
--- core/trunk/spi/pom.xml 2009-10-08 10:24:21 UTC (rev 3899)
+++ core/trunk/spi/pom.xml 2009-10-08 10:38:46 UTC (rev 3900)
@@ -12,8 +12,8 @@
<dependencies>
<dependency>
- <groupId>org.jboss.weld</groupId>
- <artifactId>jsr299-api</artifactId>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
</dependency>
<dependency>
Modified: core/trunk/version-matrix/pom.xml
===================================================================
--- core/trunk/version-matrix/pom.xml 2009-10-08 10:24:21 UTC (rev 3899)
+++ core/trunk/version-matrix/pom.xml 2009-10-08 10:38:46 UTC (rev 3900)
@@ -100,8 +100,6 @@
<artifactId>inject-tck</artifactId>
<version>1.0.0-PFD-3</version>
</dependency>
-
-
<dependency>
<groupId>org.testng</groupId>
@@ -305,8 +303,8 @@
</dependency>
<dependency>
- <groupId>org.jboss.weld</groupId>
- <artifactId>jsr299-api</artifactId>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
<version>${weld.version}</version>
</dependency>
15 years, 1 month