Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcvs2git2006-02-23 00:43:29 +0000
committercvs2git2006-02-23 00:43:29 +0000
commit5bb7c6114117f2ac72ea0742e108f7f80ec19d09 (patch)
tree656ec4907a20b7d504b6ce18b16a370e081f612f
parent50644179aa8b2a0b73a8ba13ba32e811f1f09edb (diff)
downloadorg.eclipse.mylyn.tasks-5bb7c6114117f2ac72ea0742e108f7f80ec19d09.tar.gz
org.eclipse.mylyn.tasks-5bb7c6114117f2ac72ea0742e108f7f80ec19d09.tar.xz
org.eclipse.mylyn.tasks-5bb7c6114117f2ac72ea0742e108f7f80ec19d09.zip
This commit was manufactured by cvs2svn to create branch 'e_3_1'.
Cherrypick from master 2006-02-23 00:43:28 UTC mkersten 'Progress on: Bug 129032: support bugzilla 2.20.1': org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaNewBugParserTestCDT.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaNewBugParserTestEquinox.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaNewBugParserTestGMT.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaNewBugParserTestPlatform.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaNewBugParserTestVE.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaParserTest.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaParserTestNoBug.java org.eclipse.mylyn.bugzilla.tests/testdata/pages/enter-bug220.html org.eclipse.mylyn.bugzilla.tests/testdata/pages/enter-bug2201.html org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-220.html org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-2201.html org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/actions/NewRepositoryTaskAction.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/NewRepositoryTaskPage.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/provisional/tasklist/AbstractRepositoryConnector.java
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaNewBugParserTestCDT.java213
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaNewBugParserTestEquinox.java219
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaNewBugParserTestGMT.java219
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaNewBugParserTestPlatform.java246
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaNewBugParserTestVE.java225
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaParserTest.java196
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaParserTestNoBug.java47
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/testdata/pages/enter-bug220.html441
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/testdata/pages/enter-bug2201.html493
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-220.html667
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-2201.html859
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/actions/NewRepositoryTaskAction.java83
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/NewRepositoryTaskPage.java36
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/provisional/tasklist/AbstractRepositoryConnector.java121
14 files changed, 4065 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaNewBugParserTestCDT.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaNewBugParserTestCDT.java
new file mode 100644
index 000000000..b7b1828df
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaNewBugParserTestCDT.java
@@ -0,0 +1,213 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.mylar.bugzilla.tests;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.Reader;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.Path;
+import org.eclipse.mylar.bugzilla.core.Attribute;
+import org.eclipse.mylar.core.tests.support.FileTool;
+import org.eclipse.mylar.internal.bugzilla.core.NewBugModel;
+import org.eclipse.mylar.internal.bugzilla.core.internal.NewBugParser;
+
+/**
+ * Tests NewBugParser -- parses product attributes for new bug reports
+ */
+public class BugzillaNewBugParserTestCDT extends TestCase {
+
+ public BugzillaNewBugParserTestCDT() {
+ super();
+ }
+
+ public BugzillaNewBugParserTestCDT(String arg0) {
+ super(arg0);
+ }
+
+ public void testProductCDT() throws Exception {
+
+ File f = FileTool.getFileInPlugin(BugzillaTestPlugin.getDefault(), new Path("testdata/pages/cdt-page.html"));
+
+ Reader in = new FileReader(f);
+
+ NewBugModel nbm = new NewBugModel();
+ new NewBugParser(in).parseBugAttributes(nbm, true); // ** TRUE vs FALSE
+ // **
+
+ // attributes for this bug model
+ List<Attribute> attributes = nbm.getAttributes();
+ // printList(attributes);
+
+ Iterator<Attribute> itr = attributes.iterator();
+ Attribute att = itr.next();
+
+ // Attribute: Severity
+ assertEquals("Attribute: Severity", "Severity", att.getName());
+
+ Map<String, String> attOptions = att.getOptionValues(); // HashMap of
+ // options for the
+ // current
+ // attribute
+ Object[] options = attOptions.keySet().toArray(); // Array of keys for
+ // the options of the
+ // current attribute
+ assertEquals("# Severity options", 7, options.length);
+
+ int i = 0;
+ while (i < options.length) {
+ assertEquals("severity options", "blocker", options[i++]);
+ assertEquals("severity options", "critical", options[i++]);
+ assertEquals("severity options", "major", options[i++]);
+ assertEquals("severity options", "normal", options[i++]);
+ assertEquals("severity options", "minor", options[i++]);
+ assertEquals("severity options", "trivial", options[i++]);
+ assertEquals("severity options", "enhancement", options[i++]);
+ }
+
+ // Attribute: product
+ att = itr.next();
+ assertEquals("Attribute: product", "product", att.getName());
+
+ attOptions = att.getOptionValues();
+ options = attOptions.keySet().toArray();
+ assertEquals("No product options", 0, options.length);
+
+ // Attribute: AssignedTo
+ att = itr.next();
+ assertEquals("Attribute: AssignedTo", "AssignedTo", att.getName());
+
+ attOptions = att.getOptionValues();
+ options = attOptions.keySet().toArray();
+ assertEquals("No AssignedTo options", 0, options.length);
+
+ // Attribute: OS
+ att = itr.next();
+ assertEquals("Attribute: OS", "OS", att.getName());
+
+ attOptions = att.getOptionValues();
+ options = attOptions.keySet().toArray();
+ assertEquals("# of options", 20, options.length);
+
+ i = 0;
+ while (i < options.length) {
+ assertEquals("OS options", "All", options[i++]);
+ assertEquals("OS options", "AIX Motif", options[i++]);
+ assertEquals("OS options", "Windows 95", options[i++]);
+ assertEquals("OS options", "Windows 98", options[i++]);
+ assertEquals("OS options", "Windows CE", options[i++]);
+ assertEquals("OS options", "Windows ME", options[i++]);
+ assertEquals("OS options", "Windows 2000", options[i++]);
+ assertEquals("OS options", "Windows NT", options[i++]);
+ assertEquals("OS options", "Windows XP", options[i++]);
+ assertEquals("OS options", "Windows All", options[i++]);
+ assertEquals("OS options", "MacOS X", options[i++]);
+ assertEquals("OS options", "Linux", options[i++]);
+ assertEquals("OS options", "Linux-GTK", options[i++]);
+ assertEquals("OS options", "Linux-Motif", options[i++]);
+ assertEquals("OS options", "HP-UX", options[i++]);
+ assertEquals("OS options", "Neutrino", options[i++]);
+ assertEquals("OS options", "QNX-Photon", options[i++]);
+ assertEquals("OS options", "Solaris", options[i++]);
+ assertEquals("OS options", "Unix All", options[i++]);
+ assertEquals("OS options", "other", options[i++]);
+ }
+
+ // Attribute: Version
+ att = itr.next();
+ assertEquals("Attribute: Version", "Version", att.getName());
+
+ // attOptions = (HashMap) att.getOptionValues();
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("# Version options", 5, options.length);
+
+ i = 0;
+ while (i < options.length) {
+ assertEquals("Version options", "1.0", options[i++]);
+ assertEquals("Version options", "1.0.1", options[i++]);
+ assertEquals("Version options", "1.1", options[i++]);
+ assertEquals("Version options", "1.2", options[i++]);
+ assertEquals("Version options", "2.0", options[i++]);
+ }
+
+ // Attribute: Platform
+ att = itr.next();
+ assertEquals("Attribute: Platform", "Platform", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("# Platform options", 6, options.length);
+
+ i = 0;
+ while (i < options.length) {
+ assertEquals("Platform options", "All", options[i++]);
+ assertEquals("Platform options", "Macintosh", options[i++]);
+ assertEquals("Platform options", "PC", options[i++]);
+ assertEquals("Platform options", "Power PC", options[i++]);
+ assertEquals("Platform options", "Sun", options[i++]);
+ assertEquals("Platform options", "Other", options[i++]);
+ }
+
+ // Attribute: Component
+ att = itr.next();
+ assertEquals("Attribute: Component", "Component", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("# Component options", 9, options.length);
+
+ i = 0;
+ while (i < options.length) {
+ assertEquals("Component options", "CDT-parser", options[i++]);
+ assertEquals("Component options", "Core", options[i++]);
+ assertEquals("Component options", "Cpp-Extensions", options[i++]);
+ assertEquals("Component options", "Debug", options[i++]);
+ assertEquals("Component options", "Debug-MI", options[i++]);
+ assertEquals("Component options", "Doc", options[i++]);
+ assertEquals("Component options", "Generic-Extensions", options[i++]);
+ assertEquals("Component options", "Launcher", options[i++]);
+ assertEquals("Component options", "UI", options[i++]);
+ }
+
+ // Attribute: bug_status
+ att = itr.next();
+ assertEquals("Attribute: bug_status", "bug_status", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("# bug_status options [none]", 0, options.length);
+
+ // Attribute: form_name
+ att = itr.next();
+ assertEquals("Attribute: form_name", "form_name", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("No form_name options", 0, options.length);
+
+ // Attribute: bug_file_loc
+ att = itr.next();
+ assertEquals("Attribute: bug_file_loc", "bug_file_loc", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("No bug_file_loc options", 0, options.length);
+
+ // Attribute: priority
+ att = itr.next();
+ assertEquals("Attribute: priority", "priority", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("No priority options", 0, options.length);
+
+ }
+}
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaNewBugParserTestEquinox.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaNewBugParserTestEquinox.java
new file mode 100644
index 000000000..b93310611
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaNewBugParserTestEquinox.java
@@ -0,0 +1,219 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.mylar.bugzilla.tests;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.Reader;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.Path;
+import org.eclipse.mylar.bugzilla.core.Attribute;
+import org.eclipse.mylar.core.tests.support.FileTool;
+import org.eclipse.mylar.internal.bugzilla.core.NewBugModel;
+import org.eclipse.mylar.internal.bugzilla.core.internal.NewBugParser;
+
+/**
+ * Tests NewBugParser -- parses product attributes
+ */
+public class BugzillaNewBugParserTestEquinox extends TestCase {
+
+ public BugzillaNewBugParserTestEquinox() {
+ super();
+ }
+
+ public BugzillaNewBugParserTestEquinox(String arg0) {
+ super(arg0);
+ }
+
+ public void testProductEquinox() throws Exception {
+
+ File f = FileTool
+ .getFileInPlugin(BugzillaTestPlugin.getDefault(), new Path("testdata/pages/equinox-page.html"));
+
+ Reader in = new FileReader(f);
+
+ NewBugModel nbm = new NewBugModel();
+ new NewBugParser(in).parseBugAttributes(nbm, true); // ** TRUE vs FALSE
+ // **
+
+ // attributes for this bug model
+ List<Attribute> attributes = nbm.getAttributes();
+ // printList(attributes);
+
+ Iterator<Attribute> itr = attributes.iterator();
+ Attribute att = itr.next();
+
+ // Attribute: Severity
+ assertEquals("Attribute: Severity", "Severity", att.getName());
+
+ Map<String, String> attOptions = att.getOptionValues(); // HashMap of
+ // options for the
+ // current
+ // attribute
+ Object[] options = attOptions.keySet().toArray(); // Array of keys for
+ // the options of the
+ // current attribute
+ assertEquals("# Severity options", 7, options.length);
+
+ int i = 0;
+ while (i < options.length) {
+ assertEquals("severity options", "blocker", options[i++]);
+ assertEquals("severity options", "critical", options[i++]);
+ assertEquals("severity options", "major", options[i++]);
+ assertEquals("severity options", "normal", options[i++]);
+ assertEquals("severity options", "minor", options[i++]);
+ assertEquals("severity options", "trivial", options[i++]);
+ assertEquals("severity options", "enhancement", options[i++]);
+ }
+
+ // Attribute: product
+ att = itr.next();
+ assertEquals("Attribute: prodcut", "product", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("No product options", 0, options.length);
+
+ // Attribute: AssignedTo
+ att = itr.next();
+ assertEquals("Attribute: AssignedTo", "AssignedTo", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("No AssignedTo options", 0, options.length);
+
+ // Attribute: OS
+ att = itr.next();
+ assertEquals("Attribute: OS", "OS", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("# OS options", 20, options.length);
+
+ i = 0;
+ while (i < options.length) {
+ assertEquals("OS options", "All", options[i++]);
+ assertEquals("OS options", "AIX Motif", options[i++]);
+ assertEquals("OS options", "Windows 95", options[i++]);
+ assertEquals("OS options", "Windows 98", options[i++]);
+ assertEquals("OS options", "Windows CE", options[i++]);
+ assertEquals("OS options", "Windows ME", options[i++]);
+ assertEquals("OS options", "Windows 2000", options[i++]);
+ assertEquals("OS options", "Windows NT", options[i++]);
+ assertEquals("OS options", "Windows XP", options[i++]);
+ assertEquals("OS options", "Windows All", options[i++]);
+ assertEquals("OS options", "MacOS X", options[i++]);
+ assertEquals("OS options", "Linux", options[i++]);
+ assertEquals("OS options", "Linux-GTK", options[i++]);
+ assertEquals("OS options", "Linux-Motif", options[i++]);
+ assertEquals("OS options", "HP-UX", options[i++]);
+ assertEquals("OS options", "Neutrino", options[i++]);
+ assertEquals("OS options", "QNX-Photon", options[i++]);
+ assertEquals("OS options", "Solaris", options[i++]);
+ assertEquals("OS options", "Unix All", options[i++]);
+ assertEquals("OS options", "other", options[i++]);
+ }
+
+ // Attribute: Version
+ att = itr.next();
+ assertEquals("Attribute: Version", "Version", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("# Version options", 1, options.length);
+
+ i = 0;
+ while (i < options.length) {
+ assertEquals("Version options", "unspecified", options[i++]);
+ }
+
+ // Attribute: Platform
+ att = itr.next();
+ assertEquals("Attribute: Platform", "Platform", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("# Platform options", 6, options.length);
+
+ i = 0;
+ while (i < options.length) {
+ assertEquals("Platform options", "All", options[i++]);
+ assertEquals("Platform options", "Macintosh", options[i++]);
+ assertEquals("Platform options", "PC", options[i++]);
+ assertEquals("Platform options", "Power PC", options[i++]);
+ assertEquals("Platform options", "Sun", options[i++]);
+ assertEquals("Platform options", "Other", options[i++]);
+ }
+
+ // Attribute: Component
+ att = itr.next();
+ assertEquals("Attribute: Component", "Component", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("# Component options", 3, options.length);
+
+ i = 0;
+ while (i < options.length) {
+ assertEquals("Component options", "Dynamic Plugins", options[i++]);
+ assertEquals("Component options", "General", options[i++]);
+ assertEquals("Component options", "OSGi", options[i++]);
+ }
+
+ // Attribute: bug_status
+ att = itr.next();
+ assertEquals("Attribute: bug_status", "bug_status", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("No bug_status options", 0, options.length);
+
+ // Attribute: form_name
+ att = itr.next();
+ assertEquals("Attribute: form_name", "form_name", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("No form_name options", 0, options.length);
+
+ // Attribute: bug_file_loc
+ att = itr.next();
+ assertEquals("Attribute: bug_file_loc", "bug_file_loc", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("No bug_file_loc options", 0, options.length);
+
+ // Attribute: priority
+ att = itr.next();
+ assertEquals("Attribute: priority", "priority", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("No priority options", 0, options.length);
+
+ }
+
+ // private void printList(List<Attribute> attributes) {
+ //
+ // Iterator<Attribute> itr = attributes.iterator();
+ // System.out.println("Attributes for this Product:");
+ // System.out.println("============================");
+ //
+ // while (itr.hasNext()) {
+ // Attribute attr = itr.next();
+ // System.out.println();
+ // System.out.println(attr.getName() + ": ");
+ // System.out.println("-----------");
+ //
+ // Map<String, String> options = attr.getOptionValues();
+ // Object[] it = options.keySet().toArray();
+ // for (int i = 0; i < it.length; i++)
+ // System.out.println((String) it[i]);
+ // }
+ // }
+}
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaNewBugParserTestGMT.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaNewBugParserTestGMT.java
new file mode 100644
index 000000000..d88043c26
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaNewBugParserTestGMT.java
@@ -0,0 +1,219 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.mylar.bugzilla.tests;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.Reader;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.Path;
+import org.eclipse.mylar.bugzilla.core.Attribute;
+import org.eclipse.mylar.core.tests.support.FileTool;
+import org.eclipse.mylar.internal.bugzilla.core.NewBugModel;
+import org.eclipse.mylar.internal.bugzilla.core.internal.NewBugParser;
+
+/**
+ * Tests NewBugParser -- parses product attributes
+ */
+public class BugzillaNewBugParserTestGMT extends TestCase {
+
+ public BugzillaNewBugParserTestGMT() {
+ super();
+ }
+
+ public BugzillaNewBugParserTestGMT(String arg0) {
+ super(arg0);
+ }
+
+ public void testProductGMT() throws Exception {
+
+ File f = FileTool.getFileInPlugin(BugzillaTestPlugin.getDefault(), new Path("testdata/pages/gmt-page.html"));
+
+ Reader in = new FileReader(f);
+
+ NewBugModel nbm = new NewBugModel();
+ new NewBugParser(in).parseBugAttributes(nbm, true); // ** TRUE vs FALSE
+ // **
+
+ // attributes for this bug model
+ List<Attribute> attributes = nbm.getAttributes();
+ // printList(attributes);
+
+ Iterator<Attribute> itr = attributes.iterator();
+ Attribute att = itr.next();
+
+ // Attribute: Severity
+ assertEquals("Attribute: Severity", "Severity", att.getName());
+
+ Map<String, String> attOptions = att.getOptionValues(); // HashMap of
+ // options for the
+ // current
+ // attribute
+ Object[] options = attOptions.keySet().toArray(); // Array of keys for
+ // the options of the
+ // current attribute
+ assertEquals("# Severity options", 7, options.length);
+
+ int i = 0;
+ while (i < options.length) {
+ assertEquals("severity options", "blocker", options[i++]);
+ assertEquals("severity options", "critical", options[i++]);
+ assertEquals("severity options", "major", options[i++]);
+ assertEquals("severity options", "normal", options[i++]);
+ assertEquals("severity options", "minor", options[i++]);
+ assertEquals("severity options", "trivial", options[i++]);
+ assertEquals("severity options", "enhancement", options[i++]);
+ }
+
+ // Attribute: product
+ att = itr.next();
+ assertEquals("Attribute: product", "product", att.getName());
+
+ attOptions = att.getOptionValues();
+ options = attOptions.keySet().toArray();
+ assertEquals("No product options", 0, options.length);
+
+ // Attribute: AssignedTo
+ att = itr.next();
+ assertEquals("Attribute: AssignedTo", "AssignedTo", att.getName());
+
+ attOptions = att.getOptionValues();
+ options = attOptions.keySet().toArray();
+ assertEquals("No AssignedTo options", 0, options.length);
+
+ // Attribute: OS
+ att = itr.next();
+ assertEquals("Attribute: OS", "OS", att.getName());
+
+ attOptions = att.getOptionValues();
+ options = attOptions.keySet().toArray();
+ assertEquals("# of options", 20, options.length);
+
+ i = 0;
+ while (i < options.length) {
+ assertEquals("OS options", "All", options[i++]);
+ assertEquals("OS options", "AIX Motif", options[i++]);
+ assertEquals("OS options", "Windows 95", options[i++]);
+ assertEquals("OS options", "Windows 98", options[i++]);
+ assertEquals("OS options", "Windows CE", options[i++]);
+ assertEquals("OS options", "Windows ME", options[i++]);
+ assertEquals("OS options", "Windows 2000", options[i++]);
+ assertEquals("OS options", "Windows NT", options[i++]);
+ assertEquals("OS options", "Windows XP", options[i++]);
+ assertEquals("OS options", "Windows All", options[i++]);
+ assertEquals("OS options", "MacOS X", options[i++]);
+ assertEquals("OS options", "Linux", options[i++]);
+ assertEquals("OS options", "Linux-GTK", options[i++]);
+ assertEquals("OS options", "Linux-Motif", options[i++]);
+ assertEquals("OS options", "HP-UX", options[i++]);
+ assertEquals("OS options", "Neutrino", options[i++]);
+ assertEquals("OS options", "QNX-Photon", options[i++]);
+ assertEquals("OS options", "Solaris", options[i++]);
+ assertEquals("OS options", "Unix All", options[i++]);
+ assertEquals("OS options", "other", options[i++]);
+ }
+
+ // Attribute: Version
+ att = itr.next();
+ assertEquals("Attribute: Version", "Version", att.getName());
+
+ // attOptions = (HashMap) att.getOptionValues();
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("# Version options", 1, options.length);
+
+ i = 0;
+ while (i < options.length) {
+ assertEquals("Version options", "unspecified", options[i++]);
+ }
+
+ // Attribute: Platform
+ att = itr.next();
+ assertEquals("Attribute: Platform", "Platform", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("# Platform options", 6, options.length);
+
+ i = 0;
+ while (i < options.length) {
+ assertEquals("Platform options", "All", options[i++]);
+ assertEquals("Platform options", "Macintosh", options[i++]);
+ assertEquals("Platform options", "PC", options[i++]);
+ assertEquals("Platform options", "Power PC", options[i++]);
+ assertEquals("Platform options", "Sun", options[i++]);
+ assertEquals("Platform options", "Other", options[i++]);
+ }
+
+ att = itr.next();
+ assertEquals("Attribute: Component", "Component", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("# Component options", 1, options.length);
+
+ i = 0;
+ while (i < options.length) {
+ assertEquals("Component options", "Core", options[i++]);
+ }
+
+ // Attribute: bug_status
+ att = itr.next();
+ assertEquals("Attribute: bug_status", "bug_status", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("No bug_status options", 0, options.length);
+
+ // Attribute: form_name
+ att = itr.next();
+ assertEquals("Attribute: form_name", "form_name", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("No form_name options", 0, options.length);
+
+ // Attribute: bug_file_loc
+ att = itr.next();
+ assertEquals("Attribute: bug_file_loc", "bug_file_loc", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("No bug_file_loc options", 0, options.length);
+
+ // Attribute: priority
+ att = itr.next();
+ assertEquals("Attribute: priority", "priority", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("No priority options", 0, options.length);
+
+ }
+
+ // private void printList(List<Attribute> attributes) {
+ //
+ // Iterator<Attribute> itr = attributes.iterator();
+ // System.out.println("Attributes for this Product:");
+ // System.out.println("============================");
+ //
+ // while (itr.hasNext()) {
+ // Attribute attr = itr.next();
+ // System.out.println();
+ // System.out.println(attr.getName() + ": ");
+ // System.out.println("-----------");
+ //
+ // Map<String, String> options = attr.getOptionValues();
+ // Object[] it = options.keySet().toArray();
+ // for (int i = 0; i < it.length; i++)
+ // System.out.println((String) it[i]);
+ // }
+ // }
+}
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaNewBugParserTestPlatform.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaNewBugParserTestPlatform.java
new file mode 100644
index 000000000..705528e1e
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaNewBugParserTestPlatform.java
@@ -0,0 +1,246 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.mylar.bugzilla.tests;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.Reader;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.Path;
+import org.eclipse.mylar.bugzilla.core.Attribute;
+import org.eclipse.mylar.core.tests.support.FileTool;
+import org.eclipse.mylar.internal.bugzilla.core.NewBugModel;
+import org.eclipse.mylar.internal.bugzilla.core.internal.NewBugParser;
+
+/**
+ * Tests NewBugParser -- parses product attributes
+ */
+public class BugzillaNewBugParserTestPlatform extends TestCase {
+
+ public BugzillaNewBugParserTestPlatform() {
+ super();
+ }
+
+ public BugzillaNewBugParserTestPlatform(String arg0) {
+ super(arg0);
+ }
+
+ public void testProductPlatform() throws Exception {
+
+ File f = FileTool.getFileInPlugin(BugzillaTestPlugin.getDefault(),
+ new Path("testdata/pages/platform-page.html"));
+
+ Reader in = new FileReader(f);
+
+ NewBugModel nbm = new NewBugModel();
+ new NewBugParser(in).parseBugAttributes(nbm, true); // ** TRUE vs FALSE
+ // **
+
+ // attributes for this bug model
+ List<Attribute> attributes = nbm.getAttributes();
+ // printList(attributes);
+
+ // to iterator over the ArrayList of attributes
+ Iterator<Attribute> itr = attributes.iterator();
+
+ // Attribute: Severity
+ Attribute att = itr.next(); // current attribute
+
+ // Attribute: Severity
+ assertEquals("Attribute: Severity", "Severity", att.getName());
+
+ Map<String, String> attOptions = att.getOptionValues(); // HashMap of
+ // options for the
+ // current
+ // attribute
+ Object[] options = attOptions.keySet().toArray(); // Array of keys for
+ // the options of the
+ // current attribute
+ assertEquals("# Severity options", 7, options.length);
+
+ int i = 0;
+ while (i < options.length) {
+ assertEquals("severity options", "blocker", options[i++]);
+ assertEquals("severity options", "critical", options[i++]);
+ assertEquals("severity options", "major", options[i++]);
+ assertEquals("severity options", "normal", options[i++]);
+ assertEquals("severity options", "minor", options[i++]);
+ assertEquals("severity options", "trivial", options[i++]);
+ assertEquals("severity options", "enhancement", options[i++]);
+ }
+
+ // Attribute: product
+ att = itr.next();
+ assertEquals("Attribute: product", "product", att.getName());
+
+ attOptions = att.getOptionValues();
+ options = attOptions.keySet().toArray();
+ assertEquals("No product optins", 0, options.length);
+
+ // Attribute: AssignedTo
+ att = itr.next();
+ assertEquals("Attribute: Assigned To", "Assigned To", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("No AssingedTo options", 0, options.length);
+
+ // Attribute: OS
+ att = itr.next();
+ assertEquals("Attribute: OS", "OS", att.getName());
+
+ attOptions = att.getOptionValues();
+ options = attOptions.keySet().toArray();
+ assertEquals("# OS options", 20, options.length);
+
+ i = 0;
+ while (i < options.length) {
+ assertEquals("OS options", "All", options[i++]);
+ assertEquals("OS options", "AIX Motif", options[i++]);
+ assertEquals("OS options", "Windows 95", options[i++]);
+ assertEquals("OS options", "Windows 98", options[i++]);
+ assertEquals("OS options", "Windows CE", options[i++]);
+ assertEquals("OS options", "Windows ME", options[i++]);
+ assertEquals("OS options", "Windows 2000", options[i++]);
+ assertEquals("OS options", "Windows NT", options[i++]);
+ assertEquals("OS options", "Windows XP", options[i++]);
+ assertEquals("OS options", "Windows All", options[i++]);
+ assertEquals("OS options", "MacOS X", options[i++]);
+ assertEquals("OS options", "Linux", options[i++]);
+ assertEquals("OS options", "Linux-GTK", options[i++]);
+ assertEquals("OS options", "Linux-Motif", options[i++]);
+ assertEquals("OS options", "HP-UX", options[i++]);
+ assertEquals("OS options", "Neutrino", options[i++]);
+ assertEquals("OS options", "QNX-Photon", options[i++]);
+ assertEquals("OS options", "Solaris", options[i++]);
+ assertEquals("OS options", "Unix All", options[i++]);
+ assertEquals("OS options", "other", options[i++]);
+ }
+
+ // Attribute: Version
+ att = itr.next();
+ assertEquals("Attribute: Version", "Version", att.getName());
+
+ attOptions = att.getOptionValues();
+ options = attOptions.keySet().toArray();
+ assertEquals("# Version options", 8, options.length);
+
+ i = 0;
+ while (i < options.length) {
+ assertEquals("Version options", "1.0", options[i++]);
+ assertEquals("Version options", "2.0", options[i++]);
+ assertEquals("Version options", "2.0.1", options[i++]);
+ assertEquals("Version options", "2.0.2", options[i++]);
+ assertEquals("Version options", "2.1", options[i++]);
+ assertEquals("Version options", "2.1.1", options[i++]);
+ assertEquals("Version options", "2.1.2", options[i++]);
+ assertEquals("Version options", "3.0", options[i++]);
+ }
+
+ // Attribute: Platform
+ att = itr.next();
+ assertEquals("Attribute: Platform", "Platform", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("# Platform options", 6, options.length);
+
+ i = 0;
+ while (i < options.length) {
+ assertEquals("Platform options", "All", options[i++]);
+ assertEquals("Platform options", "Macintosh", options[i++]);
+ assertEquals("Platform options", "PC", options[i++]);
+ assertEquals("Platform options", "Power PC", options[i++]);
+ assertEquals("Platform options", "Sun", options[i++]);
+ assertEquals("Platform options", "Other", options[i++]);
+ }
+
+ // Attribute: Component
+ att = itr.next();
+ assertEquals("Attribute: Component", "Component", att.getName());
+
+ attOptions = att.getOptionValues();
+ options = attOptions.keySet().toArray();
+ assertEquals("# Component options", 16, options.length);
+
+ i = 0;
+ while (i < options.length) {
+ assertEquals("Component options", "Ant", options[i++]);
+ assertEquals("Component options", "Compare", options[i++]);
+ assertEquals("Component options", "Core", options[i++]);
+ assertEquals("Component options", "CVS", options[i++]);
+ assertEquals("Component options", "Debug", options[i++]);
+ assertEquals("Component options", "Doc", options[i++]);
+ assertEquals("Component options", "Help", options[i++]);
+ assertEquals("Component options", "Releng", options[i++]);
+ assertEquals("Component options", "Scripting", options[i++]);
+ assertEquals("Component options", "Search", options[i++]);
+ assertEquals("Component options", "SWT", options[i++]);
+ assertEquals("Component options", "Team", options[i++]);
+ assertEquals("Component options", "Text", options[i++]);
+ assertEquals("Component options", "UI", options[i++]);
+ assertEquals("Component options", "Update", options[i++]);
+ assertEquals("Component options", "WebDAV", options[i++]);
+ }
+
+ // Attribute: bug_status
+ att = itr.next();
+ assertEquals("Attribute: bug_status", "bug_status", att.getName());
+
+ attOptions = att.getOptionValues();
+ options = attOptions.keySet().toArray();
+ assertEquals("No bug_status options", 0, options.length);
+
+ // Attribute: form_name
+ att = itr.next();
+ assertEquals("Attribute: form_name", "form_name", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("No form_name options", 0, options.length);
+
+ // Attribute: bug_file_loc
+ att = itr.next();
+ assertEquals("Attribute: bug_file_loc", "bug_file_loc", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("No bug_file_loc options", 0, options.length);
+
+ // Attribute: priority
+ att = itr.next();
+ assertEquals("Attribute: priority", "priority", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("No priority options", 0, options.length);
+ }
+
+ // private void printList(List<Attribute> attributes) {
+ //
+ // Iterator<Attribute> itr = attributes.iterator();
+ // System.out.println("Attributes for this Product:");
+ // System.out.println("============================");
+ //
+ // while (itr.hasNext()) {
+ // Attribute attr = itr.next();
+ // System.out.println();
+ // System.out.println(attr.getName() + ": ");
+ // System.out.println("-----------");
+ //
+ // Map<String, String> options = attr.getOptionValues();
+ // Object[] it = options.keySet().toArray();
+ // for (int i = 0; i < it.length; i++)
+ // System.out.println((String) it[i]);
+ // }
+ // }
+}
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaNewBugParserTestVE.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaNewBugParserTestVE.java
new file mode 100644
index 000000000..75d994ab9
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaNewBugParserTestVE.java
@@ -0,0 +1,225 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.mylar.bugzilla.tests;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.Reader;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.Path;
+import org.eclipse.mylar.bugzilla.core.Attribute;
+import org.eclipse.mylar.core.tests.support.FileTool;
+import org.eclipse.mylar.internal.bugzilla.core.NewBugModel;
+import org.eclipse.mylar.internal.bugzilla.core.internal.NewBugParser;
+
+/**
+ * Tests NewBugParser -- parses product attributes
+ */
+public class BugzillaNewBugParserTestVE extends TestCase {
+
+ public BugzillaNewBugParserTestVE() {
+ super();
+ }
+
+ public BugzillaNewBugParserTestVE(String arg0) {
+ super(arg0);
+ }
+
+ public void testProductVE() throws Exception {
+ File f = FileTool.getFileInPlugin(BugzillaTestPlugin.getDefault(), new Path("testdata/pages/ve-page.html"));
+
+ Reader in = new FileReader(f);
+
+ NewBugModel nbm = new NewBugModel();
+ new NewBugParser(in).parseBugAttributes(nbm, true); // ** TRUE vs FALSE
+ // **
+
+ // attributes for this but model
+ List<Attribute> attributes = nbm.getAttributes();
+ // printList(attributes);
+
+ Iterator<Attribute> itr = attributes.iterator();
+ Attribute att = itr.next();
+
+ // Attribute: Severity
+ assertEquals("Attribute: Severity", "Severity", att.getName());
+
+ Map<String, String> attOptions = att.getOptionValues(); // HashMap of
+ // options for the
+ // current
+ // attribute
+ Object[] options = attOptions.keySet().toArray(); // Array of keys for
+ // the options of the
+ // current attribute
+ assertEquals("# Severity options", 7, options.length);
+
+ int i = 0;
+ while (i < options.length) {
+ assertEquals("severity options", "blocker", options[i++]);
+ assertEquals("severity options", "critical", options[i++]);
+ assertEquals("severity options", "major", options[i++]);
+ assertEquals("severity options", "normal", options[i++]);
+ assertEquals("severity options", "minor", options[i++]);
+ assertEquals("severity options", "trivial", options[i++]);
+ assertEquals("severity options", "enhancement", options[i++]);
+ }
+
+ // Attribute: product
+ att = itr.next();
+ assertEquals("Attribute: product", "product", att.getName());
+
+ attOptions = att.getOptionValues();
+ options = attOptions.keySet().toArray();
+ assertEquals("No product options", 0, options.length);
+
+ // Attribute: AssignedTo
+ att = itr.next();
+ assertEquals("Attribute: AssignedTo", "AssignedTo", att.getName());
+
+ attOptions = att.getOptionValues();
+ options = attOptions.keySet().toArray();
+ assertEquals("No AssignedTo options", 0, options.length);
+
+ // Attribute: OS
+ att = itr.next();
+ assertEquals("Attribute: OS", "OS", att.getName());
+
+ attOptions = att.getOptionValues();
+ options = attOptions.keySet().toArray();
+ assertEquals("# of options", 20, options.length);
+
+ i = 0;
+ while (i < options.length) {
+ assertEquals("OS options", "All", options[i++]);
+ assertEquals("OS options", "AIX Motif", options[i++]);
+ assertEquals("OS options", "Windows 95", options[i++]);
+ assertEquals("OS options", "Windows 98", options[i++]);
+ assertEquals("OS options", "Windows CE", options[i++]);
+ assertEquals("OS options", "Windows ME", options[i++]);
+ assertEquals("OS options", "Windows 2000", options[i++]);
+ assertEquals("OS options", "Windows NT", options[i++]);
+ assertEquals("OS options", "Windows XP", options[i++]);
+ assertEquals("OS options", "Windows All", options[i++]);
+ assertEquals("OS options", "MacOS X", options[i++]);
+ assertEquals("OS options", "Linux", options[i++]);
+ assertEquals("OS options", "Linux-GTK", options[i++]);
+ assertEquals("OS options", "Linux-Motif", options[i++]);
+ assertEquals("OS options", "HP-UX", options[i++]);
+ assertEquals("OS options", "Neutrino", options[i++]);
+ assertEquals("OS options", "QNX-Photon", options[i++]);
+ assertEquals("OS options", "Solaris", options[i++]);
+ assertEquals("OS options", "Unix All", options[i++]);
+ assertEquals("OS options", "other", options[i++]);
+ }
+
+ // Attribute: Version
+ att = itr.next();
+ assertEquals("Attribute: Version", "Version", att.getName());
+
+ // attOptions = (HashMap) att.getOptionValues();
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("# Version options", 3, options.length);
+
+ i = 0;
+ while (i < options.length) {
+ assertEquals("Version options", "0.5.0", options[i++]);
+ assertEquals("Version options", "1.0.0", options[i++]);
+ assertEquals("Version options", "unspecified", options[i++]);
+ }
+
+ // Attribute: Platform
+ att = itr.next();
+ assertEquals("Attribute: Platform", "Platform", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("# Platform options", 6, options.length);
+
+ i = 0;
+ while (i < options.length) {
+ assertEquals("Platform options", "All", options[i++]);
+ assertEquals("Platform options", "Macintosh", options[i++]);
+ assertEquals("Platform options", "PC", options[i++]);
+ assertEquals("Platform options", "Power PC", options[i++]);
+ assertEquals("Platform options", "Sun", options[i++]);
+ assertEquals("Platform options", "Other", options[i++]);
+ }
+
+ att = itr.next();
+ assertEquals("Attribute: Component", "Component", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("# Component options", 6, options.length);
+
+ i = 0;
+ while (i < options.length) {
+ assertEquals("Component options", "CDE", options[i++]);
+ assertEquals("Component options", "Doc", options[i++]);
+ assertEquals("Component options", "Java Core", options[i++]);
+ assertEquals("Component options", "Java Model (JEM)", options[i++]);
+ assertEquals("Component options", "JFC/Swing", options[i++]);
+ assertEquals("Component options", "SWT", options[i++]);
+ }
+
+ // Attribute: bug_status
+ att = itr.next();
+ assertEquals("Attribute: bug_status", "bug_status", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("No bug_status options", 0, options.length);
+
+ // Attribute: form_name
+ att = itr.next();
+ assertEquals("Attribute: form_name", "form_name", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("No form_name options", 0, options.length);
+
+ // Attribute: bug_file_loc
+ att = itr.next();
+ assertEquals("Attribute: bug_file_loc", "bug_file_loc", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("No bug_file_loc options", 0, options.length);
+
+ // Attribute: priority
+ att = itr.next();
+ assertEquals("Attribute: priority", "priority", att.getName());
+
+ options = att.getOptionValues().keySet().toArray();
+ assertEquals("No priority options", 0, options.length);
+
+ }
+
+ // private void printList(List<Attribute> attributes) {
+ //
+ // Iterator<Attribute> itr = attributes.iterator();
+ // System.out.println("Attributes for this Product:");
+ // System.out.println("============================");
+ //
+ // while (itr.hasNext()) {
+ // Attribute attr = itr.next();
+ // System.out.println();
+ // System.out.println(attr.getName() + ": ");
+ // System.out.println("-----------");
+ //
+ // Map<String, String> options = attr.getOptionValues();
+ // Object[] it = options.keySet().toArray();
+ // for (int i = 0; i < it.length; i++)
+ // System.out.println((String) it[i]);
+ // }
+ // }
+}
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaParserTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaParserTest.java
new file mode 100644
index 000000000..231529c60
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaParserTest.java
@@ -0,0 +1,196 @@
+/*******************************************************************************
+ * Copyright (c) 2003 - 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
+ *******************************************************************************/
+package org.eclipse.mylar.bugzilla.tests;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.Reader;
+import java.util.Iterator;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.Path;
+import org.eclipse.mylar.bugzilla.core.BugReport;
+import org.eclipse.mylar.bugzilla.core.Comment;
+import org.eclipse.mylar.core.tests.support.FileTool;
+import org.eclipse.mylar.internal.bugzilla.core.internal.BugParser;
+
+/**
+ * Tests for parsing Bugzilla reports
+ */
+public class BugzillaParserTest extends TestCase {
+
+ public BugzillaParserTest() {
+ super();
+ }
+
+ public BugzillaParserTest(String arg0) {
+ super(arg0);
+ }
+
+ public void testFullReportBug1() throws Exception {
+
+ File f = FileTool.getFileInPlugin(BugzillaTestPlugin.getDefault(), new Path("testdata/pages/bug-1-full.html"));
+
+ Reader in = new FileReader(f);
+
+ BugReport bug = BugParser.parseBug(in, 1, "<server>", false, null, null, null);
+
+ // displayBug(bug);
+ assertEquals("Bug id", 1, bug.getId());
+ assertEquals("Bug summary", "Usability issue with external editors (1GE6IRL)", bug.getSummary());
+ assertEquals("Reporter", "andre_weinand@ch.ibm.com (Andre Weinand)", bug.getReporter());
+ assertEquals("Reporter", "andre_weinand@ch.ibm.com (Andre Weinand)", bug.getAttribute("Reporter").getValue());
+ assertEquals("Summary", "Usability issue with external editors (1GE6IRL)", bug.getSummary());
+ assertEquals("Status", "VERIFIED", bug.getStatus());
+ assertEquals("Resolution", "FIXED", bug.getResolution());
+ assertEquals("Keywords", null, bug.getKeywords());
+ assertEquals("Assigned To", "James_Moody@ca.ibm.com (James Moody)", bug.getAssignedTo());
+ assertEquals("Priority", "P3", bug.getAttribute("Priority").getValue());
+ assertEquals("OS", "All", bug.getAttribute("OS").getValue());
+ assertEquals("Version", "2.0", bug.getAttribute("Version").getValue());
+ assertEquals("Target Milestone", "---", bug.getAttribute("Target Milestone").getValue());
+ assertEquals("Keywords", "", bug.getAttribute("Keywords").getValue());
+ assertEquals("Severity", "normal", bug.getAttribute("Severity").getValue());
+ assertEquals("Component", "VCM", bug.getAttribute("Component").getValue());
+ assertEquals("CC", "Kevin_McGuire@oti.com", bug.getCC().iterator().next());
+ assertEquals("Platform", "All", bug.getAttribute("Platform").getValue());
+ assertEquals("Product", "Platform", bug.getAttribute("Product").getValue());
+ assertEquals("URL", "", bug.getAttribute("URL").getValue());
+ assertEquals("Bug#", "1", bug.getAttribute("Bug#").getValue());
+
+ // Description
+ String description = "- Setup a project that contains a *.gif resource\n"
+ + "\t- release project to CVS\n"
+ + "\t- edit the *.gif resource with an external editor, e.g. PaintShop\n"
+ + "\t- save and close external editor\n"
+ + "\t- in Navigator open the icon resource and verify that your changes are there\n"
+ + "\t- release project\n"
+ + "\t\t-> nothing to release!\n"
+ + "\t- in Navigator open the icon resource and verify that your changes are still there\n\n"
+ +
+
+ "\tProblem: because I never \"Refreshed from local\", the workspace hasn't changed so \"Release\" didn't find anything.\n"
+ + "\tHowever opening the resource with an external editor found the modified file on disk and showed the changes.\n\n"
+ +
+
+ "\tThe real problem occurs if \"Release\" actually finds something to release but you don't spot that some resources are missing.\n"
+ + "\tThis is extremely error prone: one of my changes didn't made it into build 110 because of this!\n\n"
+ +
+
+ "NOTES:\n"
+ + "EG (5/23/01 3:00:33 PM)\n"
+ + "\tRelease should do a refresh from local before doing the release.\n"
+ + "\tMoving to VCM\n\n\n"
+ +
+
+ "KM (05/27/01 5:10:19 PM)\n"
+ + "\tComments from JM in related email:\n\n"
+ +
+
+ "\tShould not do this for free. Could have a setting which made it optoinal but should nt be mandatory. Default setting could be to have it on.\n"
+ + "\tConsider the SWT team who keep their workspaces on network drives. This will be slow. \n\n"
+ +
+
+ "\tSide effects will be that a build runs when the refresh is completed unless you somehow do it in a workspace runnable and don't end the\n"
+ + "\trunnable until after the release. This would be less than optimal as some builders may be responsible for maintaining some invariants and deriving resources which are releasable. If you don't run the builders before releasing, the invariants will not be maintained and you will release inconsistent state.\n\n"
+ +
+
+ "\tSummary: Offer to \"ensure local consistency\" before releasing.\n\n" +
+
+ "KM (5/31/01 1:30:35 PM)\n"
+ + "\tSee also 1GEAG1A: ITPVCM:WINNT - Internal error comparing with a document\n"
+ + "\twhich failed with an error. Never got log from Tod though.";
+
+ assert (description.length() == bug.getDescription().length());
+ assertEquals("Description", description, bug.getDescription());
+
+ // Comments:
+ Iterator<Comment> it = bug.getComments().iterator();
+ while (it.hasNext()) {
+ // COMMENT #1
+ Comment comment = it.next();
+ assertEquals("Author1", "James_Moody@ca.ibm.com", comment.getAuthor());
+ assertEquals("Name1", "James Moody", comment.getAuthorName());
+ assertEquals("Text1", "*** Bug 183 has been marked as a duplicate of this bug. ***", comment.getText());
+
+ // COMMENT #2
+ comment = it.next();
+ assertEquals("Author2", "James_Moody@ca.ibm.com", comment.getAuthor());
+ assertEquals("Name2", "James Moody", comment.getAuthorName());
+ assertEquals("Text2", "Implemented 'auto refresh' option. Default value is off.", comment.getText());
+
+ // COMMENT 3
+ comment = it.next();
+ assertEquals("Author3", "dj_houghton@ca.ibm.com", comment.getAuthor());
+ assertEquals("Name3", "DJ Houghton", comment.getAuthorName());
+ assertEquals("Text3", "PRODUCT VERSION:\n\t109\n\n", comment.getText());
+
+ // COMMENT 4
+ comment = it.next();
+ assertEquals("Author4", "James_Moody@ca.ibm.com", comment.getAuthor());
+ assertEquals("Name4", "James Moody", comment.getAuthorName());
+ assertEquals("Text4", "Fixed in v206", comment.getText());
+ }
+ }
+
+ // private static void displayBug(BugReport bug) {
+ // System.out.println("Bug " + bug.getId() + ": " + bug.getSummary());
+ // System.out.println("Opened: " + bug.getCreated());
+ // for (Iterator<Attribute> it = bug.getAttributes().iterator();
+ // it.hasNext();) {
+ // Attribute attribute = it.next();
+ // String key = attribute.getName();
+ // System.out.println(key + ": " + attribute.getValue()
+ // + (attribute.isEditable() ? " [OK]" : " %%"));
+ // }
+ //
+ // System.out.print("CC: ");
+ // for (Iterator<String> it = bug.getCC().iterator(); it.hasNext();) {
+ // String email = it.next();
+ // System.out.print(email + " ");
+ // }
+ // System.out.println();
+ //
+ // System.out.println(bug.getDescription());
+ // for (Iterator<Comment> it = bug.getComments().iterator(); it.hasNext();)
+ // {
+ // Comment comment = it.next();
+ // System.out.println(comment.getAuthorName() + " <"
+ // + comment.getAuthor() + "> (" + comment.getCreated() + ")");
+ // System.out.print(comment.getText());
+ // System.out.println();
+ // }
+ // }
+ //
+ // private static void printComments(BugReport bug) {
+ // for (Iterator<Comment> it = bug.getComments().iterator(); it.hasNext();)
+ // {
+ // Comment comment = it.next();
+ // System.out.println("Author: " + comment.getAuthor());
+ // System.out.println("Name: " + comment.getAuthorName());
+ // System.out.println("Date: " + comment.getCreated());
+ // System.out.println("Bug ID: " + comment.getBug().getId());
+ // System.out.println("Comment: " + comment.getText());
+ // System.out.println();
+ // }
+ // }
+ //
+ // /** prints names of attributes */
+ // private static void printAttributes(BugReport bug) {
+ // System.out.println("ATTRIBUTE KEYS:");
+ // for (Iterator<Attribute> it = bug.getAttributes().iterator();
+ // it.hasNext();) {
+ // Attribute att = it.next();
+ // System.out.println(att.getName());
+ // }
+ // }
+}
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaParserTestNoBug.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaParserTestNoBug.java
new file mode 100644
index 000000000..9f2a46f96
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaParserTestNoBug.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2003 - 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
+ *******************************************************************************/
+package org.eclipse.mylar.bugzilla.tests;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.Reader;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.Path;
+import org.eclipse.mylar.bugzilla.core.BugReport;
+import org.eclipse.mylar.core.tests.support.FileTool;
+import org.eclipse.mylar.internal.bugzilla.core.internal.BugParser;
+
+/**
+ * Tests for parsing Bugzilla reports
+ */
+public class BugzillaParserTestNoBug extends TestCase {
+
+ public BugzillaParserTestNoBug() {
+ super();
+ }
+
+ public BugzillaParserTestNoBug(String arg0) {
+ super(arg0);
+ }
+
+ public void testBugNotFound() throws Exception {
+
+ File f = FileTool.getFileInPlugin(BugzillaTestPlugin.getDefault(), new Path(
+ "testdata/pages/bug-not-found-eclipse.html"));
+
+ Reader in = new FileReader(f);
+
+ BugReport bug = BugParser.parseBug(in, 666, "<server>", false, null, null, null);
+ assertNull(bug);
+ }
+}
diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/enter-bug220.html b/org.eclipse.mylyn.bugzilla.tests/testdata/pages/enter-bug220.html
new file mode 100644
index 000000000..e9c1deb49
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.tests/testdata/pages/enter-bug220.html
@@ -0,0 +1,441 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+ <head>
+ <title>Enter Bug: TestProduct</title>
+
+
+<link rel="Top" href="http://you-havent-visited-editparams.cgi-yet/">
+
+
+
+
+
+
+
+
+ <link rel="Saved&nbsp;Searches" title="My Bugs"
+ href="buglist.cgi?bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;email1=relves%40cs.ubc.ca&amp;emailtype1=exact&amp;emailassigned_to1=1&amp;emailreporter1=1">
+
+
+ <link rel="Administration" title="Parameters"
+ href="editparams.cgi"><link rel="Administration" title="Users"
+ href="editusers.cgi"><link rel="Administration" title="Products"
+ href="editproducts.cgi"><link rel="Administration" title="Flag Types"
+ href="editflagtypes.cgi"><link rel="Administration" title="Groups"
+ href="editgroups.cgi"><link rel="Administration" title="Keywords"
+ href="editkeywords.cgi"><link rel="Administration" title="Whining"
+ href="editwhines.cgi"><link rel="Administration" title="Sanity Check"
+ href="sanitycheck.cgi">
+
+
+
+ <script type="text/javascript">
+ <!--
+
+ function initHelp() {}
+ // -->
+ </script>
+
+ <link href="skins/standard/global.css" rel="stylesheet" type="text/css">
+ <link href="skins/custom/global.css" rel="stylesheet" type="text/css">
+
+
+
+
+
+ </head>
+
+
+
+ <body onload="set_assign_to();"
+ class="you-havent-visited-editparams-cgi-yet">
+
+
+<div id="banner">
+ <div class="intro"></div>
+ <p id="banner-name">
+ <span>This is Bugzilla</span>
+ </p>
+ <p id="banner-version">
+ <a href="http://www.bugzilla.org/"><span>Bugzilla</span></a>
+
+ <span>Version 2.20</span>
+ </p>
+ <div class="outro"></div>
+ </div>
+
+<div id="header">
+ <h1>Enter Bug: TestProduct</h1>
+
+ <h2>This page lets you enter a new bug into Bugzilla.</h2>
+
+</div>
+
+<script type="text/javascript">
+<!--
+
+var initialowners = new Array(1);
+var last_initialowner;
+var components = new Array(1);
+ components[0] = "TestComponent";
+ initialowners[0] = "relves\x40cs.ubc.ca";
+
+function set_assign_to() {
+ // Based on the selected component, fill the "Assign To:" field
+ // with the default component owner, and the the "QA Contact:" field
+ // with the default QA Contact.
+ var form = document.Create;
+ var assigned_to = form.assigned_to.value;
+
+
+ var index = -1;
+ if (form.component.type == 'select-one') {
+ index = form.component.selectedIndex;
+ } else if (form.component.type == 'hidden') {
+ // Assume there is only one component in the list
+ index = 0;
+ }
+ if (index != -1) {
+ var owner = initialowners[index];
+ var component = components[index];
+ if (assigned_to == last_initialowner
+ || assigned_to == owner
+ || assigned_to == '') {
+ form.assigned_to.value = owner;
+ last_initialowner = owner;
+ }
+ }
+}
+-->
+</script>
+
+<form name="Create" id="Create" method="post" action="post_bug.cgi">
+<input type="hidden" name="product" value="TestProduct">
+
+<table cellspacing="2" cellpadding="0" border="0">
+
+ <tr>
+ <td><br></td>
+ </tr>
+
+ <tr>
+ <td></td>
+ <td colspan="3">
+ Before reporting a bug, please read the
+<a href="page.cgi?id=bug-writing.html">bug writing guidelines</a>, please look at the list of
+<a href="duplicates.cgi">most frequently reported bugs</a>, and please
+<a href="query.cgi">search</a> for the bug.
+ </td>
+
+ </tr>
+
+ <tr>
+ <td><br></td>
+ </tr>
+
+ <tr>
+ <td align="right" valign="top"><strong>Reporter:</strong></td>
+ <td valign="top">relves&#64;cs.ubc.ca</td>
+
+ <td align="right" valign="top"><strong>Product:</strong></td>
+ <td valign="top">TestProduct</td>
+ </tr>
+
+
+ <tr>
+ <td align="right" valign="top">
+ <strong>Version:</strong>
+
+ </td>
+ <td>
+ <select name="version" size="5">
+ <option value="other" selected="selected">other </option>
+ </select>
+ </td>
+
+ <td align="right" valign="top">
+ <strong>
+
+ <a href="describecomponents.cgi?product=TestProduct">
+ Component</a>:
+ </strong>
+ </td>
+ <td>
+ <select name="component" onchange="set_assign_to();" size="5">
+ <option value="TestComponent" selected="selected">TestComponent </option>
+ </select>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ <td colspan="3"></td>
+ </tr>
+
+ <tr><td align="right">
+ <strong>
+
+ <a href="page.cgi?id=fields.html#rep_platform">Platform</a>:
+ </strong>
+ </td>
+
+ <td>
+ <select name="rep_platform">
+ <option value="All">All</option>
+ <option value="PC" selected="selected">PC</option>
+
+ <option value="Macintosh">Macintosh</option>
+ <option value="Other">Other</option>
+ </select>
+ </td>
+<td align="right">
+ <strong>
+ <a href="page.cgi?id=fields.html#op_sys">OS</a>:
+ </strong>
+
+ </td>
+
+ <td>
+ <select name="op_sys">
+ <option value="All">All</option>
+ <option value="Windows" selected="selected">Windows</option>
+ <option value="Mac OS">Mac OS</option>
+ <option value="Linux">Linux</option>
+
+ <option value="Other">Other</option>
+ </select>
+ </td>
+ </tr>
+
+ <tr><td align="right">
+ <strong>
+ <a href="page.cgi?id=fields.html#priority">Priority</a>:
+ </strong>
+
+ </td>
+
+ <td>
+ <select name="priority">
+ <option value="P1">P1</option>
+ <option value="P2" selected="selected">P2</option>
+ <option value="P3">P3</option>
+ <option value="P4">P4</option>
+
+ <option value="P5">P5</option>
+ </select>
+ </td>
+<td align="right">
+ <strong>
+ <a href="page.cgi?id=fields.html#bug_severity">Severity</a>:
+ </strong>
+ </td>
+
+ <td>
+ <select name="bug_severity">
+ <option value="blocker">blocker</option>
+ <option value="critical">critical</option>
+ <option value="major">major</option>
+ <option value="normal" selected="selected">normal</option>
+ <option value="minor">minor</option>
+
+ <option value="trivial">trivial</option>
+ <option value="enhancement">enhancement</option>
+ </select>
+ </td>
+ </tr>
+
+
+ <tr>
+ <td>&nbsp;</td>
+
+ <td colspan="3"></td>
+ </tr>
+
+ <tr>
+ <input type="hidden" name="bug_status"
+ value="NEW">
+ <td align="right" valign="top"><strong>Initial State:</strong></td>
+ <td valign="top">NEW</td>
+ <td colspan="2"></td>
+
+ </tr>
+
+ <tr>
+ <td align="right">
+ <strong>
+ <a href="page.cgi?id=fields.html#assigned_to">Assign To</a>:
+ </strong>
+ </td>
+ <td colspan="3"><input
+ name="assigned_to"
+ value="" size="32"
+>
+
+ <noscript>(Leave blank to assign to component's default assignee)</noscript>
+ </td>
+ </tr>
+
+
+ <tr>
+ <td align="right"><strong>Cc:</strong></td>
+ <td colspan="3"><input
+ name="cc"
+ value="" size="45"
+>
+ </td>
+
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ <td colspan="3"></td>
+ </tr>
+
+
+ <tr>
+ <td align="right"><strong>URL:</strong></td>
+
+ <td colspan="3">
+ <input name="bug_file_loc" size="60"
+ value="http://">
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right"><strong>Summary:</strong></td>
+ <td colspan="3">
+ <input name="short_desc" size="60" value="">
+
+ </td>
+ </tr>
+
+ <tr><td align="right" valign="top"><strong>Description:</strong></td>
+ <td colspan="3">
+ <textarea name="comment" rows="10" cols="80"></textarea>
+ <br>
+ </td>
+
+ </tr>
+
+ <input type="hidden" name="commentprivacy" value="0">
+
+ <tr>
+ <td align="right">
+ <strong>Depends on:</strong>
+ </td>
+ <td>
+
+ <input name="dependson" accesskey="d" value="">
+ </td>
+ </tr>
+ <tr>
+ <td align="right">
+ <strong>Blocks:</strong>
+ </td>
+ <td>
+
+ <input name="blocked" accesskey="b" value="">
+ </td>
+ </tr>
+
+ <tr>
+ <td></td>
+ <td colspan="3">
+ </td>
+ </tr>
+
+
+
+ <tr>
+ <td></td>
+ <td colspan="3">
+ <input type="submit" value=" Commit "
+ onclick="if (this.form.short_desc.value == '')
+ { alert('Please enter a summary sentence for this bug.');
+ return false; } return true;">
+ &nbsp;&nbsp;&nbsp;&nbsp;
+ <input type="submit" name="maketemplate"
+ value="Remember values as bookmarkable template">
+ </td>
+ </tr>
+
+ <tr>
+ <td></td>
+ <td colspan="3">
+ <br>
+ We've made a guess at your
+ operating system and platform. Please check them
+ and, if we got it wrong, email
+ THE MAINTAINER HAS NOT YET BEEN SET.
+ </td>
+ </tr>
+
+ </table>
+
+ <input type="hidden" name="form_name" value="enter_bug">
+</form>
+
+
+<div id="footer">
+ <div class="intro"></div>
+
+
+
+
+<form method="get" action="show_bug.cgi">
+<div id="useful-links">
+ <div id="links-actions">
+ <div class="label">Actions:</div>
+
+ <div class="links">
+ <a href="./">Home</a> |
+ <a href="enter_bug.cgi">New</a> |
+ <a href="query.cgi">Search</a> |
+ bug # <input class="txt" name="id" size="6">
+ <input class="btn" type="submit" value="Find"> |
+
+ <a href="report.cgi">Reports</a>
+
+ | <a href="request.cgi?requester=relves%40cs.ubc.ca&amp;requestee=relves%40cs.ubc.ca&amp;do_union=1&amp;group=type">My Requests</a>
+
+
+ | <a href="votes.cgi?action=show_user">My&nbsp;Votes</a>
+ | <a href="sanitycheck.cgi">Sanity&nbsp;check</a>
+ | <a href="relogin.cgi">Log&nbsp;out</a>&nbsp;relves&#64;cs.ubc.ca
+ </div>
+ </div>
+
+
+ <div id="links-edit">
+ <div class="label">Edit:</div>
+ <div class="links">
+
+ <a href="userprefs.cgi">Prefs</a> | <a href="editparams.cgi">Parameters</a> | <a href="editsettings.cgi">User Preferences</a> | <a href="editusers.cgi">Users</a> | <a href="editproducts.cgi">Products</a> | <a href="editflagtypes.cgi">Flags</a> | <a href="editvalues.cgi">Field Values</a> | <a href="editgroups.cgi">Groups</a> | <a href="editkeywords.cgi">Keywords</a> | <a href="editwhines.cgi">Whining</a>
+
+ </div>
+ </div>
+
+
+
+
+ <div id="links-saved">
+ <div class="label">
+ Saved&nbsp;Searches:
+ </div>
+ <div class="links">
+ <a href="buglist.cgi?bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;email1=relves%40cs.ubc.ca&amp;emailtype1=exact&amp;emailassigned_to1=1&amp;emailreporter1=1">My&nbsp;Bugs</a>
+
+ </div>
+ </div>
+
+
+</div>
+</form>
+
+ <div class="outro"></div>
+</div>
+
+</body>
+</html>
diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/enter-bug2201.html b/org.eclipse.mylyn.bugzilla.tests/testdata/pages/enter-bug2201.html
new file mode 100644
index 000000000..b942b2a55
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.tests/testdata/pages/enter-bug2201.html
@@ -0,0 +1,493 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+ <head>
+ <title>Enter Bug: Mylar</title>
+
+
+<link rel="Top" href="https://bugs.eclipse.org/bugs/">
+
+
+
+
+
+
+
+
+ <link rel="Saved&nbsp;Searches" title="My Bugs"
+ href="buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=relves%40cs.ubc.ca&emailtype1=exact&emailassigned_to1=1&emailreporter1=1">
+
+ <link rel="Saved&nbsp;Searches"
+ title="AssignedToMe"
+ href="buglist.cgi?cmdtype=runnamed&amp;namedcmd=AssignedToMe">
+
+
+
+ <script type="text/javascript">
+ <!--
+
+ function initHelp() {}
+ // -->
+ </script>
+
+ <link href="skins/standard/global.css" rel="stylesheet" type="text/css">
+ <link href="skins/custom/global.css" rel="stylesheet" type="text/css">
+
+
+
+
+
+ </head>
+
+
+
+ <body onload="set_assign_to();"
+ class="bugs-eclipse-org-bugs">
+
+
+<!-- 1.0@bugzilla.org -->
+
+
+
+
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr style="background-image: url(/bugs/header_bg.gif);">
+ <td>
+ <a href="http://www.eclipse.org/"><img src="/bugs/header_logo.gif" width="164" height="68" border="0" /></a>
+ </td>
+ <td align="right" style="color: white; font-family: verdana,arial,helvetica; font-size: 1.25em; font-style: italic;"><b>Eclipse bugs</b></font> <br /><font style="font-size: .5em;">Bugzilla 2.20.1 &#160;</font></td>
+
+ </tr>
+</table>
+
+<div id="header">
+ <h1>Enter Bug: Mylar</h1>
+
+ <h2>This page lets you enter a new bug into Bugzilla.</h2>
+
+</div>
+
+<script type="text/javascript">
+<!--
+
+var initialowners = new Array(10);
+var last_initialowner;
+var components = new Array(10);
+ var initialqacontacts = new Array(10);
+ var last_initialqacontact;
+ components[0] = "Bugzilla";
+ initialowners[0] = "beatmik\x40acm.org";
+ initialqacontacts[0] = "";
+ components[1] = "Core";
+ initialowners[1] = "beatmik\x40acm.org";
+ initialqacontacts[1] = "";
+ components[2] = "Doc";
+ initialowners[2] = "beatmik\x40acm.org";
+ initialqacontacts[2] = "";
+ components[3] = "Java";
+ initialowners[3] = "beatmik\x40acm.org";
+ initialqacontacts[3] = "";
+ components[4] = "Jira";
+ initialowners[4] = "beatmik\x40acm.org";
+ initialqacontacts[4] = "";
+ components[5] = "Monitor";
+ initialowners[5] = "beatmik\x40acm.org";
+ initialqacontacts[5] = "";
+ components[6] = "Tasks";
+ initialowners[6] = "beatmik\x40acm.org";
+ initialqacontacts[6] = "";
+ components[7] = "UI";
+ initialowners[7] = "beatmik\x40acm.org";
+ initialqacontacts[7] = "";
+ components[8] = "XML";
+ initialowners[8] = "beatmik\x40acm.org";
+ initialqacontacts[8] = "";
+ components[9] = "Zest";
+ initialowners[9] = "irbull\x40cs.uvic.ca";
+ initialqacontacts[9] = "";
+
+function set_assign_to() {
+ // Based on the selected component, fill the "Assign To:" field
+ // with the default component owner, and the the "QA Contact:" field
+ // with the default QA Contact.
+ var form = document.Create;
+ var assigned_to = form.assigned_to.value;
+
+ var qa_contact = form.qa_contact.value;
+
+ var index = -1;
+ if (form.component.type == 'select-one') {
+ index = form.component.selectedIndex;
+ } else if (form.component.type == 'hidden') {
+ // Assume there is only one component in the list
+ index = 0;
+ }
+ if (index != -1) {
+ var owner = initialowners[index];
+ var component = components[index];
+ if (assigned_to == last_initialowner
+ || assigned_to == owner
+ || assigned_to == '') {
+ form.assigned_to.value = owner;
+ last_initialowner = owner;
+ }
+ var contact = initialqacontacts[index];
+ if (qa_contact == last_initialqacontact
+ || qa_contact == contact
+ || qa_contact == '') {
+ form.qa_contact.value = contact;
+ last_initialqacontact = contact;
+ }
+ }
+}
+-->
+</script>
+
+<form name="Create" id="Create" method="post" action="post_bug.cgi">
+<input type="hidden" name="product" value="Mylar">
+
+<table cellspacing="2" cellpadding="0" border="0">
+
+ <tr>
+ <td><br></td>
+ </tr>
+
+ <tr>
+ <td></td>
+
+ <td colspan="3">
+ Before reporting a bug, please read the
+<a href="page.cgi?id=bug-writing.html">bug writing guidelines</a>, please look at the list of
+<a href="duplicates.cgi">most frequently reported bugs</a>, and please
+<a href="query.cgi">search</a> for the bug.
+ </td>
+ </tr>
+
+ <tr>
+
+ <td><br></td>
+ </tr>
+
+ <tr>
+ <td align="right" valign="top"><strong>Reporter:</strong></td>
+ <td valign="top">relves&#64;cs.ubc.ca</td>
+
+ <td align="right" valign="top"><strong>Product:</strong></td>
+
+ <td valign="top">Mylar</td>
+ </tr>
+
+
+ <tr>
+ <td align="right" valign="top">
+ <strong>Version:</strong>
+ </td>
+ <td>
+
+ <select name="version" size="5">
+ <option value="0.2">0.2 </option>
+ <option value="0.3">0.3 </option>
+ <option value="0.4" selected="selected">0.4 </option>
+ <option value="unspecified">unspecified </option>
+ </select>
+ </td>
+
+ <td align="right" valign="top">
+ <strong>
+ <a href="describecomponents.cgi?product=Mylar">
+ Component</a>:
+ </strong>
+ </td>
+ <td>
+ <select name="component" onchange="set_assign_to();" size="5">
+
+ <option value="Bugzilla">Bugzilla </option>
+ <option value="Core">Core </option>
+ <option value="Doc">Doc </option>
+ <option value="Java">Java </option>
+ <option value="Jira">Jira </option>
+ <option value="Monitor">Monitor </option>
+
+ <option value="Tasks">Tasks </option>
+ <option value="UI">UI </option>
+ <option value="XML">XML </option>
+ <option value="Zest">Zest </option>
+ </select>
+ </td>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ <td colspan="3"></td>
+ </tr>
+
+ <tr><td align="right">
+ <strong>
+ <a href="page.cgi?id=fields.html#rep_platform">Platform</a>:
+ </strong>
+
+ </td>
+
+ <td>
+ <select name="rep_platform">
+ <option value="All">All</option>
+ <option value="Macintosh">Macintosh</option>
+ <option value="Other">Other</option>
+ <option value="PC" selected="selected">PC</option>
+
+ <option value="Power PC">Power PC</option>
+ <option value="Sun">Sun</option>
+ </select>
+ </td>
+<td align="right">
+ <strong>
+ <a href="page.cgi?id=fields.html#op_sys">OS</a>:
+ </strong>
+
+ </td>
+
+ <td>
+ <select name="op_sys">
+ <option value="All">All</option>
+ <option value="AIX Motif">AIX Motif</option>
+ <option value="HP-UX">HP-UX</option>
+ <option value="Linux">Linux</option>
+
+ <option value="Linux-GTK">Linux-GTK</option>
+ <option value="Linux-Motif">Linux-Motif</option>
+ <option value="Mac OS">Mac OS</option>
+ <option value="MacOS X">MacOS X</option>
+ <option value="Neutrino">Neutrino</option>
+ <option value="other">other</option>
+
+ <option value="QNX-Photon">QNX-Photon</option>
+ <option value="Solaris">Solaris</option>
+ <option value="Solaris-GTK">Solaris-GTK</option>
+ <option value="Solaris-Motif">Solaris-Motif</option>
+ <option value="SymbianOS-Series 80">SymbianOS-Series 80</option>
+ <option value="Unix All">Unix All</option>
+
+ <option value="Windows All">Windows All</option>
+ <option value="Windows 95">Windows 95</option>
+ <option value="Windows 98">Windows 98</option>
+ <option value="Windows 2000">Windows 2000</option>
+ <option value="Windows 2003 Server">Windows 2003 Server</option>
+ <option value="Windows CE">Windows CE</option>
+
+ <option value="Windows ME">Windows ME</option>
+ <option value="Windows Mobile 2003">Windows Mobile 2003</option>
+ <option value="Windows NT">Windows NT</option>
+ <option value="Windows XP" selected="selected">Windows XP</option>
+ </select>
+ </td>
+ </tr>
+
+ <tr>
+ <input type="hidden" name="priority"
+ value="P3">
+<td align="right">
+ <strong>
+ <a href="page.cgi?id=fields.html#bug_severity">Severity</a>:
+ </strong>
+ </td>
+
+ <td>
+
+ <select name="bug_severity">
+ <option value="blocker">blocker</option>
+ <option value="critical">critical</option>
+ <option value="major">major</option>
+ <option value="normal" selected="selected">normal</option>
+ <option value="minor">minor</option>
+
+ <option value="trivial">trivial</option>
+ <option value="enhancement">enhancement</option>
+ </select>
+ </td>
+ </tr>
+
+
+ <tr>
+ <td>&nbsp;</td>
+
+ <td colspan="3"></td>
+ </tr>
+
+ <tr>
+ <input type="hidden" name="bug_status"
+ value="NEW">
+ <td align="right" valign="top"><strong>Initial State:</strong></td>
+ <td valign="top">NEW</td>
+ <td colspan="2"></td>
+
+ </tr>
+
+ <tr>
+ <td align="right">
+ <strong>
+ <a href="page.cgi?id=fields.html#assigned_to">Assign To</a>:
+ </strong>
+ </td>
+ <td colspan="3"><input
+ name="assigned_to"
+ value="" disabled="1" size="32"
+>
+
+ <noscript>(Leave blank to assign to component's default assignee)</noscript>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right"><strong>QA Contact:</strong></td>
+ <td colspan="3"><input
+ name="qa_contact"
+ value="" disabled="1" size="32"
+>
+ <noscript>(Leave blank to assign to default qa contact)</noscript>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right"><strong>Cc:</strong></td>
+ <td colspan="3"><input
+ name="cc"
+ value="" size="45"
+>
+ </td>
+ </tr>
+
+ <tr>
+
+ <td>&nbsp;</td>
+ <td colspan="3"></td>
+ </tr>
+
+
+ <tr>
+ <td align="right"><strong>URL:</strong></td>
+ <td colspan="3">
+ <input name="bug_file_loc" size="60"
+ value="http://">
+
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right"><strong>Summary:</strong></td>
+ <td colspan="3">
+ <input name="short_desc" size="60" value="">
+ </td>
+ </tr>
+
+ <tr><td align="right" valign="top"><strong>Description:</strong></td>
+ <td colspan="3">
+ <textarea name="comment" rows="10" cols="80"></textarea>
+ <br>
+ </td>
+ </tr>
+
+ <input type="hidden" name="commentprivacy" value="0">
+
+
+ <tr>
+ <td></td>
+ <td colspan="3">
+ </td>
+ </tr>
+
+
+
+ <tr>
+ <td></td>
+
+ <td colspan="3">
+ <input type="submit" value=" Commit "
+ onclick="if (this.form.short_desc.value == '')
+ { alert('Please enter a summary sentence for this bug.');
+ return false; } return true;">
+ &nbsp;&nbsp;&nbsp;&nbsp;
+ <input type="submit" name="maketemplate"
+ value="Remember values as bookmarkable template">
+ </td>
+ </tr>
+
+ <tr>
+ <td></td>
+
+ <td colspan="3">
+ <br>
+ We've made a guess at your
+ operating system and platform. Please check them
+ and, if we got it wrong, email
+ webmaster@eclipse.org.
+ </td>
+ </tr>
+
+ </table>
+ <input type="hidden" name="form_name" value="enter_bug">
+</form>
+
+
+<div id="footer">
+ <div class="intro"></div>
+
+
+
+
+<form method="get" action="show_bug.cgi">
+<div id="useful-links">
+ <div id="links-actions">
+ <div class="label">Actions:</div>
+ <div class="links">
+ <a href="./">Home</a> |
+ <a href="enter_bug.cgi">New</a> |
+ <a href="query.cgi">Search</a> |
+ bug # <input class="txt" name="id" size="6">
+
+ <input class="btn" type="submit" value="Find"> |
+
+ <a href="report.cgi">Reports</a>
+
+ | <a href="request.cgi?requester=relves%40cs.ubc.ca&amp;requestee=relves%40cs.ubc.ca&amp;do_union=1&amp;group=type">My Requests</a>
+
+ | <a href="votes.cgi?action=show_user">My&nbsp;Votes</a>
+
+ | <a href="relogin.cgi">Log&nbsp;out</a>&nbsp;relves&#64;cs.ubc.ca
+ </div>
+
+ </div>
+
+ <div id="links-edit">
+ <div class="label">Edit:</div>
+ <div class="links">
+
+ <a href="userprefs.cgi">Prefs</a>
+ </div>
+ </div>
+
+
+
+
+ <div id="links-saved">
+
+ <div class="label">
+ Saved&nbsp;Searches:
+ </div>
+ <div class="links">
+ <a href="buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=relves%40cs.ubc.ca&emailtype1=exact&emailassigned_to1=1&emailreporter1=1">My&nbsp;Bugs</a>
+ |
+ <a href="buglist.cgi?cmdtype=runnamed&amp;namedcmd=AssignedToMe">AssignedToMe</a>
+ </div>
+
+ </div>
+
+
+</div>
+</form>
+
+ <div class="outro"></div>
+</div>
+
+</body>
+</html>
diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-220.html b/org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-220.html
new file mode 100644
index 000000000..6e8adde46
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-220.html
@@ -0,0 +1,667 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+ <head>
+ <title>Bug 7 - summary</title>
+
+
+
+
+
+
+ <script type="text/javascript">
+ <!--
+
+ function initHelp() {}
+ // -->
+ </script>
+
+ <link href="skins/standard/global.css" rel="stylesheet" type="text/css">
+ <link href="skins/custom/global.css" rel="stylesheet" type="text/css">
+
+
+
+
+
+ </head>
+
+
+
+ <body onload=""
+ class="you-havent-visited-editparams-cgi-yet bz_bug bz_status_NEW bz_component_TestComponent bz_bug_7">
+
+
+<div id="banner">
+ <div class="intro"></div>
+ <p id="banner-name">
+ <span>This is Bugzilla</span>
+ </p>
+ <p id="banner-version">
+ <a href="http://www.bugzilla.org/"><span>Bugzilla</span></a>
+ <span>Version 2.20</span>
+ </p>
+ <div class="outro"></div>
+ </div>
+
+<div id="header">
+ <h1>Bugzilla Bug 7</h1>
+
+ <h2>summary</h2>
+
+ <h3>Last modified: 2006-02-21 16:34:29</h3>
+</div>
+<i><font color="#777777">First</font></i>
+ <i><font color="#777777">Last</font></i>
+ <i><font color="#777777">Prev</font></i>
+ <i><font color="#777777">Next</font></i>
+ &nbsp;&nbsp;
+ <i><font color="#777777">No search results available</font></i>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="query.cgi">Search page</a>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="enter_bug.cgi">Enter new bug</a>
+
+<hr>
+<script type="text/javascript">
+ <!--
+
+ /* Outputs a link to call replyToComment(); used to reduce HTML output */
+ function addReplyLink(id) {
+ /* XXX this should really be updated to use the DOM Core's
+ * createElement, but finding a container isn't trivial */
+ document.write('[<a href="#add_comment" onclick="replyToComment(' +
+ id + ');">reply<' + '/a>]');
+ }
+
+ /* Adds the reply text to the `comment' textarea */
+ function replyToComment(id) {
+ /* pre id="comment_name_N" */
+ var text_elem = document.getElementById('comment_text_'+id);
+ var text = getText(text_elem);
+
+ /* make sure we split on all newlines -- IE or Moz use \r and \n
+ * respectively */
+ text = text.split(/\r|\n/);
+
+ var replytext = "";
+ for (var i=0; i < text.length; i++) {
+ replytext += "> " + text[i] + "\n";
+ }
+
+ replytext = "(In reply to comment #" + id + ")\n" + replytext + "\n";
+
+
+ /* <textarea id="comment"> */
+ var textarea = document.getElementById('comment');
+ textarea.value += replytext;
+
+ textarea.focus();
+ }
+
+ if (!Node) {
+ /* MSIE doesn't define Node, so provide a compatibility array */
+ var Node = {
+ TEXT_NODE: 3,
+ ENTITY_REFERENCE_NODE: 5
+ };
+ }
+
+ /* Concatenates all text from element's childNodes. This is used
+ * instead of innerHTML because we want the actual text (and
+ * innerText is non-standard) */
+ function getText(element) {
+ var child, text = "";
+ for (var i=0; i < element.childNodes.length; i++) {
+ child = element.childNodes[i];
+ var type = child.nodeType;
+ if (type == Node.TEXT_NODE || type == Node.ENTITY_REFERENCE_NODE) {
+ text += child.nodeValue;
+ } else {
+ /* recurse into nodes of other types */
+ text += getText(child);
+ }
+ }
+ return text;
+ }
+
+
+ //-->
+ </script>
+
+<form name="changeform" method="post" action="process_bug.cgi">
+
+ <input type="hidden" name="delta_ts" value="2006-02-21 16:34:29">
+ <input type="hidden" name="longdesclength" value="2">
+ <input type="hidden" name="id" value="7">
+
+
+
+ <table>
+
+ <tr>
+ <td valign="top">
+ <table cellspacing="1" cellpadding="1">
+
+ <tr>
+ <td align="right">
+ <b>Bug#:</b>
+ </td>
+ <td>
+ <a href="http://you-havent-visited-editparams.cgi-yet/show_bug.cgi?id=7">7</a>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b><u>P</u>roduct:</b>
+ </td><td>
+ <label for="product" accesskey="p">
+ <select name="product" id="product">
+ <option value="TestProduct" selected>TestProduct
+ </option>
+ </select>
+ </label>
+ </td>
+ <td>&nbsp;</td>
+ </tr>
+
+
+
+ <tr>
+ <td align="right">
+ <b>
+ <a href="describecomponents.cgi?product=TestProduct">
+ Co<u>m</u>ponent</a>:
+ </b>
+ </td><td>
+ <label for="component" accesskey="m">
+ <select name="component" id="component">
+ <option value="TestComponent" selected>TestComponent
+ </option>
+ </select>
+ </label>
+ </td>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b>
+ <a href="page.cgi?id=fields.html#status">Status</a>:
+ </b>
+ </td>
+ <td>NEW</td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b>
+ <a href="page.cgi?id=fields.html#resolution">Resolution</a>:
+ </b>
+ </td>
+ <td>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b>
+ <a href="page.cgi?id=fields.html#assigned_to">Assigned&nbsp;To</a>:
+ </b>
+ </td>
+ <td>Robert Elves &lt;relves&#64;cs.ubc.ca&gt;</td>
+ </tr>
+
+ </table>
+
+ </td>
+ <td valign="top">
+
+ <table cellspacing="1" cellpadding="1">
+
+ <tr>
+ <td align="right">
+ <b><u>H</u>ardware:</b>
+ </td><td>
+ <label for="rep_platform" accesskey="h">
+ <select name="rep_platform" id="rep_platform">
+ <option value="All">All
+ </option>
+ <option value="PC" selected>PC
+ </option>
+ <option value="Macintosh">Macintosh
+ </option>
+ <option value="Other">Other
+ </option>
+ </select>
+ </label>
+ </td>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b><u>O</u>S:</b>
+ </td><td>
+ <label for="op_sys" accesskey="o">
+ <select name="op_sys" id="op_sys">
+ <option value="All">All
+ </option>
+ <option value="Windows">Windows
+ </option>
+ <option value="Mac OS">Mac OS
+ </option>
+ <option value="Linux">Linux
+ </option>
+ <option value="Other" selected>Other
+ </option>
+ </select>
+ </label>
+ </td>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b><u>V</u>ersion:</b>
+ </td><td>
+ <label for="version" accesskey="v">
+ <select name="version" id="version">
+ <option value="other" selected>other
+ </option>
+ </select>
+ </label>
+ </td>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b><a href="page.cgi?id=fields.html#priority">Pr<u>i</u>ority</a>:</b>
+ </td><td>
+ <label for="priority" accesskey="i">
+ <select name="priority" id="priority">
+ <option value="P1">P1
+ </option>
+ <option value="P2" selected>P2
+ </option>
+ <option value="P3">P3
+ </option>
+ <option value="P4">P4
+ </option>
+ <option value="P5">P5
+ </option>
+ </select>
+ </label>
+ </td>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b><a href="page.cgi?id=fields.html#bug_severity">S<u>e</u>verity</a>:</b>
+ </td><td>
+ <label for="bug_severity" accesskey="e">
+ <select name="bug_severity" id="bug_severity">
+ <option value="blocker">blocker
+ </option>
+ <option value="critical">critical
+ </option>
+ <option value="major">major
+ </option>
+ <option value="normal" selected>normal
+ </option>
+ <option value="minor">minor
+ </option>
+ <option value="trivial">trivial
+ </option>
+ <option value="enhancement">enhancement
+ </option>
+ </select>
+ </label>
+ </td>
+ <td>&nbsp;</td>
+ </tr>
+
+
+ </table>
+ </td>
+
+ <td valign="top">
+
+ <table cellpadding="1" cellspacing="1">
+
+ <tr>
+ <td align="right">
+ <b>Reporter:</b>
+ </td>
+ <td>
+ <a href="mailto:relves&#64;cs.ubc.ca">Robert Elves &lt;relves&#64;cs.ubc.ca&gt;</a>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right" valign="top">
+ <b><u>A</u>dd&nbsp;CC:</b>
+ </td>
+ <td><input
+ name="newcc"
+ value="" accesskey="a" size="30"
+>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right" valign="top">
+ <b>CC:</b>
+ </td>
+ <td valign="top">
+ <select name="cc" multiple="multiple" size="5">
+ <option value="relves&#64;cs.ubc.ca">relves&#64;cs.ubc.ca</option>
+ </select>
+ <br>
+ <input type="checkbox" name="removecc">Remove selected CCs
+ <br>
+ </td>
+ </tr>
+
+ </table>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <table cellspacing="1" cellpadding="1">
+
+
+
+
+ <tr>
+ <td align="right">
+ <b>
+ <u>U</u>RL:
+ </b>
+ </td>
+ <td colspan="5">
+ <input name="bug_file_loc" accesskey="u"
+ value="" size="60">
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b><u>S</u>ummary:</b>
+ </td>
+ <td colspan="5">
+ <input name="short_desc" accesskey="s"
+ value="summary" size="60">
+ </td>
+ </tr>
+
+
+
+ </table>
+ </td>
+
+ <td valign="top">
+ <table cellspacing="1" cellpadding="1">
+ <tr>
+ <td colspan="2" valign="top">
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+
+
+
+<br>
+<table cellspacing="0" cellpadding="4" border="1">
+ <tr>
+ <th bgcolor="#cccccc" align="left">Attachment</th>
+ <th bgcolor="#cccccc" align="left">Type</th>
+ <th bgcolor="#cccccc" align="left">Created</th>
+ <th bgcolor="#cccccc" align="left">Size</th>
+ <th bgcolor="#cccccc" align="left">Actions</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">
+ <a href="attachment.cgi?bugid=7&amp;action=enter">Create a New Attachment</a> (proposed patch, testcase, etc.)
+ </td>
+ <td class="bz_disabled">
+ View All
+ </td>
+ </tr>
+</table>
+<br>
+
+
+
+ <table>
+ <tr><th align="right">Bug 7 <u>d</u>epends on:</th>
+ <td>
+ </td>
+ <td>
+ <input name="dependson" accesskey="d"
+ value="">
+ </td>
+ <td rowspan="2">
+ <a href="showdependencytree.cgi?id=7">Show
+ dependency tree</a>
+
+ <br>
+ <a href="showdependencygraph.cgi?id=7">Show
+ dependency graph</a>
+ </td>
+ </tr>
+
+ <tr><th align="right">Bug 7 <u>b</u>locks:</th>
+ <td>
+ </td>
+ <td>
+ <input name="blocked" accesskey="b"
+ value="">
+ </td>
+ </tr>
+ </table>
+
+
+
+
+ <br>
+ <b>Additional <u>C</u>omments:</b>
+ <br>
+ <a name="add_comment"></a>
+ <textarea name="comment" id="comment" rows="10" cols="80"
+ accesskey="c"></textarea>
+
+ <br>
+ <label for="addselfcc">
+ <input type="checkbox" id="addselfcc" name="addselfcc">
+ Add to CC list
+ </label>
+ <br>
+
+<br>
+ <input type="radio" id="knob-leave" name="knob" value="none" checked="checked">
+ <label for="knob-leave">
+ Leave as <b>NEW&nbsp;</b>
+ </label>
+ <br>
+
+
+
+ <input type="radio" id="knob-accept" name="knob" value="accept">
+ <label for="knob-accept">
+ Accept bug (change
+ status to <b>ASSIGNED</b>)
+ </label>
+ <br>
+
+
+ <input type="radio" id="knob-resolve" name="knob" value="resolve">
+ <label for="knob-resolve">
+ Resolve bug, changing
+ <a href="page.cgi?id=fields.html#resolution">resolution</a> to
+ </label>
+ <select name="resolution"
+ onchange="document.changeform.knob[2].checked=true">
+ <option value="FIXED">FIXED</option>
+ <option value="INVALID">INVALID</option>
+ <option value="WONTFIX">WONTFIX</option>
+ <option value="LATER">LATER</option>
+ <option value="REMIND">REMIND</option>
+ <option value="WORKSFORME">WORKSFORME</option>
+ </select>
+ <br>
+
+ <input type="radio" id="knob-duplicate" name="knob" value="duplicate">
+ <label for="knob-duplicate">
+ Resolve bug, mark it as duplicate of bug #
+ </label>
+ <input name="dup_id" size="6"
+ onchange="if (this.value != '')
+ {document.changeform.knob[3].checked=true}">
+ <br>
+
+ <input type="radio" id="knob-reassign" name="knob" value="reassign">
+ <label for="knob-reassign">
+ <a href="page.cgi?id=fields.html#assigned_to">Reassign</a> bug to
+ </label><input
+ name="assigned_to"
+ value="relves&#64;cs.ubc.ca" onchange="if ((this.value != 'relves\x40cs.ubc.ca') &amp;&amp; (this.value != '')) {
+ document.changeform.knob[4].checked=true;
+ }" accesskey="b" size="32"
+>
+ <br>
+
+ <input type="radio" id="knob-reassign-cmp" name="knob" value="reassignbycomponent">
+ <label for="knob-reassign-cmp">
+ Reassign bug to default assignee
+ of selected component
+ </label>
+ <br>
+
+ <input type="submit" value="Commit">
+ <input type="hidden" name="form_name" value="process_bug">
+ <p>
+ <font size="+1">
+ <b>
+ <a href="show_activity.cgi?id=7">View Bug Activity</a>
+ &nbsp; | &nbsp;
+ <a href="show_bug.cgi?format=multiple&amp;id=7">Format For Printing</a>
+ &nbsp; | &nbsp;
+ <a href="enter_bug.cgi?cloned_bug_id=7">Clone This Bug</a>
+
+
+ </b>
+ </font>
+
+ </p>
+
+
+
+<hr>
+<div >
+ <table>
+ <tr>
+ <td align="left">
+ <b><a name="c0" href="#c0">Description</a>:</b>&nbsp;&nbsp;<script
+ type="text/javascript"><!--
+ addReplyLink(0);
+ //--></script>
+ </td>
+ <td align="left" width="30%">
+ <b>Opened:</b> 2006-02-13 17:02
+ </td>
+ </tr>
+ </table>
+
+
+
+<pre id="comment_text_0">test summary
+</pre>
+ </div>
+ <div >
+ <br>
+ <span class="bz_comment">
+ ------- <i>Comment
+ <a name="c1" href="#c1">#1</a> From
+ <a href="mailto:relves&#64;cs.ubc.ca">Robert Elves</a>
+ 2006-02-21 16:34
+ </i>
+ <script type="text/javascript"><!--
+ addReplyLink(1); //--></script>
+ -------
+ </span>
+
+
+
+<pre id="comment_text_1">out
+</pre>
+ </div>
+
+</form>
+
+<hr>
+<i><font color="#777777">First</font></i>
+ <i><font color="#777777">Last</font></i>
+ <i><font color="#777777">Prev</font></i>
+ <i><font color="#777777">Next</font></i>
+ &nbsp;&nbsp;
+ <i><font color="#777777">No search results available</font></i>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="query.cgi">Search page</a>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="enter_bug.cgi">Enter new bug</a>
+
+<br>
+<div id="footer">
+ <div class="intro"></div>
+
+
+
+
+<form method="get" action="show_bug.cgi">
+<div id="useful-links">
+ <div id="links-actions">
+ <div class="label">Actions:</div>
+ <div class="links">
+ <a href="./">Home</a> |
+ <a href="enter_bug.cgi">New</a> |
+ <a href="query.cgi">Search</a> |
+ bug # <input class="txt" name="id" size="6">
+ <input class="btn" type="submit" value="Find"> |
+
+ <a href="report.cgi">Reports</a>
+
+ | <a href="request.cgi">Requests</a>
+
+
+ | <a href="createaccount.cgi">New&nbsp;Account</a>
+ | <a href="index.cgi?GoAheadAndLogIn=1">Log&nbsp;In</a>
+ </div>
+ </div>
+
+
+
+
+
+ <div id="links-saved">
+ <div class="label">
+ </div>
+ <div class="links">
+
+ </div>
+ </div>
+
+
+</div>
+</form>
+
+ <div class="outro"></div>
+</div>
+
+</body>
+</html> \ No newline at end of file
diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-2201.html b/org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-2201.html
new file mode 100644
index 000000000..f93d6a5c8
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-2201.html
@@ -0,0 +1,859 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+ <head>
+ <title>Bug 125527 - bugzilla refresh incorrect for new reports and newly opened hits</title>
+
+
+
+
+
+
+ <script type="text/javascript">
+ <!--
+
+ function initHelp() {}
+ // -->
+ </script>
+
+ <link href="skins/standard/global.css" rel="stylesheet" type="text/css">
+ <link href="skins/custom/global.css" rel="stylesheet" type="text/css">
+
+
+
+
+
+ </head>
+
+
+
+ <body onload=""
+ class="bugs-eclipse-org-bugs bz_bug bz_status_RESOLVED bz_component_Bugzilla bz_bug_125527">
+
+
+<!-- 1.0@bugzilla.org -->
+
+
+
+
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr style="background-image: url(/bugs/header_bg.gif);">
+ <td>
+ <a href="http://www.eclipse.org/"><img src="/bugs/header_logo.gif" width="164" height="68" border="0" /></a>
+ </td>
+ <td align="right" style="color: white; font-family: verdana,arial,helvetica; font-size: 1.25em; font-style: italic;"><b>Eclipse bugs</b></font> <br /><font style="font-size: .5em;">Bugzilla 2.20.1 &#160;</font></td>
+ </tr>
+</table>
+
+<div id="header">
+ <h1>Bugzilla Bug 125527</h1>
+
+ <h2>bugzilla refresh incorrect for new reports and newly opened hits</h2>
+
+ <h3>Last modified: 2006-01-27 21:30:34</h3>
+</div>
+<i><font color="#777777">First</font></i>
+ <i><font color="#777777">Last</font></i>
+ <i><font color="#777777">Prev</font></i>
+ <i><font color="#777777">Next</font></i>
+ &nbsp;&nbsp;
+ <i><font color="#777777">No search results available</font></i>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="query.cgi">Search page</a>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="enter_bug.cgi">Enter new bug</a>
+
+<hr>
+<script type="text/javascript">
+ <!--
+
+ /* Outputs a link to call replyToComment(); used to reduce HTML output */
+ function addReplyLink(id) {
+ /* XXX this should really be updated to use the DOM Core's
+ * createElement, but finding a container isn't trivial.
+ */
+ document.write('[<a href="#add_comment" onclick="replyToComment(' +
+ id + ');">reply<' + '/a>]');
+ }
+
+ /* Adds the reply text to the `comment' textarea */
+ function replyToComment(id) {
+ /* pre id="comment_name_N" */
+ var text_elem = document.getElementById('comment_text_'+id);
+ var text = getText(text_elem);
+
+ /* make sure we split on all newlines -- IE or Moz use \r and \n
+ * respectively.
+ */
+ text = text.split(/\r|\n/);
+
+ var replytext = "";
+ for (var i=0; i < text.length; i++) {
+ replytext += "> " + text[i] + "\n";
+ }
+
+ replytext = "(In reply to comment #" + id + ")\n" + replytext + "\n";
+
+
+ /* <textarea id="comment"> */
+ var textarea = document.getElementById('comment');
+ textarea.value += replytext;
+
+ textarea.focus();
+ }
+
+ if (typeof Node == 'undefined') {
+ /* MSIE doesn't define Node, so provide a compatibility object */
+ window.Node = {
+ TEXT_NODE: 3,
+ ENTITY_REFERENCE_NODE: 5
+ };
+ }
+
+ /* Concatenates all text from element's childNodes. This is used
+ * instead of innerHTML because we want the actual text (and
+ * innerText is non-standard).
+ */
+ function getText(element) {
+ var child, text = "";
+ for (var i=0; i < element.childNodes.length; i++) {
+ child = element.childNodes[i];
+ var type = child.nodeType;
+ if (type == Node.TEXT_NODE || type == Node.ENTITY_REFERENCE_NODE) {
+ text += child.nodeValue;
+ } else {
+ /* recurse into nodes of other types */
+ text += getText(child);
+ }
+ }
+ return text;
+ }
+
+
+ //-->
+ </script>
+
+<form name="changeform" method="post" action="process_bug.cgi">
+
+ <input type="hidden" name="delta_ts" value="2006-01-27 21:30:34">
+ <input type="hidden" name="longdesclength" value="2">
+ <input type="hidden" name="id" value="125527">
+
+
+
+ <table>
+
+ <tr>
+ <td valign="top">
+ <table cellspacing="1" cellpadding="1">
+
+ <tr>
+ <td align="right">
+ <b>[Technology]</b>
+ <b>Bug#:</b>
+ </td>
+ <td>
+ <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=125527">125527</a>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b><u>P</u>roduct:</b>
+ </td><td>
+ <label for="product" accesskey="p">
+ <select name="product" id="product">
+ <option value="AJDT">AJDT
+ </option>
+ <option value="ALF">ALF
+ </option>
+ <option value="AspectJ">AspectJ
+ </option>
+ <option value="BIRT">BIRT
+ </option>
+ <option value="BPEL">BPEL
+ </option>
+ <option value="Buckminster">Buckminster
+ </option>
+ <option value="CDT">CDT
+ </option>
+ <option value="Community">Community
+ </option>
+ <option value="Dali">Dali
+ </option>
+ <option value="Dash">Dash
+ </option>
+ <option value="Data Tools">Data Tools
+ </option>
+ <option value="DSDP">DSDP
+ </option>
+ <option value="ECF">ECF
+ </option>
+ <option value="EMF">EMF
+ </option>
+ <option value="EMFT">EMFT
+ </option>
+ <option value="EPF">EPF
+ </option>
+ <option value="Equinox">Equinox
+ </option>
+ <option value="ERCP">ERCP
+ </option>
+ <option value="GEF">GEF
+ </option>
+ <option value="GMF">GMF
+ </option>
+ <option value="GMT">GMT
+ </option>
+ <option value="Higgins">Higgins
+ </option>
+ <option value="Hyades">Hyades
+ </option>
+ <option value="Java Server Faces">Java Server Faces
+ </option>
+ <option value="JDT">JDT
+ </option>
+ <option value="JSR220-ORM">JSR220-ORM
+ </option>
+ <option value="Laszlo">Laszlo
+ </option>
+ <option value="Lepido">Lepido
+ </option>
+ <option value="MDDi">MDDi
+ </option>
+ <option value="MTJ">MTJ
+ </option>
+ <option value="Mylar" selected>Mylar
+ </option>
+ <option value="OHF">OHF
+ </option>
+ <option value="PDE">PDE
+ </option>
+ <option value="Phoenix">Phoenix
+ </option>
+ <option value="Photran">Photran
+ </option>
+ <option value="Platform">Platform
+ </option>
+ <option value="PTP">PTP
+ </option>
+ <option value="SOA">SOA
+ </option>
+ <option value="Target Management">Target Management
+ </option>
+ <option value="TPTP">TPTP
+ </option>
+ <option value="UML2">UML2
+ </option>
+ <option value="VE">VE
+ </option>
+ <option value="VTP">VTP
+ </option>
+ <option value="Web Tools">Web Tools
+ </option>
+ <option value="XSD">XSD
+ </option>
+ </select>
+ </label>
+ </td>
+ <td>&nbsp;</td>
+ </tr>
+
+
+
+ <tr>
+ <td align="right">
+ <b>
+ <a href="describecomponents.cgi?product=Mylar">
+ Co<u>m</u>ponent</a>:
+ </b>
+ </td><td>
+ <label for="component" accesskey="m">
+ <select name="component" id="component">
+ <option value="Bugzilla" selected>Bugzilla
+ </option>
+ <option value="Core">Core
+ </option>
+ <option value="Doc">Doc
+ </option>
+ <option value="Java">Java
+ </option>
+ <option value="Jira">Jira
+ </option>
+ <option value="Monitor">Monitor
+ </option>
+ <option value="Tasks">Tasks
+ </option>
+ <option value="UI">UI
+ </option>
+ <option value="XML">XML
+ </option>
+ <option value="Zest">Zest
+ </option>
+ </select>
+ </label>
+ </td>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b>
+ <a href="page.cgi?id=fields.html#status">Status</a>:
+ </b>
+ </td>
+ <td>RESOLVED</td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b>
+ <a href="page.cgi?id=fields.html#resolution">Resolution</a>:
+ </b>
+ </td>
+ <td>FIXED
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b>
+ <a href="page.cgi?id=fields.html#assigned_to">Assigned&nbsp;To</a>:
+ </b>
+ </td>
+ <td>Robert Elves &lt;relves&#64;cs.ubc.ca&gt;</td>
+ </tr>
+
+ </table>
+
+ </td>
+ <td valign="top">
+
+ <table cellspacing="1" cellpadding="1">
+
+ <tr>
+ <td align="right">
+ <b><u>H</u>ardware:</b>
+ </td><td>
+ <label for="rep_platform" accesskey="h">
+ <select name="rep_platform" id="rep_platform">
+ <option value="All">All
+ </option>
+ <option value="Macintosh">Macintosh
+ </option>
+ <option value="Other">Other
+ </option>
+ <option value="PC" selected>PC
+ </option>
+ <option value="Power PC">Power PC
+ </option>
+ <option value="Sun">Sun
+ </option>
+ </select>
+ </label>
+ </td>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b><u>O</u>S:</b>
+ </td><td>
+ <label for="op_sys" accesskey="o">
+ <select name="op_sys" id="op_sys">
+ <option value="All">All
+ </option>
+ <option value="AIX Motif">AIX Motif
+ </option>
+ <option value="HP-UX">HP-UX
+ </option>
+ <option value="Linux">Linux
+ </option>
+ <option value="Linux-GTK">Linux-GTK
+ </option>
+ <option value="Linux-Motif">Linux-Motif
+ </option>
+ <option value="Mac OS">Mac OS
+ </option>
+ <option value="MacOS X">MacOS X
+ </option>
+ <option value="Neutrino">Neutrino
+ </option>
+ <option value="other">other
+ </option>
+ <option value="QNX-Photon">QNX-Photon
+ </option>
+ <option value="Solaris">Solaris
+ </option>
+ <option value="Solaris-GTK">Solaris-GTK
+ </option>
+ <option value="Solaris-Motif">Solaris-Motif
+ </option>
+ <option value="SymbianOS-Series 80">SymbianOS-Series 80
+ </option>
+ <option value="Unix All">Unix All
+ </option>
+ <option value="Windows All" selected>Windows All
+ </option>
+ <option value="Windows 95">Windows 95
+ </option>
+ <option value="Windows 98">Windows 98
+ </option>
+ <option value="Windows 2000">Windows 2000
+ </option>
+ <option value="Windows 2003 Server">Windows 2003 Server
+ </option>
+ <option value="Windows CE">Windows CE
+ </option>
+ <option value="Windows ME">Windows ME
+ </option>
+ <option value="Windows Mobile 2003">Windows Mobile 2003
+ </option>
+ <option value="Windows NT">Windows NT
+ </option>
+ <option value="Windows XP">Windows XP
+ </option>
+ </select>
+ </label>
+ </td>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b>Version:</b>
+ </td><td>
+ <label for="version" accesskey="o">
+ <select name="version" id="version">
+ <option value="0.2">0.2
+ </option>
+ <option value="0.3">0.3
+ </option>
+ <option value="0.4">0.4
+ </option>
+ <option value="unspecified" selected>unspecified
+ </option>
+ </select>
+ </label>
+ </td>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b><a href="page.cgi?id=fields.html#priority">Pr<u>i</u>ority</a>:</b>
+ </td><td>
+ <label for="priority" accesskey="i">
+ <select name="priority" id="priority">
+ <option value="P1" selected>P1
+ </option>
+ <option value="P2">P2
+ </option>
+ <option value="P3">P3
+ </option>
+ <option value="P4">P4
+ </option>
+ <option value="P5">P5
+ </option>
+ </select>
+ </label>
+ </td>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b><a href="page.cgi?id=fields.html#bug_severity">Severity</a>:</b>
+ </td><td>
+ <label for="bug_severity" accesskey="i">
+ <select name="bug_severity" id="bug_severity">
+ <option value="blocker">blocker
+ </option>
+ <option value="critical">critical
+ </option>
+ <option value="major">major
+ </option>
+ <option value="normal" selected>normal
+ </option>
+ <option value="minor">minor
+ </option>
+ <option value="trivial">trivial
+ </option>
+ <option value="enhancement">enhancement
+ </option>
+ </select>
+ </label>
+ </td>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b>
+ Target Milestone:
+ </b>
+ </td><td>
+ <label for="target_milestone" accesskey="i">
+ <select name="target_milestone" id="target_milestone">
+ <option value="---" selected>---
+ </option>
+ <option value="0.5">0.5
+ </option>
+ <option value="0.6">0.6
+ </option>
+ </select>
+ </label>
+ </td>
+ <td>&nbsp;</td>
+ </tr>
+
+ </table>
+ </td>
+
+ <td valign="top">
+
+ <table cellpadding="1" cellspacing="1">
+
+ <tr>
+ <td align="right">
+ <b>Reporter:</b>
+ </td>
+ <td>
+ <a href="mailto:beatmik&#64;acm.org">Mik Kersten &lt;beatmik&#64;acm.org&gt;</a>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right" valign="top">
+ <b><u>A</u>dd&nbsp;CC:</b>
+ </td>
+ <td><input
+ name="newcc"
+ value="" accesskey="a" size="30"
+>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right" valign="top">
+ <b>CC:</b>
+ </td>
+ <td valign="top">
+ <select name="cc" multiple="multiple" size="5">
+ <option value="beatmik&#64;acm.org">beatmik&#64;acm.org</option>
+ </select>
+ <br>
+ <input type="checkbox" name="removecc">Remove selected CCs
+ <br>
+ </td>
+ </tr>
+
+ </table>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <table cellspacing="1" cellpadding="1">
+
+
+
+ <tr>
+ <td align="right">
+ <b><u>Q</u>A Contact:</b>
+ </td>
+ <td colspan="7"><input
+ name="qa_contact"
+ value="" accesskey="q" size="60"
+>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b>
+ <u>U</u>RL:
+ </b>
+ </td>
+ <td colspan="5">
+ <input name="bug_file_loc" accesskey="u"
+ value="" size="60">
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b><u>S</u>ummary:</b>
+ </td>
+ <td colspan="5">
+ <input name="short_desc" accesskey="s"
+ value="bugzilla refresh incorrect for new reports and newly opened hits" size="60">
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b>Status <u>W</u>hiteboard:</b>
+ </td>
+ <td colspan="5">
+ <input name="status_whiteboard" accesskey="w"
+ value="" size="60">
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b>
+ <a href="describekeywords.cgi"><u>K</u>eywords</a>:
+ </b>
+ <td colspan="5">
+ <input name="keywords" accesskey="k"
+ value="" size="60">
+ </td>
+ </tr>
+
+ </table>
+ </td>
+
+ <td valign="top">
+ <table cellspacing="1" cellpadding="1">
+ <tr>
+ <td colspan="2" valign="top">
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+
+
+
+<br>
+<table cellspacing="0" cellpadding="4" border="1">
+ <tr>
+ <th bgcolor="#cccccc" align="left">Attachment</th>
+ <th bgcolor="#cccccc" align="left">Type</th>
+ <th bgcolor="#cccccc" align="left">Created</th>
+ <th bgcolor="#cccccc" align="left">Size</th>
+ <th bgcolor="#cccccc" align="left">Actions</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">
+ <a href="attachment.cgi?bugid=125527&amp;action=enter">Create a New Attachment</a> (proposed patch, testcase, etc.)
+ </td>
+ <td class="bz_disabled">
+ View All
+ </td>
+ </tr>
+</table>
+<br>
+
+
+
+ <table>
+ <tr><th align="right">Bug 125527 depends on:</th>
+ <td>
+ </td>
+ <td>
+ <input name="dependson" accesskey="i"
+ value="">
+ </td>
+ <td rowspan="2">
+ <a href="showdependencytree.cgi?id=125527">Show
+ dependency tree</a>
+
+ </td>
+ </tr>
+
+ <tr><th align="right">Bug 125527 <u>b</u>locks:</th>
+ <td>
+ </td>
+ <td>
+ <input name="blocked" accesskey="b"
+ value="">
+ </td>
+ </tr>
+ </table>
+
+ <table>
+ <tr>
+ <th>
+ <a href="page.cgi?id=voting.html">Votes</a>:
+ </th>
+ <td>0&nbsp;&nbsp;&nbsp;
+ <a href="votes.cgi?action=show_bug&amp;bug_id=125527">Show
+ votes for this bug</a>&nbsp;&nbsp;&nbsp;
+ <a href="votes.cgi?action=show_user&amp;bug_id=125527#vote_125527">Vote
+ for this bug</a>
+ </td>
+ </tr>
+ </table>
+
+
+
+ <br>
+ <b>Additional <u>C</u>omments:</b>
+ <br>
+ <a name="add_comment"></a>
+ <textarea name="comment" id="comment" rows="10" cols="80"
+ accesskey="c"></textarea>
+
+ <br>
+ <label for="addselfcc">
+ <input type="checkbox" id="addselfcc" name="addselfcc">
+ Add to CC list
+ </label>
+ <br>
+
+<br>
+ <input type="radio" id="knob-leave" name="knob" value="none" checked="checked">
+ <label for="knob-leave">
+ Leave as <b>RESOLVED&nbsp;FIXED</b>
+ </label>
+ <br>
+
+
+
+
+ <input type="radio" id="knob-reopen" name="knob" value="reopen">
+ <label for="knob-reopen">
+ Reopen bug
+ </label>
+ <br>
+ <input type="radio" id="knob-verify" name="knob" value="verify">
+ <label for="knob-verify">
+ Mark bug as <b>VERIFIED</b>
+ </label>
+ <br>
+ <input type="radio" id="knob-close" name="knob" value="close">
+ <label for="knob-close">
+ Mark bug as <b>CLOSED</b>
+ </label>
+ <br>
+
+ <input type="submit" value="Commit">
+ <input type="hidden" name="form_name" value="process_bug">
+ <p>
+ <font size="+1">
+ <b>
+ <a href="show_activity.cgi?id=125527">View Bug Activity</a>
+ &nbsp; | &nbsp;
+ <a href="show_bug.cgi?format=multiple&amp;id=125527">Format For Printing</a>
+ &nbsp; | &nbsp;
+ <a href="enter_bug.cgi?cloned_bug_id=125527">Clone This Bug</a>
+
+
+ </b>
+ </font>
+
+ </p>
+
+
+
+<hr>
+<div >
+ <table>
+ <tr>
+ <td align="left">
+ <b><a name="c0" href="show_bug.cgi?id=125527#c0">
+ Description</a>:</b>&nbsp;&nbsp;<script type="text/javascript"><!--
+ addReplyLink(0);
+ //--></script>
+ </td>
+ <td align="left" width="30%">
+ <b>Opened:</b> 2006-01-27 13:36
+ </td>
+ </tr>
+ </table>
+
+
+
+<pre id="comment_text_0">After bug report is added, description is always blank, and it's opened in
+wrong editor (ExistingBugEditor, not MylarTaskEditor).
+
+After hit is opened and becomes a task, task stays italic.
+</pre>
+ </div>
+ <div >
+ <br>
+ <span class="bz_comment">
+ ------- <i>Comment
+ <a name="c1" href="show_bug.cgi?id=125527#c1">
+ #1</a> From
+ <a href="mailto:beatmik&#64;acm.org">Mik Kersten</a>
+ 2006-01-27 21:30
+ </i>
+ <script type="text/javascript"><!--
+ addReplyLink(1); //--></script>
+ -------
+ </span>
+
+
+
+<pre id="comment_text_1">Done.
+</pre>
+ </div>
+
+</form>
+
+<hr>
+<i><font color="#777777">First</font></i>
+ <i><font color="#777777">Last</font></i>
+ <i><font color="#777777">Prev</font></i>
+ <i><font color="#777777">Next</font></i>
+ &nbsp;&nbsp;
+ <i><font color="#777777">No search results available</font></i>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="query.cgi">Search page</a>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="enter_bug.cgi">Enter new bug</a>
+
+<br>
+<div id="footer">
+ <div class="intro"></div>
+
+
+
+
+<form method="get" action="show_bug.cgi">
+<div id="useful-links">
+ <div id="links-actions">
+ <div class="label">Actions:</div>
+ <div class="links">
+ <a href="./">Home</a> |
+ <a href="enter_bug.cgi">New</a> |
+ <a href="query.cgi">Search</a> |
+ bug # <input class="txt" name="id" size="6">
+ <input class="btn" type="submit" value="Find"> |
+
+ <a href="report.cgi">Reports</a>
+
+ | <a href="request.cgi">Requests</a>
+
+
+ | <a href="createaccount.cgi">New&nbsp;Account</a>
+ | <a href="index.cgi?GoAheadAndLogIn=1">Log&nbsp;In</a>
+ </div>
+ </div>
+
+
+
+
+
+ <div id="links-saved">
+ <div class="label">
+ </div>
+ <div class="links">
+
+ </div>
+ </div>
+
+
+</div>
+</form>
+
+ <div class="outro"></div>
+</div>
+
+</body>
+</html> \ No newline at end of file
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/actions/NewRepositoryTaskAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/actions/NewRepositoryTaskAction.java
new file mode 100644
index 000000000..e38bde8f5
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/actions/NewRepositoryTaskAction.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.mylar.internal.tasklist.ui.actions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.mylar.internal.tasklist.TaskListPreferenceConstants;
+import org.eclipse.mylar.internal.tasklist.ui.wizards.MultiRepositoryAwareWizard;
+import org.eclipse.mylar.internal.tasklist.ui.wizards.NewRepositoryTaskPage;
+import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryConnector;
+import org.eclipse.mylar.provisional.tasklist.MylarTaskListPlugin;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author Mik Kersten and Ken Sueda
+ */
+public class NewRepositoryTaskAction extends Action implements IViewActionDelegate {
+
+ public static final String ID = "org.eclipse.mylar.tasklist.ui.repositories.actions.create";
+
+ @Override
+ public void run() {
+
+ boolean offline = MylarTaskListPlugin.getPrefs().getBoolean(TaskListPreferenceConstants.WORK_OFFLINE);
+ if (offline) {
+ MessageDialog.openInformation(null, "Unable to create bug report",
+ "Unable to create a new bug report since you are currently offline");
+ return;
+ }
+ // TaskRepository repository =
+ // MylarTaskListPlugin.getRepositoryManager().getDefaultRepository(BugzillaPlugin.REPOSITORY_KIND);
+ List<String> connectorKinds = new ArrayList<String>();
+ for (AbstractRepositoryConnector client: MylarTaskListPlugin.getRepositoryManager().getRepositoryClients()) {
+ if (client.canCreateTaskFromId()) {
+ connectorKinds.add(client.getRepositoryType());
+ }
+ }
+
+ IWizard wizard = new MultiRepositoryAwareWizard(new NewRepositoryTaskPage(connectorKinds));
+
+ Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+ if (wizard != null && shell != null && !shell.isDisposed()) {
+
+ WizardDialog dialog = new WizardDialog(shell, wizard);
+ dialog.setBlockOnOpen(true);
+ dialog.open();
+
+ } else {
+ // TODO handle not good
+ }
+ }
+
+ public void init(IViewPart view) {
+
+ }
+
+ public void run(IAction action) {
+ run();
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+
+ }
+}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/NewRepositoryTaskPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/NewRepositoryTaskPage.java
new file mode 100644
index 000000000..3ed78aae2
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/NewRepositoryTaskPage.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.mylar.internal.tasklist.ui.wizards;
+
+import java.util.List;
+
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryConnector;
+import org.eclipse.mylar.provisional.tasklist.MylarTaskListPlugin;
+import org.eclipse.mylar.provisional.tasklist.TaskRepository;
+
+/**
+ * @author Mik Kersten
+ */
+public class NewRepositoryTaskPage extends SelectRepositoryPage {
+
+ public NewRepositoryTaskPage(List<String> kinds) {
+ super(kinds);
+ }
+
+ @Override
+ protected IWizard createWizard(TaskRepository taskRepository) {
+ AbstractRepositoryConnector connector = MylarTaskListPlugin.getRepositoryManager().getRepositoryClient(
+ taskRepository.getKind());
+ return connector.getNewTaskWizard(taskRepository);
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/provisional/tasklist/AbstractRepositoryConnector.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/provisional/tasklist/AbstractRepositoryConnector.java
new file mode 100644
index 000000000..17528b384
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/provisional/tasklist/AbstractRepositoryConnector.java
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.mylar.provisional.tasklist;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.jobs.IJobChangeListener;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.mylar.internal.tasklist.ui.wizards.AbstractRepositorySettingsPage;
+
+/**
+ * @author Mik Kersten
+ */
+public abstract class AbstractRepositoryConnector {
+
+ private static final int MAX_REFRESH_JOBS = 5;
+
+ private List<AbstractRepositoryTask> toBeRefreshed = new LinkedList<AbstractRepositoryTask>();
+
+ private Map<AbstractRepositoryTask, Job> currentlyRefreshing = new HashMap<AbstractRepositoryTask, Job>();
+
+ public abstract boolean canCreateTaskFromId();
+
+ public abstract boolean canCreateNewTask();
+
+ public void requestRefresh(AbstractRepositoryTask task) {
+ if (!currentlyRefreshing.containsKey(task) && !toBeRefreshed.contains(task)) {
+ toBeRefreshed.add(task);
+ }
+ updateRefreshState();
+ }
+
+ public void removeTaskToBeRefreshed(AbstractRepositoryTask task) {
+ toBeRefreshed.remove(task);
+ if (currentlyRefreshing.get(task) != null) {
+ currentlyRefreshing.get(task).cancel();
+ currentlyRefreshing.remove(task);
+ }
+ updateRefreshState();
+ }
+
+ public void removeRefreshingTask(AbstractRepositoryTask task) {
+ if (currentlyRefreshing.containsKey(task)) {
+ currentlyRefreshing.remove(task);
+ }
+ updateRefreshState();
+ }
+
+ public void clearAllRefreshes() {
+ toBeRefreshed.clear();
+ List<Job> l = new ArrayList<Job>();
+ l.addAll(currentlyRefreshing.values());
+ for (Job j : l) {
+ if (j != null)
+ j.cancel();
+ }
+ currentlyRefreshing.clear();
+ }
+
+ private void updateRefreshState() {
+ if (currentlyRefreshing.size() < MAX_REFRESH_JOBS && toBeRefreshed.size() > 0) {
+ AbstractRepositoryTask bugzillaTask = toBeRefreshed.remove(0);
+ Job refreshJob = synchronize(bugzillaTask, true, null);
+ if (refreshJob != null) {
+ currentlyRefreshing.put(bugzillaTask, refreshJob);
+ }
+ }
+ }
+
+ public abstract String getLabel();
+
+ /**
+ * @return the unique type of the repository, e.g. "bugzilla"
+ */
+ public abstract String getRepositoryType();
+
+ /**
+ * @param id
+ * identifier, e.g. "123" bug Bugzilla bug 123
+ * @return null if task could not be created
+ */
+ public abstract ITask createTaskFromExistingId(TaskRepository repository, String id);
+
+ /**
+ * Synchronize state with the repository (e.g. queries, task contents)
+ */
+ public abstract void synchronize();
+
+ /**
+ * @param listener can be null
+ * @return TODO
+ */
+ public abstract Job synchronize(ITask task, boolean forceUpdate, IJobChangeListener listener);
+
+ public abstract void synchronize(AbstractRepositoryQuery repositoryQuery);
+
+ public abstract AbstractRepositorySettingsPage getSettingsPage();
+
+ public abstract IWizard getQueryWizard(TaskRepository repository);
+
+ public abstract void openEditQueryDialog(AbstractRepositoryQuery query);
+
+ public abstract IWizard getAddExistingTaskWizard(TaskRepository repository);
+
+ public abstract IWizard getNewTaskWizard(TaskRepository taskRepository);
+
+}

Back to the top