Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gvozdev2010-04-07 12:04:56 -0400
committerAndrew Gvozdev2010-04-07 12:04:56 -0400
commit2dc29833ffbddce7f25ea7d5e4d1654fa335426d (patch)
tree9237b92559deb738a005acb3742b5046680e2046 /xlc/org.eclipse.cdt.errorparsers.xlc.tests
parent857c5eae688574a290eeb7c1c4863efbef46a2ea (diff)
downloadorg.eclipse.cdt-2dc29833ffbddce7f25ea7d5e4d1654fa335426d.tar.gz
org.eclipse.cdt-2dc29833ffbddce7f25ea7d5e4d1654fa335426d.tar.xz
org.eclipse.cdt-2dc29833ffbddce7f25ea7d5e4d1654fa335426d.zip
bug 308322: Converted to RegexErrorParser
Diffstat (limited to 'xlc/org.eclipse.cdt.errorparsers.xlc.tests')
-rw-r--r--xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestUnrecoverableError.java2
-rw-r--r--xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/XlcErrorParserTester.java20
2 files changed, 14 insertions, 8 deletions
diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestUnrecoverableError.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestUnrecoverableError.java
index 8ccbd80075..e94da5b1cf 100644
--- a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestUnrecoverableError.java
+++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestUnrecoverableError.java
@@ -28,7 +28,7 @@ public class TestUnrecoverableError extends TestCase {
aix.parseLine(err_msg);
assertEquals("temp1.c", aix.getFileName());
assertEquals(5, aix.getLineNumber());
- assertEquals(IMarkerGenerator.SEVERITY_ERROR_BUILD, aix.getSeverity());
+ assertEquals(IMarkerGenerator.SEVERITY_ERROR_RESOURCE, aix.getSeverity());
assertEquals("INTERNAL COMPILER ERROR",aix.getMessage());
}
public TestUnrecoverableError( String name)
diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/XlcErrorParserTester.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/XlcErrorParserTester.java
index 3cc193b866..b565c593fb 100644
--- a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/XlcErrorParserTester.java
+++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/XlcErrorParserTester.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
+ * Copyright (c) 2006, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,9 +15,9 @@ package org.eclipse.cdt.errorparsers.xlc.tests;
import junit.framework.Assert;
import org.eclipse.cdt.core.ErrorParserManager;
+import org.eclipse.cdt.core.IErrorParserNamed;
import org.eclipse.cdt.core.IMarkerGenerator;
import org.eclipse.cdt.core.ProblemMarkerInfo;
-import org.eclipse.cdt.errorparsers.xlc.XlcErrorParser;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
@@ -30,6 +30,8 @@ import org.eclipse.core.runtime.IPath;
*/
public class XlcErrorParserTester {
+ public static final String XLC_ERROR_PARSER_ID = "org.eclipse.cdt.errorparsers.xlc.XlcErrorParser";
+
static private int counter=0;
IProject fTempProject = ResourcesPlugin.getWorkspace().getRoot().getProject("XlcErrorParserTester.temp." + counter++);
@@ -84,16 +86,19 @@ public class XlcErrorParserTester {
*/
@Override
public IFile findFileName(String fileName) {
- return fTempProject.getFile(fileName);
+ if (fileName!=null && fileName.trim().length()>0)
+ return fTempProject.getFile(fileName);
+ return null;
}
/**
* Called by ErrorPattern.RecordError() for external problem markers
*/
@Override
- public void generateExternalMarker(IResource file, int lineNumb, String desc, int sev, String varName, IPath externalPath) {
- if (file!=null) {
- fileName = file.getName();
+ public void generateExternalMarker(IResource rc, int lineNumb, String desc, int sev, String varName, IPath externalPath) {
+ // if rc is this project it means that file was not found
+ if (rc!=null && rc!=fTempProject) {
+ fileName = rc.getName();
} else {
fileName="";
}
@@ -109,7 +114,8 @@ public class XlcErrorParserTester {
* @return
*/
boolean parseLine(String line) {
- XlcErrorParser errorParser = new XlcErrorParser();
+ IErrorParserNamed errorParser = ErrorParserManager.getErrorParserCopy(XLC_ERROR_PARSER_ID);
+ Assert.assertNotNull(errorParser);
MockErrorParserManager epManager = new MockErrorParserManager();
return errorParser.processLine(line, epManager);

Back to the top