Author: dazarov
Date: 2011-12-13 19:57:54 -0500 (Tue, 13 Dec 2011)
New Revision: 37304
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/marker/SeamMarkerResolutionTest.java
Log:
Add @SuppressWarnings quick fix
https://issues.jboss.org/browse/JBIDE-10187
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/marker/SeamMarkerResolutionTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/marker/SeamMarkerResolutionTest.java 2011-12-14
00:51:00 UTC (rev 37303)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/marker/SeamMarkerResolutionTest.java 2011-12-14
00:57:54 UTC (rev 37304)
@@ -27,6 +27,7 @@
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.ui.IMarkerResolution;
import org.eclipse.ui.ide.IDE;
+import org.jboss.tools.common.ui.marker.AddSuppressWarningsMarkerResolution;
import org.jboss.tools.common.ui.marker.ConfigureProblemSeverityMarkerResolution;
import org.jboss.tools.jst.web.kb.PageContextFactory;
import org.jboss.tools.seam.core.SeamCoreBuilder;
@@ -57,6 +58,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");
+ }
+ }
@Override
protected void setUp() throws Exception {
@@ -335,6 +346,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 instanceof DeleteAnnotationMarkerResolution) {
@@ -368,6 +380,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 instanceof AddAnnotatedMethodMarkerResolution) {
@@ -397,6 +410,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 instanceof AddAnnotatedMethodMarkerResolution) {
@@ -426,6 +440,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 instanceof ChangeScopeMarkerResolution) {
@@ -451,6 +466,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 instanceof ChangeScopeMarkerResolution) {
@@ -484,6 +500,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 instanceof AddSetterMarkerResolution) {