Author: dazarov
Date: 2011-11-18 13:46:37 -0500 (Fri, 18 Nov 2011)
New Revision: 36454
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/marker/SeamMarkerResolutionTest.java
Log:
"Configure Problem Severity" quick fix for every JBDS Problem Markers which
opens Preferences Dialog filtered with current problem
https://issues.jboss.org/browse/JBIDE-9885
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-11-18
18:15:10 UTC (rev 36453)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/marker/SeamMarkerResolutionTest.java 2011-11-18
18:46:37 UTC (rev 36454)
@@ -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.ConfigureProblemSeverityMarkerResolution;
import org.jboss.tools.jst.web.kb.PageContextFactory;
import org.jboss.tools.seam.core.SeamCoreBuilder;
import org.jboss.tools.seam.core.SeamCorePlugin;
@@ -48,6 +49,14 @@
//public static final String TEXT_MARKER_TYPE =
"org.eclipse.wst.validation.textmarker";
private IProject project;
+
+ private void checkForConfigureProblemSeverity(IMarkerResolution[] resolutions){
+ for(IMarkerResolution resolution : resolutions){
+ if(resolution.getClass().equals(ConfigureProblemSeverityMarkerResolution.class))
+ return;
+ }
+ fail("Configure Problem Severity marker resolution not found");
+ }
@Override
protected void setUp() throws Exception {
@@ -325,6 +334,7 @@
IMarker marker = markers[i];
IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry()
.getResolutions(marker);
+ checkForConfigureProblemSeverity(resolutions);
for (int j = 0; j < resolutions.length; j++) {
IMarkerResolution resolution = resolutions[j];
if (resolution instanceof DeleteAnnotationMarkerResolution) {
@@ -357,6 +367,7 @@
IMarker marker = markers[i];
IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry()
.getResolutions(marker);
+ checkForConfigureProblemSeverity(resolutions);
for (int j = 0; j < resolutions.length; j++) {
IMarkerResolution resolution = resolutions[j];
if (resolution instanceof AddAnnotatedMethodMarkerResolution) {
@@ -385,6 +396,7 @@
IMarker marker = markers[i];
IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry()
.getResolutions(marker);
+ checkForConfigureProblemSeverity(resolutions);
for (int j = 0; j < resolutions.length; j++) {
IMarkerResolution resolution = resolutions[j];
if (resolution instanceof AddAnnotatedMethodMarkerResolution) {
@@ -413,6 +425,7 @@
IMarker marker = markers[i];
IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry()
.getResolutions(marker);
+ checkForConfigureProblemSeverity(resolutions);
for (int j = 0; j < resolutions.length; j++) {
IMarkerResolution resolution = resolutions[j];
if (resolution instanceof ChangeScopeMarkerResolution) {
@@ -437,6 +450,7 @@
IMarker marker = markers[i];
IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry()
.getResolutions(marker);
+ checkForConfigureProblemSeverity(resolutions);
for (int j = 0; j < resolutions.length; j++) {
IMarkerResolution resolution = resolutions[j];
if (resolution instanceof ChangeScopeMarkerResolution) {
@@ -469,6 +483,7 @@
IMarker marker = markers[i];
IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry()
.getResolutions(marker);
+ checkForConfigureProblemSeverity(resolutions);
for (int j = 0; j < resolutions.length; j++) {
IMarkerResolution resolution = resolutions[j];
if (resolution instanceof AddSetterMarkerResolution) {