Author: dazarov
Date: 2012-01-12 14:14:51 -0500 (Thu, 12 Jan 2012)
New Revision: 37802
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/Arder.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NamedInjectionBroken.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/Order.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
Log:
Quick fix for "Injection point other than injected field must not declare a @Named
annotation that does not specify the value member [JSR-299 ?\194?\1673.11]" error
marker
https://issues.jboss.org/browse/JBIDE-7638
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/Arder.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/Arder.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/Arder.java 2012-01-12
19:14:51 UTC (rev 37802)
@@ -0,0 +1,8 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.inject.Named;
+
+@Named("arder2")
+public class Arder extends Order {
+
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/Arder.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NamedInjectionBroken.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NamedInjectionBroken.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NamedInjectionBroken.java 2012-01-12
19:14:51 UTC (rev 37802)
@@ -0,0 +1,24 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+
+public class NamedInjectionBroken {
+
+ @Named @Inject Order order;
+
+ @Named("e")
+ @Inject
+ NamedInjectionBroken(Order order) {
+ // DO nothing
+ }
+
+ @Inject public void init(@Named Order order) {
+ // DO nothing
+ }
+
+ @Named("injectTestFooName") @Inject
+ public void foo(Order order) {
+ // DO nothing
+ }
+}
\ No newline at end of file
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NamedInjectionBroken.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/Order.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/Order.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/Order.java 2012-01-12
19:14:51 UTC (rev 37802)
@@ -0,0 +1,8 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.inject.Named;
+
+@Named("order1")
+public class Order {
+
+}
\ No newline at end of file
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/Order.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2012-01-12
19:04:41 UTC (rev 37801)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2012-01-12
19:14:51 UTC (rev 37802)
@@ -19,12 +19,9 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.ltk.core.refactoring.Change;
import org.eclipse.ltk.core.refactoring.CompositeChange;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.TextFileChange;
import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
-import org.eclipse.text.edits.MultiTextEdit;
import org.eclipse.ui.IMarkerResolution;
import org.eclipse.ui.ide.IDE;
import org.jboss.tools.cdi.core.test.tck.TCKTest;
@@ -32,6 +29,7 @@
import org.jboss.tools.cdi.internal.core.validation.CDIValidationErrorManager;
import org.jboss.tools.cdi.ui.marker.AddAnnotationMarkerResolution;
import org.jboss.tools.cdi.ui.marker.AddLocalBeanMarkerResolution;
+import org.jboss.tools.cdi.ui.marker.AddNameMarkerResolution;
import org.jboss.tools.cdi.ui.marker.AddRetentionAnnotationMarkerResolution;
import org.jboss.tools.cdi.ui.marker.AddSerializableInterfaceMarkerResolution;
import org.jboss.tools.cdi.ui.marker.AddTargetAnnotationMarkerResolution;
@@ -45,9 +43,7 @@
import org.jboss.tools.cdi.ui.marker.MakeMethodPublicMarkerResolution;
import org.jboss.tools.cdi.ui.marker.TestableResolutionWithDialog;
import org.jboss.tools.cdi.ui.marker.TestableResolutionWithRefactoringProcessor;
-import org.jboss.tools.common.base.test.AbstractRefactorTest.TestChangeStructure;
import org.jboss.tools.common.base.test.validation.TestUtil;
-import org.jboss.tools.common.refactoring.BaseFileChange;
import org.jboss.tools.common.ui.marker.AddSuppressWarningsMarkerResolution;
import org.jboss.tools.common.ui.marker.ConfigureProblemSeverityMarkerResolution;
import org.jboss.tools.common.util.FileUtil;
@@ -1019,4 +1015,15 @@
CDIValidationErrorManager.UNKNOWN_INTERCEPTOR_CLASS_NAME_ID,
CreateCDIElementMarkerResolution.class);
}
+
+ public void testAddNameResolution() throws CoreException{
+ checkResolution(tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/NamedInjectionBroken.java"
+ },
+ CDICoreValidator.PROBLEM_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.PARAM_INJECTION_DECLARES_EMPTY_NAME_ID,
+ AddNameMarkerResolution.class);
+ }
}
\ No newline at end of file