Author: dazarov
Date: 2012-01-16 19:45:13 -0500 (Mon, 16 Jan 2012)
New Revision: 37885
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/MultipleDisposers.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/MultipleObservers.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 "Method has more than one parameter annotated @Disposes/@Observes
https://issues.jboss.org/browse/JBIDE-7670
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/MultipleDisposers.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/MultipleDisposers.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/MultipleDisposers.java 2012-01-17
00:45:13 UTC (rev 37885)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.enterprise.inject.Disposes;
+import javax.enterprise.inject.Produces;
+
+
+public class MultipleDisposers {
+ @Produces
+ public String produce(){
+ return "";
+ }
+
+ public void dispose(@Disposes String param, @Disposes String param2, @Disposes String
param3){
+
+ }
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/MultipleDisposers.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/MultipleObservers.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/MultipleObservers.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/MultipleObservers.java 2012-01-17
00:45:13 UTC (rev 37885)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.enterprise.event.Observes;
+
+
+public class MultipleObservers {
+ public void method(@Observes Boolean param, @Observes Boolean param2, @Observes Boolean
param3){
+
+ }
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/MultipleObservers.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-17
00:39:08 UTC (rev 37884)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2012-01-17
00:45:13 UTC (rev 37885)
@@ -37,6 +37,7 @@
import org.jboss.tools.cdi.ui.marker.CreateCDIElementMarkerResolution;
import org.jboss.tools.cdi.ui.marker.DeleteAllDisposerDuplicantMarkerResolution;
import org.jboss.tools.cdi.ui.marker.DeleteAllInjectedConstructorsMarkerResolution;
+import
org.jboss.tools.cdi.ui.marker.DeleteAllOtherAnnotationsFromParametersMarkerResolution;
import org.jboss.tools.cdi.ui.marker.DeleteAnnotationMarkerResolution;
import org.jboss.tools.cdi.ui.marker.MakeFieldStaticMarkerResolution;
import org.jboss.tools.cdi.ui.marker.MakeMethodBusinessMarkerResolution;
@@ -1026,4 +1027,26 @@
CDIValidationErrorManager.PARAM_INJECTION_DECLARES_EMPTY_NAME_ID,
AddNameMarkerResolution.class);
}
+
+ public void testDeleteAllOtherDisposerParametersResolution() throws CoreException{
+ checkResolution(tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/MultipleDisposers.java"
+ },
+ CDICoreValidator.PROBLEM_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.MULTIPLE_DISPOSING_PARAMETERS_ID,
+ DeleteAllOtherAnnotationsFromParametersMarkerResolution.class);
+ }
+
+ public void testDeleteAllOtherObserverParametersResolution() throws CoreException{
+ checkResolution(tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/MultipleObservers.java"
+ },
+ CDICoreValidator.PROBLEM_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.MULTIPLE_OBSERVING_PARAMETERS_ID,
+ DeleteAllOtherAnnotationsFromParametersMarkerResolution.class);
+ }
}
\ No newline at end of file