Author: pete.muir(a)jboss.org
Date: 2009-04-04 09:53:33 -0400 (Sat, 04 Apr 2009)
New Revision: 2297
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/literals/CurrentLiteral.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Mustard.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/OtherLiteral.java
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/literals/CurrentBinding.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/BakedBean_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/CurrentBinding.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/OtherBinding.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/RootManager.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Proxies.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Reflections.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/BrokenInjectedBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Vanilla.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/instantiation/InstantiationByTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java
Log:
WBRI-215
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/RootManager.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/RootManager.java 2009-04-03 20:40:25
UTC (rev 2296)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/RootManager.java 2009-04-04 13:53:33
UTC (rev 2297)
@@ -67,20 +67,19 @@
import org.jboss.webbeans.context.ApplicationContext;
import org.jboss.webbeans.context.ContextMap;
import org.jboss.webbeans.context.CreationalContextImpl;
-import org.jboss.webbeans.ejb.EjbDescriptorCache;
import org.jboss.webbeans.event.EventManager;
import org.jboss.webbeans.event.ObserverImpl;
import org.jboss.webbeans.injection.NonContextualInjector;
import org.jboss.webbeans.injection.resolution.ResolvableAnnotatedClass;
import org.jboss.webbeans.injection.resolution.Resolver;
import org.jboss.webbeans.introspector.AnnotatedItem;
-import org.jboss.webbeans.introspector.AnnotatedMethod;
import org.jboss.webbeans.log.Log;
import org.jboss.webbeans.log.Logging;
import org.jboss.webbeans.manager.api.WebBeansManager;
import org.jboss.webbeans.metadata.MetaDataCache;
import org.jboss.webbeans.resources.spi.NamingContext;
import org.jboss.webbeans.util.Beans;
+import org.jboss.webbeans.util.Proxies;
import org.jboss.webbeans.util.Reflections;
/**
@@ -661,22 +660,26 @@
currentInjectionPoint.get().push(injectionPoint);
}
AnnotatedItem<T, ?> element =
ResolvableAnnotatedClass.of(injectionPoint.getType(),
injectionPoint.getBindings().toArray(new Annotation[0]));
- Bean<T> bean = getBeanByType(element, element.getBindingsAsArray());
+ Bean<T> resolvedBean = getBeanByType(element,
element.getBindingsAsArray());
+ if
(getServices().get(MetaDataCache.class).getScopeModel(resolvedBean.getScopeType()).isNormal()
&& !Proxies.isTypeProxyable(injectionPoint.getType()))
+ {
+ throw new UnproxyableDependencyException("Attempting to inject an
unproxyable normal scoped bean " + resolvedBean + " into " +
injectionPoint);
+ }
if (creationalContext instanceof CreationalContextImpl)
{
CreationalContextImpl<?> ctx = (CreationalContextImpl<?>)
creationalContext;
- if (ctx.containsIncompleteInstance(bean))
+ if (ctx.containsIncompleteInstance(resolvedBean))
{
- return ctx.getIncompleteInstance(bean);
+ return ctx.getIncompleteInstance(resolvedBean);
}
else
{
- return getInstance(bean, ctx.getCreationalContext(bean));
+ return getInstance(resolvedBean, ctx.getCreationalContext(resolvedBean));
}
}
else
{
- return getInstance(bean);
+ return getInstance(resolvedBean);
}
}
finally
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Proxies.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Proxies.java 2009-04-03 20:40:25
UTC (rev 2296)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Proxies.java 2009-04-04 13:53:33
UTC (rev 2297)
@@ -16,6 +16,8 @@
*/
package org.jboss.webbeans.util;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Modifier;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Iterator;
@@ -195,25 +197,33 @@
{
return true;
}
- else if (Reflections.getConstructor(clazz) == null)
- {
- return false;
- }
- else if (Reflections.isTypeOrAnyMethodFinal(clazz))
- {
- return false;
- }
- else if (Reflections.isPrimitive(clazz))
- {
- return false;
- }
- else if (Reflections.isArrayType(clazz))
- {
- return false;
- }
else
{
- return true;
+ Constructor<?> constructor = Reflections.getDeclaredConstructor(clazz);
+ if (constructor == null)
+ {
+ return false;
+ }
+ else if (Modifier.isPrivate(constructor.getModifiers()))
+ {
+ return false;
+ }
+ else if (Reflections.isTypeOrAnyMethodFinal(clazz))
+ {
+ return false;
+ }
+ else if (Reflections.isPrimitive(clazz))
+ {
+ return false;
+ }
+ else if (Reflections.isArrayType(clazz))
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Reflections.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Reflections.java 2009-04-03
20:40:25 UTC (rev 2296)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Reflections.java 2009-04-04
13:53:33 UTC (rev 2297)
@@ -336,7 +336,7 @@
* @param parameterTypes The parameter types
* @return The matching constructor. Null is returned if none is found
*/
- public static <T> Constructor<T> getConstructor(Class<T> clazz,
Class<?>... parameterTypes)
+ public static <T> Constructor<T> getDeclaredConstructor(Class<T>
clazz, Class<?>... parameterTypes)
{
try
{
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/literals/CurrentBinding.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/literals/CurrentBinding.java 2009-04-03
20:40:25 UTC (rev 2296)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/literals/CurrentBinding.java 2009-04-04
13:53:33 UTC (rev 2297)
@@ -1,11 +0,0 @@
-package org.jboss.jsr299.tck.literals;
-
-import javax.inject.AnnotationLiteral;
-import javax.inject.Current;
-
-/**
- * Annotation literal for @Current
- *
- * @author Pete Muir
- */
-public class CurrentBinding extends AnnotationLiteral<Current> implements Current
{}
\ No newline at end of file
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/literals/CurrentLiteral.java
(from rev 2287,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/literals/CurrentBinding.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/literals/CurrentLiteral.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/literals/CurrentLiteral.java 2009-04-04
13:53:33 UTC (rev 2297)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.literals;
+
+import javax.inject.AnnotationLiteral;
+import javax.inject.Current;
+
+/**
+ * Annotation literal for @Current
+ *
+ * @author Pete Muir
+ */
+public class CurrentLiteral extends AnnotationLiteral<Current> implements Current
{}
\ No newline at end of file
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java 2009-04-03
20:40:25 UTC (rev 2296)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java 2009-04-04
13:53:33 UTC (rev 2297)
@@ -12,7 +12,7 @@
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.jsr299.tck.literals.CurrentBinding;
+import org.jboss.jsr299.tck.literals.CurrentLiteral;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -129,7 +129,7 @@
{
Bean<?> model =
getCurrentManager().resolveByType(Tuna.class).iterator().next();
assert model.getBindings().size() == 1;
- assert model.getBindings().contains(new CurrentBinding());
+ assert model.getBindings().contains(new CurrentLiteral());
assert false;
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java 2009-04-03
20:40:25 UTC (rev 2296)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java 2009-04-04
13:53:33 UTC (rev 2297)
@@ -11,7 +11,7 @@
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.jsr299.tck.literals.CurrentBinding;
+import org.jboss.jsr299.tck.literals.CurrentLiteral;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.testng.annotations.Test;
@@ -77,7 +77,7 @@
{
Set<Bean<Tarantula>> tarantulaBeans =
getCurrentManager().resolveByType(Tarantula.class);
assert tarantulaBeans.size() == 1;
- assert tarantulaBeans.iterator().next().getBindings().contains(new
CurrentBinding());
+ assert tarantulaBeans.iterator().next().getBindings().contains(new
CurrentLiteral());
}
@Test(groups = "producerField")
Deleted:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/BakedBean_Broken.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/BakedBean_Broken.java 2009-04-03
20:40:25 UTC (rev 2296)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/BakedBean_Broken.java 2009-04-04
13:53:33 UTC (rev 2297)
@@ -1,12 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.dependency.resolution;
-
-public class BakedBean_Broken
-{
- /*
- * private constructor makes this bean unproxyable
- */
- private BakedBean_Broken()
- {
-
- }
-}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/BrokenInjectedBean.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/BrokenInjectedBean.java 2009-04-03
20:40:25 UTC (rev 2296)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/BrokenInjectedBean.java 2009-04-04
13:53:33 UTC (rev 2297)
@@ -2,7 +2,8 @@
import javax.inject.Current;
+
class BrokenInjectedBean
{
- @Current public BakedBean_Broken bakedBean;
+ public @Current Mustard mustard;
}
Deleted:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/CurrentBinding.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/CurrentBinding.java 2009-04-03
20:40:25 UTC (rev 2296)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/CurrentBinding.java 2009-04-04
13:53:33 UTC (rev 2297)
@@ -1,9 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.dependency.resolution;
-
-import javax.inject.AnnotationLiteral;
-import javax.inject.Current;
-
-class CurrentBinding extends AnnotationLiteral<Current> implements Current
-{
-
-}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java 2009-04-03
20:40:25 UTC (rev 2296)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java 2009-04-04
13:53:33 UTC (rev 2297)
@@ -7,6 +7,7 @@
import java.util.HashSet;
import java.util.Set;
+import javax.context.RequestScoped;
import javax.inject.UnproxyableDependencyException;
import javax.inject.UnsatisfiedDependencyException;
import javax.inject.manager.Bean;
@@ -15,6 +16,8 @@
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.jsr299.tck.literals.CurrentLiteral;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -84,7 +87,7 @@
Field injectedField = InjectedBean.class.getField("vanilla");
Set<Annotation> bindings = new HashSet<Annotation>();
- bindings.add(new CurrentBinding());
+ bindings.add(new CurrentLiteral());
MockInjectionPoint injectionPoint = new MockInjectionPoint(vanillaBean,
Vanilla.class, injectedField, bindings);
assert getCurrentManager().getInstanceToInject(injectionPoint) instanceof Vanilla;
@@ -98,7 +101,7 @@
Field injectedField = InjectedBean.class.getField("vanilla");
Set<Annotation> bindings = new HashSet<Annotation>();
- bindings.add(new OtherBinding());
+ bindings.add(new OtherLiteral());
MockInjectionPoint injectionPoint = new MockInjectionPoint(vanillaBean,
Vanilla.class, injectedField, bindings);
assert getCurrentManager().getInstanceToInject(injectionPoint) instanceof Vanilla;
@@ -112,21 +115,52 @@
Field injectedField = InjectedBean.class.getField("vanilla");
Set<Annotation> bindings = new HashSet<Annotation>();
- bindings.add(new OtherBinding());
+ bindings.add(new OtherLiteral());
MockInjectionPoint injectionPoint = new MockInjectionPoint(vanillaBean,
Vanilla.class, injectedField, bindings);
getCurrentManager().getInstanceToInject(injectionPoint);
}
- @Test(expectedExceptions = UnproxyableDependencyException.class, groups =
"ri-broken")
+ @Test(expectedExceptions=UnproxyableDependencyException.class)
@SpecAssertion(section = "5.7.1", id = "g")
public void testGetInstanceToInjectThrowsUnproxyableDependencyException() throws
Exception
{
- Bean<BakedBean_Broken> bakedBean =
getCurrentManager().resolveByType(BakedBean_Broken.class).iterator().next();
+ final Bean<Mustard> bean =
getCurrentManager().resolveByType(Mustard.class).iterator().next();
+ final Set<Annotation> bindings = new HashSet<Annotation>();
+ bindings.add(new OtherLiteral());
- Field injectedField = BrokenInjectedBean.class.getField("bakedBean");
- Set<Annotation> bindings = new HashSet<Annotation>();
- bindings.add(new CurrentBinding());
- MockInjectionPoint injectionPoint = new MockInjectionPoint(bakedBean,
BakedBean_Broken.class, injectedField, bindings);
+ Bean<Mustard> wrappedBean = new
ForwardingBean<Mustard>(getCurrentManager())
+ {
+
+ @Override
+ protected Bean<Mustard> delegate()
+ {
+ return bean;
+ }
+
+ @Override
+ public Class<? extends Annotation> getScopeType()
+ {
+ return RequestScoped.class;
+ }
+
+ @Override
+ public Set<Annotation> getBindings()
+ {
+ return bindings;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ return this == obj;
+ }
+
+ };
+
+ getCurrentManager().addBean(wrappedBean);
+
+ Field injectedField = BrokenInjectedBean.class.getField("mustard");
+ MockInjectionPoint injectionPoint = new MockInjectionPoint(bean, Mustard.class,
injectedField, bindings);
getCurrentManager().getInstanceToInject(injectionPoint);
}
}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Mustard.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Mustard.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Mustard.java 2009-04-04
13:53:33 UTC (rev 2297)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.lookup.dependency.resolution;
+
+
+public class Mustard
+{
+
+ private Mustard()
+ {
+ // TODO Auto-generated constructor stub
+ }
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Mustard.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/OtherBinding.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/OtherBinding.java 2009-04-03
20:40:25 UTC (rev 2296)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/OtherBinding.java 2009-04-04
13:53:33 UTC (rev 2297)
@@ -1,8 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.dependency.resolution;
-
-import javax.inject.AnnotationLiteral;
-
-class OtherBinding extends AnnotationLiteral<Other> implements Other
-{
-
-}
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/OtherLiteral.java
(from rev 2287,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/OtherBinding.java)
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/OtherLiteral.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/OtherLiteral.java 2009-04-04
13:53:33 UTC (rev 2297)
@@ -0,0 +1,8 @@
+package org.jboss.jsr299.tck.tests.lookup.dependency.resolution;
+
+import javax.inject.AnnotationLiteral;
+
+class OtherLiteral extends AnnotationLiteral<Other> implements Other
+{
+
+}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Vanilla.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Vanilla.java 2009-04-03
20:40:25 UTC (rev 2296)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Vanilla.java 2009-04-04
13:53:33 UTC (rev 2297)
@@ -1,5 +1,6 @@
package org.jboss.jsr299.tck.tests.lookup.dependency.resolution;
+
class Vanilla
{
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java 2009-04-03
20:40:25 UTC (rev 2296)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java 2009-04-04
13:53:33 UTC (rev 2297)
@@ -33,7 +33,7 @@
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.jsr299.tck.literals.CurrentBinding;
+import org.jboss.jsr299.tck.literals.CurrentLiteral;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -60,7 +60,7 @@
@Override
protected void execute() throws Exception
{
- FieldInjectionPointBean beanWithInjectedBean =
getCurrentManager().getInstanceByType(FieldInjectionPointBean.class, new
CurrentBinding());
+ FieldInjectionPointBean beanWithInjectedBean =
getCurrentManager().getInstanceByType(FieldInjectionPointBean.class, new
CurrentLiteral());
BeanWithInjectionPointMetadata beanWithInjectionPoint =
beanWithInjectedBean.getInjectedBean();
assert beanWithInjectionPoint.getInjectedMetadata() != null;
@@ -82,7 +82,7 @@
@Override
protected void execute() throws Exception
{
- FieldInjectionPointBean beanWithInjectedBean =
getCurrentManager().getInstanceByType(FieldInjectionPointBean.class, new
CurrentBinding());
+ FieldInjectionPointBean beanWithInjectedBean =
getCurrentManager().getInstanceByType(FieldInjectionPointBean.class, new
CurrentLiteral());
BeanWithInjectionPointMetadata beanWithInjectionPoint =
beanWithInjectedBean.getInjectedBean();
assert beanWithInjectionPoint.getInjectedMetadata() != null;
assert
beanWithInjectionPoint.getInjectedMetadata().getType().equals(BeanWithInjectionPointMetadata.class);
@@ -101,7 +101,7 @@
@Override
protected void execute() throws Exception
{
- FieldInjectionPointBean beanWithInjectedBean =
getCurrentManager().getInstanceByType(FieldInjectionPointBean.class, new
CurrentBinding());
+ FieldInjectionPointBean beanWithInjectedBean =
getCurrentManager().getInstanceByType(FieldInjectionPointBean.class, new
CurrentLiteral());
BeanWithInjectionPointMetadata beanWithInjectionPoint =
beanWithInjectedBean.getInjectedBean();
assert beanWithInjectionPoint.getInjectedMetadata() != null;
Set<Annotation> bindingTypes =
beanWithInjectionPoint.getInjectedMetadata().getBindings();
@@ -122,7 +122,7 @@
@Override
protected void execute() throws Exception
{
- FieldInjectionPointBean beanWithInjectedBean =
getCurrentManager().getInstanceByType(FieldInjectionPointBean.class, new
CurrentBinding());
+ FieldInjectionPointBean beanWithInjectedBean =
getCurrentManager().getInstanceByType(FieldInjectionPointBean.class, new
CurrentLiteral());
BeanWithInjectionPointMetadata beanWithInjectionPoint =
beanWithInjectedBean.getInjectedBean();
assert beanWithInjectionPoint.getInjectedMetadata() != null;
assert
Field.class.isAssignableFrom(beanWithInjectionPoint.getInjectedMetadata().getMember().getClass());
@@ -141,7 +141,7 @@
@Override
protected void execute() throws Exception
{
- MethodInjectionPointBean beanWithInjectedBean =
getCurrentManager().getInstanceByType(MethodInjectionPointBean.class, new
CurrentBinding());
+ MethodInjectionPointBean beanWithInjectedBean =
getCurrentManager().getInstanceByType(MethodInjectionPointBean.class, new
CurrentLiteral());
BeanWithInjectionPointMetadata beanWithInjectionPoint =
beanWithInjectedBean.getInjectedBean();
assert beanWithInjectionPoint.getInjectedMetadata() != null;
assert
Method.class.isAssignableFrom(beanWithInjectionPoint.getInjectedMetadata().getMember().getClass());
@@ -149,7 +149,7 @@
// Since the type and bindings must correspond to the parameter, check
// them
assert
beanWithInjectionPoint.getInjectedMetadata().getType().equals(BeanWithInjectionPointMetadata.class);
- assert
beanWithInjectionPoint.getInjectedMetadata().getBindings().contains(new
CurrentBinding());
+ assert
beanWithInjectionPoint.getInjectedMetadata().getBindings().contains(new
CurrentLiteral());
}
}.run();
}
@@ -165,7 +165,7 @@
@Override
protected void execute() throws Exception
{
- ConstructorInjectionPointBean beanWithInjectedBean =
getCurrentManager().getInstanceByType(ConstructorInjectionPointBean.class, new
CurrentBinding());
+ ConstructorInjectionPointBean beanWithInjectedBean =
getCurrentManager().getInstanceByType(ConstructorInjectionPointBean.class, new
CurrentLiteral());
BeanWithInjectionPointMetadata beanWithInjectionPoint =
beanWithInjectedBean.getInjectedBean();
assert beanWithInjectionPoint.getInjectedMetadata() != null;
assert
Constructor.class.isAssignableFrom(beanWithInjectionPoint.getInjectedMetadata().getMember().getClass());
@@ -173,7 +173,7 @@
// Since the type and bindings must correspond to the parameter, check
// them
assert
beanWithInjectionPoint.getInjectedMetadata().getType().equals(BeanWithInjectionPointMetadata.class);
- assert
beanWithInjectionPoint.getInjectedMetadata().getBindings().contains(new
CurrentBinding());
+ assert
beanWithInjectionPoint.getInjectedMetadata().getBindings().contains(new
CurrentLiteral());
}
}.run();
}
@@ -189,7 +189,7 @@
@Override
protected void execute() throws Exception
{
- FieldInjectionPointBean beanWithInjectedBean =
getCurrentManager().getInstanceByType(FieldInjectionPointBean.class, new
CurrentBinding());
+ FieldInjectionPointBean beanWithInjectedBean =
getCurrentManager().getInstanceByType(FieldInjectionPointBean.class, new
CurrentLiteral());
BeanWithInjectionPointMetadata beanWithInjectionPoint =
beanWithInjectedBean.getInjectedBean();
assert beanWithInjectionPoint.getInjectedMetadata() != null;
assert
beanWithInjectionPoint.getInjectedMetadata().getAnnotation(AnimalStereotype.class) !=
null;
@@ -208,12 +208,12 @@
@Override
protected void execute() throws Exception
{
- FieldInjectionPointBean beanWithInjectedBean =
getCurrentManager().getInstanceByType(FieldInjectionPointBean.class, new
CurrentBinding());
+ FieldInjectionPointBean beanWithInjectedBean =
getCurrentManager().getInstanceByType(FieldInjectionPointBean.class, new
CurrentLiteral());
BeanWithInjectionPointMetadata beanWithInjectionPoint =
beanWithInjectedBean.getInjectedBean();
assert beanWithInjectionPoint.getInjectedMetadata() != null;
Set<Annotation> annotations = new
HashSet<Annotation>(Arrays.asList(beanWithInjectionPoint.getInjectedMetadata().getAnnotations()));
assert annotations.size() > 0;
- assert annotations.contains(new CurrentBinding());
+ assert annotations.contains(new CurrentLiteral());
assert annotations.contains(new AnimalStereotypeAnnotationLiteral());
}
}.run();
@@ -269,7 +269,7 @@
@Override
protected void execute() throws Exception
{
- FieldInjectionPointBean beanWithInjectedBean =
getCurrentManager().getInstanceByType(FieldInjectionPointBean.class, new
CurrentBinding());
+ FieldInjectionPointBean beanWithInjectedBean =
getCurrentManager().getInstanceByType(FieldInjectionPointBean.class, new
CurrentLiteral());
BeanWithInjectionPointMetadata beanWithInjectionPoint =
beanWithInjectedBean.getInjectedBean();
assert beanWithInjectionPoint.getInjectedMetadata() != null;
assert
InjectionPoint.class.isAssignableFrom(beanWithInjectionPoint.getInjectedMetadata().getClass());
@@ -290,10 +290,10 @@
@Override
protected void execute() throws Exception
{
- FieldInjectionPointBean beanWithInjectedBean =
getCurrentManager().getInstanceByType(FieldInjectionPointBean.class, new
CurrentBinding());
+ FieldInjectionPointBean beanWithInjectedBean =
getCurrentManager().getInstanceByType(FieldInjectionPointBean.class, new
CurrentLiteral());
BeanWithInjectionPointMetadata beanWithInjectionPoint =
beanWithInjectedBean.getInjectedBean();
assert beanWithInjectionPoint.getInjectedMetadata() != null;
- assert
beanWithInjectionPoint.getInjectedMetadata().getBindings().contains(new
CurrentBinding());
+ assert
beanWithInjectionPoint.getInjectedMetadata().getBindings().contains(new
CurrentLiteral());
}
}.run();
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/instantiation/InstantiationByTypeTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/instantiation/InstantiationByTypeTest.java 2009-04-03
20:40:25 UTC (rev 2296)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/instantiation/InstantiationByTypeTest.java 2009-04-04
13:53:33 UTC (rev 2297)
@@ -8,7 +8,7 @@
import org.hibernate.tck.annotations.SpecAssertion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.jsr299.tck.literals.CurrentBinding;
+import org.jboss.jsr299.tck.literals.CurrentLiteral;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.testng.annotations.Test;
@@ -49,7 +49,7 @@
@SpecAssertion(section="5.7.2", id = "j")
public void testDuplicateBindingTypesUsed()
{
- getCurrentManager().getInstanceByType(Tuna.class, new CurrentBinding(), new
CurrentBinding());
+ getCurrentManager().getInstanceByType(Tuna.class, new CurrentLiteral(), new
CurrentLiteral());
}
@Test(groups="resolution",
expectedExceptions=IllegalArgumentException.class)
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java 2009-04-03
20:40:25 UTC (rev 2296)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java 2009-04-04
13:53:33 UTC (rev 2297)
@@ -13,7 +13,7 @@
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.jsr299.tck.literals.CurrentBinding;
+import org.jboss.jsr299.tck.literals.CurrentLiteral;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.testng.annotations.Test;
@@ -58,7 +58,7 @@
@SpecAssertion(section="5.9", id = "d")
public void testDuplicateBindingTypesUsed()
{
- getCurrentManager().resolveByType(Tuna.class, new CurrentBinding(), new
CurrentBinding());
+ getCurrentManager().resolveByType(Tuna.class, new CurrentLiteral(), new
CurrentLiteral());
}
@Test(groups="resolution",
expectedExceptions=IllegalArgumentException.class)
@@ -76,7 +76,7 @@
public void testResolveByType() throws Exception
{
- assert getCurrentManager().resolveByType(Tuna.class, new CurrentBinding()).size()
== 1;
+ assert getCurrentManager().resolveByType(Tuna.class, new CurrentLiteral()).size()
== 1;
assert getCurrentManager().resolveByType(Tuna.class).size() == 1;