Author: dazarov
Date: 2011-12-13 18:25:46 -0500 (Tue, 13 Dec 2011)
New Revision: 37299
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
Log:
Add @SuppressWarnings quick fix
https://issues.jboss.org/browse/JBIDE-10187
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 2011-12-13
21:14:06 UTC (rev 37298)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-12-13
23:25:46 UTC (rev 37299)
@@ -43,6 +43,7 @@
import org.jboss.tools.cdi.ui.marker.TestableResolutionWithDialog;
import org.jboss.tools.cdi.ui.marker.TestableResolutionWithRefactoringProcessor;
import org.jboss.tools.common.base.test.validation.TestUtil;
+import org.jboss.tools.common.ui.marker.AddSuppressWarningsMarkerResolution;
import org.jboss.tools.common.ui.marker.ConfigureProblemSeverityMarkerResolution;
import org.jboss.tools.common.util.FileUtil;
@@ -59,6 +60,16 @@
}
fail("Configure Problem Severity marker resolution not found");
}
+
+ private void checkForAddSuppressWarnings(IFile file, IMarkerResolution[] resolutions){
+ if(file.getFileExtension().equals("java")){
+ for(IMarkerResolution resolution : resolutions){
+ if(resolution.getClass().equals(AddSuppressWarningsMarkerResolution.class))
+ return;
+ }
+ fail("Add @SuppressWarnings marker resolution not found");
+ }
+ }
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);
@@ -86,6 +97,7 @@
IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry()
.getResolutions(marker);
checkForConfigureProblemSeverity(resolutions);
+ checkForAddSuppressWarnings(file, resolutions);
for (int j = 0; j < resolutions.length; j++) {
IMarkerResolution resolution = resolutions[j];
if (resolution.getClass().equals(resolutionClass)) {