Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvladt2011-02-22 17:31:36 +0000
committervladt2011-02-22 17:35:12 +0000
commit29e2fc24b109e0531f9bdddf6f53a5a78d29f24d (patch)
tree55026227b4e2f24dcb8223bebda8835ffcf154bb /org.eclipse.m2e.tests.common
parentccb6bf07e0c45c181491bdb9d75c5cd362adfa88 (diff)
downloadm2e-core-29e2fc24b109e0531f9bdddf6f53a5a78d29f24d.tar.gz
m2e-core-29e2fc24b109e0531f9bdddf6f53a5a78d29f24d.tar.xz
m2e-core-29e2fc24b109e0531f9bdddf6f53a5a78d29f24d.zip
337220: location details needed in markers for jumping to file defining marker error
Diffstat (limited to 'org.eclipse.m2e.tests.common')
-rw-r--r--org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/WorkspaceHelpers.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/WorkspaceHelpers.java b/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/WorkspaceHelpers.java
index c2408bd6..b1556ff1 100644
--- a/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/WorkspaceHelpers.java
+++ b/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/WorkspaceHelpers.java
@@ -38,9 +38,11 @@ import org.eclipse.core.runtime.Status;
import org.codehaus.plexus.util.FileUtils;
import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.internal.markers.MarkerLocation;
import org.eclipse.m2e.core.project.configurator.MojoExecutionKey;
+@SuppressWarnings("restriction")
public class WorkspaceHelpers {
public static void cleanWorkspace() throws InterruptedException, CoreException {
@@ -306,4 +308,24 @@ public class WorkspaceHelpers {
Assert.assertEquals("Marker's lifecyclePhase", mojoExecution.getLifecyclePhase(),
marker.getAttribute(IMavenConstants.MARKER_ATTR_LIFECYCLE_PHASE, null));
}
+
+ public static void assertMarkerLocation(MarkerLocation markerLocation, IMarker marker) throws CoreException {
+ Assert.assertEquals("Wrong line number", markerLocation.getLineNumber(), marker.getAttribute(IMarker.LINE_NUMBER));
+ Assert.assertEquals("Wrong char start", markerLocation.getCharStart(), marker.getAttribute(IMarker.CHAR_START));
+ Assert.assertEquals("Wrong char end", markerLocation.getCharEnd(), marker.getAttribute(IMarker.CHAR_END));
+
+ markerLocation = markerLocation.getCauseLocation();
+ if(markerLocation == null) {
+ return;
+ }
+
+ Assert.assertEquals("Wrong cause resource path", markerLocation.getResourcePath(),
+ marker.getAttribute(IMavenConstants.MARKER_CAUSE_RESOURCE_PATH));
+ Assert.assertEquals("Wrong cause line number", markerLocation.getLineNumber(),
+ marker.getAttribute(IMavenConstants.MARKER_CAUSE_LINE_NUMBER));
+ Assert.assertEquals("Wrong cause char start", markerLocation.getCharStart(),
+ marker.getAttribute(IMavenConstants.MARKER_CAUSE_CHAR_START));
+ Assert.assertEquals("Wrong cause char end", markerLocation.getCharEnd(),
+ marker.getAttribute(IMavenConstants.MARKER_CAUSE_CHAR_END));
+ }
}

Back to the top