Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-08-25 08:17:07 +0000
committerEike Stepper2012-08-25 08:17:07 +0000
commit35ccea27376c56de99e1f4b24baec85cf10852ab (patch)
tree0388c00bd721854364a5f5066d71fd57ec537696 /plugins
parent0efa2388535a308854891d67a88d8a1b65e4a738 (diff)
downloadcdo-35ccea27376c56de99e1f4b24baec85cf10852ab.tar.gz
cdo-35ccea27376c56de99e1f4b24baec85cf10852ab.tar.xz
cdo-35ccea27376c56de99e1f4b24baec85cf10852ab.zip
Add resolution labels/descriptions to .markers files
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.version.tests/src/org/eclipse/emf/cdo/releng/version/tests/VersionBuilderTest.java49
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.version.tests/tests/00002-ProblemAfterChange/incremental/build.markers3
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.version.tests/tests/00002-ProblemAfterChange/incremental/fix1.markers6
3 files changed, 44 insertions, 14 deletions
diff --git a/plugins/org.eclipse.emf.cdo.releng.version.tests/src/org/eclipse/emf/cdo/releng/version/tests/VersionBuilderTest.java b/plugins/org.eclipse.emf.cdo.releng.version.tests/src/org/eclipse/emf/cdo/releng/version/tests/VersionBuilderTest.java
index bb90e79208..6e64af5e30 100644
--- a/plugins/org.eclipse.emf.cdo.releng.version.tests/src/org/eclipse/emf/cdo/releng/version/tests/VersionBuilderTest.java
+++ b/plugins/org.eclipse.emf.cdo.releng.version.tests/src/org/eclipse/emf/cdo/releng/version/tests/VersionBuilderTest.java
@@ -26,6 +26,7 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.ui.IMarkerResolution;
+import org.eclipse.ui.IMarkerResolution2;
import java.io.File;
import java.io.PrintStream;
@@ -258,7 +259,7 @@ public class VersionBuilderTest extends TestCase
assertTrue("Marker has resolutions but hasResolutions() returns false", FIX_GENERATOR.hasResolutions(marker));
for (IMarkerResolution resolution : resolutions)
{
- msg("Fixing " + marker.getResource().getFullPath() + ": " + resolution.getLabel());
+ msg(resolution.getLabel() + ": " + marker.getResource().getFullPath().makeRelative());
resolution.run(marker);
}
}
@@ -341,7 +342,7 @@ public class VersionBuilderTest extends TestCase
builder.append("Marker");
builder.append(lineDelimiter);
- addAttribute(builder, Markers.RESOURCE_ATTRIBUTE + " ", file.getFullPath());
+ addAttribute(builder, Markers.RESOURCE_ATTRIBUTE + " ", file.getFullPath().makeRelative());
Map<String, Object> attributes = marker.getAttributes();
List<String> keys = new ArrayList<String>(attributes.keySet());
@@ -421,11 +422,46 @@ public class VersionBuilderTest extends TestCase
Object value = attributes.get(key);
addAttribute(builder, key, value);
}
+
+ IMarkerResolution[] resolutions = FIX_GENERATOR.getResolutions(marker);
+ if (resolutions != null && resolutions.length != 0)
+ {
+ assertTrue("Marker has resolutions but hasResolutions() returns false", FIX_GENERATOR.hasResolutions(marker));
+ for (int j = 0; j < resolutions.length; j++)
+ {
+ IMarkerResolution resolution = resolutions[j];
+ addFix(builder, j + 1, resolution);
+ }
+ }
}
return builder.toString();
}
+ private static void addAttribute(StringBuilder builder, String key, Object value)
+ {
+ String str = " " + key + " = " + value;
+ msg(str);
+
+ builder.append(str);
+ builder.append(lineDelimiter);
+ }
+
+ private static void addFix(StringBuilder builder, int j, IMarkerResolution resolution)
+ {
+ String str = " FIX-" + j + " = " + resolution.getLabel();
+ if (resolution instanceof IMarkerResolution2)
+ {
+ IMarkerResolution2 resolution2 = (IMarkerResolution2)resolution;
+ str += " (" + resolution2.getDescription() + ")";
+ }
+
+ msg(str);
+
+ builder.append(str);
+ builder.append(lineDelimiter);
+ }
+
private static Object getSeverityLabel(int severity)
{
switch (severity)
@@ -441,15 +477,6 @@ public class VersionBuilderTest extends TestCase
}
}
- private static void addAttribute(StringBuilder builder, String key, Object value)
- {
- String str = " " + key + " = " + value;
- msg(str);
-
- builder.append(str);
- builder.append(lineDelimiter);
- }
-
private static String getRelativePath(File file)
{
return file.getAbsolutePath().substring(TRIM_LENGTH).replace('\\', '/');
diff --git a/plugins/org.eclipse.emf.cdo.releng.version.tests/tests/00002-ProblemAfterChange/incremental/build.markers b/plugins/org.eclipse.emf.cdo.releng.version.tests/tests/00002-ProblemAfterChange/incremental/build.markers
index 69dd465d61..7d4d0a3098 100644
--- a/plugins/org.eclipse.emf.cdo.releng.version.tests/tests/00002-ProblemAfterChange/incremental/build.markers
+++ b/plugins/org.eclipse.emf.cdo.releng.version.tests/tests/00002-ProblemAfterChange/incremental/build.markers
@@ -1,5 +1,5 @@
Marker
- <resource> = /com.foo.project1/META-INF/MANIFEST.MF
+ <resource> = com.foo.project1/META-INF/MANIFEST.MF
<charStart> = (4,18)
<charEnd> = (4,23)
<severity> = ERROR
@@ -7,3 +7,4 @@ Marker
problemType = component.version
quickFixPattern = Bundle-Version: *(\d+(\.\d+(\.\d+)?)?)
quickFixReplacement = 1.0.100
+ FIX-1 = Change the version (Change the version to 1.0.100)
diff --git a/plugins/org.eclipse.emf.cdo.releng.version.tests/tests/00002-ProblemAfterChange/incremental/fix1.markers b/plugins/org.eclipse.emf.cdo.releng.version.tests/tests/00002-ProblemAfterChange/incremental/fix1.markers
index f1cfd3f323..9698a7776c 100644
--- a/plugins/org.eclipse.emf.cdo.releng.version.tests/tests/00002-ProblemAfterChange/incremental/fix1.markers
+++ b/plugins/org.eclipse.emf.cdo.releng.version.tests/tests/00002-ProblemAfterChange/incremental/fix1.markers
@@ -1,5 +1,5 @@
Marker
- <resource> = /com.foo.project1-feature/feature.xml
+ <resource> = com.foo.project1-feature/feature.xml
<charStart> = (5,17)
<charEnd> = (5,22)
<severity> = ERROR
@@ -8,8 +8,10 @@ Marker
quickFixConfigureOption = ignore.feature.content.changes
quickFixPattern = feature.*?version\s*=\s*["'](\d+(\.\d+(\.\d+)?)?)
quickFixReplacement = 1.0.100
+ FIX-1 = Change the version (Change the version to 1.0.100)
+ FIX-2 = Configure the project to ignore the problem (Set ignore.feature.content.changes = true in '/com.foo.project1-feature/.project')
Marker
- <resource> = /com.foo.project1-feature/feature.xml
+ <resource> = com.foo.project1-feature/feature.xml
<charStart> = (28,15)
<charEnd> = (28,31)
<severity> = WARNING

Back to the top