Author: akazakov
Date: 2010-12-20 13:08:30 -0500 (Mon, 20 Dec 2010)
New Revision: 27620
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/resolution/InjectionInstance.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java
Log:
https://issues.jboss.org/browse/JBIDE-7949
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2010-12-20
17:56:58 UTC (rev 27619)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2010-12-20
18:08:30 UTC (rev 27620)
@@ -6,8 +6,8 @@
DUPLCICATE_EL_NAME=A few beans ({0}) have the same EL name and the name is not resolvable
[JSR-299 �5.3.1]
UNRESOLVABLE_EL_NAME=The EL name "{0}" is of the form x.y, where y
("{1}") is a valid bean EL name, and x ("{2}") is the EL name of the
other bean {3} [JSR-299 �5.3.1]
-UNSATISFIED_INJECTION_POINTS=No bean is eligible for injection to the injection point
-AMBIGUOUS_INJECTION_POINTS=Multiple beans are eligible for injection to the injection
point
+UNSATISFIED_INJECTION_POINTS=No bean is eligible for injection to the injection point
[JSR-299 �5.2.1]
+AMBIGUOUS_INJECTION_POINTS=Multiple beans are eligible for injection to the injection
point [JSR-299 �5.2.1]
UNPROXYABLE_BEAN_ARRAY_TYPE=Injection point declares an array type {0} that cannot be
proxied by the container resolves to a bean {1} with a normal scope [JSR-299 �5.4.1]
UNPROXYABLE_BEAN_PRIMITIVE_TYPE=Injection point declares a primitive type {0} that cannot
be proxied by the container resolves to a bean {1} with a normal scope [JSR-299 �5.4.1]
UNPROXYABLE_BEAN_TYPE_WITH_NPC=Injection point declares a class {0} with a non-private
constructor with no parameters (such a class cannot be proxied by the container) resolves
to a bean {1} with a normal scope [JSR-299 �5.4.1]
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/resolution/InjectionInstance.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/resolution/InjectionInstance.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/resolution/InjectionInstance.java 2010-12-20
18:08:30 UTC (rev 27620)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.tests.jbt.resolution;
+
+import javax.enterprise.inject.Instance;
+import javax.inject.Inject;
+
+public class InjectionInstance {
+
+ @Inject Instance<String> multipleOk;
+ @Inject Instance<String> emptyOk;
+
+ @Inject String multipleBroken;
+ @Inject StringBuffer emptyBroken;
+}
\ No newline at end of file
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/resolution/InjectionInstance.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java 2010-12-20
17:56:58 UTC (rev 27619)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java 2010-12-20
18:08:30 UTC (rev 27620)
@@ -62,6 +62,30 @@
}
/**
+ * CDI validator should not complain if there ambiguous dependencies for @Inject
Instance<[type]>
+ * See
https://issues.jboss.org/browse/JBIDE-7949
+ *
+ * @throws Exception
+ */
+ public void testAmbiguousDependencyForInstance() throws Exception {
+ IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/InjectionInstance.java");
+ assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 8);
+ assertMarkerIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 11);
+ }
+
+ /**
+ * CDI validator should not complain if there unsatisfied dependencies for @Inject
Instance<[type]>
+ * See
https://issues.jboss.org/browse/JBIDE-7949
+ *
+ * @throws Exception
+ */
+ public void testUnsatisfiedDependencyForInstance() throws Exception {
+ IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/InjectionInstance.java");
+ assertMarkerIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 9);
+ assertMarkerIsCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 12);
+ }
+
+ /**
* 5.2.4. Primitive types and null values
* - injection point of primitive type resolves to a bean that may have null values,
such as a producer method with a non-primitive return type or a producer field with a
non-primitive type
*