Author: dazarov
Date: 2010-12-15 12:37:11 -0500 (Wed, 15 Dec 2010)
New Revision: 27519
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/FooProducerNoInterface.qfxresult
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TibetanTerrier_BrokenNoInterface.qfxresult
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java
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-7673
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/FooProducerNoInterface.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/FooProducerNoInterface.qfxresult
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/FooProducerNoInterface.qfxresult 2010-12-15
17:37:11 UTC (rev 27519)
@@ -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 public Foo createFoo() { return new Foo(); }
+}
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TibetanTerrier_BrokenNoInterface.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TibetanTerrier_BrokenNoInterface.qfxresult
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TibetanTerrier_BrokenNoInterface.qfxresult 2010-12-15
17:37:11 UTC (rev 27519)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.ejb.Stateless;
+import javax.enterprise.event.Observes;
+
+@Stateless
+class TibetanTerrier_BrokenNoInterface
+{
+ public void observeSomeEvent(@Observes String someEvent)
+ {
+ }
+}
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java 2010-12-15
17:10:29 UTC (rev 27518)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java 2010-12-15
17:37:11 UTC (rev 27519)
@@ -209,7 +209,7 @@
static class JavaFileFilter implements FileFilter {
public boolean accept(File pathname) {
String name = pathname.getName();
- return (pathname.isDirectory() && !name.endsWith(".svn")) ||
((name.endsWith(".java") || name.equals("beans.xml")) &&
!name.endsWith("Test.java"));
+ return (pathname.isDirectory() && !name.endsWith(".svn")) ||
((name.endsWith(".java") || name.endsWith(".qfxresult") ||
name.equals("beans.xml")) && !name.endsWith("Test.java"));
}
}
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-15
17:10:29 UTC (rev 27518)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2010-12-15
17:37:11 UTC (rev 27519)
@@ -29,6 +29,7 @@
import org.jboss.tools.cdi.ui.marker.MakeFieldStaticMarkerResolution;
import org.jboss.tools.cdi.ui.marker.MakeMethodBusinessMarkerResolution;
import org.jboss.tools.cdi.ui.marker.MakeMethodPublicMarkerResolution;
+import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.test.util.JobUtils;
/**
@@ -39,6 +40,10 @@
public static final String MARKER_TYPE =
"org.jboss.tools.cdi.core.cdiproblem";
private void checkResolution(IProject project, String[] fileNames, String markerType,
String idName, int id, Class<? extends IMarkerResolution> resolutionClass) throws
CoreException {
+ checkResolution(project, fileNames, new String[]{}, markerType, idName, id,
resolutionClass);
+ }
+
+ private void checkResolution(IProject project, String[] fileNames, String[] results,
String markerType, String idName, int id, Class<? extends IMarkerResolution>
resolutionClass) throws CoreException {
IFile file = project.getFile(fileNames[0]);
assertTrue("File - "+file.getFullPath()+" must be
exist",file.exists());
@@ -69,6 +74,8 @@
assertTrue("Marker resolution did not decrease number of problems. was:
"+markers.length+" now: "+newMarkers.length, newMarkers.length <
markers.length);
+ checkResults(project, fileNames, results);
+
return;
}
}
@@ -137,6 +144,19 @@
}
}
+ private void checkResults(IProject project, String[] fileNames, String[] results) throws
CoreException{
+ for(int i = 0; i < results.length; i++){
+ IFile file = project.getFile(fileNames[i]);
+ IFile resultFile = project.getFile(results[i]);
+
+ String fileContent = FileUtil.readStream(file);
+ String resultContent = FileUtil.readStream(resultFile);
+
+ assertEquals("Wrong result of resolution", resultContent, fileContent);
+ }
+
+ }
+
public void testMakeProducerFieldStaticResolution() throws CoreException {
checkResolution(tckProject,
new String[]{
@@ -179,6 +199,9 @@
new String[]{
"JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/FooProducerNoInterface.java"
},
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/FooProducerNoInterface.qfxresult"
+ },
MARKER_TYPE,
CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
CDIValidationErrorManager.ILLEGAL_PRODUCER_METHOD_IN_SESSION_BEAN_ID,
@@ -214,6 +237,9 @@
new String[]{
"JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/TibetanTerrier_BrokenNoInterface.java"
},
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/TibetanTerrier_BrokenNoInterface.qfxresult"
+ },
MARKER_TYPE,
CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
CDIValidationErrorManager.ILLEGAL_OBSERVER_IN_SESSION_BEAN_ID,