Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2005-11-04 21:19:12 +0000
committermkersten2005-11-04 21:19:12 +0000
commite22519ca0e9999a69c25435efd31f89c774867c2 (patch)
tree6afb7603be4e6540f250f35d234a5361a9dc476e /org.eclipse.mylyn.bugzilla.tests
parentcfdffb680b35cb357ad820597dfcfa6afef307e3 (diff)
downloadorg.eclipse.mylyn.tasks-e22519ca0e9999a69c25435efd31f89c774867c2.tar.gz
org.eclipse.mylyn.tasks-e22519ca0e9999a69c25435efd31f89c774867c2.tar.xz
org.eclipse.mylyn.tasks-e22519ca0e9999a69c25435efd31f89c774867c2.zip
Progress on Bugzilla Bug 115017: bugzilla 2.20 hits only result in one match
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.tests')
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/test/AllBugzillaTests.java15
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/test/RegularExpressionMatchTest.java96
2 files changed, 104 insertions, 7 deletions
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/test/AllBugzillaTests.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/test/AllBugzillaTests.java
index 8169cb2a4..76a459fb5 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/test/AllBugzillaTests.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/test/AllBugzillaTests.java
@@ -21,13 +21,14 @@ public class AllBugzillaTests {
public static Test suite() {
TestSuite suite = new TestSuite("Test for org.eclipse.mylar.bugzilla.test");
//$JUnit-BEGIN$
- suite.addTest(new TestSuite(BugzillaNewBugParserTestCDT.class));
- suite.addTest(new TestSuite(BugzillaNewBugParserTestEquinox.class));
- suite.addTest(new TestSuite(BugzillaNewBugParserTestGMT.class));
- suite.addTest(new TestSuite(BugzillaNewBugParserTestPlatform.class));
- suite.addTest(new TestSuite(BugzillaNewBugParserTestVE.class));
- suite.addTest(new TestSuite(BugzillaParserTestNoBug.class));
- suite.addTest(new TestSuite(BugzillaProductParserTest.class));
+ suite.addTestSuite(RegularExpressionMatchTest.class);
+ suite.addTestSuite(BugzillaNewBugParserTestCDT.class);
+ suite.addTestSuite(BugzillaNewBugParserTestEquinox.class);
+ suite.addTestSuite(BugzillaNewBugParserTestGMT.class);
+ suite.addTestSuite(BugzillaNewBugParserTestPlatform.class);
+ suite.addTestSuite(BugzillaNewBugParserTestVE.class);
+ suite.addTestSuite(BugzillaParserTestNoBug.class);
+ suite.addTestSuite(BugzillaProductParserTest.class);
// TODO: enable
// suite.addTest(new TestSuite(BugzillaParserTest.class));
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/test/RegularExpressionMatchTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/test/RegularExpressionMatchTest.java
new file mode 100644
index 000000000..2da4d14c1
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/test/RegularExpressionMatchTest.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2004 - 2005 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
+ *******************************************************************************/
+
+package org.eclipse.mylar.bugzilla.test;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.StringReader;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.mylar.bugzilla.core.search.BugzillaSearchEngine;
+import org.eclipse.mylar.bugzilla.core.search.BugzillaSearchHit;
+
+import com.sun.org.apache.xerces.internal.impl.xpath.regex.Match;
+
+public class RegularExpressionMatchTest extends TestCase {
+
+ public void testMatchV218() throws IOException {
+ BufferedReader in = new BufferedReader(new StringReader(BUGZILLA_218));
+ Match match = new Match();
+ BugzillaSearchHit hit = BugzillaSearchEngine.createHit(BugzillaSearchEngine.reValue, new NullProgressMonitor(), in, match, 123);
+ assertEquals("nor", hit.getSeverity());
+ assertEquals("P2", hit.getPriority());
+ }
+
+ public void testMatchV220() throws IOException {
+ BufferedReader in = new BufferedReader(new StringReader(BUGZILLA_220));
+ Match match = new Match();
+ BugzillaSearchHit hit = BugzillaSearchEngine.createHit(BugzillaSearchEngine.reValueBugzilla220, new NullProgressMonitor(), in, match, 123);
+ assertEquals("nor", hit.getSeverity());
+ assertEquals("P2", hit.getPriority());
+ System.err.println(">> " + hit.getSeverity());
+ }
+
+ private static final String BUGZILLA_218 =
+ " <tr class=\"bz_normal bz_P2 bz_ASSIGNED bz_even \">\n" +
+ " \n" +
+ "\n" +
+ " <td class=\"first-child\">\n" +
+ " <a href=\"show_bug.cgi?id=111870\">111870</a>\n" +
+ " <span style=\"display: none\"></span>\n" +
+ " </td>\n" +
+ "\n" +
+ " <td><nobr>nor</nobr>\n" +
+ " </td>\n" +
+ " <td><nobr>P2</nobr>\n" +
+ " </td>\n" +
+ " <td><nobr>Oth</nobr>\n" +
+ " </td>\n" +
+ " <td><nobr>wes.coelho&#64;gmail.com</nobr>\n" +
+ " </td>\n" +
+ " <td><nobr>ASSI</nobr>\n" +
+ " </td>\n" +
+ " <td><nobr></nobr>\n" +
+ " </td>\n" +
+ " <td>hour estimates are wrong\n" +
+ " </td>\n" +
+ "\n" +
+ " </tr>\n";
+
+ private static final String BUGZILLA_220 =
+ " <tr class=\"bz_enhancement bz_P2 bz_ASSIGNED bz_row_odd \">\n" +
+ " \n" +
+ "\n" +
+ " <td class=\"first-child\">\n" +
+ " <a href=\"show_bug.cgi?id=114172\">114172</a>\n" +
+ " <span style=\"display: none\"></span>\n" +
+ " </td>\n" +
+ "\n" +
+ " <td style=\"white-space: nowrap\">nor\n" +
+ " </td>\n" +
+ " <td style=\"white-space: nowrap\">P2\n" +
+ " </td>\n" +
+ " <td style=\"white-space: nowrap\">PC\n" +
+ " </td>\n" +
+ " <td style=\"white-space: nowrap\">wes.coelho&#64;gmail.com\n" +
+ " </td>\n" +
+ " <td style=\"white-space: nowrap\">ASSI\n" +
+ " </td>\n" +
+ " <td style=\"white-space: nowrap\">\n" +
+ " </td>\n" +
+ " <td >Switch task data directory option on the task list\n" +
+ " </td>\n" +
+ "\n" +
+ " </tr>\n";
+}

Back to the top