Author: dazarov
Date: 2010-12-11 10:50:28 -0500 (Sat, 11 Dec 2010)
New Revision: 27380
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/Foo.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/FooProducer.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/FooProducerLocal.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/FooProducerNoInterface.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/FunnelWeaver.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NonStaticProducerOfSessionBeanBroken.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
Log:
https://issues.jboss.org/browse/JBIDE-7669
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/Foo.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/Foo.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/Foo.java 2010-12-11
15:50:28 UTC (rev 27380)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+public class Foo
+{
+
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/Foo.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/FooProducer.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/FooProducer.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/FooProducer.java 2010-12-11
15:50:28 UTC (rev 27380)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.ejb.Stateful;
+import javax.enterprise.inject.Produces;
+
+@Stateful
+public class FooProducer implements FooProducerLocal
+{
+ @Produces Foo createFoo() { return new Foo(); }
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/FooProducer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/FooProducerLocal.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/FooProducerLocal.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/FooProducerLocal.java 2010-12-11
15:50:28 UTC (rev 27380)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.ejb.Local;
+
+@Local
+public interface FooProducerLocal
+{
+
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/FooProducerLocal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/FooProducerNoInterface.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/FooProducerNoInterface.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/FooProducerNoInterface.java 2010-12-11
15:50:28 UTC (rev 27380)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.ejb.Stateful;
+import javax.enterprise.inject.Produces;
+
+@Stateful
+public class FooProducerNoInterface
+{
+ @Produces Foo createFoo() { return new Foo(); }
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/FooProducerNoInterface.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/FunnelWeaver.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/FunnelWeaver.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/FunnelWeaver.java 2010-12-11
15:50:28 UTC (rev 27380)
@@ -0,0 +1,5 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+class FunnelWeaver<T> {
+
+}
\ No newline at end of file
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/FunnelWeaver.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NonStaticProducerOfSessionBeanBroken.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NonStaticProducerOfSessionBeanBroken.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NonStaticProducerOfSessionBeanBroken.java 2010-12-11
15:50:28 UTC (rev 27380)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.ejb.Stateless;
+import javax.enterprise.inject.Produces;
+
+@Stateless
+public class NonStaticProducerOfSessionBeanBroken {
+
+ @Produces public FunnelWeaver<String> anotherFunnelWeaver;
+}
\ No newline at end of file
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NonStaticProducerOfSessionBeanBroken.java
___________________________________________________________________
Name: 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 2010-12-11
11:56:32 UTC (rev 27379)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2010-12-11
15:50:28 UTC (rev 27380)
@@ -18,8 +18,10 @@
import org.eclipse.ui.IMarkerResolution;
import org.eclipse.ui.ide.IDE;
import org.jboss.tools.cdi.core.test.tck.validation.ValidationTest;
+import org.jboss.tools.cdi.ui.marker.AddLocalBeanMarkerResolution;
import org.jboss.tools.cdi.ui.marker.MakeFieldStaticMarkerResolution;
import org.jboss.tools.cdi.ui.marker.MakeMethodBusinessMarkerResolution;
+import org.jboss.tools.cdi.ui.marker.MakeMethodPublicMarkerResolution;
/**
* @author Daniel Azarov
@@ -29,7 +31,7 @@
public static final String MARKER_TYPE =
"org.jboss.tools.cdi.core.cdiproblem";
public void testMakeFieldStaticResolution() throws CoreException {
- IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/NonStaticProducerOfSessionBeanBroken.java");
+ IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/NonStaticProducerOfSessionBeanBroken.java");
assertTrue("File - "+file.getFullPath()+" must be
exist",file.exists());
@@ -55,12 +57,39 @@
}
public void testMakeMethodBusinessResolution() throws CoreException {
- IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/enterprise/nonbusiness/FooProducer.java");
+ IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/FooProducer.java");
assertTrue("File - "+file.getFullPath()+" must be
exist",file.exists());
IMarker[] markers = file.findMarkers(MARKER_TYPE, true, IResource.DEPTH_INFINITE);
+ boolean found1 = false;
+ boolean found2 = false;
+ for (int i = 0; i < markers.length; i++) {
+ IMarker marker = markers[i];
+ IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry()
+ .getResolutions(marker);
+ for (int j = 0; j < resolutions.length; j++) {
+ IMarkerResolution resolution = resolutions[j];
+ if (resolution instanceof MakeMethodBusinessMarkerResolution) {
+ found1 = true;
+ }
+ if (resolution instanceof AddLocalBeanMarkerResolution) {
+ found2 = true;
+ }
+ }
+ }
+ assertTrue("Quick fix: \"Make method business\" doesn't
exist.", found1);
+ assertTrue("Quick fix: \"Add @LocalBean annotation\" doesn't
exist.", found2);
+ }
+
+ public void testMakeMethodPublicResolution() throws CoreException {
+ IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/FooProducerNoInterface.java");
+
+ assertTrue("File - "+file.getFullPath()+" must be
exist",file.exists());
+
+ IMarker[] markers = file.findMarkers(MARKER_TYPE, true, IResource.DEPTH_INFINITE);
+
boolean found = false;
for (int i = 0; i < markers.length; i++) {
IMarker marker = markers[i];
@@ -68,7 +97,7 @@
.getResolutions(marker);
for (int j = 0; j < resolutions.length; j++) {
IMarkerResolution resolution = resolutions[j];
- if (resolution instanceof MakeMethodBusinessMarkerResolution) {
+ if (resolution instanceof MakeMethodPublicMarkerResolution) {
found = true;
break;
}
@@ -77,7 +106,7 @@
break;
}
}
- assertTrue("Quick fix: \"Make method business\" doesn't
exist.", found);
+ assertTrue("Quick fix: \"Make method public\" doesn't exist.",
found);
}
}