Author: pete.muir(a)jboss.org
Date: 2009-03-30 11:24:13 -0400 (Mon, 30 Mar 2009)
New Revision: 2272
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Dummy.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Field.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Tame.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Cow.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/CurrentActivityTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Donkey.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Dummy.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Dusk.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Field.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Horse.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/NightTime.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/NonNormalScope.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Tame.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/duplicateOnParent/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/duplicateOnParent/DuplicateBeanOnDirectParentTest.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Cow.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Fox.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/NightTime.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
11.6 tests
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java
(rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java 2009-03-30
15:24:13 UTC (rev 2272)
@@ -0,0 +1,97 @@
+package org.jboss.jsr299.tck;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Set;
+
+import javax.context.CreationalContext;
+import javax.inject.manager.Bean;
+import javax.inject.manager.InjectionPoint;
+import javax.inject.manager.Manager;
+
+public abstract class ForwardingBean<T> extends Bean<T>
+{
+
+ protected ForwardingBean(Manager manager)
+ {
+ super(manager);
+ }
+
+ protected abstract Bean<T> delegate();
+
+ @Override
+ public Set<Annotation> getBindings()
+ {
+ return delegate().getBindings();
+ }
+
+ @Override
+ public Class<? extends Annotation> getDeploymentType()
+ {
+ return delegate().getDeploymentType();
+ }
+
+ @Override
+ public Set<? extends InjectionPoint> getInjectionPoints()
+ {
+ return delegate().getInjectionPoints();
+ }
+
+ @Override
+ public String getName()
+ {
+ return delegate().getName();
+ }
+
+ @Override
+ public Class<? extends Annotation> getScopeType()
+ {
+ return delegate().getScopeType();
+ }
+
+ @Override
+ public Set<Type> getTypes()
+ {
+ return delegate().getTypes();
+ }
+
+ @Override
+ public boolean isNullable()
+ {
+ return delegate().isNullable();
+ }
+
+ @Override
+ public boolean isSerializable()
+ {
+ return delegate().isSerializable();
+ }
+
+ public T create(CreationalContext<T> creationalContext)
+ {
+ return delegate().create(creationalContext);
+ }
+
+ public void destroy(T instance)
+ {
+ delegate().destroy(instance);
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ return delegate().equals(obj);
+ }
+
+ @Override
+ public String toString()
+ {
+ return delegate().toString();
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return delegate().hashCode();
+ }
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java 2009-03-30
13:07:40 UTC (rev 2271)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java 2009-03-30
15:24:13 UTC (rev 2272)
@@ -12,13 +12,16 @@
import javax.context.CreationalContext;
import javax.context.Dependent;
import javax.event.Observer;
+import javax.inject.AnnotationLiteral;
import javax.inject.Production;
import javax.inject.manager.Bean;
import javax.inject.manager.InjectionPoint;
import javax.inject.manager.Manager;
import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.ForwardingBean;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -30,8 +33,9 @@
{
final Set<InjectionPoint> injectionPoints = new
HashSet<InjectionPoint>();
final Set<Type> types = new HashSet<Type>();
+ final Set<Annotation> bindings = new HashSet<Annotation>();
+ bindings.add(new AnnotationLiteral<Tame>() {});
types.add(Object.class);
- types.add(injectionPointType);
final Bean<?> bean = new Bean<Object>(manager)
{
@@ -40,7 +44,7 @@
@Override
public Set<Annotation> getBindings()
{
- return Collections.emptySet();
+ return bindings;
}
@Override
@@ -126,7 +130,7 @@
public Type getType()
{
- return Object.class;
+ return injectionPointType;
}
public boolean isAnnotationPresent(Class<? extends Annotation>
annotationType)
@@ -139,8 +143,6 @@
return bean;
}
- private static @interface Dummy {}
-
private static class DummyContext implements Context
{
@@ -167,7 +169,10 @@
}
@Test(groups="ri-broken")
- @SpecAssertion(section="11.6", id="b")
+ @SpecAssertions({
+ @SpecAssertion(section="11.6", id="b"),
+ @SpecAssertion(section="11.6", id="m")
+ })
public void testBeanBelongingToParentActivityBelongsToChildActivity()
{
assert getCurrentManager().resolveByType(Cow.class).size() == 1;
@@ -190,7 +195,10 @@
}
@Test(groups="ri-broken")
- @SpecAssertion(section="11.6", id="j")
+ @SpecAssertions({
+ @SpecAssertion(section="11.6", id="j"),
+ @SpecAssertion(section="11.6", id="n")
+ })
public void testObserverBelongingToParentActivityBelongsToChildActivity()
{
assert getCurrentManager().resolveObservers(new NightTime()).size() == 1;
@@ -219,4 +227,63 @@
assert childActivity.getContext(Dummy.class) != null;
}
+ @Test(groups="ri-broken")
+ @SpecAssertion(section="11.6", id="o")
+ public void testBeanBelongingToChildActivityCannotBeInjectedIntoParentActivityBean()
+ {
+ assert getCurrentManager().resolveByType(Cow.class).size() == 1;
+ Manager childActivity = getCurrentManager().createActivity();
+ Bean<?> dummyBean = createDummyBean(childActivity, Cow.class);
+ childActivity.addBean(dummyBean);
+ assert getCurrentManager().resolveByType(Object.class, new
AnnotationLiteral<Tame>() {}).size() == 0;
+ }
+
+ @Test(groups="ri-broken")
+ @SpecAssertion(section="11.6", id="p")
+ public void testInstanceProcessedByCurrentActivity()
+ {
+ Context dummyContext = new DummyContext();
+ getCurrentManager().addContext(dummyContext);
+ assert getCurrentManager().resolveByType(Cow.class).size() == 1;
+ final Bean<Cow> bean =
getCurrentManager().resolveByType(Cow.class).iterator().next();
+ Manager childActivity = getCurrentManager().createActivity();
+ final Set<Annotation> bindingTypes = new HashSet<Annotation>();
+ bindingTypes.add(new AnnotationLiteral<Tame>() {});
+ childActivity.addBean(new ForwardingBean<Cow>(childActivity)
+ {
+
+ @Override
+ protected Bean<Cow> delegate()
+ {
+ return bean;
+ }
+
+ @Override
+ public Set<Annotation> getBindings()
+ {
+ return bindingTypes;
+ }
+
+ });
+ assert getCurrentManager().getInstanceByType(Field.class).get() == null;
+ }
+
+ @Test(groups="ri-broken")
+ @SpecAssertion(section="11.6", id="s")
+ public void testObserverBelongingToChildDoesNotFireForParentActivity()
+ {
+ Manager childActivity = getCurrentManager().createActivity();
+ Observer<NightTime> observer = new Observer<NightTime>()
+ {
+
+ public void notify(NightTime event)
+ {
+ assert false;
+ }
+
+ };
+ childActivity.addObserver(observer, NightTime.class);
+ getCurrentManager().fireEvent(new NightTime());
+ }
+
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Cow.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Cow.java 2009-03-30
13:07:40 UTC (rev 2271)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Cow.java 2009-03-30
15:24:13 UTC (rev 2272)
@@ -1,6 +1,6 @@
package org.jboss.jsr299.tck.tests.activities;
-public class Cow
+class Cow
{
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Dummy.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Dummy.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Dummy.java 2009-03-30
15:24:13 UTC (rev 2272)
@@ -0,0 +1,23 @@
+/**
+ *
+ */
+package org.jboss.jsr299.tck.tests.activities;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.context.ScopeType;
+
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@Documented
+@ScopeType
+@Inherited
+@interface Dummy {}
\ No newline at end of file
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Dummy.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Field.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Field.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Field.java 2009-03-30
15:24:13 UTC (rev 2272)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.activities;
+
+import javax.inject.Instance;
+import javax.inject.Obtains;
+
+class Field
+{
+
+ @Obtains @Tame Instance<Cow> instance;
+
+ public Cow get()
+ {
+ return instance.get();
+ }
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Field.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Fox.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Fox.java 2009-03-30
13:07:40 UTC (rev 2271)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Fox.java 2009-03-30
15:24:13 UTC (rev 2272)
@@ -2,7 +2,7 @@
import javax.event.Observes;
-public class Fox
+class Fox
{
private static boolean observed = false;
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/NightTime.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/NightTime.java 2009-03-30
13:07:40 UTC (rev 2271)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/NightTime.java 2009-03-30
15:24:13 UTC (rev 2272)
@@ -1,6 +1,6 @@
package org.jboss.jsr299.tck.tests.activities;
-public class NightTime
+class NightTime
{
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Tame.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Tame.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Tame.java 2009-03-30
15:24:13 UTC (rev 2272)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.activities;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Tame
+{
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Tame.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Cow.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Cow.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Cow.java 2009-03-30
15:24:13 UTC (rev 2272)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+class Cow
+{
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Cow.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/CurrentActivityTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/CurrentActivityTest.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/CurrentActivityTest.java 2009-03-30
15:24:13 UTC (rev 2272)
@@ -0,0 +1,216 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import java.lang.annotation.Annotation;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.context.Context;
+import javax.context.ContextNotActiveException;
+import javax.context.Contextual;
+import javax.context.CreationalContext;
+import javax.event.Observer;
+import javax.inject.AnnotationLiteral;
+import javax.inject.manager.Bean;
+import javax.inject.manager.Manager;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.ForwardingBean;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.testng.annotations.Test;
+
+@Artifact
+public class CurrentActivityTest extends AbstractJSR299Test
+{
+
+ static interface TestableObserver<T> extends Observer<T>
+ {
+
+ boolean isObserved();
+
+ }
+
+
+ private static class DummyContext implements Context
+ {
+
+ private boolean active = true;
+
+ public <T> T get(Contextual<T> contextual)
+ {
+ return null;
+ }
+
+ public <T> T get(Contextual<T> contextual, CreationalContext<T>
creationalContext)
+ {
+ return null;
+ }
+
+ public Class<? extends Annotation> getScopeType()
+ {
+ return Dummy.class;
+ }
+
+ public boolean isActive()
+ {
+ return active;
+ }
+
+ public void setActive(boolean active)
+ {
+ this.active = active;
+ }
+
+ }
+
+ private static class NonNormalContext extends DummyContext
+ {
+
+ @Override
+ public Class<? extends Annotation> getScopeType()
+ {
+ return NonNormalScope.class;
+ }
+
+ }
+
+ @Test(groups="ri-broken",
expectedExceptions=ContextNotActiveException.class)
+ @SpecAssertion(section="11.6.1", id="b")
+ public void testInactiveScope()
+ {
+ DummyContext dummyContext = new DummyContext();
+ dummyContext.setActive(false);
+ getCurrentManager().addContext(dummyContext);
+ Manager childActivity = getCurrentManager().createActivity();
+ childActivity.setCurrent(dummyContext.getScopeType());
+ }
+
+ @Test(groups="ri-broken",
expectedExceptions=IllegalArgumentException.class)
+ @SpecAssertion(section="11.6.1", id="c")
+ public void testNonNormalScope()
+ {
+ Context dummyContext = new NonNormalContext();
+ getCurrentManager().addContext(dummyContext);
+ Manager childActivity = getCurrentManager().createActivity();
+ childActivity.setCurrent(dummyContext.getScopeType());
+ }
+
+ @Test(groups="ri-broken")
+ @SpecAssertion(section="11.6.1", id="d")
+ public void testELEvaluationProcessedByCurrentActivty()
+ {
+ Context dummyContext = new DummyContext();
+ getCurrentManager().addContext(dummyContext);
+ assert getCurrentManager().resolveByType(Cow.class).size() == 1;
+ final Bean<Cow> bean =
getCurrentManager().resolveByType(Cow.class).iterator().next();
+ Manager childActivity = getCurrentManager().createActivity();
+ childActivity.addBean(new ForwardingBean<Cow>(childActivity)
+ {
+
+ @Override
+ protected Bean<Cow> delegate()
+ {
+ return bean;
+ }
+
+ @Override
+ public String getName()
+ {
+ return "daisy";
+ }
+
+ });
+ childActivity.setCurrent(dummyContext.getScopeType());
+ assert
getCurrentConfiguration().getEl().evaluateValueExpression("#{daisy}", Cow.class)
!= null;
+ }
+
+ @Test(groups="ri-broken")
+ @SpecAssertion(section="11.6.1", id="e")
+ public void testInjectedManagerIsCurrentActivity()
+ {
+ Context dummyContext = new DummyContext();
+ getCurrentManager().addContext(dummyContext);
+ assert getCurrentManager().resolveByType(Cow.class).size() == 1;
+ Manager childActivity = getCurrentManager().createActivity();
+ childActivity.setCurrent(dummyContext.getScopeType());
+ assert
getCurrentManager().getInstanceByType(Horse.class).getManager().equals(childActivity);
+ }
+
+
+ @Test(groups="ri-broken")
+ @SpecAssertion(section="11.6.1", id="f")
+ public void testJndiManagerIsCurrentActivity()
+ {
+ Context dummyContext = new DummyContext();
+ getCurrentManager().addContext(dummyContext);
+ assert getCurrentManager().resolveByType(Cow.class).size() == 1;
+ Manager childActivity = getCurrentManager().createActivity();
+ childActivity.setCurrent(dummyContext.getScopeType());
+ assert
getCurrentManager().getInstanceByType(Donkey.class).getManager().equals(childActivity);
+ }
+
+ @Test(groups="ri-broken")
+ @SpecAssertions({
+ @SpecAssertion(section="11.6.1", id="g"),
+ @SpecAssertion(section="11.6.1", id="m")
+ })
+ public void testEventProcessedByCurrentActivity()
+ {
+ Context dummyContext = new DummyContext();
+ getCurrentManager().addContext(dummyContext);
+ Manager childActivity = getCurrentManager().createActivity();
+ TestableObserver<NightTime> observer = new
TestableObserver<NightTime>()
+ {
+
+ boolean observed = false;
+
+ public void notify(NightTime event)
+ {
+ observed = true;
+ }
+
+ public boolean isObserved()
+ {
+ return observed;
+ }
+
+ };
+ childActivity.addObserver(observer, NightTime.class);
+ childActivity.setCurrent(dummyContext.getScopeType());
+ getCurrentManager().getInstanceByType(Dusk.class).ping();
+ assert observer.isObserved();
+ }
+
+ @Test(groups="ri-broken")
+ @SpecAssertion(section="11.6.1", id="h")
+ public void testInstanceProcessedByCurrentActivity()
+ {
+ Context dummyContext = new DummyContext();
+ getCurrentManager().addContext(dummyContext);
+ assert getCurrentManager().resolveByType(Cow.class).size() == 1;
+ final Bean<Cow> bean =
getCurrentManager().resolveByType(Cow.class).iterator().next();
+ Manager childActivity = getCurrentManager().createActivity();
+ final Set<Annotation> bindingTypes = new HashSet<Annotation>();
+ bindingTypes.add(new AnnotationLiteral<Tame>() {});
+ childActivity.addBean(new ForwardingBean<Cow>(childActivity)
+ {
+
+ @Override
+ protected Bean<Cow> delegate()
+ {
+ return bean;
+ }
+
+ @Override
+ public Set<Annotation> getBindings()
+ {
+ return bindingTypes;
+ }
+
+ });
+ childActivity.setCurrent(dummyContext.getScopeType());
+ assert getCurrentManager().getInstanceByType(Field.class).get() != null;
+ }
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/CurrentActivityTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Donkey.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Donkey.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Donkey.java 2009-03-30
15:24:13 UTC (rev 2272)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import javax.inject.manager.Manager;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+class Donkey
+{
+
+ Manager manager;
+
+ public Donkey() throws NamingException
+ {
+ manager = (Manager) new InitialContext().lookup("java:app/Manager");
+ }
+
+ public Manager getManager()
+ {
+ return manager;
+ }
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Donkey.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Dummy.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Dummy.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Dummy.java 2009-03-30
15:24:13 UTC (rev 2272)
@@ -0,0 +1,23 @@
+/**
+ *
+ */
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.context.ScopeType;
+
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@Documented
+@ScopeType
+@Inherited
+@interface Dummy {}
\ No newline at end of file
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Dummy.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Dusk.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Dusk.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Dusk.java 2009-03-30
15:24:13 UTC (rev 2272)
@@ -0,0 +1,18 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import javax.event.Event;
+import javax.event.Fires;
+import javax.inject.Initializer;
+
+class Dusk
+{
+
+ @Initializer
+ public Dusk(@Fires Event<NightTime> event)
+ {
+ event.fire(new NightTime());
+ }
+
+ public void ping() {}
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Dusk.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Field.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Field.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Field.java 2009-03-30
15:24:13 UTC (rev 2272)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import javax.inject.Instance;
+import javax.inject.Obtains;
+
+class Field
+{
+
+ @Obtains @Tame Instance<Cow> instance;
+
+ public Cow get()
+ {
+ return instance.get();
+ }
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Field.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Horse.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Horse.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Horse.java 2009-03-30
15:24:13 UTC (rev 2272)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import javax.inject.Current;
+import javax.inject.manager.Manager;
+
+class Horse
+{
+
+ @Current Manager manager;
+
+ public Manager getManager()
+ {
+ return manager;
+ }
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Horse.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/NightTime.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/NightTime.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/NightTime.java 2009-03-30
15:24:13 UTC (rev 2272)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+class NightTime
+{
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/NightTime.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/NonNormalScope.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/NonNormalScope.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/NonNormalScope.java 2009-03-30
15:24:13 UTC (rev 2272)
@@ -0,0 +1,23 @@
+/**
+ *
+ */
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.context.ScopeType;
+
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@Documented
+@ScopeType(normal=false)
+@Inherited
+@interface NonNormalScope {}
\ No newline at end of file
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/NonNormalScope.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Tame.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Tame.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Tame.java 2009-03-30
15:24:13 UTC (rev 2272)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Tame
+{
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Tame.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/duplicateOnParent/DuplicateBeanOnDirectParentTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/duplicateOnParent/DuplicateBeanOnDirectParentTest.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/duplicateOnParent/DuplicateBeanOnDirectParentTest.java 2009-03-30
15:24:13 UTC (rev 2272)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.activities.duplicateOnParent;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+
+@Artifact
+public class DuplicateBeanOnDirectParentTest extends AbstractJSR299Test
+{
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/duplicateOnParent/DuplicateBeanOnDirectParentTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-03-30 13:07:40 UTC (rev 2271)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-03-30 15:24:13 UTC (rev 2272)
@@ -6369,8 +6369,9 @@
</section>
<section id="11.6.1" title="Current Activity">
- <assertion id="a">
+ <assertion id="a" testable="false">
<text>An activity may be associated with the current context for a normal
scope by calling |setCurrent()|, passing the normal scope type</text>
+ <note>A statement of intent</note>
</assertion>
<assertion id="b">
@@ -6401,18 +6402,6 @@
<text>~All EL evaluations (as defined Section 5.10, "EL name
resolution"), all calls to any injected |Manager| object or |Manager| object obtained
via JNDI lookup (as defined by Section 5.7, "The Manager object"), all calls to
any injected |Event| object (as defined in Section 7.6, "The Event interface")
and ~all calls to any injected |Instance| object (as defined by Section 5.8, "Dynamic
lookup") are processed by the current activity</text>
</assertion>
- <assertion id="j">
- <text>If the root activity has no active normal scope such that the current
context for that scope has an associated activity, the root activity is the current
activity.</text>
- </assertion>
-
- <assertion id="k">
- <text>If the root activity has exactly one active normal scope such that the
current context for that scope has an associated activity, that activity is the current
activity.</text>
- </assertion>
-
- <assertion id="l" testable="false">
- <text>Otherwise, there is no well-defined current activity, and the behavior
is undefined. Portable frameworks and applications should not depend upon the behavior of
the container when two different current contexts have an associated
activity.</text>
- </assertion>
-
<assertion id="m">
<text>A bean registered with an activity is only available to Unified EL
expressions that are evaluated when that activity or one of its children is the current
activity.</text>
</assertion>