Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 39378 Details for
Bug 136219
convert bug parser to use xml and rdf sources
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Progress: Bugzilla server configuration retrieved from rdf.
patch136219-1.txt (text/plain), 68.49 KB, created by
Robert Elves
on 2006-04-24 20:55:07 EDT
(
hide
)
Description:
Progress: Bugzilla server configuration retrieved from rdf.
Filename:
MIME Type:
Creator:
Robert Elves
Created:
2006-04-24 20:55:07 EDT
Size:
68.49 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylar.bugzilla.core >Index: src/org/eclipse/mylar/internal/bugzilla/core/BugzillaRepositoryUtil.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.bugzilla.core/src/org/eclipse/mylar/internal/bugzilla/core/BugzillaRepositoryUtil.java,v >retrieving revision 1.12 >diff -u -r1.12 BugzillaRepositoryUtil.java >--- src/org/eclipse/mylar/internal/bugzilla/core/BugzillaRepositoryUtil.java 29 Mar 2006 00:55:09 -0000 1.12 >+++ src/org/eclipse/mylar/internal/bugzilla/core/BugzillaRepositoryUtil.java 25 Apr 2006 00:38:03 -0000 >@@ -26,7 +26,6 @@ > import java.security.KeyManagementException; > import java.security.NoSuchAlgorithmException; > import java.util.ArrayList; >-import java.util.Arrays; > import java.util.HashMap; > import java.util.List; > >@@ -44,7 +43,6 @@ > import org.apache.commons.httpclient.params.HttpMethodParams; > import org.eclipse.core.runtime.IProgressMonitor; > import org.eclipse.core.runtime.IStatus; >-import org.eclipse.core.runtime.NullProgressMonitor; > import org.eclipse.core.runtime.Status; > import org.eclipse.jface.dialogs.MessageDialog; > import org.eclipse.jface.preference.IPreferenceStore; >@@ -55,7 +53,8 @@ > import org.eclipse.mylar.internal.bugzilla.core.internal.BugParser; > import org.eclipse.mylar.internal.bugzilla.core.internal.NewBugParser; > import org.eclipse.mylar.internal.bugzilla.core.internal.OfflineReportsFile; >-import org.eclipse.mylar.internal.bugzilla.core.search.BugzillaQueryPageParser; >+import org.eclipse.mylar.internal.bugzilla.core.internal.ProductConfiguration; >+import org.eclipse.mylar.internal.bugzilla.core.internal.ServerConfigurationFactory; > import org.eclipse.mylar.internal.core.util.MylarStatusHandler; > import org.eclipse.mylar.provisional.tasklist.MylarTaskListPlugin; > import org.eclipse.mylar.provisional.tasklist.TaskRepository; >@@ -211,54 +210,16 @@ > * LoginException Exception > */ > public static List<String> getProductList(TaskRepository repository) throws IOException, LoginException, Exception { >- // BufferedReader in = null; >- // try { >- // repository = >- // MylarTaskListPlugin.getRepositoryManager().getRepository( >- // BugzillaPlugin.REPOSITORY_KIND, repositoryUrl); >- // String urlText = ""; >- // if (repository.hasCredentials()) { >- // urlText += POST_ARGS_LOGIN_FIRST >- // + URLEncoder.encode(repository.getUserName(), >- // BugzillaPlugin.ENCODING_UTF_8) >- // + POST_ARGS_PASSWORD >- // + URLEncoder.encode(repository.getPassword(), >- // BugzillaPlugin.ENCODING_UTF_8); >- // } >- // >- // URL url = new URL(repository.getUrl() + "/enter_bug.cgi" + urlText); >- // >- // URLConnection cntx = >- // BugzillaPlugin.getDefault().getUrlConnection(url); >- // if (cntx != null) { >- // InputStream input = cntx.getInputStream(); >- // if (input != null) { >- // in = new BufferedReader(new InputStreamReader(input)); >- // >- // >- // >- // return new ProductParser(in).getProducts(repository); >- // } >- // } >- >- BugzillaQueryPageParser parser = new BugzillaQueryPageParser(repository, new NullProgressMonitor()); >- if (!parser.wasSuccessful()) { >- throw new RuntimeException("Couldn't get products"); >- } else { >- return Arrays.asList(parser.getProductValues()); >- } >- >- // return null; >- // } finally { >- // try { >- // if (in != null) >- // in.close(); >- // } catch (IOException e) { >- // BugzillaPlugin.log(new Status(IStatus.ERROR, >- // IBugzillaConstants.PLUGIN_ID, IStatus.ERROR, >- // "Problem closing the stream", e)); >- // } >- // } >+ >+ return BugzillaPlugin.getDefault().getProductConfiguration(repository.getUrl()).getProducts(); >+ >+// BugzillaQueryPageParser parser = new BugzillaQueryPageParser(repository, new NullProgressMonitor()); >+// if (!parser.wasSuccessful()) { >+// throw new RuntimeException("Couldn't get products"); >+// } else { >+// return Arrays.asList(parser.getProductValues()); >+// } >+ > } > > /** >@@ -346,10 +307,10 @@ > Attribute a = new Attribute("Severity"); > a.setParameterName("bug_severity"); > // get optionValues from ProductConfiguration >- String[] optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getSeverities(); >+ List<String> optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getSeverities(); > // add option values from ProductConfiguration to Attribute optionValues >- for (int i = 0; i < optionValues.length; i++) { >- a.addOptionValue(optionValues[i], optionValues[i]); >+ for (String option: optionValues) { >+ a.addOptionValue(option, option); > } > // add Attribute to model > attributes.put("severites", a); >@@ -358,8 +319,8 @@ > a = new Attribute("OS"); > a.setParameterName("op_sys"); > optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getOSs(); >- for (int i = 0; i < optionValues.length; i++) { >- a.addOptionValue(optionValues[i], optionValues[i]); >+ for (String option: optionValues) { >+ a.addOptionValue(option, option); > } > attributes.put("OSs", a); > >@@ -367,8 +328,8 @@ > a = new Attribute("Platform"); > a.setParameterName("rep_platform"); > optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getPlatforms(); >- for (int i = 0; i < optionValues.length; i++) { >- a.addOptionValue(optionValues[i], optionValues[i]); >+ for (String option: optionValues) { >+ a.addOptionValue(option, option); > } > attributes.put("platforms", a); > >@@ -376,8 +337,8 @@ > a = new Attribute("Version"); > a.setParameterName("version"); > optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getVersions(model.getProduct()); >- for (int i = 0; i < optionValues.length; i++) { >- a.addOptionValue(optionValues[i], optionValues[i]); >+ for (String option: optionValues) { >+ a.addOptionValue(option, option); > } > attributes.put("versions", a); > >@@ -385,8 +346,8 @@ > a = new Attribute("Component"); > a.setParameterName("component"); > optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getComponents(model.getProduct()); >- for (int i = 0; i < optionValues.length; i++) { >- a.addOptionValue(optionValues[i], optionValues[i]); >+ for (String option: optionValues) { >+ a.addOptionValue(option, option); > } > attributes.put("components", a); > >@@ -394,8 +355,8 @@ > a = new Attribute("Priority"); > a.setParameterName("bug_severity"); > optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getPriorities(); >- for (int i = 0; i < optionValues.length; i++) { >- a.addOptionValue(optionValues[i], optionValues[i]); >+ for (String option: optionValues) { >+ a.addOptionValue(option, option); > } > > // set NBM Attributes (after all Attributes have been created, and added >@@ -425,16 +386,14 @@ > return url; > } > >- static String queryOptionsToString(String[] array) { >- // make a new string buffer and go through each element in the array >+ static String queryOptionsToString(List<String> array) { >+ > StringBuffer buffer = new StringBuffer(); >- for (int i = 0; i < array.length; i++) { >- // append the new value to the end and add a '!' as a delimiter >- buffer.append(array[i]); >+ for (String string : array) { >+ buffer.append(string); > buffer.append("!"); > } >- >- // return the buffer converted to a string >+ > return buffer.toString(); > } > >@@ -478,56 +437,77 @@ > IOException { > > String repositoryUrl = repository.getUrl(); >- BugzillaQueryPageParser parser = new BugzillaQueryPageParser(repository, monitor); >- if (!parser.wasSuccessful()) >- return; >+// BugzillaQueryPageParser parser = new BugzillaQueryPageParser(repository, monitor); >+// if (!parser.wasSuccessful()) >+// return; >+ >+ ProductConfiguration config = ServerConfigurationFactory.getInstance().getConfiguration( >+ repositoryUrl); > > // get the preferences store so that we can change the data in it > IPreferenceStore prefs = BugzillaPlugin.getDefault().getPreferenceStore(); > > prefs.setValue(IBugzillaConstants.VALUES_STATUS + PREF_DELIM_REPOSITORY + repositoryUrl, >- queryOptionsToString(parser.getStatusValues())); >+ queryOptionsToString(config.getStatusValues())); > monitor.worked(1); > > prefs.setValue(IBugzillaConstants.VALUSE_STATUS_PRESELECTED + PREF_DELIM_REPOSITORY + repositoryUrl, >- queryOptionsToString(parser.getPreselectedStatusValues())); >+ queryOptionsToString(config.getOpenStatusValues())); > monitor.worked(1); > > prefs.setValue(IBugzillaConstants.VALUES_RESOLUTION + PREF_DELIM_REPOSITORY + repositoryUrl, >- queryOptionsToString(parser.getResolutionValues())); >+ queryOptionsToString(config.getResolutions())); > monitor.worked(1); > > prefs.setValue(IBugzillaConstants.VALUES_SEVERITY + PREF_DELIM_REPOSITORY + repositoryUrl, >- queryOptionsToString(parser.getSeverityValues())); >+ queryOptionsToString(config.getSeverities())); > monitor.worked(1); > > prefs.setValue(IBugzillaConstants.VALUES_PRIORITY + PREF_DELIM_REPOSITORY + repositoryUrl, >- queryOptionsToString(parser.getPriorityValues())); >+ queryOptionsToString(config.getPriorities())); > monitor.worked(1); > > prefs.setValue(IBugzillaConstants.VALUES_HARDWARE + PREF_DELIM_REPOSITORY + repositoryUrl, >- queryOptionsToString(parser.getHardwareValues())); >+ queryOptionsToString(config.getPlatforms())); > monitor.worked(1); > > prefs.setValue(IBugzillaConstants.VALUES_OS + PREF_DELIM_REPOSITORY + repositoryUrl, >- queryOptionsToString(parser.getOSValues())); >+ queryOptionsToString(config.getOSs())); > monitor.worked(1); > > prefs.setValue(IBugzillaConstants.VALUES_PRODUCT + PREF_DELIM_REPOSITORY + repositoryUrl, >- queryOptionsToString(parser.getProductValues())); >+ queryOptionsToString(config.getProducts())); > monitor.worked(1); > >- prefs.setValue(IBugzillaConstants.VALUES_COMPONENT + PREF_DELIM_REPOSITORY + repositoryUrl, >- queryOptionsToString(parser.getComponentValues())); >+ >+ prefs.setValue(IBugzillaConstants.VALUES_COMPONENT + PREF_DELIM_REPOSITORY + repositoryUrl+PREF_DELIM_REPOSITORY, >+ queryOptionsToString(config.getComponents())); > monitor.worked(1); > > prefs.setValue(IBugzillaConstants.VALUES_VERSION + PREF_DELIM_REPOSITORY + repositoryUrl, >- queryOptionsToString(parser.getVersionValues())); >+ queryOptionsToString(config.getVersions())); > monitor.worked(1); >- >+ > prefs.setValue(IBugzillaConstants.VALUES_TARGET + PREF_DELIM_REPOSITORY + repositoryUrl, >- queryOptionsToString(parser.getTargetValues())); >+ queryOptionsToString(config.getTargetMilestones())); > monitor.worked(1); >+ >+ for (String product: config.getProducts()) { >+ prefs.setValue(IBugzillaConstants.VALUES_COMPONENT + PREF_DELIM_REPOSITORY + repositoryUrl+PREF_DELIM_REPOSITORY+product, >+ queryOptionsToString(config.getComponents(product))); >+ monitor.worked(1); >+ >+ prefs.setValue(IBugzillaConstants.VALUES_VERSION + PREF_DELIM_REPOSITORY + repositoryUrl, >+ queryOptionsToString(config.getVersions(product))); >+ monitor.worked(1); >+ >+ prefs.setValue(IBugzillaConstants.VALUES_TARGET + PREF_DELIM_REPOSITORY + repositoryUrl, >+ queryOptionsToString(config.getTargetMilestones(product))); >+ monitor.worked(1); >+ } >+ >+ >+ > } > > public static boolean downloadAttachment(TaskRepository repository, int id, File destinationFile, boolean overwrite) >Index: src/org/eclipse/mylar/internal/bugzilla/core/BugzillaPlugin.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.bugzilla.core/src/org/eclipse/mylar/internal/bugzilla/core/BugzillaPlugin.java,v >retrieving revision 1.12 >diff -u -r1.12 BugzillaPlugin.java >--- src/org/eclipse/mylar/internal/bugzilla/core/BugzillaPlugin.java 12 Mar 2006 17:03:12 -0000 1.12 >+++ src/org/eclipse/mylar/internal/bugzilla/core/BugzillaPlugin.java 25 Apr 2006 00:38:02 -0000 >@@ -40,7 +40,7 @@ > import org.eclipse.mylar.internal.bugzilla.core.internal.FavoritesFile; > import org.eclipse.mylar.internal.bugzilla.core.internal.OfflineReportsFile; > import org.eclipse.mylar.internal.bugzilla.core.internal.ProductConfiguration; >-import org.eclipse.mylar.internal.bugzilla.core.internal.ProductConfigurationFactory; >+import org.eclipse.mylar.internal.bugzilla.core.internal.ServerConfigurationFactory; > import org.eclipse.mylar.internal.bugzilla.core.search.IBugzillaResultEditorMatchAdapter; > import org.eclipse.mylar.internal.core.util.MylarStatusHandler; > import org.eclipse.mylar.provisional.tasklist.MylarTaskListPlugin; >@@ -105,7 +105,8 @@ > } > Authenticator.setDefault(authenticator); > >- setDefaultQueryOptions(); >+ // Removed since not repository specific >+ //setDefaultQueryOptions(); > > readFavoritesFile(); > readOfflineReportsFile(); >@@ -217,6 +218,18 @@ > } > > public ProductConfiguration getProductConfiguration(String serverUrl) { >+ if(! productConfigurations.containsKey(serverUrl)) { >+ try { >+ productConfigurations.put(serverUrl, ServerConfigurationFactory.getInstance().getConfiguration( >+ serverUrl)); >+ } catch (IOException e) { >+ MessageDialog >+ .openInformation( >+ null, >+ "Retrieval of Bugzilla Configuration", "Bugzilla configuration retrieval failed."); >+ } >+ } >+ > return productConfigurations.get(serverUrl); > } > >@@ -290,12 +303,12 @@ > IPath configFile = getProductConfigurationCachePath(serverUrl); > > try { >- productConfigurations.put(serverUrl, ProductConfigurationFactory.getInstance().readConfiguration( >+ productConfigurations.put(serverUrl, ServerConfigurationFactory.getInstance().readConfiguration( > configFile.toFile())); > } catch (IOException ex) { > try { > log(ex); >- productConfigurations.put(serverUrl, ProductConfigurationFactory.getInstance().getConfiguration( >+ productConfigurations.put(serverUrl, ServerConfigurationFactory.getInstance().getConfiguration( > serverUrl)); > } catch (IOException e) { > log(e); >@@ -420,42 +433,42 @@ > return getPreferenceStore().getInt(IBugzillaConstants.MAX_RESULTS); > } > >- private void setDefaultQueryOptions() { >- // get the preferences store for the bugzilla preferences >- IPreferenceStore prefs = getPreferenceStore(); >- >- prefs.setDefault(IBugzillaConstants.VALUES_STATUS, BugzillaRepositoryUtil >- .queryOptionsToString(IBugzillaConstants.DEFAULT_STATUS_VALUES)); >- >- prefs.setDefault(IBugzillaConstants.VALUSE_STATUS_PRESELECTED, BugzillaRepositoryUtil >- .queryOptionsToString(IBugzillaConstants.DEFAULT_PRESELECTED_STATUS_VALUES)); >- >- prefs.setDefault(IBugzillaConstants.VALUES_RESOLUTION, BugzillaRepositoryUtil >- .queryOptionsToString(IBugzillaConstants.DEFAULT_RESOLUTION_VALUES)); >- >- prefs.setDefault(IBugzillaConstants.VALUES_SEVERITY, BugzillaRepositoryUtil >- .queryOptionsToString(IBugzillaConstants.DEFAULT_SEVERITY_VALUES)); >- >- prefs.setDefault(IBugzillaConstants.VALUES_PRIORITY, BugzillaRepositoryUtil >- .queryOptionsToString(IBugzillaConstants.DEFAULT_PRIORITY_VALUES)); >- >- prefs.setDefault(IBugzillaConstants.VALUES_HARDWARE, BugzillaRepositoryUtil >- .queryOptionsToString(IBugzillaConstants.DEFAULT_HARDWARE_VALUES)); >- >- prefs.setDefault(IBugzillaConstants.VALUES_OS, BugzillaRepositoryUtil >- .queryOptionsToString(IBugzillaConstants.DEFAULT_OS_VALUES)); >- >- prefs.setDefault(IBugzillaConstants.VALUES_PRODUCT, BugzillaRepositoryUtil >- .queryOptionsToString(IBugzillaConstants.DEFAULT_PRODUCT_VALUES)); >- >- prefs.setDefault(IBugzillaConstants.VALUES_COMPONENT, BugzillaRepositoryUtil >- .queryOptionsToString(IBugzillaConstants.DEFAULT_COMPONENT_VALUES)); >- >- prefs.setDefault(IBugzillaConstants.VALUES_VERSION, BugzillaRepositoryUtil >- .queryOptionsToString(IBugzillaConstants.DEFAULT_VERSION_VALUES)); >- >- prefs.setDefault(IBugzillaConstants.VALUES_TARGET, BugzillaRepositoryUtil >- .queryOptionsToString(IBugzillaConstants.DEFAULT_TARGET_VALUES)); >- } >+// private void setDefaultQueryOptions() { >+// // get the preferences store for the bugzilla preferences >+// IPreferenceStore prefs = getPreferenceStore(); >+// >+// prefs.setDefault(IBugzillaConstants.VALUES_STATUS, BugzillaRepositoryUtil >+// .queryOptionsToString(IBugzillaConstants.DEFAULT_STATUS_VALUES)); >+// >+// prefs.setDefault(IBugzillaConstants.VALUSE_STATUS_PRESELECTED, BugzillaRepositoryUtil >+// .queryOptionsToString(IBugzillaConstants.DEFAULT_PRESELECTED_STATUS_VALUES)); >+// >+// prefs.setDefault(IBugzillaConstants.VALUES_RESOLUTION, BugzillaRepositoryUtil >+// .queryOptionsToString(IBugzillaConstants.DEFAULT_RESOLUTION_VALUES)); >+// >+// prefs.setDefault(IBugzillaConstants.VALUES_SEVERITY, BugzillaRepositoryUtil >+// .queryOptionsToString(IBugzillaConstants.DEFAULT_SEVERITY_VALUES)); >+// >+// prefs.setDefault(IBugzillaConstants.VALUES_PRIORITY, BugzillaRepositoryUtil >+// .queryOptionsToString(IBugzillaConstants.DEFAULT_PRIORITY_VALUES)); >+// >+// prefs.setDefault(IBugzillaConstants.VALUES_HARDWARE, BugzillaRepositoryUtil >+// .queryOptionsToString(IBugzillaConstants.DEFAULT_HARDWARE_VALUES)); >+// >+// prefs.setDefault(IBugzillaConstants.VALUES_OS, BugzillaRepositoryUtil >+// .queryOptionsToString(IBugzillaConstants.DEFAULT_OS_VALUES)); >+// >+// prefs.setDefault(IBugzillaConstants.VALUES_PRODUCT, BugzillaRepositoryUtil >+// .queryOptionsToString(IBugzillaConstants.DEFAULT_PRODUCT_VALUES)); >+// >+// prefs.setDefault(IBugzillaConstants.VALUES_COMPONENT, BugzillaRepositoryUtil >+// .queryOptionsToString(IBugzillaConstants.DEFAULT_COMPONENT_VALUES)); >+// >+// prefs.setDefault(IBugzillaConstants.VALUES_VERSION, BugzillaRepositoryUtil >+// .queryOptionsToString(IBugzillaConstants.DEFAULT_VERSION_VALUES)); >+// >+// prefs.setDefault(IBugzillaConstants.VALUES_TARGET, BugzillaRepositoryUtil >+// .queryOptionsToString(IBugzillaConstants.DEFAULT_TARGET_VALUES)); >+// } > > } >Index: src/org/eclipse/mylar/internal/bugzilla/core/internal/ProductConfigurationFactory.java >=================================================================== >RCS file: src/org/eclipse/mylar/internal/bugzilla/core/internal/ProductConfigurationFactory.java >diff -N src/org/eclipse/mylar/internal/bugzilla/core/internal/ProductConfigurationFactory.java >--- src/org/eclipse/mylar/internal/bugzilla/core/internal/ProductConfigurationFactory.java 24 Jan 2006 19:55:40 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,196 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2004 - 2006 University Of British Columbia and others. >- * All rights reserved. This program and the accompanying materials >- * are made available under the terms of the Eclipse Public License v1.0 >- * which accompanies this distribution, and is available at >- * http://www.eclipse.org/legal/epl-v10.html >- * >- * Contributors: >- * University Of British Columbia - initial API and implementation >- *******************************************************************************/ >- >-package org.eclipse.mylar.internal.bugzilla.core.internal; >- >-import java.io.BufferedReader; >-import java.io.File; >-import java.io.FileInputStream; >-import java.io.FileOutputStream; >-import java.io.IOException; >-import java.io.InputStreamReader; >-import java.io.ObjectInputStream; >-import java.io.ObjectOutputStream; >-import java.net.URL; >-import java.net.URLConnection; >-import java.util.ArrayList; >- >-import org.eclipse.mylar.internal.bugzilla.core.BugzillaPlugin; >- >-/** >- * A factory for creating ProductConfiguration objects that encapsulate valid >- * combinations of products, components, and versions. >- */ >-public class ProductConfigurationFactory { >- /** Singleton factory instance */ >- private static ProductConfigurationFactory instance; >- >- /** >- * Private constructor to ensure singleton instances. >- */ >- private ProductConfigurationFactory() { >- // no initial setup needed >- } >- >- /** >- * Returns the factory singletoninstance. >- */ >- public static synchronized ProductConfigurationFactory getInstance() { >- if (instance == null) { >- instance = new ProductConfigurationFactory(); >- } >- return instance; >- } >- >- /** >- * Builds a ProductConfiguration object by parsing the source of the >- * Bugzilla query page. >- */ >- public ProductConfiguration getConfiguration(String server) throws IOException { >- URL serverURL = new URL(server + "/query.cgi"); >- ProductConfiguration configuration = new ProductConfiguration(); >- ArrayList<String[]> componentsMatrix = new ArrayList<String[]>(); >- ArrayList<String[]> versionsMatrix = new ArrayList<String[]>(); >- URLConnection c = serverURL.openConnection(); >- BufferedReader in = new BufferedReader(new InputStreamReader(c.getInputStream())); >- String line; >- while ((line = in.readLine()) != null) { >- if (line.startsWith(" cpts[")) { >- String[] components = parseComponents(line); >- if (components.length > 0) >- componentsMatrix.add(components); >- } else if (line.startsWith(" vers[")) { >- String[] versions = parseComponents(line); >- if (versions.length > 0) >- versionsMatrix.add(versions); >- } else if (line.indexOf("<select name=\"product\"") != -1) { >- String[] products = parseProducts(in); >- for (int i = 0; i < products.length; i++) { >- String product = products[i]; >- configuration.addProduct(product); >- // If components don't jibe with the products, just don't >- // make them available. >- if (products.length == componentsMatrix.size()) { >- configuration.addComponents(product, componentsMatrix.get(i)); >- } >- >- // If versions don't jibe with the products, just don't make >- // them available >- if (products.length == versionsMatrix.size()) { >- configuration.addVersions(product, versionsMatrix.get(i)); >- } >- } >- } >- } >- return configuration; >- } >- >- /** >- * Returns an array of valid components or versions by parsing the >- * JavaScript array in the Bugzilla query page. >- */ >- protected String[] parseComponents(String line) { >- ArrayList<String> components = new ArrayList<String>(); >- int start = line.indexOf('\''); >- if (start >= 0) { >- boolean inName = true; >- StringBuffer name = new StringBuffer(); >- for (int i = start + 1; i < line.length(); i++) { >- char ch = line.charAt(i); >- if (inName) { >- if (ch == '\'') { >- components.add(name.toString()); >- name.setLength(0); >- inName = false; >- } else >- name.append(ch); >- } else { >- if (ch == '\'') { >- inName = true; >- } >- } >- } >- } >- return components.toArray(new String[0]); >- } >- >- /** >- * Returns an array of valid product names by parsing the product selection >- * list in the Bugzilla query page. >- */ >- protected String[] parseProducts(BufferedReader in) throws IOException { >- ArrayList<String> products = new ArrayList<String>(); >- String line; >- while ((line = in.readLine()) != null) { >- if (line.indexOf("</select>") != -1) >- break; >- int optionIndex = line.indexOf("<option value=\""); >- if (optionIndex != -1) { >- boolean inName = false; >- StringBuffer name = new StringBuffer(); >- for (int i = optionIndex; i < line.length(); i++) { >- char ch = line.charAt(i); >- if (inName) { >- if (ch == '<') { >- products.add(name.toString()); >- break; >- } else >- name.append(ch); >- } else { >- if (ch == '>') { >- inName = true; >- } >- } >- } >- } >- } >- return products.toArray(new String[0]); >- } >- >- /** >- * Restores a ProductConfiguration from a file. >- */ >- public ProductConfiguration readConfiguration(File file) throws IOException { >- if (!file.exists()) >- return null; >- FileInputStream fin = null; >- ProductConfiguration configuration = null; >- try { >- fin = new FileInputStream(file); >- ObjectInputStream in = new ObjectInputStream(fin); >- configuration = (ProductConfiguration) in.readObject(); >- } catch (ClassNotFoundException e) { >- BugzillaPlugin.log(e); >- IOException ex = new IOException(); >- ex.initCause(e); >- throw ex; >- } finally { >- if (fin != null) >- fin.close(); >- } >- return configuration; >- } >- >- /** >- * Saves a ProductConfiguration to a file. >- */ >- public void writeConfiguration(ProductConfiguration configuration, File file) throws IOException { >- FileOutputStream fout = null; >- try { >- fout = new FileOutputStream(file); >- ObjectOutputStream out = new ObjectOutputStream(fout); >- out.writeObject(configuration); >- } finally { >- if (fout != null) >- fout.close(); >- } >- } >-} >Index: src/org/eclipse/mylar/internal/bugzilla/core/internal/HtmlTag.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.bugzilla.core/src/org/eclipse/mylar/internal/bugzilla/core/internal/HtmlTag.java,v >retrieving revision 1.1 >diff -u -r1.1 HtmlTag.java >--- src/org/eclipse/mylar/internal/bugzilla/core/internal/HtmlTag.java 24 Jan 2006 19:55:40 -0000 1.1 >+++ src/org/eclipse/mylar/internal/bugzilla/core/internal/HtmlTag.java 25 Apr 2006 00:38:03 -0000 >@@ -35,6 +35,9 @@ > > /** tag's base url */ > private URL baseUrl; >+ >+ /** tag is self terminated */ >+ private boolean selfTerminating; > > /** > * Basic constructor. The tag is uninitialized. >@@ -244,6 +247,9 @@ > sb.append('"'); > } > } >+ if(selfTerminating) { >+ sb.append('/'); >+ } > sb.append('>'); > > return sb.toString(); >@@ -344,4 +350,13 @@ > tags.put(new String("UL"), Tag.UL); > tags.put(new String("VAR"), Tag.VAR); > } >+ >+ public void setSelfTerminating(boolean terminating) { >+ this.selfTerminating = terminating; >+ >+ } >+ >+ public boolean isSelfTerminating() { >+ return selfTerminating; >+ } > } >Index: src/org/eclipse/mylar/internal/bugzilla/core/internal/ProductConfiguration.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.bugzilla.core/src/org/eclipse/mylar/internal/bugzilla/core/internal/ProductConfiguration.java,v >retrieving revision 1.1 >diff -u -r1.1 ProductConfiguration.java >--- src/org/eclipse/mylar/internal/bugzilla/core/internal/ProductConfiguration.java 24 Jan 2006 19:55:40 -0000 1.1 >+++ src/org/eclipse/mylar/internal/bugzilla/core/internal/ProductConfiguration.java 25 Apr 2006 00:38:03 -0000 >@@ -11,8 +11,8 @@ > > package org.eclipse.mylar.internal.bugzilla.core.internal; > >-import java.io.Serializable; > import java.util.ArrayList; >+import java.util.Collections; > import java.util.HashMap; > import java.util.List; > import java.util.Map; >@@ -20,17 +20,58 @@ > /** > * Class describing the configuration of products and components for a given > * Bugzilla installation. >+ * >+ * @author Rob Elves > */ >-public class ProductConfiguration implements Serializable { >- >- /** Automatically generated serialVersionUID */ >- private static final long serialVersionUID = 3257004354337519410L; >+public class ProductConfiguration { > > private Map<String, ProductEntry> products = new HashMap<String, ProductEntry>(); > >+ private List<String> platforms = new ArrayList<String>(); >+ >+ private List<String> operatingSystems = new ArrayList<String>(); >+ >+ private List<String> priorities = new ArrayList<String>(); >+ >+ private List<String> severities = new ArrayList<String>(); >+ >+ private List<String> bugStatus = new ArrayList<String>(); >+ >+ private List<String> openStatusValues = new ArrayList<String>(); >+ >+ private List<String> resolutionValues = new ArrayList<String>(); >+ >+ // master lists >+ >+ private List<String> versions = new ArrayList<String>(); >+ >+ private List<String> components = new ArrayList<String>(); >+ >+ private List<String> milestones = new ArrayList<String>(); >+ >+ >+ >+ private String bugzillaVersion = "unknown"; >+ > public ProductConfiguration() { > super(); > } >+ >+ public void addStatus(String status) { >+ bugStatus.add(status); >+ } >+ >+ public List<String> getStatusValues() { >+ return bugStatus; >+ } >+ >+ public void addResolution(String res) { >+ resolutionValues.add(res); >+ } >+ >+ public List<String> getResolutions() { >+ return resolutionValues; >+ } > > /** > * Adds a product to the configuration. >@@ -45,66 +86,76 @@ > /** > * Returns an array of names of current products. > */ >- public String[] getProducts() { >- return products.keySet().toArray(new String[0]); >+ public List<String> getProducts() { >+ return new ArrayList<String>(products.keySet()); > } > > /** > * Returns an array of names of component that exist for a given product or > * <code>null</code> if the product does not exist. > */ >- public String[] getComponents(String product) { >+ public List<String> getComponents(String product) { > ProductEntry entry = products.get(product); > if (entry != null) { > return entry.getComponents(); > } else >- return null; >+ return Collections.emptyList(); > } > > /** > * Returns an array of names of versions that exist for a given product or > * <code>null</code> if the product does not exist. > */ >- public String[] getVersions(String product) { >+ public List<String> getVersions(String product) { > ProductEntry entry = products.get(product); > if (entry != null) { > return entry.getVersions(); > } else >- return null; >+ return Collections.emptyList(); > } > > /** > * Returns an array of names of valid severity values. > */ >- public String[] getSeverities() { >- return new String[] { "blocker", "critical", "major", "normal", "minor", "trivial", "enhancement" }; >+ public List<String> getSeverities() { >+ return severities; >+ // return new List<String> { "blocker", "critical", "major", "normal", >+ // "minor", "trivial", "enhancement" }; > } > > /** > * Returns an array of names of valid OS values. > */ >- public String[] getOSs() { >- return new String[] { "All", "Windows XP", "Linux", "other" }; >+ public List<String> getOSs() { >+ return operatingSystems; >+ // return new List<String> { "All", "Windows XP", "Linux", "other" }; >+ } >+ >+ public void addOS(String os) { >+ operatingSystems.add(os); > } > > /** > * Returns an array of names of valid platform values. > */ >- public String[] getPlatforms() { >- return new String[] { "All", "Macintosh", "PC" }; >+ public List<String> getPlatforms() { >+ return platforms; >+ // return new List<String> { "All", "Macintosh", "PC" }; > } > > /** > * Returns an array of names of valid platform values. > */ >- public String[] getPriorities() { >- return new String[] { "P1", "P2", "P3", "P4", "P5" }; >+ public List<String> getPriorities() { >+ return priorities; >+ // return new List<String> { "P1", "P2", "P3", "P4", "P5" }; > } > > /** > * Adds a component to the given product. > */ > public void addComponent(String product, String component) { >+ if(!components.contains(component)) components.add(component); > ProductEntry entry = products.get(product); > if (entry == null) { > entry = new ProductEntry(product); >@@ -113,56 +164,119 @@ > entry.addComponent(component); > } > >- /** >- * Adds a list of components to the given product. >- */ >- public void addComponents(String product, String[] components) { >+// /** >+// * Adds a list of components to the given product. >+// */ >+// public void addComponents(String product, List<String> components) { >+// ProductEntry entry = products.get(product); >+// if (entry == null) { >+// entry = new ProductEntry(product); >+// products.put(product, entry); >+// } >+// for (String component : components) { >+// entry.addComponent(component); >+// } >+// } >+// /** >+// * Adds a list of components to the given product. >+// */ >+// public void addComponents(String product, List<String> components) { >+// ProductEntry entry = products.get(product); >+// if (entry == null) { >+// entry = new ProductEntry(product); >+// products.put(product, entry); >+// } >+// for (String component : components) { >+// entry.addComponent(component); >+// } >+// } >+ >+ >+ public void addVersion(String product, String version) { >+ if(!versions.contains(version)) versions.add(version); > ProductEntry entry = products.get(product); > if (entry == null) { > entry = new ProductEntry(product); > products.put(product, entry); > } >- for (int i = 0; i < components.length; i++) { >- String component = components[i]; >- entry.addComponent(component); >- } >+ entry.addVersion(version); > } >+ >+// /** >+// * Adds a list of components to the given product. >+// */ >+// public void addVersions(String product, List<String> versions) { >+// ProductEntry entry = products.get(product); >+// if (entry == null) { >+// entry = new ProductEntry(product); >+// products.put(product, entry); >+// } >+// for (String version : versions) { >+// entry.addVersion(version); >+// } >+// } > >- /** >- * Adds a list of components to the given product. >- */ >- public void addVersions(String product, String[] versions) { >+ public void addPlatform(String platform) { >+ platforms.add(platform); >+ } >+ >+ public void addPriority(String priority) { >+ priorities.add(priority); >+ >+ } >+ >+ public void addSeverity(String severity) { >+ severities.add(severity); >+ >+ } >+ >+ public void setInstallVersion(String version) { >+ bugzillaVersion = version; >+ } >+ >+ public String getInstallVersion() { >+ return bugzillaVersion; >+ } >+ >+ public void addTargetMilestone(String product, String target) { >+ if(!milestones.contains(target)) milestones.add(target); > ProductEntry entry = products.get(product); > if (entry == null) { > entry = new ProductEntry(product); > products.put(product, entry); > } >- for (int i = 0; i < versions.length; i++) { >- String version = versions[i]; >- entry.addVersion(version); >- } >+ >+ entry.addTargetMilestone(target); >+ >+ } >+ >+ public List<String> getTargetMilestones(String product) { >+ ProductEntry entry = products.get(product); >+ if (entry != null) { >+ return entry.getTargetMilestones(); >+ } else >+ return Collections.emptyList(); > } > > /** > * Container for product information: name, components. > */ >- private static class ProductEntry implements Serializable { >- >- /** Automatically generated serialVersionUID */ >- private static final long serialVersionUID = 3977018465733391668L; >+ private static class ProductEntry { > > String productName; > > List<String> components = new ArrayList<String>(); > > List<String> versions = new ArrayList<String>(); >+ >+ List<String> milestones = new ArrayList<String>(); > > ProductEntry(String name) { > this.productName = name; > } > >- String[] getComponents() { >- return components.toArray(new String[0]); >+ List<String> getComponents() { >+ return components; > } > > void addComponent(String componentName) { >@@ -171,8 +285,8 @@ > } > } > >- String[] getVersions() { >- return versions.toArray(new String[0]); >+ List<String> getVersions() { >+ return versions; > } > > void addVersion(String name) { >@@ -180,5 +294,34 @@ > versions.add(name); > } > } >+ >+ List<String> getTargetMilestones() { >+ return milestones; >+ } >+ >+ void addTargetMilestone(String target) { >+ milestones.add(target); >+ } >+ } >+ >+ public List<String> getOpenStatusValues() { >+ return openStatusValues; >+ } >+ >+ public void addOpenStatusValue(String value) { >+ openStatusValues.add(value); >+ } >+ >+ public List<String> getComponents() { >+ return components; >+ } >+ >+ public List<String> getTargetMilestones() { >+ return milestones; >+ } >+ >+ public List<String> getVersions() { >+ return versions; > } >+ > } >Index: src/org/eclipse/mylar/internal/bugzilla/core/internal/HtmlStreamTokenizer.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.bugzilla.core/src/org/eclipse/mylar/internal/bugzilla/core/internal/HtmlStreamTokenizer.java,v >retrieving revision 1.1 >diff -u -r1.1 HtmlStreamTokenizer.java >--- src/org/eclipse/mylar/internal/bugzilla/core/internal/HtmlStreamTokenizer.java 24 Jan 2006 19:55:40 -0000 1.1 >+++ src/org/eclipse/mylar/internal/bugzilla/core/internal/HtmlStreamTokenizer.java 25 Apr 2006 00:38:03 -0000 >@@ -223,12 +223,17 @@ > } > String attributeName = s.substring(start, i).toLowerCase(); > >+ if(attributeName.equals("/")) { >+ tag.setSelfTerminating(true); >+ continue; >+ } >+ > for (; i < s.length() && Character.isWhitespace(s.charAt(i)); i++) { > // just move forward > } > if (i == s.length() || s.charAt(i) != '=') { >- // no attribute value >- tag.setAttribute(attributeName, ""); >+ // no attribute value >+ tag.setAttribute(attributeName, ""); > continue; > } > >@@ -450,16 +455,24 @@ > } > if (value != null) { > if (type == TAG) { >- sb.append('<'); >+ // sb.append('<'); > } else if (type == COMMENT) { >- sb.append("<!"); >+ sb.append("<!--"); > } > sb.append(value); > if (type == TAG) { >- sb.append('>'); >+ // if(value instanceof HtmlTag) { >+ // HtmlTag htmlTag = (HtmlTag)value; >+ // if(htmlTag.getTagName().startsWith("?xml")) { >+ // sb.append("?>"); >+ // } >+ // } else { >+ // sb.append('>'); >+ > } else if (type == COMMENT) { > sb.append("-->"); > } >+ > } > return sb.toString(); > } >@@ -501,7 +514,7 @@ > /* > * Based on ISO 8879. > * >- * Portions � International Organization for Standardization 1986 Permission >+ * Portions � International Organization for Standardization 1986 Permission > * to copy in any form is granted for use with conforming SGML systems and > * applications as defined in ISO 8879, provided this notice is included in > * all copies. >Index: src/org/eclipse/mylar/internal/bugzilla/core/internal/ServerConfigurationFactory.java >=================================================================== >RCS file: src/org/eclipse/mylar/internal/bugzilla/core/internal/ServerConfigurationFactory.java >diff -N src/org/eclipse/mylar/internal/bugzilla/core/internal/ServerConfigurationFactory.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylar/internal/bugzilla/core/internal/ServerConfigurationFactory.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,116 @@ >+/******************************************************************************* >+ * 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.bugzilla.core.internal; >+ >+import java.io.BufferedReader; >+import java.io.IOException; >+import java.io.InputStreamReader; >+import java.io.StringReader; >+import java.net.URL; >+import java.net.URLConnection; >+ >+import org.xml.sax.InputSource; >+import org.xml.sax.SAXException; >+import org.xml.sax.XMLReader; >+import org.xml.sax.helpers.XMLReaderFactory; >+ >+/** >+ * Reads bugzilla product configuration from config.cgi on server in RDF format. >+ * >+ * @author Rob Elves >+ */ >+public class ServerConfigurationFactory extends AbstractBugzillaConfigurationFactory { >+ >+ private static final String CONFIG_RDF_URL = "/config.cgi?ctype=rdf"; >+ >+ private static AbstractBugzillaConfigurationFactory instance; >+ >+ private ServerConfigurationFactory() { >+ // no initial setup needed >+ } >+ >+ public static synchronized AbstractBugzillaConfigurationFactory getInstance() { >+ if (instance == null) { >+ instance = new ServerConfigurationFactory(); >+ } >+ return instance; >+ } >+ >+ // public ProductConfiguration getConfiguration(String server) throws >+ // IOException { >+ // URL serverURL = new URL(server + "/config.cgi?ctype=rdf"); >+ // URLConnection c = serverURL.openConnection(); >+ // BufferedReader in = new BufferedReader(new >+ // InputStreamReader(c.getInputStream())); >+ // Document document; >+ // DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); >+ // factory.setValidating(false); >+ // factory.setNamespaceAware(false); >+ // try { >+ // DocumentBuilder builder = factory.newDocumentBuilder(); >+ // document = builder.parse( new InputSource(in) ); >+ // >+ // } catch (SAXParseException spe) { >+ // System.err.println("Sax parse exception!"); >+ // } catch (ParserConfigurationException e) { >+ // e.printStackTrace(); >+ // } catch (SAXException e) { >+ // e.printStackTrace(); >+ // } >+ // return null; >+ // >+ // } >+ >+ public ProductConfiguration getConfiguration(String server) throws IOException { >+ URL serverURL = new URL(server + CONFIG_RDF_URL); >+ URLConnection c = serverURL.openConnection(); >+ BufferedReader in = new BufferedReader(new InputStreamReader(c.getInputStream())); >+ >+ SaxConfigurationContentHandler contentHandler = new SaxConfigurationContentHandler(); >+ >+ try { >+ StringBuffer result = XmlCleaner.clean(in); >+ StringReader strReader = new StringReader(result.toString()); >+ XMLReader reader = XMLReaderFactory.createXMLReader(); >+ // reader.setErrorHandler(new SaxErrorHandler()) >+ reader.setContentHandler(contentHandler); >+ reader.parse(new InputSource(strReader)); >+ } catch (SAXException e) { >+ throw new IOException("Unable to read server configuration."); >+ } >+ return contentHandler.getConfiguration(); >+ >+ } >+ >+ // class SaxErrorHandler implements ErrorHandler { >+ // >+ // public void error(SAXParseException exception) throws SAXException { >+ // System.err.println("Error: >+ // "+exception.getLineNumber()+"\n"+exception.getLocalizedMessage()); >+ // >+ // } >+ // >+ // public void fatalError(SAXParseException exception) throws SAXException { >+ // System.err.println("Fatal Error: >+ // "+exception.getLineNumber()+"\n"+exception.getLocalizedMessage()); >+ // >+ // } >+ // >+ // public void warning(SAXParseException exception) throws SAXException { >+ // System.err.println("Warning: >+ // "+exception.getLineNumber()+"\n"+exception.getLocalizedMessage()); >+ // >+ // } >+ // >+ // } >+ >+} >Index: src/org/eclipse/mylar/internal/bugzilla/core/internal/SaxConfigurationContentHandler.java >=================================================================== >RCS file: src/org/eclipse/mylar/internal/bugzilla/core/internal/SaxConfigurationContentHandler.java >diff -N src/org/eclipse/mylar/internal/bugzilla/core/internal/SaxConfigurationContentHandler.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylar/internal/bugzilla/core/internal/SaxConfigurationContentHandler.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,389 @@ >+/******************************************************************************* >+ * 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.bugzilla.core.internal; >+ >+import java.util.ArrayList; >+import java.util.HashMap; >+import java.util.List; >+import java.util.Map; >+ >+import org.xml.sax.Attributes; >+import org.xml.sax.SAXException; >+import org.xml.sax.helpers.DefaultHandler; >+ >+/** >+ * Quick config rdf parser. >+ * >+ * <pre> >+ * config.cgi?ctype=rdf >+ * </pre> >+ * >+ * Populates a <link>ProductConfiguration</link> data structure. >+ * >+ * @author Rob Elves >+ */ >+public class SaxConfigurationContentHandler extends DefaultHandler { >+ >+ private static final String ELEMENT_RESOLUTION = "resolution"; >+ >+ private static final String ELEMENT_STATUS_OPEN = "status_open"; >+ >+ private static final String ELEMENT_TARGET_MILESTONE = "target_milestone"; >+ >+ private static final String ELEMENT_TARGET_MILESTONES = "target_milestones"; >+ >+ private static final String ELEMENT_INSTALL_VERSION = "install_version"; >+ >+ private static final String ATTRIBUTE_RDF_ABOUT = "rdf:about"; >+ >+ private static final String ATTRIBUTE_RESOURCE = "resource"; >+ >+ private static final String ELEMENT_VERSION = "version"; >+ >+ private static final String ELEMENT_VERSIONS = "versions"; >+ >+ private static final String ELEMENT_COMPONENT = "component"; >+ >+ private static final String ELEMENT_COMPONENTS = "components"; >+ >+ private static final String ELEMENT_NAME = "name"; >+ >+ private static final String ELEMENT_PRODUCTS = "products"; >+ >+ private static final String ELEMENT_SEVERITY = "severity"; >+ >+ private static final String ELEMENT_PRIORITY = "priority"; >+ >+ private static final String ELEMENT_OP_SYS = "op_sys"; >+ >+ private static final String ELEMENT_PLATFORM = "platform"; >+ >+ private static final String ELEMENT_LI = "li"; >+ >+ private static final String ELEMENT_STATUS = "status"; >+ >+ private static final int EXPECTING_ROOT = 0; >+ >+ private static final int IN_INSTALL_VERSION = 1 << 1; >+ >+ private static final int IN_STATUS = 1 << 2; >+ >+ private static final int IN_PLATFORM = 1 << 3; >+ >+ private static final int IN_OP_SYS = 1 << 4; >+ >+ private static final int IN_PRIORITY = 1 << 5; >+ >+ private static final int IN_SEVERITY = 1 << 6; >+ >+ private static final int IN_PRODUCTS = 1 << 7; >+ >+ private static final int IN_COMPONENTS = 1 << 8; >+ >+ private static final int IN_VERSIONS = 1 << 9; >+ >+ private static final int IN_LI = 1 << 10; >+ >+ private static final int IN_LI_LI = 1 << 11; >+ >+ private static final int IN_NAME = 1 << 12; >+ >+ private static final int IN_COMPONENT = 1 << 13; >+ >+ private static final int IN_VERSION = 1 << 14; >+ >+ private static final int IN_TARGET_MILESTONES = 1 << 15; >+ >+ private static final int IN_TARGET_MILESTONE = 1 << 16; >+ >+ private static final int IN_STATUS_OPEN = 1 << 17; >+ >+ private static final int IN_RESOLUTION = 1 << 18; >+ >+ private int state = EXPECTING_ROOT; >+ >+ private String currentProduct; >+ >+ private String about; >+ >+ private ProductConfiguration configuration = new ProductConfiguration(); >+ >+ private Map<String, List<String>> components = new HashMap<String, List<String>>(); >+ >+ private Map<String, List<String>> versions = new HashMap<String, List<String>>(); >+ >+ private Map<String, List<String>> milestones = new HashMap<String, List<String>>(); >+ >+ private Map<String, String> componentNames = new HashMap<String, String>(); >+ >+ private Map<String, String> versionNames = new HashMap<String, String>(); >+ >+ private Map<String, String> milestoneNames = new HashMap<String, String>(); >+ >+ public ProductConfiguration getConfiguration() { >+ return configuration; >+ } >+ >+ @Override >+ public void characters(char[] ch, int start, int length) throws SAXException { >+ switch (state) { >+ >+ case IN_PRODUCTS | IN_LI | IN_NAME: >+ configuration.addProduct(String.copyValueOf(ch, start, length)); >+ currentProduct = String.copyValueOf(ch, start, length); >+ break; >+ case IN_COMPONENTS | IN_LI | IN_COMPONENT | IN_NAME: >+ if (about != null) { >+ String name = String.copyValueOf(ch, start, length); >+ componentNames.put(about, name); >+ // System.err.println("Component: "+about+" ---> "+name); >+ } >+ break; >+ case IN_VERSIONS | IN_LI | IN_VERSION | IN_NAME: >+ if (about != null) { >+ String name = String.copyValueOf(ch, start, length); >+ versionNames.put(about, name); >+ // System.err.println("Version: "+about+" ---> "+name); >+ } >+ break; >+ case IN_TARGET_MILESTONES | IN_LI | IN_TARGET_MILESTONE | IN_NAME: >+ if (about != null) { >+ String name = String.copyValueOf(ch, start, length); >+ milestoneNames.put(about, name); >+ // System.err.println("Version: "+about+" ---> "+name); >+ } >+ break; >+ case IN_PLATFORM | IN_LI: >+ configuration.addPlatform(String.copyValueOf(ch, start, length)); >+ break; >+ case IN_OP_SYS | IN_LI: >+ configuration.addOS(String.copyValueOf(ch, start, length)); >+ break; >+ case IN_PRIORITY | IN_LI: >+ configuration.addPriority(String.copyValueOf(ch, start, length)); >+ break; >+ case IN_SEVERITY | IN_LI: >+ configuration.addSeverity(String.copyValueOf(ch, start, length)); >+ break; >+ case IN_INSTALL_VERSION: >+ configuration.setInstallVersion(String.copyValueOf(ch, start, length)); >+ break; >+ case IN_STATUS | IN_LI: >+ configuration.addStatus(String.copyValueOf(ch, start, length)); >+ break; >+ case IN_RESOLUTION | IN_LI: >+ configuration.addResolution(String.copyValueOf(ch, start, length)); >+ break; >+ case IN_STATUS_OPEN | IN_LI: >+ configuration.addOpenStatusValue(String.copyValueOf(ch, start, length)); >+ break; >+ } >+ } >+ >+ @Override >+ public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { >+ >+ if (localName.equals(ELEMENT_STATUS)) { >+ state = state | IN_STATUS; >+ } else if (localName.equals(ELEMENT_LI) && ((state & IN_LI) == IN_LI)) { >+ state = state | IN_LI_LI; >+ parseResource(attributes); >+ } else if (localName.equals(ELEMENT_LI) && ((state & IN_LI) != IN_LI)) { >+ state = state | IN_LI; >+ } else if (localName.equals(ELEMENT_PLATFORM)) { >+ state = state | IN_PLATFORM; >+ } else if (localName.equals(ELEMENT_OP_SYS)) { >+ state = state | IN_OP_SYS; >+ } else if (localName.equals(ELEMENT_PRIORITY)) { >+ state = state | IN_PRIORITY; >+ } else if (localName.equals(ELEMENT_SEVERITY)) { >+ state = state | IN_SEVERITY; >+ } else if (localName.equals(ELEMENT_PRODUCTS)) { >+ state = state | IN_PRODUCTS; >+ } else if (localName.equals(ELEMENT_OP_SYS)) { >+ state = state | IN_OP_SYS; >+ } else if (localName.equals(ELEMENT_NAME)) { >+ state = state | IN_NAME; >+ } else if (localName.equals(ELEMENT_COMPONENTS)) { >+ state = state | IN_COMPONENTS; >+ } else if (localName.equals(ELEMENT_COMPONENT)) { >+ state = state | IN_COMPONENT; >+ parseResource(attributes); >+ } else if (localName.equals(ELEMENT_VERSIONS)) { >+ state = state | IN_VERSIONS; >+ } else if (localName.equals(ELEMENT_VERSION)) { >+ state = state | IN_VERSION; >+ parseResource(attributes); >+ } else if (localName.equals(ELEMENT_INSTALL_VERSION)) { >+ state = state | IN_INSTALL_VERSION; >+ } else if (localName.equals(ELEMENT_TARGET_MILESTONES)) { >+ state = state | IN_TARGET_MILESTONES; >+ } else if (localName.equals(ELEMENT_TARGET_MILESTONE)) { >+ state = state | IN_TARGET_MILESTONE; >+ parseResource(attributes); >+ } else if (localName.equals(ELEMENT_STATUS_OPEN)) { >+ state = state | IN_STATUS_OPEN; >+ } else if (localName.equals(ELEMENT_RESOLUTION)) { >+ state = state | IN_RESOLUTION; >+ } >+ >+ } >+ >+ private void parseResource(Attributes attributes) { >+ >+ switch (state) { >+ case IN_PRODUCTS | IN_LI | IN_COMPONENTS | IN_LI_LI: >+ if (attributes != null) { >+ String compURI = attributes.getValue(ATTRIBUTE_RESOURCE); >+ if (compURI != null) { >+ >+ List<String> compURIs = components.get(currentProduct); >+ if (compURIs == null) { >+ compURIs = new ArrayList<String>(); >+ components.put(currentProduct, compURIs); >+ } >+ compURIs.add(compURI); >+ >+ } >+ } >+ break; >+ case IN_PRODUCTS | IN_LI | IN_VERSIONS | IN_LI_LI: >+ if (attributes != null) { >+ String resourceURI = attributes.getValue(ATTRIBUTE_RESOURCE); >+ if (resourceURI != null) { >+ List<String> versionUris = versions.get(currentProduct); >+ if (versionUris == null) { >+ versionUris = new ArrayList<String>(); >+ versions.put(currentProduct, versionUris); >+ } >+ versionUris.add(resourceURI); >+ } >+ } >+ break; >+ case IN_PRODUCTS | IN_LI | IN_TARGET_MILESTONES | IN_LI_LI: >+ if (attributes != null) { >+ String resourceURI = attributes.getValue(ATTRIBUTE_RESOURCE); >+ if (resourceURI != null) { >+ List<String> milestoneUris = milestones.get(currentProduct); >+ if (milestoneUris == null) { >+ milestoneUris = new ArrayList<String>(); >+ milestones.put(currentProduct, milestoneUris); >+ } >+ milestoneUris.add(resourceURI); >+ } >+ } >+ break; >+ case IN_COMPONENTS | IN_LI | IN_COMPONENT: >+ if (attributes != null) { >+ about = attributes.getValue(ATTRIBUTE_RDF_ABOUT); >+ } >+ break; >+ case IN_VERSIONS | IN_LI | IN_VERSION: >+ if (attributes != null) { >+ about = attributes.getValue(ATTRIBUTE_RDF_ABOUT); >+ } >+ break; >+ >+ case IN_TARGET_MILESTONES | IN_LI | IN_TARGET_MILESTONE: >+ if (attributes != null) { >+ about = attributes.getValue(ATTRIBUTE_RDF_ABOUT); >+ } >+ break; >+ >+ } >+ } >+ >+ @Override >+ public void endElement(String uri, String localName, String qName) throws SAXException { >+ >+ // KEEP: && ((state & IN_LI) == IN_LI) >+ >+ if (localName.equals(ELEMENT_STATUS)) { >+ state = state & ~IN_STATUS; >+ } else if (localName.equals(ELEMENT_LI) && ((state & IN_LI_LI) == IN_LI_LI)) { >+ state = state & ~IN_LI_LI; >+ } else if (localName.equals(ELEMENT_LI) && ((state & IN_LI_LI) != IN_LI_LI)) { >+ state = state & ~IN_LI; >+ } else if (localName.equals(ELEMENT_PLATFORM)) { >+ state = state & ~IN_PLATFORM; >+ } else if (localName.equals(ELEMENT_OP_SYS)) { >+ state = state & ~IN_OP_SYS; >+ } else if (localName.equals(ELEMENT_PRIORITY)) { >+ state = state & ~IN_PRIORITY; >+ } else if (localName.equals(ELEMENT_SEVERITY)) { >+ state = state & ~IN_SEVERITY; >+ } else if (localName.equals(ELEMENT_PRODUCTS)) { >+ state = state & ~IN_PRODUCTS; >+ } else if (localName.equals(ELEMENT_OP_SYS)) { >+ state = state & ~IN_OP_SYS; >+ } else if (localName.equals(ELEMENT_NAME)) { >+ state = state & ~IN_NAME; >+ } else if (localName.equals(ELEMENT_COMPONENTS)) { >+ state = state & ~IN_COMPONENTS; >+ } else if (localName.equals(ELEMENT_COMPONENT)) { >+ state = state & ~IN_COMPONENT; >+ } else if (localName.equals(ELEMENT_VERSION)) { >+ state = state & ~IN_VERSION; >+ } else if (localName.equals(ELEMENT_VERSIONS)) { >+ state = state & ~IN_VERSIONS; >+ } else if (localName.equals(ELEMENT_INSTALL_VERSION)) { >+ state = state & ~IN_INSTALL_VERSION; >+ } else if (localName.equals(ELEMENT_TARGET_MILESTONE)) { >+ state = state & ~IN_TARGET_MILESTONE; >+ } else if (localName.equals(ELEMENT_TARGET_MILESTONES)) { >+ state = state & ~IN_TARGET_MILESTONES; >+ } else if (localName.equals(ELEMENT_STATUS_OPEN)) { >+ state = state & ~IN_STATUS_OPEN; >+ } else if (localName.equals(ELEMENT_RESOLUTION)) { >+ state = state & ~IN_RESOLUTION; >+ } >+ >+ } >+ >+ @Override >+ public void endDocument() throws SAXException { >+ >+ for (String product : components.keySet()) { >+ List<String> componentURIs = components.get(product); >+ for (String uri : componentURIs) { >+ String realName = componentNames.get(uri); >+ if (realName != null) { >+ configuration.addComponent(product, realName); >+ } >+ } >+ >+ } >+ >+ for (String product : versions.keySet()) { >+ List<String> versionURIs = versions.get(product); >+ for (String uri : versionURIs) { >+ String realName = versionNames.get(uri); >+ if (realName != null) { >+ configuration.addVersion(product, realName); >+ } >+ } >+ >+ } >+ >+ for (String product : milestones.keySet()) { >+ List<String> milestoneURIs = milestones.get(product); >+ for (String uri : milestoneURIs) { >+ String realName = milestoneNames.get(uri); >+ if (realName != null) { >+ configuration.addTargetMilestone(product, realName); >+ } >+ } >+ >+ } >+ super.endDocument(); >+ } >+} >Index: src/org/eclipse/mylar/internal/bugzilla/core/internal/XmlCleaner.java >=================================================================== >RCS file: src/org/eclipse/mylar/internal/bugzilla/core/internal/XmlCleaner.java >diff -N src/org/eclipse/mylar/internal/bugzilla/core/internal/XmlCleaner.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylar/internal/bugzilla/core/internal/XmlCleaner.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,63 @@ >+/******************************************************************************* >+ * 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.bugzilla.core.internal; >+ >+import java.io.IOException; >+import java.io.Reader; >+import java.text.ParseException; >+ >+import org.eclipse.mylar.internal.bugzilla.core.internal.HtmlStreamTokenizer.Token; >+ >+/** >+ * This is in place to escape & characters within the resource and rdf:about >+ * attributes. Currently the values are not escaped which causes sax parser >+ * errors. This bug has been filed and can be found here: >+ * https://bugzilla.mozilla.org/show_bug.cgi?id=264785 >+ * >+ * @author Rob Elves >+ */ >+public class XmlCleaner { >+ >+ public static StringBuffer clean(Reader in) { >+ >+ HtmlStreamTokenizer tokenizer = new HtmlStreamTokenizer(in, null); >+ StringBuffer content = new StringBuffer(); >+ >+ // Hack since HtmlStreamTokenizer not familiar with xml tag. >+ content.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); >+ try { >+ for (Token token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer.nextToken()) { >+ >+ if (token.getType() == Token.TAG) { >+ HtmlTag tag = (HtmlTag) token.getValue(); >+ if (tag.getAttribute("resource") != null) { >+ String resourceID = tag.getAttribute("resource"); >+ tag.setAttribute("resource", resourceID.replace("&", "&")); >+ } >+ if (tag.getAttribute("rdf:about") != null) { >+ String resourceID = tag.getAttribute("rdf:about"); >+ tag.setAttribute("rdf:about", resourceID.replace("&", "&")); >+ } >+ } >+ if (!token.toString().startsWith("<?xml")) { >+ content.append(token.toString()); >+ } >+ } >+ } catch (IOException e) { >+ >+ } catch (ParseException e) { >+ >+ } >+ return content; >+ } >+ >+} >#P org.eclipse.mylar.bugzilla.ui >Index: src/org/eclipse/mylar/internal/bugzilla/ui/wizard/BugzillaProductPage.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.bugzilla.ui/src/org/eclipse/mylar/internal/bugzilla/ui/wizard/BugzillaProductPage.java,v >retrieving revision 1.11 >diff -u -r1.11 BugzillaProductPage.java >--- src/org/eclipse/mylar/internal/bugzilla/ui/wizard/BugzillaProductPage.java 17 Mar 2006 18:43:36 -0000 1.11 >+++ src/org/eclipse/mylar/internal/bugzilla/ui/wizard/BugzillaProductPage.java 25 Apr 2006 00:38:04 -0000 >@@ -225,11 +225,12 @@ > try { > if (!model.hasParsedAttributes() || !prevProduct.equals(model.getProduct())) { > String serverUrl = repository.getUrl(); >- if (model.isConnected()) { >- BugzillaRepositoryUtil.setupNewBugAttributes(serverUrl, model, false); >- } else { >+// if (model.isConnected()) { >+// BugzillaRepositoryUtil.setupNewBugAttributes(serverUrl, model, false); >+// } else { >+ > BugzillaRepositoryUtil.setupProdConfigAttributes(serverUrl, model); >- } >+// } > model.setParsedAttributesStatus(true); > if (prevProduct == null) { > bugWizard.setAttributePage(new WizardAttributesPage(workbench)); >#P org.eclipse.mylar.tests >Index: tests-manual.html >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.tests/tests-manual.html,v >retrieving revision 1.17 >diff -u -r1.17 tests-manual.html >--- tests-manual.html 13 Apr 2006 20:58:52 -0000 1.17 >+++ tests-manual.html 25 Apr 2006 00:38:05 -0000 >@@ -39,7 +39,9 @@ > <li>Select repository with invalid password</li> > <li>Error Dialog presented on product update or selection of Next: The > user name or password you entered is not valid...</li> >- </ul></li> >+ </ul> >+ </li> >+ <li><font color="#FF0000">Make sure submission of comment doesn't remove dependancies</font></li> > <li>Submission of changes to existing bug with invalid repository > credentials<ul> > <li>Mylar Bugzilla Client Dialog: Bugzilla could not post your bug since your login name or password is incorrect. >#P org.eclipse.mylar.bugzilla.tests >Index: src/org/eclipse/mylar/bugzilla/tests/BugzillaProductParserTest.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.bugzilla.tests/src/org/eclipse/mylar/bugzilla/tests/BugzillaProductParserTest.java,v >retrieving revision 1.16 >diff -u -r1.16 BugzillaProductParserTest.java >--- src/org/eclipse/mylar/bugzilla/tests/BugzillaProductParserTest.java 9 Mar 2006 21:06:25 -0000 1.16 >+++ src/org/eclipse/mylar/bugzilla/tests/BugzillaProductParserTest.java 25 Apr 2006 00:38:06 -0000 >@@ -78,9 +78,9 @@ > IBugzillaConstants.BugzillaServerVersion.SERVER_220.toString()); > > List<String> productList = BugzillaRepositoryUtil.getProductList(repository); >- Iterator<String> itr = productList.iterator(); >- assertTrue(itr.hasNext()); >- assertEquals("TestProduct", "TestProduct", itr.next()); >+ assertEquals(2, productList.size()); >+ assertTrue(productList.contains("TestProduct")); >+ assertTrue(productList.contains("Widget")); > > } > >@@ -90,20 +90,21 @@ > IBugzillaConstants.BugzillaServerVersion.SERVER_218.toString()); > > List<String> productList = BugzillaRepositoryUtil.getProductList(repository); >- Iterator<String> itr = productList.iterator(); >- assertTrue(itr.hasNext()); >- assertEquals("TestProduct", "TestProduct", itr.next()); >- } >- >- public void test216Products() throws Exception { >+ assertEquals(1, productList.size()); >+ assertTrue(productList.contains("TestProduct")); > >- repository = new TaskRepository(BugzillaPlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_216_URL, >- IBugzillaConstants.BugzillaServerVersion.SERVER_216.toString()); >- >- List<String> productList = BugzillaRepositoryUtil.getProductList(repository); >- Iterator<String> itr = productList.iterator(); >- assertTrue(itr.hasNext()); >- assertEquals("TestProduct", "TestProduct", itr.next()); > } >+ >+// No longer supporting 216 >+// public void test216Products() throws Exception { >+// >+// repository = new TaskRepository(BugzillaPlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_216_URL, >+// IBugzillaConstants.BugzillaServerVersion.SERVER_216.toString()); >+// >+// List<String> productList = BugzillaRepositoryUtil.getProductList(repository); >+// Iterator<String> itr = productList.iterator(); >+// assertTrue(itr.hasNext()); >+// assertEquals("TestProduct", "TestProduct", itr.next()); >+// } > > } >Index: src/org/eclipse/mylar/bugzilla/tests/AllBugzillaTests.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.bugzilla.tests/src/org/eclipse/mylar/bugzilla/tests/AllBugzillaTests.java,v >retrieving revision 1.11 >diff -u -r1.11 AllBugzillaTests.java >--- src/org/eclipse/mylar/bugzilla/tests/AllBugzillaTests.java 6 Apr 2006 04:10:22 -0000 1.11 >+++ src/org/eclipse/mylar/bugzilla/tests/AllBugzillaTests.java 25 Apr 2006 00:38:06 -0000 >@@ -21,6 +21,7 @@ > public static Test suite() { > TestSuite suite = new TestSuite("Test for org.eclipse.mylar.bugzilla.tests"); > // $JUnit-BEGIN$ >+ suite.addTestSuite(BugzillaConfigurationTest.class); > suite.addTestSuite(BugzillaTaskHyperlinkDetectorTest.class); > suite.addTestSuite(ReportAttachmentTest.class); > suite.addTestSuite(BugzillaSearchEngineTest.class); >Index: src/org/eclipse/mylar/bugzilla/tests/BugzillaConfigurationTest.java >=================================================================== >RCS file: src/org/eclipse/mylar/bugzilla/tests/BugzillaConfigurationTest.java >diff -N src/org/eclipse/mylar/bugzilla/tests/BugzillaConfigurationTest.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylar/bugzilla/tests/BugzillaConfigurationTest.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,125 @@ >+/******************************************************************************* >+ * 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.IOException; >+ >+import org.eclipse.mylar.internal.bugzilla.core.IBugzillaConstants; >+import org.eclipse.mylar.internal.bugzilla.core.internal.AbstractBugzillaConfigurationFactory; >+import org.eclipse.mylar.internal.bugzilla.core.internal.ProductConfiguration; >+import org.eclipse.mylar.internal.bugzilla.core.internal.ServerConfigurationFactory; >+ >+import junit.framework.TestCase; >+ >+public class BugzillaConfigurationTest extends TestCase { >+ >+ protected void setUp() throws Exception { >+ super.setUp(); >+ } >+ >+ protected void tearDown() throws Exception { >+ super.tearDown(); >+ } >+ >+ >+ public void test222RDFProductConfig() throws IOException { >+ AbstractBugzillaConfigurationFactory factory = ServerConfigurationFactory.getInstance(); >+ ProductConfiguration config = factory.getConfiguration(IBugzillaConstants.TEST_BUGZILLA_222_URL); >+ assertNotNull(config); >+ assertEquals("2.22rc1", config.getInstallVersion()); >+ assertEquals(7, config.getStatusValues().size()); >+ assertEquals(8, config.getResolutions().size()); >+ assertEquals(4, config.getPlatforms().size()); >+ assertEquals(5, config.getOSs().size()); >+ assertEquals(5, config.getPriorities().size()); >+ assertEquals(7, config.getSeverities().size()); >+ assertEquals(1, config.getProducts().size()); >+ assertEquals(4, config.getOpenStatusValues().size()); >+ assertEquals(1, config.getComponents("TestProduct").size()); >+ assertEquals(1, config.getVersions("TestProduct").size()); >+ assertEquals(1, config.getTargetMilestones("TestProduct").size()); >+ } >+ >+ public void test2201RDFProductConfig() throws IOException { >+ AbstractBugzillaConfigurationFactory factory = ServerConfigurationFactory.getInstance(); >+ ProductConfiguration config = factory.getConfiguration(IBugzillaConstants.TEST_BUGZILLA_2201_URL); >+ assertNotNull(config); >+ assertEquals("2.20.1", config.getInstallVersion()); >+ assertEquals(7, config.getStatusValues().size()); >+ assertEquals(8, config.getResolutions().size()); >+ assertEquals(4, config.getPlatforms().size()); >+ assertEquals(5, config.getOSs().size()); >+ assertEquals(5, config.getPriorities().size()); >+ assertEquals(7, config.getSeverities().size()); >+ assertEquals(1, config.getProducts().size()); >+ assertEquals(4, config.getOpenStatusValues().size()); >+ assertEquals(2, config.getComponents("TestProduct").size()); >+ assertEquals(1, config.getVersions("TestProduct").size()); >+ //assertEquals(1, config.getTargetMilestones("TestProduct").size()); >+ } >+ >+ public void test220RDFProductConfig() throws IOException { >+ AbstractBugzillaConfigurationFactory factory = ServerConfigurationFactory.getInstance(); >+ ProductConfiguration config = factory.getConfiguration(IBugzillaConstants.TEST_BUGZILLA_220_URL); >+ assertNotNull(config); >+ assertEquals("2.20", config.getInstallVersion()); >+ assertEquals(7, config.getStatusValues().size()); >+ assertEquals(8, config.getResolutions().size()); >+ assertEquals(4, config.getPlatforms().size()); >+ assertEquals(5, config.getOSs().size()); >+ assertEquals(5, config.getPriorities().size()); >+ assertEquals(7, config.getSeverities().size()); >+ assertEquals(2, config.getProducts().size()); >+ assertEquals(4, config.getOpenStatusValues().size()); >+ assertEquals(2, config.getComponents("TestProduct").size()); >+ assertEquals(1, config.getVersions("TestProduct").size()); >+ //assertEquals(1, config.getTargetMilestones("TestProduct").size()); >+ } >+ >+ public void test218RDFProductConfig() throws IOException { >+ AbstractBugzillaConfigurationFactory factory = ServerConfigurationFactory.getInstance(); >+ ProductConfiguration config = factory.getConfiguration(IBugzillaConstants.TEST_BUGZILLA_218_URL); >+ assertNotNull(config); >+ assertEquals("2.18.5", config.getInstallVersion()); >+ assertEquals(7, config.getStatusValues().size()); >+ assertEquals(8, config.getResolutions().size()); >+ assertEquals(8, config.getPlatforms().size()); >+ assertEquals(37, config.getOSs().size()); >+ assertEquals(5, config.getPriorities().size()); >+ assertEquals(7, config.getSeverities().size()); >+ assertEquals(1, config.getProducts().size()); >+ assertEquals(4, config.getOpenStatusValues().size()); >+ assertEquals(1, config.getComponents("TestProduct").size()); >+ assertEquals(1, config.getVersions("TestProduct").size()); >+ //assertEquals(1, config.getTargetMilestones("TestProduct").size()); >+ } >+ >+ public void testEclipseRDFProductConfig() throws IOException { >+ AbstractBugzillaConfigurationFactory factory = ServerConfigurationFactory.getInstance(); >+ ProductConfiguration config = factory.getConfiguration(IBugzillaConstants.ECLIPSE_BUGZILLA_URL); >+ assertNotNull(config); >+ assertEquals("2.20.1", config.getInstallVersion()); >+ assertEquals(7, config.getStatusValues().size()); >+ assertEquals(8, config.getResolutions().size()); >+ assertEquals(6, config.getPlatforms().size()); >+ assertEquals(27, config.getOSs().size()); >+ assertEquals(5, config.getPriorities().size()); >+ assertEquals(7, config.getSeverities().size()); >+ assertEquals(53, config.getProducts().size()); >+ assertEquals(4, config.getOpenStatusValues().size()); >+ assertEquals(10, config.getComponents("Mylar").size()); >+ //assertEquals(10, config.getComponents("Hyades").size()); >+ //assertEquals(1, config.getTargetMilestones("TestProduct").size()); >+ } >+ >+ // NOTE: Bugzilla 2.16 doesn't have config.cgi interface >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 136219
: 39378 |
39381
|
39429
|
39484
|
39498
|
39599
|
39615
|
39833
|
39835
|
40093
|
40670
|
40671