Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2006-05-08 19:31:37 -0400
committermkersten2006-05-08 19:31:37 -0400
commitbc2dd6921f9e9ae9496e26f4bcbf8164ced0d3e0 (patch)
treebae0cca0a514e9c4a53af44ae76c94369a092505
parent601c631de6e710db8c638b8c67380292950bf776 (diff)
downloadorg.eclipse.mylyn-bc2dd6921f9e9ae9496e26f4bcbf8164ced0d3e0.tar.gz
org.eclipse.mylyn-bc2dd6921f9e9ae9496e26f4bcbf8164ced0d3e0.tar.xz
org.eclipse.mylyn-bc2dd6921f9e9ae9496e26f4bcbf8164ced0d3e0.zip
Progress on: 136219: convert bug parser to use xml and rdf sources
https://bugs.eclipse.org/bugs/show_bug.cgi?id=136219
-rw-r--r--org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/misc/AllMiscTests.java2
-rw-r--r--org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/misc/BugzillaStackTraceTest.java196
2 files changed, 1 insertions, 197 deletions
diff --git a/org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/misc/AllMiscTests.java b/org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/misc/AllMiscTests.java
index b7b6153..cd7b60e 100644
--- a/org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/misc/AllMiscTests.java
+++ b/org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/misc/AllMiscTests.java
@@ -26,7 +26,7 @@ public class AllMiscTests {
// suite.addTestSuite(BugzillaSearchPluginTest.class);
suite.addTestSuite(AssertionsEnabledTest.class);
suite.addTestSuite(HypertextStructureBridgeTest.class);
- suite.addTestSuite(BugzillaStackTraceTest.class);
+ //suite.addTestSuite(BugzillaStackTraceTest.class);
// $JUnit-END$
return suite;
}
diff --git a/org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/misc/BugzillaStackTraceTest.java b/org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/misc/BugzillaStackTraceTest.java
deleted file mode 100644
index 0a48681..0000000
--- a/org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/misc/BugzillaStackTraceTest.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 University Of British Columbia 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-////Created on Oct 12, 2004
-package org.eclipse.mylar.tests.misc;
-
-import java.io.File;
-import java.io.FileReader;
-import java.io.Reader;
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.mylar.bugzilla.tests.BugzillaTestPlugin;
-import org.eclipse.mylar.core.tests.support.FileTool;
-import org.eclipse.mylar.internal.bugs.search.BugzillaMylarSearchOperation;
-import org.eclipse.mylar.internal.bugzilla.core.internal.BugParser;
-import org.eclipse.mylar.internal.bugzilla.core.search.BugzillaSearchHit;
-import org.eclipse.mylar.internal.bugzilla.ui.tasklist.BugzillaReportNode;
-import org.eclipse.mylar.internal.bugzilla.ui.tasklist.StackTrace;
-
-/**
- * Class to test the Bridge methods that do not require server queries
- *
- * @author Shawn Minto
- */
-public class BugzillaStackTraceTest extends TestCase {
-
- private static final String TEST_FILE_LOC = "testdata/reports-stacktrace/";
-
- private static final String BUGZILLA_SERVER_NAME = "https://bugs.eclipse.org/bugs";
-
- /**
- * Test that the regular expression escaping mechanism works properly
- */
- public void testREGEX() {
- String r = ".*+(){}[]^$|?/\\";
- String r2 = StackTrace.escapeForRegex(r);
- String ans = "\\.\\*\\+\\(\\)\\{\\}\\[\\]\\^\\$\\|\\?\\/\\\\";
- String msg = "Regular Expression matching wrong:\nwas: " + r2 + "\nshould be:" + ans;
- assertTrue(msg, r2.equals(ans));
- }
-
- // /**
- // * Test parsing the bug for multiple stacks in in
- // */
- // public void testMultipleStacksDiffComments(){
- // // REPORT_REPOSITORY 4862 - 2 stack traces - 1 in description, 1 in
- // comment - text
- // before and after
- // performParse(4862, "4862.html", 2, false);
- // }
-
- // /**
- // * Test parsing the bug for a single stack in the description with some
- // * text before it
- // */
- // public void testSingleStackCodeBeforeInDescription(){
- // // REPORT_REPOSITORY 76388 - 1 stack trace - description - text before
- // and formatted
- // ugly
- // performParse(76388, "76388.html", 1, false);
- // }
-
- /**
- * Test parsing the bug for a single stack trace in the description with
- * text before and after it
- */
- public void testSingleStackCodeBeforeAndAfterInDescription() {
-
- // REPORT_REPOSITORY 76146 - 1 stack trace - description - text before
- // and code after
- performParse(76146, "76146.html", 1, false);
- }
-
- /**
- * Test parsing a bug that has 1 stack trace in the description with no
- * extra text, but has lines in it that span 3 lines
- */
- public void testSingleStackPoorFormatInDescription() {
- // REPORT_REPOSITORY 67395 - 1 stack trace - description - no extra
- // text, 1 at line
- // spans 3 lines
- performParse(67395, "67395.html", 1, false);
- }
-
- /**
- * Test parsing a bug with no stack traces and no qualified exception names
- */
- public void testNoStackNoQualified() {
- // REPORT_REPOSITORY 4548 - no stack traces, no qualified reference to
- // an exception
- performParse(4548, "4548.html", 0, false);
- }
-
- /**
- * Test parsing a bug with no stack traces, but a qualified reference to an
- * exception
- */
- public void testNoStackQual() {
- // REPORT_REPOSITORY 1 - no stack traces, qualified reference to
- // exception - made up
- // bug
- performParse(1, "1.html", 0, false);
- }
-
- /**
- * Test parsing of a bug with 1 stack trace and multiple qualified
- * references
- */
- public void testSingleStackQual() {
- // REPORT_REPOSITORY 2 - 1 stack trace- 2 qual ref, stack trace, 1 qual
- // ref - made up
- // bug
- performParse(2, "2.html", 1, false);
- }
-
- /**
- * Test parsing of a bug with many stacks traces in a single comment
- */
- public void testMultipleStackSingleComment() {
- // REPORT_REPOSITORY 40152 - 1 stack trace- 2 qual ref, stack trace, 1
- // qual ref - made
- // up bug
- performParse(40152, "40152.html", 33, false);
- }
-
- /**
- * Print out the stack traces
- *
- * @param l
- * List of stack traces
- */
- private void printStackTraces(List<StackTrace> l) {
- System.out.println("\n\n");
- for (int i = 0; i < l.size(); i++) {
- StackTrace trace = l.get(i);
- System.out.println("*****************?????????????????*****************\n");
- System.out.println("OFFSET: " + trace.getOffset() + " LENGTH: " + trace.getLength());
- System.out.println(trace.getStackTrace());
- System.out.println("*****************?????????????????*****************\n\n");
- }
- }
-
- private void performParse(int bugNumber, String bugFileName, int numTracesExpected, boolean printStackTraces) {
-
- BugzillaSearchHit hit = new BugzillaSearchHit("<TEST-SERVER>", bugNumber, "", "", "", "", "", "", "", ""); // stack
- // trace
- // in
- // desc
- // and
- // com
-
- // create a new doi info
- BugzillaReportNode doi = new BugzillaReportNode(0, hit, false);
- try {
-
- // read the bug in from a file
- File f = FileTool.getFileInPlugin(BugzillaTestPlugin.getDefault(), new Path(TEST_FILE_LOC + bugFileName)); // used
- // if
- // run
- // as a
- // plugin
- // test
- // File f = new File(TEST_FILE_LOC+bugFileName); // used if run as a
- // standalone test
- Reader reader = new FileReader(f);
- doi.setBug(BugParser.parseBug(reader, hit.getId(), BUGZILLA_SERVER_NAME, true, null, null, null));
- reader.close();
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- // do a second pass parse on the bug
- List<BugzillaReportNode> l = new ArrayList<BugzillaReportNode>();
- l.add(doi);
- BugzillaMylarSearchOperation.secondPassBugzillaParser(l);
-
- // make sure that we received the right number of stack traces back
- // System.out.println("*** REPORT_REPOSITORY " + hit.getId() + " ***");
- // System.out.println("NumStackTraces = " +
- // doi.getStackTraces().size());
- assertEquals("Wrong Number stack traces", numTracesExpected, doi.getStackTraces().size());
- if (printStackTraces)
- printStackTraces(doi.getStackTraces());
- }
-}

Back to the top