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 101563 Details for
Bug 229655
port Bugzilla connector to new 3.0 api
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.
In progress 2
BugzillaPort2.patch (text/plain), 325.07 KB, created by
Robert Elves
on 2008-05-22 13:19:44 EDT
(
hide
)
Description:
In progress 2
Filename:
MIME Type:
Creator:
Robert Elves
Created:
2008-05-22 13:19:44 EDT
Size:
325.07 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.sandbox.tests >Index: src/org/eclipse/mylyn/sandbox/tests/TaskReportGeneratorTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.sandbox.tests/src/org/eclipse/mylyn/sandbox/tests/TaskReportGeneratorTest.java,v >retrieving revision 1.4 >diff -u -r1.4 TaskReportGeneratorTest.java >--- src/org/eclipse/mylyn/sandbox/tests/TaskReportGeneratorTest.java 12 May 2008 17:20:15 -0000 1.4 >+++ src/org/eclipse/mylyn/sandbox/tests/TaskReportGeneratorTest.java 22 May 2008 17:18:46 -0000 >@@ -97,7 +97,7 @@ > } > > public void testCompletedBugzillaTasksRetrieved() throws InvocationTargetException, InterruptedException { >- TaskRepository repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, >+ TaskRepository repository = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, > IBugzillaConstants.ECLIPSE_BUGZILLA_URL); > TasksUiPlugin.getRepositoryManager().addRepository(repository); > BugzillaTask task1 = new BugzillaTask(IBugzillaConstants.ECLIPSE_BUGZILLA_URL, "1", "bugzillatask 1"); >Index: src/org/eclipse/mylyn/sandbox/tests/BugzillaActiveSearchTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.sandbox.tests/src/org/eclipse/mylyn/sandbox/tests/BugzillaActiveSearchTest.java,v >retrieving revision 1.22 >diff -u -r1.22 BugzillaActiveSearchTest.java >--- src/org/eclipse/mylyn/sandbox/tests/BugzillaActiveSearchTest.java 12 May 2008 17:20:15 -0000 1.22 >+++ src/org/eclipse/mylyn/sandbox/tests/BugzillaActiveSearchTest.java 22 May 2008 17:18:46 -0000 >@@ -65,7 +65,7 @@ > @Override > protected void setUp() throws Exception { > WorkspaceSetupHelper.setupWorkspace(); >- repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.ECLIPSE_BUGZILLA_URL); >+ repository = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, IBugzillaConstants.ECLIPSE_BUGZILLA_URL); > TasksUiPlugin.getRepositoryManager().addRepository(repository); > > IJavaProject jp = WorkspaceSetupHelper.getJdtCoreDomProject(); >#P org.eclipse.mylyn.tasks.ui >Index: src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java,v >retrieving revision 1.104 >diff -u -r1.104 TaskEditor.java >--- src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java 20 May 2008 21:37:42 -0000 1.104 >+++ src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java 22 May 2008 17:18:48 -0000 >@@ -216,7 +216,7 @@ > } > > updateTitleImage(); >- updateHeaderToolBar(); >+ //updateHeaderToolBar(); > } > > private void initialize() { >#P org.eclipse.mylyn.tasks.core >Index: src/org/eclipse/mylyn/internal/tasks/core/deprecated/AbstractAttributeFactory.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/deprecated/AbstractAttributeFactory.java,v >retrieving revision 1.1 >diff -u -r1.1 AbstractAttributeFactory.java >--- src/org/eclipse/mylyn/internal/tasks/core/deprecated/AbstractAttributeFactory.java 4 May 2008 05:54:56 -0000 1.1 >+++ src/org/eclipse/mylyn/internal/tasks/core/deprecated/AbstractAttributeFactory.java 22 May 2008 17:18:50 -0000 >@@ -11,13 +11,14 @@ > import java.io.Serializable; > import java.util.Date; > >+import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper; > > /** > * Extend to provide mapping between repository task attribute IDs and native repository IDs. > * > * @author Rob Elves > * @since 2.0 >- * @deprecated use {@link AttributeMapper} instead >+ * @deprecated use {@link TaskAttributeMapper} instead > */ > @SuppressWarnings("serial") > @Deprecated >Index: src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataState.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataState.java,v >retrieving revision 1.9 >diff -u -r1.9 TaskDataState.java >--- src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataState.java 22 May 2008 05:39:34 -0000 1.9 >+++ src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataState.java 22 May 2008 17:18:50 -0000 >@@ -24,6 +24,8 @@ > */ > public class TaskDataState implements ITaskDataWorkingCopy { > >+ private final String repositoryUrl; >+ > private final String connectorKind; > > private TaskData editsTaskData; >@@ -32,16 +34,14 @@ > > private TaskData localTaskData; > >- private boolean saved; >- > private TaskData repositoryTaskData; > >- private final String repositoryUrl; >- > private ITask task; > > private final String taskId; > >+ private boolean saved; >+ > private TaskDataManager taskDataManager; > > public TaskDataState(String connectorKind, String repositoryUrl, String taskId) { >Index: src/org/eclipse/mylyn/tasks/core/data/TaskAttribute.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskAttribute.java,v >retrieving revision 1.14 >diff -u -r1.14 TaskAttribute.java >--- src/org/eclipse/mylyn/tasks/core/data/TaskAttribute.java 4 May 2008 00:08:16 -0000 1.14 >+++ src/org/eclipse/mylyn/tasks/core/data/TaskAttribute.java 22 May 2008 17:18:50 -0000 >@@ -230,8 +230,7 @@ > /** > * Key for the author of a comment. > */ >- public static final String USER_OWNER = "task.common.user.owner"; >- >+ //public static final String USER_OWNER = "task.common.user.owner"; > public static final String USER_REPORTER = "task.common.user.reporter"; > > public static final String USER_REPORTER_NAME = "task.common.user.reporter.name"; >Index: src/org/eclipse/mylyn/tasks/core/data/TaskMapper.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskMapper.java,v >retrieving revision 1.2 >diff -u -r1.2 TaskMapper.java >--- src/org/eclipse/mylyn/tasks/core/data/TaskMapper.java 20 May 2008 20:06:29 -0000 1.2 >+++ src/org/eclipse/mylyn/tasks/core/data/TaskMapper.java 22 May 2008 17:18:50 -0000 >@@ -111,7 +111,7 @@ > } > > public String getOwner() { >- return getValue(TaskAttribute.USER_OWNER); >+ return getValue(TaskAttribute.USER_ASSIGNED); > } > > public PriorityLevel getPriority() { >@@ -209,7 +209,7 @@ > > // TODO use Person class? > public void setOwner(String owner) { >- setValue(TaskAttribute.USER_OWNER, owner); >+ setValue(TaskAttribute.USER_ASSIGNED, owner); > } > > public void setPriority(PriorityLevel priority) { >Index: src/org/eclipse/mylyn/internal/tasks/core/externalization/TaskListExternalizer.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/TaskListExternalizer.java,v >retrieving revision 1.11 >diff -u -r1.11 TaskListExternalizer.java >--- src/org/eclipse/mylyn/internal/tasks/core/externalization/TaskListExternalizer.java 16 May 2008 19:52:58 -0000 1.11 >+++ src/org/eclipse/mylyn/internal/tasks/core/externalization/TaskListExternalizer.java 22 May 2008 17:18:50 -0000 >@@ -296,7 +296,7 @@ > doc = openAsDOM(inFile); > > if (doc == null) { >- StatusHandler.log(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, "Empty TaskList")); >+ //StatusHandler.log(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, "Empty TaskList")); > return; > } > >#P org.eclipse.mylyn.bugzilla.core >Index: src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeFactory.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeFactory.java,v >retrieving revision 1.23 >diff -u -r1.23 BugzillaAttributeFactory.java >--- src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeFactory.java 4 May 2008 05:54:53 -0000 1.23 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeFactory.java 22 May 2008 17:18:52 -0000 >@@ -42,59 +42,59 @@ > @Override > public String mapCommonAttributeKey(String key) { > if (key.equals(RepositoryTaskAttribute.NEW_CC)) { >- return BugzillaReportElement.NEWCC.getKeyString(); >+ return BugzillaReportElement.NEWCC.getKey(); > } else if (key.equals(RepositoryTaskAttribute.COMMENT_DATE)) { >- return BugzillaReportElement.BUG_WHEN.getKeyString(); >+ return BugzillaReportElement.BUG_WHEN.getKey(); > } else if (key.equals(RepositoryTaskAttribute.COMMENT_AUTHOR)) { >- return BugzillaReportElement.WHO.getKeyString(); >+ return BugzillaReportElement.WHO.getKey(); > } else if (key.equals(RepositoryTaskAttribute.COMMENT_AUTHOR_NAME)) { >- return BugzillaReportElement.WHO_NAME.getKeyString(); >+ return BugzillaReportElement.WHO_NAME.getKey(); > } else if (key.equals(RepositoryTaskAttribute.USER_CC)) { >- return BugzillaReportElement.CC.getKeyString(); >+ return BugzillaReportElement.CC.getKey(); > } else if (key.equals(RepositoryTaskAttribute.COMMENT_TEXT)) { >- return BugzillaReportElement.THETEXT.getKeyString(); >+ return BugzillaReportElement.THETEXT.getKey(); > } else if (key.equals(RepositoryTaskAttribute.DATE_CREATION)) { >- return BugzillaReportElement.CREATION_TS.getKeyString(); >+ return BugzillaReportElement.CREATION_TS.getKey(); > } else if (key.equals(RepositoryTaskAttribute.DESCRIPTION)) { >- return BugzillaReportElement.DESC.getKeyString(); >+ return BugzillaReportElement.DESC.getKey(); > } else if (key.equals(RepositoryTaskAttribute.ATTACHMENT_ID)) { >- return BugzillaReportElement.ATTACHID.getKeyString(); >+ return BugzillaReportElement.ATTACHID.getKey(); > } else if (key.equals(RepositoryTaskAttribute.ATTACHMENT_TYPE)) { >- return BugzillaReportElement.TYPE.getKeyString(); >+ return BugzillaReportElement.TYPE.getKey(); > } else if (key.equals(RepositoryTaskAttribute.ATTACHMENT_CTYPE)) { >- return BugzillaReportElement.CTYPE.getKeyString(); >+ return BugzillaReportElement.CTYPE.getKey(); > } else if (key.equals(RepositoryTaskAttribute.USER_ASSIGNED)) { >- return BugzillaReportElement.ASSIGNED_TO.getKeyString(); >+ return BugzillaReportElement.ASSIGNED_TO.getKey(); > } else if (key.equals(RepositoryTaskAttribute.USER_ASSIGNED_NAME)) { >- return BugzillaReportElement.ASSIGNED_TO_NAME.getKeyString(); >+ return BugzillaReportElement.ASSIGNED_TO_NAME.getKey(); > } else if (key.equals(RepositoryTaskAttribute.RESOLUTION)) { >- return BugzillaReportElement.RESOLUTION.getKeyString(); >+ return BugzillaReportElement.RESOLUTION.getKey(); > } else if (key.equals(RepositoryTaskAttribute.STATUS)) { >- return BugzillaReportElement.BUG_STATUS.getKeyString(); >+ return BugzillaReportElement.BUG_STATUS.getKey(); > } else if (key.equals(RepositoryTaskAttribute.DATE_MODIFIED)) { >- return BugzillaReportElement.DELTA_TS.getKeyString(); >+ return BugzillaReportElement.DELTA_TS.getKey(); > } else if (key.equals(RepositoryTaskAttribute.USER_REPORTER)) { >- return BugzillaReportElement.REPORTER.getKeyString(); >+ return BugzillaReportElement.REPORTER.getKey(); > } else if (key.equals(RepositoryTaskAttribute.USER_REPORTER_NAME)) { >- return BugzillaReportElement.REPORTER_NAME.getKeyString(); >+ return BugzillaReportElement.REPORTER_NAME.getKey(); > } else if (key.equals(RepositoryTaskAttribute.SUMMARY)) { >- return BugzillaReportElement.SHORT_DESC.getKeyString(); >+ return BugzillaReportElement.SHORT_DESC.getKey(); > } else if (key.equals(RepositoryTaskAttribute.PRODUCT)) { >- return BugzillaReportElement.PRODUCT.getKeyString(); >+ return BugzillaReportElement.PRODUCT.getKey(); > } else if (key.equals(RepositoryTaskAttribute.KEYWORDS)) { >- return BugzillaReportElement.KEYWORDS.getKeyString(); >+ return BugzillaReportElement.KEYWORDS.getKey(); > } else if (key.equals(RepositoryTaskAttribute.ATTACHMENT_DATE)) { >- return BugzillaReportElement.DATE.getKeyString(); >+ return BugzillaReportElement.DATE.getKey(); > } else if (key.equals(RepositoryTaskAttribute.ATTACHMENT_SIZE)) { >- return BugzillaReportElement.SIZE.getKeyString(); >+ return BugzillaReportElement.SIZE.getKey(); > } else if (key.equals(RepositoryTaskAttribute.ADD_SELF_CC)) { >- return BugzillaReportElement.ADDSELFCC.getKeyString(); >+ return BugzillaReportElement.ADDSELFCC.getKey(); > } else if (key.equals(RepositoryTaskAttribute.PRIORITY)) { >- return BugzillaReportElement.PRIORITY.getKeyString(); >+ return BugzillaReportElement.PRIORITY.getKey(); > } else if (key.equals(RepositoryTaskAttribute.COMMENT_NEW)) { >- return BugzillaReportElement.NEW_COMMENT.getKeyString(); >+ return BugzillaReportElement.NEW_COMMENT.getKey(); > } else if (key.equals(RepositoryTaskAttribute.COMPONENT)) { >- return BugzillaReportElement.COMPONENT.getKeyString(); >+ return BugzillaReportElement.COMPONENT.getKey(); > } else { > return key; > } >@@ -135,13 +135,13 @@ > try { > String mappedKey = mapCommonAttributeKey(attributeKey); > Date parsedDate = null; >- if (mappedKey.equals(BugzillaReportElement.DELTA_TS.getKeyString())) { >+ if (mappedKey.equals(BugzillaReportElement.DELTA_TS.getKey())) { > parsedDate = new SimpleDateFormat(delta_ts_format).parse(dateString); >- } else if (mappedKey.equals(BugzillaReportElement.CREATION_TS.getKeyString())) { >+ } else if (mappedKey.equals(BugzillaReportElement.CREATION_TS.getKey())) { > parsedDate = new SimpleDateFormat(creation_ts_format).parse(dateString); >- } else if (mappedKey.equals(BugzillaReportElement.BUG_WHEN.getKeyString())) { >+ } else if (mappedKey.equals(BugzillaReportElement.BUG_WHEN.getKey())) { > parsedDate = new SimpleDateFormat(comment_creation_ts_format).parse(dateString); >- } else if (mappedKey.equals(BugzillaReportElement.DATE.getKeyString())) { >+ } else if (mappedKey.equals(BugzillaReportElement.DATE.getKey())) { > parsedDate = new SimpleDateFormat(attachment_creation_ts_format).parse(dateString); > } > return parsedDate; >Index: src/org/eclipse/mylyn/internal/bugzilla/core/MultiBugReportFactory.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/MultiBugReportFactory.java,v >retrieving revision 1.12 >diff -u -r1.12 MultiBugReportFactory.java >--- src/org/eclipse/mylyn/internal/bugzilla/core/MultiBugReportFactory.java 8 May 2008 17:53:45 -0000 1.12 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/MultiBugReportFactory.java 22 May 2008 17:18:53 -0000 >@@ -16,9 +16,10 @@ > > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IStatus; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.LegacyTaskDataCollector; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskData; > import org.eclipse.mylyn.tasks.core.RepositoryStatus; >+import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper; >+import org.eclipse.mylyn.tasks.core.data.TaskData; >+import org.eclipse.mylyn.tasks.core.data.TaskDataCollector; > > /** > * Reads bug reports from repository. >@@ -31,13 +32,11 @@ > super(inStream, encoding); > } > >- private static BugzillaAttributeFactory bugzillaAttributeFactory = new BugzillaAttributeFactory(); >- >- public void populateReport(Map<String, RepositoryTaskData> bugMap, LegacyTaskDataCollector collector, >+ public void populateReport(Map<String, TaskData> bugMap, TaskDataCollector collector, TaskAttributeMapper mapper, > List<BugzillaCustomField> customFields) throws IOException, CoreException { > >- SaxMultiBugReportContentHandler contentHandler = new SaxMultiBugReportContentHandler(bugzillaAttributeFactory, >- collector, bugMap, customFields); >+ SaxMultiBugReportContentHandler contentHandler = new SaxMultiBugReportContentHandler(mapper, collector, bugMap, >+ customFields); > collectResults(contentHandler, false); > > if (contentHandler.errorOccurred()) { >Index: src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java,v >retrieving revision 1.121 >diff -u -r1.121 BugzillaRepositoryConnector.java >--- src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java 20 May 2008 05:54:06 -0000 1.121 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java 22 May 2008 17:18:53 -0000 >@@ -12,12 +12,14 @@ > import java.io.UnsupportedEncodingException; > import java.net.MalformedURLException; > import java.net.URLEncoder; >+import java.text.ParseException; > import java.text.SimpleDateFormat; >+import java.util.Collection; > import java.util.Date; >+import java.util.HashMap; > import java.util.HashSet; > import java.util.Iterator; > import java.util.LinkedHashSet; >-import java.util.List; > import java.util.Set; > > import org.eclipse.core.runtime.CoreException; >@@ -27,28 +29,23 @@ > import org.eclipse.core.runtime.Status; > import org.eclipse.mylyn.commons.core.StatusHandler; > import org.eclipse.mylyn.commons.net.Policy; >-import org.eclipse.mylyn.internal.tasks.core.AbstractTask; >-import org.eclipse.mylyn.internal.tasks.core.ITaskList; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.AbstractAttachmentHandler; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.AbstractLegacyRepositoryConnector; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.AbstractTaskDataHandler; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.ITaskFactory; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.QueryHitCollector; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskAttribute; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskData; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.TaskComment; >+import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; > import org.eclipse.mylyn.tasks.core.IRepositoryQuery; > import org.eclipse.mylyn.tasks.core.ITask; > import org.eclipse.mylyn.tasks.core.TaskRepository; >-import org.eclipse.mylyn.tasks.core.ITask.PriorityLevel; >+import org.eclipse.mylyn.tasks.core.data.AbstractTaskDataHandler; >+import org.eclipse.mylyn.tasks.core.data.TaskAttribute; >+import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper; >+import org.eclipse.mylyn.tasks.core.data.TaskData; > import org.eclipse.mylyn.tasks.core.data.TaskDataCollector; >+import org.eclipse.mylyn.tasks.core.data.TaskMapper; > import org.eclipse.mylyn.tasks.core.sync.ISynchronizationContext; > > /** > * @author Mik Kersten > * @author Rob Elves > */ >-public class BugzillaRepositoryConnector extends AbstractLegacyRepositoryConnector { >+public class BugzillaRepositoryConnector extends AbstractRepositoryConnector { > > private static final String BUG_ID = "&bug_id="; > >@@ -62,37 +59,37 @@ > > private static final String DEADLINE_FORMAT = "yyyy-MM-dd"; > >- private BugzillaAttachmentHandler attachmentHandler; >+// private BugzillaAttachmentHandler attachmentHandler; > >- private BugzillaTaskDataHandler taskDataHandler; >+ private final BugzillaTaskDataHandler taskDataHandler = new BugzillaTaskDataHandler(this); > > private BugzillaClientManager clientManager; > > private final Set<BugzillaLanguageSettings> languages = new LinkedHashSet<BugzillaLanguageSettings>(); > >- @Override >- public void init(ITaskList taskList) { >- super.init(taskList); >- this.taskDataHandler = new BugzillaTaskDataHandler(this); >- this.attachmentHandler = new BugzillaAttachmentHandler(this); >- BugzillaCorePlugin.setConnector(this); >- BugzillaLanguageSettings enSetting = new BugzillaLanguageSettings(IBugzillaConstants.DEFAULT_LANG); >- enSetting.addLanguageAttribute("error_login", "Login"); >- enSetting.addLanguageAttribute("error_login", "log in"); >- enSetting.addLanguageAttribute("error_login", "check e-mail"); >- enSetting.addLanguageAttribute("error_login", "Invalid Username Or Password"); >- enSetting.addLanguageAttribute("error_collision", "Mid-air collision!"); >- enSetting.addLanguageAttribute("error_comment_required", "Comment Required"); >- enSetting.addLanguageAttribute("error_logged_out", "logged out"); >- enSetting.addLanguageAttribute("bad_login", "Login"); >- enSetting.addLanguageAttribute("bad_login", "log in"); >- enSetting.addLanguageAttribute("bad_login", "check e-mail"); >- enSetting.addLanguageAttribute("bad_login", "Invalid Username Or Password"); >- enSetting.addLanguageAttribute("bad_login", "error"); >- enSetting.addLanguageAttribute("processed", "processed"); >- enSetting.addLanguageAttribute("changes_submitted", "Changes submitted"); >- languages.add(enSetting); >- } >+// @Override >+// public void init(ITaskList taskList) { >+// super.init(taskList); >+// this.taskDataHandler = new BugzillaTaskDataHandler(this); >+// this.attachmentHandler = new BugzillaAttachmentHandler(this); >+// BugzillaCorePlugin.setConnector(this); >+// BugzillaLanguageSettings enSetting = new BugzillaLanguageSettings(IBugzillaConstants.DEFAULT_LANG); >+// enSetting.addLanguageAttribute("error_login", "Login"); >+// enSetting.addLanguageAttribute("error_login", "log in"); >+// enSetting.addLanguageAttribute("error_login", "check e-mail"); >+// enSetting.addLanguageAttribute("error_login", "Invalid Username Or Password"); >+// enSetting.addLanguageAttribute("error_collision", "Mid-air collision!"); >+// enSetting.addLanguageAttribute("error_comment_required", "Comment Required"); >+// enSetting.addLanguageAttribute("error_logged_out", "logged out"); >+// enSetting.addLanguageAttribute("bad_login", "Login"); >+// enSetting.addLanguageAttribute("bad_login", "log in"); >+// enSetting.addLanguageAttribute("bad_login", "check e-mail"); >+// enSetting.addLanguageAttribute("bad_login", "Invalid Username Or Password"); >+// enSetting.addLanguageAttribute("bad_login", "error"); >+// enSetting.addLanguageAttribute("processed", "processed"); >+// enSetting.addLanguageAttribute("changes_submitted", "Changes submitted"); >+// languages.add(enSetting); >+// } > > @Override > public String getLabel() { >@@ -100,37 +97,23 @@ > } > > @Override >- public AbstractAttachmentHandler getAttachmentHandler() { >- return attachmentHandler; >- } >- >- @Override >- public AbstractTaskDataHandler getLegacyTaskDataHandler() { >- return taskDataHandler; >- } >- >- @Override > public String getConnectorKind() { >- return BugzillaCorePlugin.REPOSITORY_KIND; >- } >- >- @Override >- public AbstractTask createTask(String repositoryUrl, String id, String summary) { >- BugzillaTask task = new BugzillaTask(repositoryUrl, id, summary); >- task.setCreationDate(new Date()); >- return task; >+ return BugzillaCorePlugin.CONNECTOR_KIND; > } > > @Override >- public boolean updateTaskFromTaskData(TaskRepository repository, ITask repositoryTask, RepositoryTaskData taskData) { >- BugzillaTask bugzillaTask = (BugzillaTask) repositoryTask; >+ public void updateTaskFromTaskData(TaskRepository repository, ITask task, TaskData taskData) { > if (taskData != null) { >- if (taskData.isPartial()) { >- bugzillaTask.setSummary(taskData.getAttributeValue(RepositoryTaskAttribute.SUMMARY)); >- bugzillaTask.setPriority(taskData.getAttributeValue(RepositoryTaskAttribute.PRIORITY)); >- bugzillaTask.setOwner(taskData.getAttributeValue(RepositoryTaskAttribute.USER_OWNER)); >- return false; >- } >+ TaskMapper scheme = new TaskMapper(taskData); >+ scheme.applyTo(task); >+ >+// if (taskData.isPartial()) { >+// >+// bugzillaTask.setSummary(getAtaskData.getAttributeValue(RepositoryTaskAttribute.SUMMARY)); >+// bugzillaTask.setPriority(taskData.getAttributeValue(RepositoryTaskAttribute.PRIORITY)); >+// bugzillaTask.setOwner(taskData.getAttributeValue(RepositoryTaskAttribute.USER_OWNER)); >+// return; >+// } > > //// // subtasks > // repositoryTask.dropSubTasks(); >@@ -154,117 +137,130 @@ > // } > > // Summary >- String summary = taskData.getSummary(); >- bugzillaTask.setSummary(summary); >+// String summary = taskData.getSummary(); >+// bugzillaTask.setSummary(summary); > > // Owner >- String owner = taskData.getAssignedTo(); >- if (owner != null && !owner.equals("")) { >- bugzillaTask.setOwner(owner); >- } >+// String owner = taskData.getAssignedTo(); >+// if (owner != null && !owner.equals("")) { >+// bugzillaTask.setOwner(owner); >+// } > > // Creation Date >- String createdString = taskData.getCreated(); >- if (createdString != null && createdString.length() > 0) { >- Date dateCreated = taskData.getAttributeFactory().getDateForAttributeType( >- RepositoryTaskAttribute.DATE_CREATION, taskData.getCreated()); >- if (dateCreated != null) { >- bugzillaTask.setCreationDate(dateCreated); >- } >- } >+// String createdString = taskData.getCreated(); >+// if (createdString != null && createdString.length() > 0) { >+// Date dateCreated = taskData.getAttributeFactory().getDateForAttributeType( >+// RepositoryTaskAttribute.DATE_CREATION, taskData.getCreated()); >+// if (dateCreated != null) { >+// bugzillaTask.setCreationDate(dateCreated); >+// } >+// } > > // Completed > boolean isComplete = false; > // TODO: use repository configuration to determine what -completed- > // states are >- if (taskData.getStatus() != null) { >- isComplete = taskData.getStatus().equals(IBugzillaConstants.VALUE_STATUS_RESOLVED) >- || taskData.getStatus().equals(IBugzillaConstants.VALUE_STATUS_CLOSED) >- || taskData.getStatus().equals(IBugzillaConstants.VALUE_STATUS_VERIFIED); >+ >+ TaskAttribute attributeStatus = taskData.getMappedAttribute(TaskAttribute.STATUS); >+ >+ if (attributeStatus != null) { >+ isComplete = attributeStatus.getValue().equals(IBugzillaConstants.VALUE_STATUS_RESOLVED) >+ || attributeStatus.getValue().equals(IBugzillaConstants.VALUE_STATUS_CLOSED) >+ || attributeStatus.getValue().equals(IBugzillaConstants.VALUE_STATUS_VERIFIED); > } >- bugzillaTask.setCompleted(isComplete); > >+ TaskAttribute commentContainer = taskData.getMappedAttribute(TaskAttribute.CONTAINER_COMMENTS); > // Completion Date >- if (isComplete) { >+ if (isComplete && commentContainer != null) { > Date completionDate = null; >- try { >- >- List<TaskComment> taskComments = taskData.getComments(); >- if (taskComments != null && !taskComments.isEmpty()) { >- // TODO: fix not to be based on comment >- completionDate = new SimpleDateFormat(COMMENT_FORMAT).parse(taskComments.get( >- taskComments.size() - 1).getCreated()); >- >- } else { >- // Use last modified date >- String lastMod = taskData.getLastModified(); >- if (lastMod != null && lastMod.length() > 0) { >- completionDate = taskData.getAttributeFactory().getDateForAttributeType( >- RepositoryTaskAttribute.DATE_MODIFIED, lastMod); >+ Collection<TaskAttribute> taskComments = commentContainer.getAttributes().values(); >+ if (taskComments != null && !taskComments.isEmpty()) { >+ Set<String> keys = commentContainer.getAttributes().keySet(); >+ int max = 0; >+ for (String string : keys) { >+ try { >+ int temp = Integer.parseInt(string); >+ if (temp > max) { >+ temp = max; >+ } >+ } catch (NumberFormatException e) { >+ //ignore >+ } >+ } >+ TaskAttribute lastComment = commentContainer.getAttribute(max + ""); >+ if (lastComment != null) { >+ TaskAttribute attributeCommentDate = lastComment.getMappedAttribute(TaskAttribute.COMMENT_DATE); >+ if (attributeCommentDate != null) { >+ try { >+ completionDate = new SimpleDateFormat(COMMENT_FORMAT).parse(attributeCommentDate.getValue()); >+ } catch (ParseException e) { >+ // ignore >+ } > } > } > >- } catch (Exception e) { >- >+ } else { >+ // Use last modified date >+ TaskAttribute attributeLastModified = taskData.getMappedAttribute(TaskAttribute.DATE_MODIFIED); >+ if (attributeLastModified != null && attributeLastModified.getValue().length() > 0) { >+ completionDate = taskData.getAttributeMapper().getDateValue(attributeLastModified); >+ } > } > >- if (bugzillaTask.getCompletionDate() != null && completionDate != null) { >- // if changed: >- // TODO: get taskListManger.setDueDate(ITask task, Date >- // dueDate) >+ if (task.getCompletionDate() != null && completionDate != null) { >+ // TODO: if changed notify via task list > } >- bugzillaTask.setCompletionDate(completionDate); >+ task.setCompletionDate(completionDate); > > } > >- // Priority >- String priority = PriorityLevel.getDefault().toString(); >- if (taskData.getAttribute(RepositoryTaskAttribute.PRIORITY) != null) { >- priority = taskData.getAttribute(RepositoryTaskAttribute.PRIORITY).getValue(); >- } >- bugzillaTask.setPriority(priority); >+// // Priority >+// String priority = PriorityLevel.getDefault().toString(); >+// if (taskData.getAttribute(RepositoryTaskAttribute.PRIORITY) != null) { >+// priority = taskData.getAttribute(RepositoryTaskAttribute.PRIORITY).getValue(); >+// } >+// bugzillaTask.setPriority(priority); > > // Task Web Url > String url = getTaskUrl(repository.getRepositoryUrl(), taskData.getTaskId()); > if (url != null) { >- bugzillaTask.setUrl(url); >+ task.setUrl(url); > } > > // Bugzilla Specific Attributes > > // Product >- if (taskData.getProduct() != null) { >- bugzillaTask.setProduct(taskData.getProduct()); >+ if (scheme.getProduct() != null) { >+ task.setAttribute(TaskAttribute.PRODUCT, scheme.getProduct()); > } > > // Severity >- String severity = taskData.getAttributeValue(BugzillaReportElement.BUG_SEVERITY.getKeyString()); >- if (severity != null && !severity.equals("")) { >- bugzillaTask.setSeverity(severity); >+ TaskAttribute attrSeverity = taskData.getMappedAttribute(BugzillaReportElement.BUG_SEVERITY.getKey()); >+ if (attrSeverity != null && !attrSeverity.getValue().equals("")) { >+ task.setAttribute(BugzillaReportElement.BUG_SEVERITY.getKey(), attrSeverity.getValue()); > } > > // Due Date >- if (taskData.getAttribute(BugzillaReportElement.ESTIMATED_TIME.getKeyString()) != null) { >+ if (taskData.getMappedAttribute(BugzillaReportElement.ESTIMATED_TIME.getKey()) != null) { > Date dueDate = null; > // HACK: if estimated_time field exists, time tracking is > // enabled > try { >- String dueStr = taskData.getAttributeValue(BugzillaReportElement.DEADLINE.getKeyString()); >- if (dueStr != null) { >- dueDate = new SimpleDateFormat(DEADLINE_FORMAT).parse(dueStr); >+ TaskAttribute attributeDeadline = taskData.getMappedAttribute(BugzillaReportElement.DEADLINE.getKey()); >+ if (attributeDeadline != null) { >+ dueDate = new SimpleDateFormat(DEADLINE_FORMAT).parse(attributeDeadline.getValue()); > } > } catch (Exception e) { > // ignore > } >- bugzillaTask.setDueDate(dueDate); >+ task.setDueDate(dueDate); > } > > } >- return false; > } > >- @Override >- public boolean updateTaskFromQueryHit(TaskRepository repository, ITask existingTask, AbstractTask newTask) { >+// @Override >+// public boolean updateTaskFromQueryHit(TaskRepository repository, ITask existingTask, AbstractTask newTask) { > // // these properties are not provided by Bugzilla queries > // newTask.setCompleted(existingTask.isCompleted()); > // // newTask.setCompletionDate(existingTask.getCompletionDate()); >@@ -289,8 +285,8 @@ > // changed = true; > // } > // } >- return false; >- } >+// return false; >+// } > > @Override > public void preSynchronization(ISynchronizationContext event, IProgressMonitor monitor) throws CoreException { >@@ -344,7 +340,7 @@ > String newurlQueryString = URLEncoder.encode(task.getTaskId() + ",", repository.getCharacterEncoding()); > urlQueryString += newurlQueryString; > if (queryCounter >= 1000) { >- queryForChanged(repository, changedTasks, urlQueryString); >+ queryForChanged(repository, changedTasks, urlQueryString, event); > > queryCounter = 0; > urlQueryString = urlQueryBase + BUG_ID; >@@ -352,7 +348,7 @@ > } > > if (!itr.hasNext() && queryCounter != 0) { >- queryForChanged(repository, changedTasks, urlQueryString); >+ queryForChanged(repository, changedTasks, urlQueryString, event); > } > } > >@@ -374,20 +370,35 @@ > } > } > >- private void queryForChanged(final TaskRepository repository, Set<ITask> changedTasks, String urlQueryString) >- throws UnsupportedEncodingException, CoreException { >- QueryHitCollector collector = new QueryHitCollector(new ITaskFactory() { >- >- public AbstractTask createTask(RepositoryTaskData taskData, IProgressMonitor monitor) { >- // do not construct actual task objects here as query shouldn't result in new tasks >- return (AbstractTask) taskList.getTask(taskData.getRepositoryUrl(), taskData.getTaskId()); >+ /** >+ * TODO: clean up use of BugzillaTaskDataCollector >+ */ >+ private void queryForChanged(final TaskRepository repository, Set<ITask> changedTasks, String urlQueryString, >+ ISynchronizationContext context) throws UnsupportedEncodingException, CoreException { >+ >+ HashMap<String, ITask> taskById = new HashMap<String, ITask>(); >+ for (ITask task : context.getTasks()) { >+ taskById.put(task.getTaskId(), task); >+ } >+ final Set<TaskData> changedTaskData = new HashSet<TaskData>(); >+ TaskDataCollector collector = new TaskDataCollector() { >+ >+ @Override >+ public void accept(TaskData taskData) { >+ changedTaskData.add(taskData); > } >- }); >+ }; > > BugzillaRepositoryQuery query = new BugzillaRepositoryQuery(repository.getRepositoryUrl(), urlQueryString, ""); >- performQuery(repository, query, collector, null, new NullProgressMonitor()); >+ performQuery(repository, query, collector, context, new NullProgressMonitor()); >+ >+ for (TaskData data : changedTaskData) { >+ ITask changedTask = taskById.get(data.getTaskId()); >+ if (changedTask != null) { >+ changedTasks.add(changedTask); >+ } >+ } > >- changedTasks.addAll(collector.getTasks()); > } > > @Override >@@ -406,12 +417,13 @@ > try { > monitor.beginTask("Running query", IProgressMonitor.UNKNOWN); > BugzillaClient client = getClientManager().getClient(repository, monitor); >- boolean hitsReceived = client.getSearchHits(query, resultCollector, monitor); >+ TaskAttributeMapper mapper = getTaskDataHandler().getAttributeMapper(repository); >+ boolean hitsReceived = client.getSearchHits(query, resultCollector, mapper, monitor); > if (!hitsReceived) { > // XXX: HACK in case of ip change bugzilla can return 0 hits > // due to invalid authorization token, forcing relogin fixes > client.logout(monitor); >- client.getSearchHits(query, resultCollector, monitor); >+ client.getSearchHits(query, resultCollector, mapper, monitor); > } > > return Status.OK_STATUS; >@@ -471,6 +483,26 @@ > public BugzillaClientManager getClientManager() { > if (clientManager == null) { > clientManager = new BugzillaClientManager(); >+ >+ // TODO: Move this initialization elsewhere >+ BugzillaCorePlugin.setConnector(this); >+ BugzillaLanguageSettings enSetting = new BugzillaLanguageSettings(IBugzillaConstants.DEFAULT_LANG); >+ enSetting.addLanguageAttribute("error_login", "Login"); >+ enSetting.addLanguageAttribute("error_login", "log in"); >+ enSetting.addLanguageAttribute("error_login", "check e-mail"); >+ enSetting.addLanguageAttribute("error_login", "Invalid Username Or Password"); >+ enSetting.addLanguageAttribute("error_collision", "Mid-air collision!"); >+ enSetting.addLanguageAttribute("error_comment_required", "Comment Required"); >+ enSetting.addLanguageAttribute("error_logged_out", "logged out"); >+ enSetting.addLanguageAttribute("bad_login", "Login"); >+ enSetting.addLanguageAttribute("bad_login", "log in"); >+ enSetting.addLanguageAttribute("bad_login", "check e-mail"); >+ enSetting.addLanguageAttribute("bad_login", "Invalid Username Or Password"); >+ enSetting.addLanguageAttribute("bad_login", "error"); >+ enSetting.addLanguageAttribute("processed", "processed"); >+ enSetting.addLanguageAttribute("changes_submitted", "Changes submitted"); >+ languages.add(enSetting); >+ > } > return clientManager; > } >@@ -490,7 +522,6 @@ > try { > BugzillaClient client = getClientManager().getClient(repository, monitor); > if (client != null) { >- int x; > String timestamp = client.getConfigurationTimestamp(monitor); > if (timestamp != null) { > String oldTimestamp = repository.getProperty(IBugzillaConstants.PROPERTY_CONFIGTIMESTAMP); >@@ -538,23 +569,45 @@ > return BugzillaCorePlugin.getDefault().getLanguageSetting(IBugzillaConstants.DEFAULT_LANG); > } > >+// @Override >+// public RepositoryTaskData getLegacyTaskData(TaskRepository repository, String taskId, IProgressMonitor monitor) >+// throws CoreException { >+// return getLegacyTaskDataHandler().getTaskData(repository, taskId, monitor); >+// } >+ > @Override >- public RepositoryTaskData getLegacyTaskData(TaskRepository repository, String taskId, IProgressMonitor monitor) >+ public void postSynchronization(ISynchronizationContext event, IProgressMonitor monitor) throws CoreException { >+// try { >+// monitor.beginTask("", 1); >+// if (event.isFullSynchronization()) { >+// event.getTaskRepository().setSynchronizationTimeStamp( >+// getSynchronizationTimestamp(event.getTaskRepository(), event.getChangedTasks())); >+// } >+// } finally { >+// monitor.done(); >+// } >+ } >+ >+ @Override >+ public TaskData getTaskData(TaskRepository repository, String taskId, IProgressMonitor monitor) > throws CoreException { >- return getLegacyTaskDataHandler().getTaskData(repository, taskId, monitor); >+ return taskDataHandler.getTaskData(repository, taskId, monitor); > } > > @Override >- public void postSynchronization(ISynchronizationContext event, IProgressMonitor monitor) throws CoreException { >- try { >- monitor.beginTask("", 1); >- if (event.isFullSynchronization()) { >- event.getTaskRepository().setSynchronizationTimeStamp( >- getSynchronizationTimestamp(event.getTaskRepository(), event.getChangedTasks())); >- } >- } finally { >- monitor.done(); >+ public AbstractTaskDataHandler getTaskDataHandler() { >+ return taskDataHandler; >+ } >+ >+ @Override >+ public boolean hasChanged(ITask task, TaskData taskData) { >+ TaskMapper mapper = new TaskMapper(taskData); >+ Date localDate = task.getModificationDate(); >+ Date repositoryDate = mapper.getModificationDate(); >+ if (repositoryDate != null && repositoryDate.equals(localDate)) { >+ return false; > } >+ return true; > } > > } >Index: src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaReportElement.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaReportElement.java,v >retrieving revision 1.33 >diff -u -r1.33 BugzillaReportElement.java >--- src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaReportElement.java 8 May 2008 17:53:45 -0000 1.33 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaReportElement.java 22 May 2008 17:18:52 -0000 >@@ -8,48 +8,160 @@ > > package org.eclipse.mylyn.internal.bugzilla.core; > >+import org.eclipse.mylyn.tasks.core.data.TaskAttribute; >+ > /** >- * Bugzilla XML element enum. Each enum has the attribute name and associated xml element tag name. >- * > * @author Rob Elves > */ > public enum BugzillaReportElement { >- // Format: ENUM ( "pretty name", "xml key", <hidden: true/false>, <readonly: true/false>) >- // Hidden elements are not automatically displayed in ui >- STATUS_WHITEBOARD("Status Whiteboard:", "status_whiteboard", true, false), ACTUAL_TIME("Hours Worked:", >- "actual_time", true), ADD_COMMENT("Additional Comments:", "comment", true, false), ASSIGNED_TO( >- "Assigned to:", "assigned_to", true, true), ASSIGNED_TO_NAME("Assigned to:", "assigned_to_name", true, true), ATTACHID( >- "attachid", "attachid"), ATTACHMENT("attachment", "attachment"), BLOCKED("Blocks:", "blocked", true, false), BUG( >- "bug", "bug", true), BUG_FILE_LOC("URL:", "bug_file_loc", true, false), BUG_ID("Bug:", "bug_id", true), BUG_SEVERITY( >- "Severity:", "bug_severity", false), BUG_STATUS("Status:", "bug_status", true, true), BUG_WHEN("bug_when", >- "bug_when", true, true), BUGZILLA("bugzilla", "bugzilla", true), CC("CC:", "cc", true, true), CCLIST_ACCESSIBLE( >- "CC List", "cclist_accessible", true), CLASSIFICATION("Classification:", "classification", true), CLASSIFICATION_ID( >- "Classification ID:", "classification_id", true), COMPONENT("Component:", "component", false), CREATION_TS( >- "Opened:", "creation_ts", true), CTYPE("Content Type", "ctype"), DATA("data", "data"), DATE("Date", "date"), DEADLINE( >- "Deadline:", "deadline", true, true), DELTA_TS("Modified:", "delta_ts", true), DEPENDSON( >- "Depends on (Subtasks):", "dependson", true, false), DESC("desc", "desc", true, true), EVERCONFIRMED( >- "everconfirmed", "everconfirmed", true), ESTIMATED_TIME("Estimated Time:", "estimated_time", true), FILENAME( >- "filename", "filename"), GROUP("Group", "group", true, true), IS_OBSOLETE("Obsolete", "isobsolete", true), IS_PATCH( >- "Patch", "ispatch", true), KEYWORDS("Keywords:", "keywords", true), LONG_DESC("Description:", "long_desc"), LONGDESCLENGTH( >- "Number of comments", "longdesclength", true), NEWCC("Add CC:", "newcc", true), OP_SYS("OS:", "op_sys", >- false), PRIORITY("Priority:", "priority", false, false), PRODUCT("Product:", "product", false), REP_PLATFORM( >- "Platform:", "rep_platform", false), REPORTER("Reporter:", "reporter", true, true), REPORTER_NAME( >- "Reporter:", "reporter_name", true, true), REPORTER_ACCESSIBLE("Reporter", "reporter_accessible", true), RESOLUTION( >- "Resolution:", "resolution", false, true), // Exiting bug field, new cc >- REMAINING_TIME("Hours Left:", "remaining_time", true), SET_DEFAULT_ASSIGNEE("Reassign to default assignee", >- "set_default_assignee", false), SHORT_DESC("Summary:", "short_desc", true), SIZE("Size:", "size"), TARGET_MILESTONE( >- "Target milestone:", "target_milestone", false), THETEXT("thetext", "thetext", false, true), TYPE("type", >- "type"), UNKNOWN("UNKNOWN", "UNKNOWN"), VERSION("Version:", "version", false), INSTALL_VERSION( >- "version of bugzilla installed", "install_version", true), VOTES("Votes:", "votes", true, true), WORK_TIME( >- "Add Time:", "work_time", true, false), WHO("who", "who"), WHO_NAME("who_name", "who_name", true, true), QA_CONTACT( >- "QA Contact", "qa_contact", true, false), QA_CONTACT_NAME("QA Contact", "qa_contact_name", true, true), ADDSELFCC( >- "Add self to CC", "addselfcc", true, false), >+ >+ STATUS_WHITEBOARD("Status Whiteboard:", "status_whiteboard", TaskAttribute.TYPE_LONG_TEXT, false, false), >+ >+ ACTUAL_TIME("Hours Worked:", "actual_time", TaskAttribute.TYPE_SHORT_TEXT, true, false), >+ >+ ADD_COMMENT("Additional Comments:", "comment", TaskAttribute.TYPE_LONG_TEXT, true, false), >+ >+ ASSIGNED_TO("Assigned to:", "assigned_to", TaskAttribute.TYPE_PERSON, true, true), >+ >+ ASSIGNED_TO_NAME("Assigned to:", "assigned_to_name", TaskAttribute.TYPE_PERSON, true, true), >+ >+ ATTACHID("attachid", "attachid", TaskAttribute.TYPE_SHORT_TEXT, false, false), >+ >+ ATTACHMENT("attachment", "attachment", TaskAttribute.TYPE_ATTACHMENT, false, false), >+ >+ BLOCKED("Blocks:", "blocked", TaskAttribute.TYPE_SHORT_TEXT, true, false), >+ >+ BUG("bug", "bug", TaskAttribute.TYPE_SHORT_TEXT, true, false), >+ >+ BUG_FILE_LOC("URL:", "bug_file_loc", TaskAttribute.TYPE_SHORT_TEXT, true, false), >+ >+ BUG_ID("Bug:", "bug_id", TaskAttribute.TYPE_SHORT_TEXT, true, false), >+ >+ BUG_SEVERITY("Severity:", "bug_severity", TaskAttribute.TYPE_SINGLE_SELECT, false, false), >+ >+ BUG_STATUS("Status:", "bug_status", TaskAttribute.TYPE_SHORT_TEXT, true, true), >+ >+ BUG_WHEN("bug_when", "bug_when", TaskAttribute.TYPE_SHORT_TEXT, true, true), >+ >+ BUGZILLA("bugzilla", "bugzilla", TaskAttribute.TYPE_SHORT_TEXT, true, false), >+ >+ CC("CC:", "cc", TaskAttribute.TYPE_MULTI_SELECT, true, true), >+ >+ CCLIST_ACCESSIBLE("CC List", "cclist_accessible", TaskAttribute.TYPE_SHORT_TEXT, true, false), >+ >+ CLASSIFICATION("Classification:", "classification", TaskAttribute.TYPE_SHORT_TEXT, true, false), >+ >+ CLASSIFICATION_ID("Classification ID:", "classification_id", TaskAttribute.TYPE_SHORT_TEXT, true, false), >+ >+ COMPONENT("Component:", "component", TaskAttribute.TYPE_SINGLE_SELECT, false, false), >+ >+ CREATION_TS("Opened:", "creation_ts", TaskAttribute.TYPE_SHORT_TEXT, true, false), >+ >+ CTYPE("Content Type", "ctype", TaskAttribute.TYPE_SHORT_TEXT, false, false), >+ >+ DATA("data", "data", TaskAttribute.TYPE_SHORT_TEXT, false, false), >+ >+ DATE("Date", "date", TaskAttribute.TYPE_SHORT_TEXT, false, false), >+ >+ DEADLINE("Deadline:", "deadline", TaskAttribute.TYPE_SHORT_TEXT, true, true), >+ >+ DELTA_TS("Modified:", "delta_ts", TaskAttribute.TYPE_SHORT_TEXT, true, false), >+ >+ DEPENDSON("Depends on (Subtasks):", "dependson", TaskAttribute.TYPE_SHORT_TEXT, true, false), >+ >+ DESC("desc", "desc", TaskAttribute.TYPE_LONG_TEXT, true, true), >+ >+ EVERCONFIRMED("everconfirmed", "everconfirmed", TaskAttribute.TYPE_BOOLEAN, true, false), >+ >+ ESTIMATED_TIME("Estimated Time:", "estimated_time", TaskAttribute.TYPE_SHORT_TEXT, true, false), >+ >+ FILENAME("filename", "filename", TaskAttribute.TYPE_SHORT_TEXT, false, false), >+ >+ GROUP("Group", "group", TaskAttribute.TYPE_BOOLEAN, true, true), >+ >+ IS_OBSOLETE("Obsolete", "isobsolete", TaskAttribute.TYPE_BOOLEAN, true, false), >+ >+ IS_PATCH("Patch", "ispatch", TaskAttribute.TYPE_BOOLEAN, true, false), >+ >+ KEYWORDS("Keywords:", "keywords", TaskAttribute.TYPE_SHORT_TEXT, true, false), >+ >+ LONG_DESC("Description:", "long_desc", TaskAttribute.TYPE_LONG_TEXT, false, false), >+ >+ LONGDESCLENGTH("Number of comments", "longdesclength", TaskAttribute.TYPE_SHORT_TEXT, true, false), >+ >+ NEWCC("Add CC:", "newcc", TaskAttribute.TYPE_SHORT_TEXT, true, false), >+ >+ OP_SYS("OS:", "op_sys", TaskAttribute.TYPE_SINGLE_SELECT, false, false), >+ >+ PRIORITY("Priority:", "priority", TaskAttribute.TYPE_SINGLE_SELECT, false, false), >+ >+ PRODUCT("Product:", "product", TaskAttribute.TYPE_SHORT_TEXT, false, true), >+ >+ REP_PLATFORM("Platform:", "rep_platform", TaskAttribute.TYPE_SINGLE_SELECT, false, false), >+ >+ REPORTER("Reporter:", "reporter", TaskAttribute.TYPE_PERSON, true, true), >+ >+ REPORTER_NAME("Reporter:", "reporter_name", TaskAttribute.TYPE_PERSON, true, true), >+ >+ REPORTER_ACCESSIBLE("Reporter", "reporter_accessible", TaskAttribute.TYPE_BOOLEAN, true, false), >+ >+ RESOLUTION("Resolution:", "resolution", TaskAttribute.TYPE_SINGLE_SELECT, false, true), // Exiting bug field, new cc >+ >+ REMAINING_TIME("Hours Left:", "remaining_time", TaskAttribute.TYPE_SHORT_TEXT, true, false), >+ >+ SET_DEFAULT_ASSIGNEE("Reassign to default assignee", "set_default_assignee", TaskAttribute.TYPE_OPERATION, false, >+ false), >+ >+ SHORT_DESC("Summary:", "short_desc", TaskAttribute.TYPE_SHORT_TEXT, true, false), >+ >+ SIZE("Size:", "size", TaskAttribute.TYPE_SHORT_TEXT, false, false), >+ >+ TARGET_MILESTONE("Target milestone:", "target_milestone", TaskAttribute.TYPE_SHORT_TEXT, false, false), >+ >+ THETEXT("thetext", "thetext", TaskAttribute.TYPE_SHORT_TEXT, false, true), >+ >+ TYPE("type", "type", TaskAttribute.TYPE_SHORT_TEXT, false, false), >+ >+ UNKNOWN("UNKNOWN", "UNKNOWN", TaskAttribute.TYPE_SHORT_TEXT, false, false), >+ >+ VERSION("Version:", "version", TaskAttribute.TYPE_SHORT_TEXT, false, false), >+ >+ INSTALL_VERSION("version of bugzilla installed", "install_version", null, true, false), >+ >+ VOTES("Votes:", "votes", TaskAttribute.TYPE_SHORT_TEXT, true, true), >+ >+ WORK_TIME("Add Time:", "work_time", TaskAttribute.TYPE_SHORT_TEXT, true, false), >+ >+ WHO("who", "who", TaskAttribute.TYPE_PERSON, false, false), >+ >+ WHO_NAME("who_name", "who_name", TaskAttribute.TYPE_SHORT_TEXT, true, true), >+ >+ QA_CONTACT("QA Contact", "qa_contact", TaskAttribute.TYPE_PERSON, true, false), >+ >+ QA_CONTACT_NAME("QA Contact", "qa_contact_name", TaskAttribute.TYPE_SHORT_TEXT, true, true), >+ >+ ADDSELFCC("Add self to CC", "addselfcc", TaskAttribute.TYPE_BOOLEAN, true, false), >+ >+ STATUS_OPEN("open status values", "status_open", null, true, true), >+ >+ NEW_COMMENT("new comment", "new_comment", TaskAttribute.TYPE_LONG_TEXT, true, false), >+ > // Used by search engine >- LI("used by search engine", "li", true), ID("used by search engine", "id", true), SHORT_SHORT_DESC( >- "used by search engine", "short_short_desc", false), SEQ("used by search engine", "seq", false), RESULT( >- "used by search engine", "result", false), RDF("used by search engine", "rdf", false), INSTALLATION( >- "used by search engine", "installation", false), BUGS("used by search engine", "bugs", false), STATUS_OPEN( >- "open status values", "status_open", true, true), NEW_COMMENT("new comment", "new_comment", true, false); >+ LI("used by search engine", "li", null, true, false), >+ >+ ID("used by search engine", "id", null, true, false), >+ >+ SHORT_SHORT_DESC("used by search engine", "short_short_desc", null, false, false), >+ >+ SEQ("used by search engine", "seq", null, false, false), >+ >+ RESULT("used by search engine", "result", null, false, false), >+ >+ RDF("used by search engine", "rdf", null, false, false), >+ >+ INSTALLATION("used by search engine", "installation", null, false, false), >+ >+ BUGS("used by search engine", "bugs", null, false, false); > > private final boolean isHidden; > >@@ -59,22 +171,17 @@ > > private final String prettyName; > >- BugzillaReportElement(String prettyName, String fieldName) { >- this(prettyName, fieldName, false, false); >- } >- >- BugzillaReportElement(String prettyName, String fieldName, boolean hidden) { >- this(prettyName, fieldName, hidden, false); >- } >+ private final String type; > >- BugzillaReportElement(String prettyName, String fieldName, boolean hidden, boolean readonly) { >+ BugzillaReportElement(String prettyName, String fieldName, String type, boolean hidden, boolean readonly) { > this.prettyName = prettyName; > this.keyString = fieldName; >+ this.type = type; > this.isHidden = hidden; > this.isReadOnly = readonly; > } > >- public String getKeyString() { >+ public String getKey() { > return keyString; > } > >@@ -89,4 +196,12 @@ > public String toString() { > return prettyName; > } >+ >+ public String getKind() { >+ return isHidden() ? null : TaskAttribute.KIND_DEFAULT; >+ } >+ >+ public String getType() { >+ return type; >+ } > } >Index: src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTask.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTask.java,v >retrieving revision 1.31 >diff -u -r1.31 BugzillaTask.java >--- src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTask.java 5 May 2008 16:40:28 -0000 1.31 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTask.java 22 May 2008 17:18:53 -0000 >@@ -15,7 +15,9 @@ > /** > * @author Mik Kersten > * @author Rob Elves >+ * @deprecated > */ >+@Deprecated > public class BugzillaTask extends AbstractTask { > > private String severity; >@@ -39,7 +41,7 @@ > > @Override > public String getConnectorKind() { >- return BugzillaCorePlugin.REPOSITORY_KIND; >+ return BugzillaCorePlugin.CONNECTOR_KIND; > } > > public String getSeverity() { >Index: src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java,v >retrieving revision 1.50 >diff -u -r1.50 BugzillaTaskDataHandler.java >--- src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java 8 May 2008 17:53:45 -0000 1.50 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java 22 May 2008 17:18:53 -0000 >@@ -18,13 +18,17 @@ > import org.eclipse.core.runtime.IProgressMonitor; > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.SubProgressMonitor; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.AbstractAttributeFactory; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.AbstractTaskDataHandler; > import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskAttribute; > import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskData; > import org.eclipse.mylyn.tasks.core.ITask; >+import org.eclipse.mylyn.tasks.core.RepositoryResponse; > import org.eclipse.mylyn.tasks.core.RepositoryStatus; > import org.eclipse.mylyn.tasks.core.TaskRepository; >+import org.eclipse.mylyn.tasks.core.data.AbstractTaskDataHandler; >+import org.eclipse.mylyn.tasks.core.data.TaskAttribute; >+import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper; >+import org.eclipse.mylyn.tasks.core.data.TaskAttributeProperties; >+import org.eclipse.mylyn.tasks.core.data.TaskData; > import org.eclipse.mylyn.tasks.core.data.TaskDataCollector; > > /** >@@ -33,23 +37,20 @@ > */ > public class BugzillaTaskDataHandler extends AbstractTaskDataHandler { > >- private final AbstractAttributeFactory attributeFactory = new BugzillaAttributeFactory(); >- > private final BugzillaRepositoryConnector connector; > > public BugzillaTaskDataHandler(BugzillaRepositoryConnector connector) { > this.connector = connector; > } > >- @Override >- public RepositoryTaskData getTaskData(TaskRepository repository, String taskId, IProgressMonitor monitor) >+ public TaskData getTaskData(TaskRepository repository, String taskId, IProgressMonitor monitor) > throws CoreException { > try { > BugzillaClient client = connector.getClientManager().getClient(repository, > new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN)); > int bugId = BugzillaRepositoryConnector.getBugId(taskId); >- RepositoryTaskData taskData; >- taskData = client.getTaskData(bugId, monitor); >+ TaskData taskData; >+ taskData = client.getTaskData(bugId, getAttributeMapper(repository), monitor); > return taskData; > > } catch (IOException e) { >@@ -65,7 +66,8 @@ > monitor.beginTask("Receiving tasks", taskIds.size()); > BugzillaClient client = connector.getClientManager().getClient(repository, > new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN)); >- client.getTaskData(taskIds, collector, monitor); >+ >+ client.getTaskData(taskIds, collector, getAttributeMapper(repository), monitor); > } catch (IOException e) { > throw new CoreException(new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.PLUGIN_ID, > RepositoryStatus.ERROR_IO, repository.getRepositoryUrl(), e)); >@@ -75,8 +77,8 @@ > } > > @Override >- public String postTaskData(TaskRepository repository, RepositoryTaskData taskData, IProgressMonitor monitor) >- throws CoreException { >+ public RepositoryResponse postTaskData(TaskRepository repository, TaskData taskData, >+ Set<TaskAttribute> changedAttributes, IProgressMonitor monitor) throws CoreException { > try { > BugzillaClient client = connector.getClientManager().getClient(repository, > new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN)); >@@ -99,156 +101,198 @@ > } > > @Override >- public AbstractAttributeFactory getAttributeFactory(String repositoryUrl, String repositoryKind, String taskKind) { >- // we don't care about the repository information right now >- return attributeFactory; >- } >- >- @Override >- public AbstractAttributeFactory getAttributeFactory(RepositoryTaskData taskData) { >- return getAttributeFactory(taskData.getRepositoryUrl(), taskData.getConnectorKind(), taskData.getTaskKind()); >- } >- >- @Override >- public boolean initializeTaskData(TaskRepository repository, RepositoryTaskData data, IProgressMonitor monitor) >+ public boolean initializeTaskData(TaskRepository repository, TaskData data, IProgressMonitor monitor) > throws CoreException { > > if (data == null) { > return false; > } >- String product = data.getProduct(); >- if (product.equals("")) { >+ >+ TaskAttribute root = data.getRoot(); >+ >+ TaskAttribute oldProductAttribute = root.getAttribute(TaskAttribute.PRODUCT); >+ if (oldProductAttribute == null) { >+ return false; >+ } >+ >+ if (oldProductAttribute.getValue().equals("")) { > // Bugzilla needs a product to create task data > // If I see it right the product is never an empty String. > // but to be save I return false as before bug# 213077 > return false; > } >- data.removeAllAttributes(); >+ >+ root.clearAttributes(); >+ // TODO: Are the following necessary? >+ root.clearMetaDatas(); >+ root.clearOptions(); >+ root.clearValues(); > > RepositoryConfiguration repositoryConfiguration = BugzillaCorePlugin.getRepositoryConfiguration(repository, > false, monitor); > >- RepositoryTaskAttribute a = BugzillaClient.makeNewAttribute(BugzillaReportElement.PRODUCT); >+ TaskAttribute productAttribute = createAttribute(data, BugzillaReportElement.PRODUCT); >+ productAttribute.setValue(oldProductAttribute.getValue()); >+ > List<String> optionValues = repositoryConfiguration.getProducts(); > Collections.sort(optionValues); >- a.setValue(product); >- a.setReadOnly(true); >- >- data.addAttribute(BugzillaReportElement.PRODUCT.getKeyString(), a); >+ for (String optionValue : optionValues) { >+ productAttribute.putOption(optionValue, optionValue); >+ } > >- a = BugzillaClient.makeNewAttribute(BugzillaReportElement.BUG_STATUS); >+ TaskAttribute attributeStatus = createAttribute(data, BugzillaReportElement.BUG_STATUS); > optionValues = repositoryConfiguration.getStatusValues(); > for (String option : optionValues) { >- a.addOption(option, option); >+ attributeStatus.putOption(option, option); > } >- a.setValue(IBugzillaConstants.VALUE_STATUS_NEW); > >- data.addAttribute(BugzillaReportElement.BUG_STATUS.getKeyString(), a); >+ attributeStatus.setValue(IBugzillaConstants.VALUE_STATUS_NEW); > >- a = BugzillaClient.makeNewAttribute(BugzillaReportElement.SHORT_DESC); >- data.addAttribute(BugzillaReportElement.SHORT_DESC.getKeyString(), a); >+ createAttribute(data, BugzillaReportElement.SHORT_DESC); > >- a = BugzillaClient.makeNewAttribute(BugzillaReportElement.VERSION); >- optionValues = repositoryConfiguration.getVersions(data.getProduct()); >+ TaskAttribute attributeVersion = createAttribute(data, BugzillaReportElement.VERSION); >+ optionValues = repositoryConfiguration.getVersions(productAttribute.getValue()); > Collections.sort(optionValues); > for (String option : optionValues) { >- a.addOption(option, option); >+ attributeVersion.putOption(option, option); > } > if (optionValues.size() > 0) { >- a.setValue(optionValues.get(optionValues.size() - 1)); >+ attributeVersion.setValue(optionValues.get(optionValues.size() - 1)); > } > >- data.addAttribute(BugzillaReportElement.VERSION.getKeyString(), a); >- >- a = BugzillaClient.makeNewAttribute(BugzillaReportElement.COMPONENT); >- optionValues = repositoryConfiguration.getComponents(data.getProduct()); >+ TaskAttribute attributeComponent = createAttribute(data, BugzillaReportElement.COMPONENT); >+ optionValues = repositoryConfiguration.getComponents(productAttribute.getValue()); > Collections.sort(optionValues); > for (String option : optionValues) { >- a.addOption(option, option); >+ attributeComponent.putOption(option, option); > } > if (optionValues.size() == 1) { >- a.setValue(optionValues.get(0)); >+ attributeComponent.setValue(optionValues.get(0)); > } > >- data.addAttribute(BugzillaReportElement.COMPONENT.getKeyString(), a); >- >- a = BugzillaClient.makeNewAttribute(BugzillaReportElement.REP_PLATFORM); >+ TaskAttribute attributePlatform = createAttribute(data, BugzillaReportElement.REP_PLATFORM); > optionValues = repositoryConfiguration.getPlatforms(); > for (String option : optionValues) { >- a.addOption(option, option); >+ attributePlatform.putOption(option, option); > } > if (optionValues.size() > 0) { > // bug 159397 choose first platform: All >- a.setValue(optionValues.get(0)); >+ attributePlatform.setValue(optionValues.get(0)); > } > >- data.addAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString(), a); >- >- a = BugzillaClient.makeNewAttribute(BugzillaReportElement.OP_SYS); >+ TaskAttribute attributeOPSYS = createAttribute(data, BugzillaReportElement.OP_SYS); > optionValues = repositoryConfiguration.getOSs(); > for (String option : optionValues) { >- a.addOption(option, option); >+ attributeOPSYS.putOption(option, option); > } > if (optionValues.size() > 0) { > // bug 159397 change to choose first op_sys All >- a.setValue(optionValues.get(0)); >+ attributeOPSYS.setValue(optionValues.get(0)); > } > >- data.addAttribute(BugzillaReportElement.OP_SYS.getKeyString(), a); >- >- a = BugzillaClient.makeNewAttribute(BugzillaReportElement.PRIORITY); >+ TaskAttribute attributePriority = createAttribute(data, BugzillaReportElement.PRIORITY); > optionValues = repositoryConfiguration.getPriorities(); > for (String option : optionValues) { >- a.addOption(option, option); >+ attributePriority.putOption(option, option); > } > if (optionValues.size() > 0) { >- a.setValue(optionValues.get((optionValues.size() / 2))); // choose middle priority >+ // choose middle priority >+ attributePriority.setValue(optionValues.get((optionValues.size() / 2))); > } > >- data.addAttribute(BugzillaReportElement.PRIORITY.getKeyString(), a); >- >- a = BugzillaClient.makeNewAttribute(BugzillaReportElement.BUG_SEVERITY); >+ TaskAttribute attributeSeverity = createAttribute(data, BugzillaReportElement.BUG_SEVERITY); > optionValues = repositoryConfiguration.getSeverities(); > for (String option : optionValues) { >- a.addOption(option, option); >+ attributeSeverity.putOption(option, option); > } > if (optionValues.size() > 0) { >- a.setValue(optionValues.get((optionValues.size() / 2))); // choose middle severity >+ // choose middle severity >+ attributeSeverity.setValue(optionValues.get((optionValues.size() / 2))); > } > >- data.addAttribute(BugzillaReportElement.BUG_SEVERITY.getKeyString(), a); >+ TaskAttribute attributeAssignedTo = createAttribute(data, BugzillaReportElement.ASSIGNED_TO); >+ attributeAssignedTo.setValue(""); >+// attributeAssignedTo.setReadOnly(false); >+ >+ TaskAttribute attributeBugFileLoc = createAttribute(data, BugzillaReportElement.BUG_FILE_LOC); >+ attributeBugFileLoc.setValue("http://"); >+ //a.setHidden(false); >+ >+ createAttribute(data, BugzillaReportElement.DEPENDSON); >+// a.setValue(""); >+// a.setReadOnly(false); >+ createAttribute(data, BugzillaReportElement.BLOCKED); >+// a.setValue(""); >+// a.setReadOnly(false); >+ createAttribute(data, BugzillaReportElement.NEWCC); >+// a.setValue(""); >+// a.setReadOnly(false); >+ return true; >+ } >+ >+ public static TaskAttribute createAttribute(TaskData data, BugzillaReportElement key) { >+ return createAttribute(data.getRoot(), key); >+ } >+ >+ public static TaskAttribute createAttribute(TaskAttribute parent, BugzillaReportElement key) { >+ TaskAttribute attribute = parent.createAttribute(key.getKey()); >+ TaskAttributeProperties.defaults() >+ .setReadOnly(key.isReadOnly()) >+ .setKind(key.getKind()) >+ .setLabel(key.toString()) >+ .setType(key.getType()) >+ .applyTo(attribute); >+ return attribute; >+ } >+ >+ private void addAttributeValue(TaskData data, BugzillaReportElement key, String value) { >+ data.getRoot().getAttribute(key.getKey()).addValue(value); >+ } >+ >+ @Override >+ public boolean canGetMultiTaskData() { >+ return true; >+ } >+ >+ @Override >+ public boolean canInitializeSubTaskData(ITask task, TaskData parentTaskData) { >+ return true; >+ } >+ >+ @Override >+ public boolean initializeSubTaskData(TaskRepository repository, TaskData subTaskData, TaskData parentTaskData, >+ IProgressMonitor monitor) throws CoreException { >+ TaskAttribute attributeProject = parentTaskData.getRoot().getMappedAttribute(TaskAttribute.PRODUCT); >+ String product = attributeProject.getValue(); >+ >+ TaskAttribute subAttributeProject = createAttribute(subTaskData, BugzillaReportElement.PRODUCT); >+ subAttributeProject.setValue(product); >+ >+ initializeTaskData(repository, subTaskData, monitor); >+ // TODO: >+ //cloneTaskData(parentTaskData, subTaskData); >+ TaskAttribute attributeBlocked = createAttribute(subTaskData, BugzillaReportElement.BLOCKED); >+ attributeBlocked.setValue(parentTaskData.getTaskId()); >+ >+ TaskAttribute parentAttributeAssigned = parentTaskData.getRoot() >+ .getMappedAttribute(TaskAttribute.USER_ASSIGNED); >+ TaskAttribute attributeAssigned = createAttribute(subTaskData, BugzillaReportElement.ASSIGNED_TO); >+ attributeAssigned.setValue(parentAttributeAssigned.getValue()); > >- a = BugzillaClient.makeNewAttribute(BugzillaReportElement.ASSIGNED_TO); >- a.setValue(""); >- a.setReadOnly(false); >- >- data.addAttribute(BugzillaReportElement.ASSIGNED_TO.getKeyString(), a); >- >- a = BugzillaClient.makeNewAttribute(BugzillaReportElement.BUG_FILE_LOC); >- a.setValue("http://"); >- a.setHidden(false); >- >- data.addAttribute(BugzillaReportElement.BUG_FILE_LOC.getKeyString(), a); >- a = BugzillaClient.makeNewAttribute(BugzillaReportElement.DEPENDSON); >- a.setValue(""); >- a.setReadOnly(false); >- data.addAttribute(BugzillaReportElement.DEPENDSON.getKeyString(), a); >- a = BugzillaClient.makeNewAttribute(BugzillaReportElement.BLOCKED); >- a.setValue(""); >- a.setReadOnly(false); >- data.addAttribute(BugzillaReportElement.BLOCKED.getKeyString(), a); >- a = BugzillaClient.makeNewAttribute(BugzillaReportElement.NEWCC); >- a.setValue(""); >- a.setReadOnly(false); >- data.addAttribute(BugzillaReportElement.NEWCC.getKeyString(), a); > return true; > } > >- // TODO: Move to AbstractTaskDataHandler > @Override >+ public TaskAttributeMapper getAttributeMapper(TaskRepository taskRepository) { >+ //client = connector.getClientManager().getClient(taskRepository, new NullProgressMonitor()); >+ return new BugzillaAttributeMapper(taskRepository); >+ } >+ >+ //*************************** OLD API >+ > public Set<String> getSubTaskIds(RepositoryTaskData taskData) { > Set<String> result = new HashSet<String>(); >- RepositoryTaskAttribute attribute = taskData.getAttribute(BugzillaReportElement.DEPENDSON.getKeyString()); >+ RepositoryTaskAttribute attribute = taskData.getAttribute(BugzillaReportElement.DEPENDSON.getKey()); > if (attribute != null) { > String[] ids = attribute.getValue().split(","); > for (String id : ids) { >@@ -263,28 +307,9 @@ > > } > >- @Override >- public boolean canGetMultiTaskData() { >- return true; >- } >- >- @Override >- public boolean initializeSubTaskData(TaskRepository taskRepository, RepositoryTaskData taskData, >- RepositoryTaskData parentTaskData, IProgressMonitor monitor) throws CoreException { >- String project = parentTaskData.getProduct(); >- taskData.setAttributeValue(RepositoryTaskAttribute.PRODUCT, project); >- initializeTaskData(taskRepository, taskData, monitor); >- cloneTaskData(parentTaskData, taskData); >- taskData.setAttributeValue(BugzillaReportElement.BLOCKED.getKeyString(), parentTaskData.getTaskId()); >- taskData.setAttributeValue(RepositoryTaskAttribute.USER_ASSIGNED, parentTaskData.getAssignedTo()); >- taskData.setDescription(""); >- taskData.setSummary(""); >- return true; >- } >- >- @Override >- public boolean canInitializeSubTaskData(ITask task, RepositoryTaskData parentTaskData) { >- return true; >- } >+// @Override >+// public AbstractAttributeFactory getAttributeFactory(RepositoryTaskData taskData) { >+// return getAttributeFactory(taskData.getRepositoryUrl(), taskData.getConnectorKind(), taskData.getTaskKind()); >+// } > > } >Index: src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java,v >retrieving revision 1.17 >diff -u -r1.17 RepositoryConfiguration.java >--- src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java 13 May 2008 06:35:47 -0000 1.17 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java 22 May 2008 17:18:53 -0000 >@@ -12,6 +12,7 @@ > import java.util.ArrayList; > import java.util.Collections; > import java.util.HashMap; >+import java.util.HashSet; > import java.util.List; > import java.util.Locale; > import java.util.Map; >@@ -21,9 +22,9 @@ > import org.eclipse.mylyn.commons.core.StatusHandler; > import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants.BUGZILLA_OPERATION; > import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants.BUGZILLA_REPORT_STATUS; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryOperation; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskAttribute; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskData; >+import org.eclipse.mylyn.tasks.core.data.TaskAttribute; >+import org.eclipse.mylyn.tasks.core.data.TaskData; >+import org.eclipse.mylyn.tasks.core.data.TaskOperation; > > /** > * Class describing the configuration of products and components for a given Bugzilla installation. >@@ -432,14 +433,18 @@ > return customFields; > } > >- public void configureTaskData(RepositoryTaskData taskData) { >+ public void configureTaskData(TaskData taskData) { > updateAttributeOptions(taskData); > addValidOperations(taskData); > } > >- public void updateAttributeOptions(RepositoryTaskData existingReport) { >- String product = existingReport.getAttributeValue(BugzillaReportElement.PRODUCT.getKeyString()); >- for (RepositoryTaskAttribute attribute : existingReport.getAttributes()) { >+ public void updateAttributeOptions(TaskData existingReport) { >+ TaskAttribute attributeProduct = existingReport.getMappedAttribute(BugzillaReportElement.PRODUCT.getKey()); >+ if (attributeProduct == null) { >+ return; >+ } >+ String product = attributeProduct.getValue(); >+ for (TaskAttribute attribute : new HashSet<TaskAttribute>(existingReport.getRoot().getAttributes().values())) { > if (attribute.getId().startsWith(BugzillaCustomField.CUSTOM_FIELD_PREFIX)) { > attribute.clearOptions(); > List<BugzillaCustomField> customFields = getCustomFields(); >@@ -448,13 +453,22 @@ > if (bugzillaCustomField.getName().equals(attribute.getId())) { > List<String> optionList = bugzillaCustomField.getOptions(); > for (String option : optionList) { >- attribute.addOption(option, option); >+ attribute.putOption(option, option); > } > } > } > } else { >- BugzillaReportElement element = BugzillaReportElement.valueOf(attribute.getId().trim().toUpperCase( >- Locale.ENGLISH)); >+ >+ BugzillaReportElement element; >+ try { >+ element = BugzillaReportElement.valueOf(attribute.getId().trim().toUpperCase(Locale.ENGLISH)); >+ } catch (RuntimeException e) { >+ if (e instanceof IllegalArgumentException) { >+ // ignore unrecognized tags >+ continue; >+ } >+ throw e; >+ } > attribute.clearOptions(); > List<String> optionValues = getOptionValues(element, product); > if (element != BugzillaReportElement.OP_SYS && element != BugzillaReportElement.BUG_SEVERITY >@@ -463,12 +477,12 @@ > } > if (element == BugzillaReportElement.TARGET_MILESTONE && optionValues.isEmpty()) { > >- existingReport.removeAttribute(BugzillaReportElement.TARGET_MILESTONE); >+ existingReport.getRoot().removeAttribute(BugzillaReportElement.TARGET_MILESTONE.getKey()); > continue; > } > attribute.clearOptions(); > for (String option : optionValues) { >- attribute.addOption(option, option); >+ attribute.putOption(option, option); > } > > // TODO: bug#162428, bug#150680 - something along the lines of... >@@ -484,13 +498,19 @@ > > } > >- private void addValidOperations(RepositoryTaskData bugReport) { >- BUGZILLA_REPORT_STATUS status; >+ private void addValidOperations(TaskData bugReport) { >+ TaskAttribute attributeStatus = bugReport.getMappedAttribute(TaskAttribute.STATUS); >+ BUGZILLA_REPORT_STATUS status = BUGZILLA_REPORT_STATUS.NEW; > try { >- status = BUGZILLA_REPORT_STATUS.valueOf(bugReport.getStatus()); >+ if (attributeStatus == null) { >+ StatusHandler.log(new Status(IStatus.WARNING, BugzillaCorePlugin.PLUGIN_ID, >+ "Status not found for task. Synchronize task to correct.")); >+ } else { >+ status = BUGZILLA_REPORT_STATUS.valueOf(attributeStatus.getValue()); >+ } > } catch (RuntimeException e) { > StatusHandler.log(new Status(IStatus.INFO, BugzillaCorePlugin.PLUGIN_ID, "Unrecognized status: " >- + bugReport.getStatus(), e)); >+ + attributeStatus.getValue(), e)); > status = BUGZILLA_REPORT_STATUS.NEW; > } > switch (status) { >@@ -535,55 +555,89 @@ > } > } > >- private void addOperation(RepositoryTaskData bugReport, BUGZILLA_OPERATION opcode) { >- RepositoryOperation newOperation = null; >+ private void addOperation(TaskData bugReport, BUGZILLA_OPERATION opcode) { >+ TaskAttribute attribute; >+ TaskOperation newOperation = null; >+ TaskAttribute operationAttribute = bugReport.getRoot().createAttribute(TaskAttribute.OPERATION); >+ TaskAttribute operationContainer = bugReport.getRoot().createAttribute(TaskAttribute.CONTAINER_OPERATIONS); >+ TaskOperation defaultOperation; >+ > switch (opcode) { > case none: >- newOperation = new RepositoryOperation(opcode.toString(), "Leave as " + bugReport.getStatus() + " " >- + bugReport.getResolution()); >- newOperation.setChecked(true); >+ attribute = operationContainer.createAttribute(opcode.toString()); >+ attribute.setValue(opcode.toString()); >+ newOperation = TaskOperation.createFrom(attribute); >+ >+ TaskAttribute attributeStatus = bugReport.getMappedAttribute(TaskAttribute.STATUS); >+ TaskAttribute attributeResolution = bugReport.getMappedAttribute(TaskAttribute.RESOLUTION); >+ >+ newOperation.setLabel("Leave as " + attributeStatus.getValue() + " " + attributeResolution.getValue()); >+ newOperation.applyTo(attribute); >+ >+ // set as default >+ newOperation.applyTo(operationAttribute); > break; > case accept: >- newOperation = new RepositoryOperation(opcode.toString(), OPERATION_LABEL_ACCEPT); >+ attribute = operationContainer.createAttribute(opcode.toString()); >+ attribute.setValue(opcode.toString()); >+ newOperation = TaskOperation.createFrom(attribute); >+ newOperation.setLabel(OPERATION_LABEL_ACCEPT); > break; > case resolve: >- newOperation = new RepositoryOperation(opcode.toString(), OPERATION_LABEL_RESOLVE); >- newOperation.setUpOptions(OPERATION_OPTION_RESOLUTION); >+ attribute = operationContainer.createAttribute(opcode.toString()); >+ attribute.setValue(opcode.toString()); >+ newOperation = TaskOperation.createFrom(attribute); >+ newOperation.setLabel(OPERATION_LABEL_RESOLVE); >+ >+ //TaskAttribute.META_ASSOCIATED_ATTRIBUTE_ID > for (String resolution : getResolutions()) { > // DUPLICATE and MOVED have special meanings so do not show as resolution >+ > if (resolution.compareTo("DUPLICATE") != 0 && resolution.compareTo("MOVED") != 0) { >- newOperation.addOption(resolution, resolution); >+ attribute.putOption(resolution, resolution); > } > } > break; > case duplicate: >- newOperation = new RepositoryOperation(opcode.toString(), OPERATION_LABEL_DUPLICATE); >- newOperation.setInputName(OPERATION_INPUT_DUP_ID); >- newOperation.setInputValue(""); >+ attribute = operationContainer.createAttribute(OPERATION_INPUT_DUP_ID); >+ attribute.setValue(opcode.toString()); >+ newOperation = TaskOperation.createFrom(attribute); >+ newOperation.setLabel(OPERATION_LABEL_DUPLICATE); >+ // TODO: Specify short text input > break; > case reassign: >- newOperation = new RepositoryOperation(opcode.toString(), OPERATION_LABEL_REASSIGN); >- newOperation.setInputName(OPERATION_INPUT_ASSIGNED_TO); >- newOperation.setInputValue(""); >+ attribute = operationContainer.createAttribute(OPERATION_INPUT_ASSIGNED_TO); >+ attribute.setValue(OPERATION_INPUT_ASSIGNED_TO); >+ newOperation = TaskOperation.createFrom(attribute); >+ newOperation.setLabel(OPERATION_LABEL_REASSIGN); > break; > case reassignbycomponent: >- newOperation = new RepositoryOperation(opcode.toString(), OPERATION_LABEL_REASSIGN_DEFAULT); >+ attribute = operationContainer.createAttribute(opcode.toString()); >+ attribute.setValue(opcode.toString()); >+ newOperation = TaskOperation.createFrom(attribute); >+ newOperation.setLabel(OPERATION_LABEL_REASSIGN_DEFAULT); > break; > case reopen: >- newOperation = new RepositoryOperation(opcode.toString(), OPERATION_LABEL_REOPEN); >+ attribute = operationContainer.createAttribute(opcode.toString()); >+ attribute.setValue(opcode.toString()); >+ newOperation = TaskOperation.createFrom(attribute); >+ newOperation.setLabel(OPERATION_LABEL_REOPEN); > break; > case verify: >- newOperation = new RepositoryOperation(opcode.toString(), OPERATION_LABEL_VERIFY); >+ attribute = operationContainer.createAttribute(opcode.toString()); >+ attribute.setValue(opcode.toString()); >+ newOperation = TaskOperation.createFrom(attribute); >+ newOperation.setLabel(OPERATION_LABEL_VERIFY); > break; > case close: >- newOperation = new RepositoryOperation(opcode.toString(), OPERATION_LABEL_CLOSE); >+ attribute = operationContainer.createAttribute(opcode.toString()); >+ attribute.setValue(opcode.toString()); >+ newOperation = TaskOperation.createFrom(attribute); >+ newOperation.setLabel(OPERATION_LABEL_CLOSE); > break; > default: > break; > } >- if (newOperation != null) { >- bugReport.addOperation(newOperation); >- } > } > > /** >Index: src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryQuery.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryQuery.java,v >retrieving revision 1.10 >diff -u -r1.10 BugzillaRepositoryQuery.java >--- src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryQuery.java 8 May 2008 05:45:32 -0000 1.10 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryQuery.java 22 May 2008 17:18:53 -0000 >@@ -26,7 +26,7 @@ > > @Override > public String getConnectorKind() { >- return BugzillaCorePlugin.REPOSITORY_KIND; >+ return BugzillaCorePlugin.CONNECTOR_KIND; > } > > public boolean isCustomQuery() { >Index: src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java,v >retrieving revision 1.21 >diff -u -r1.21 SaxMultiBugReportContentHandler.java >--- src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java 8 May 2008 17:53:45 -0000 1.21 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java 22 May 2008 17:18:53 -0000 >@@ -8,6 +8,7 @@ > > package org.eclipse.mylyn.internal.bugzilla.core; > >+import java.io.Serializable; > import java.util.ArrayList; > import java.util.HashMap; > import java.util.List; >@@ -15,11 +16,15 @@ > import java.util.Map; > > import org.eclipse.mylyn.internal.tasks.core.deprecated.AbstractAttributeFactory; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.LegacyTaskDataCollector; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryAttachment; >+import org.eclipse.mylyn.internal.tasks.core.deprecated.AttributeContainer; > import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskAttribute; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskData; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.TaskComment; >+import org.eclipse.mylyn.tasks.core.data.TaskAttachmentMapper; >+import org.eclipse.mylyn.tasks.core.data.TaskAttribute; >+import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper; >+import org.eclipse.mylyn.tasks.core.data.TaskAttributeProperties; >+import org.eclipse.mylyn.tasks.core.data.TaskCommentMapper; >+import org.eclipse.mylyn.tasks.core.data.TaskData; >+import org.eclipse.mylyn.tasks.core.data.TaskDataCollector; > import org.xml.sax.Attributes; > import org.xml.sax.SAXException; > import org.xml.sax.helpers.DefaultHandler; >@@ -37,33 +42,44 @@ > > private StringBuffer characters; > >- private TaskComment taskComment; >+ private TaskAttribute taskComment; > >- private Map<String, TaskComment> attachIdToComment = new HashMap<String, TaskComment>(); >+ private Map<String, TaskAttribute> attachIdToComment = new HashMap<String, TaskAttribute>(); > > private int commentNum = 0; > >- private RepositoryAttachment attachment; >+ private int attachmentNum = 0; > >- private final Map<String, RepositoryTaskData> taskDataMap; >+ private TaskAttribute attachment; > >- private RepositoryTaskData repositoryTaskData; >+ private final Map<String, TaskData> taskDataMap; >+ >+ private TaskData repositoryTaskData; > > private List<TaskComment> longDescs; > > private String errorMessage = null; > >- private final AbstractAttributeFactory attributeFactory; >+ private final TaskAttributeMapper attributeMapper; > > private final List<BugzillaCustomField> customFields; > >- private final LegacyTaskDataCollector collector; >+ private final TaskDataCollector collector; >+ >+ private TaskAttribute commentContainer; >+ >+ private TaskAttribute attachmentContainer; >+ >+ private boolean isDeprecated = false; >+ >+ private boolean isPatch = false; > > //private int retrieved = 1; > >- public SaxMultiBugReportContentHandler(AbstractAttributeFactory factory, LegacyTaskDataCollector collector, >- Map<String, RepositoryTaskData> taskDataMap, List<BugzillaCustomField> customFields) { >- this.attributeFactory = factory; >+ public SaxMultiBugReportContentHandler(TaskAttributeMapper mapper, TaskDataCollector collector, >+ Map<String, TaskData> taskDataMap, List<BugzillaCustomField> customFields) { >+ >+ this.attributeMapper = mapper; > this.taskDataMap = taskDataMap; > this.customFields = customFields; > this.collector = collector; >@@ -114,20 +130,28 @@ > if (attributes != null && (attributes.getValue("error") != null)) { > errorMessage = attributes.getValue("error"); > } >- attachIdToComment = new HashMap<String, TaskComment>(); >+ attachIdToComment = new HashMap<String, TaskAttribute>(); > commentNum = 0; >+ attachmentNum = 0; > taskComment = null; >- longDescs = new ArrayList<TaskComment>(); >+ longDescs = new ArrayList<TaskAttribute>(); > break; > case LONG_DESC: >- taskComment = new TaskComment(attributeFactory, commentNum++); >+ taskComment = commentContainer.createAttribute("" + commentNum++); >+ TaskAttributeProperties.defaults() >+ .setReadOnly(true) >+ .setKind(TaskAttribute.KIND_DEFAULT) >+ .setLabel("comment") >+ .setType(TaskAttribute.TYPE_LONG_TEXT) >+ .applyTo(taskComment); > break; > case WHO: > if (taskComment != null) { > if (attributes != null && attributes.getLength() > 0) { > String name = attributes.getValue(ATTRIBUTE_NAME); > if (name != null) { >- taskComment.setAttributeValue(BugzillaReportElement.WHO_NAME.getKeyString(), name); >+ BugzillaTaskDataHandler.createAttribute(taskComment, BugzillaReportElement.WHO_NAME).setValue( >+ name); > } > } > } >@@ -136,9 +160,8 @@ > if (attributes != null && attributes.getLength() > 0) { > String name = attributes.getValue(ATTRIBUTE_NAME); > if (name != null) { >- RepositoryTaskAttribute attr = attributeFactory.createAttribute(BugzillaReportElement.REPORTER_NAME.getKeyString()); >- attr.setValue(name); >- repositoryTaskData.addAttribute(BugzillaReportElement.REPORTER_NAME.getKeyString(), attr); >+ BugzillaTaskDataHandler.createAttribute(repositoryTaskData, BugzillaReportElement.REPORTER_NAME) >+ .setValue(name); > } > } > break; >@@ -146,23 +169,15 @@ > if (attributes != null && attributes.getLength() > 0) { > String name = attributes.getValue(ATTRIBUTE_NAME); > if (name != null) { >- RepositoryTaskAttribute attr = attributeFactory.createAttribute(BugzillaReportElement.ASSIGNED_TO_NAME.getKeyString()); >- attr.setValue(name); >- repositoryTaskData.addAttribute(BugzillaReportElement.ASSIGNED_TO_NAME.getKeyString(), attr); >+ BugzillaTaskDataHandler.createAttribute(repositoryTaskData, BugzillaReportElement.ASSIGNED_TO_NAME) >+ .setValue(name); > } > } > break; > case ATTACHMENT: >- attachment = new RepositoryAttachment(attributeFactory); > if (attributes != null) { >- if ("1".equals(attributes.getValue(BugzillaReportElement.IS_OBSOLETE.getKeyString()))) { >- attachment.addAttribute(BugzillaReportElement.IS_OBSOLETE.getKeyString(), >- attributeFactory.createAttribute(BugzillaReportElement.IS_OBSOLETE.getKeyString())); >- attachment.setObsolete(true); >- } >- if ("1".equals(attributes.getValue(BugzillaReportElement.IS_PATCH.getKeyString()))) { >- attachment.setPatch(true); >- } >+ isDeprecated = "1".equals(attributes.getValue(BugzillaReportElement.IS_OBSOLETE.getKey())); >+ isPatch = "1".equals(attributes.getValue(BugzillaReportElement.IS_PATCH.getKey())); > } > break; > } >@@ -175,7 +190,7 @@ > String parsedText = characters.toString(); > > if (localName.startsWith(BugzillaCustomField.CUSTOM_FIELD_PREFIX)) { >- RepositoryTaskAttribute attribute = repositoryTaskData.getAttribute(localName); >+ TaskAttribute attribute = repositoryTaskData.getRoot().getAttribute(localName); > if (attribute == null) { > String desc = "???"; > for (BugzillaCustomField bugzillaCustomField : customFields) { >@@ -183,10 +198,9 @@ > desc = bugzillaCustomField.getDescription(); > } > } >- RepositoryTaskAttribute newattribute = new RepositoryTaskAttribute(localName, desc, true); >- newattribute.setReadOnly(false); >- newattribute.setValue(parsedText); >- repositoryTaskData.addAttribute(localName, newattribute); >+ TaskAttribute atr = repositoryTaskData.getRoot().createAttribute(localName); >+ atr.putMetaDataValue(TaskAttribute.META_READ_ONLY, Boolean.toString(false)); >+ atr.setValue(parsedText); > } else { > attribute.addValue(parsedText); > } >@@ -213,35 +227,28 @@ > errorMessage = "Bug id from server did not match requested id."; > } > >- RepositoryTaskAttribute attr = repositoryTaskData.getAttribute(tag.getKeyString()); >+ TaskAttribute attr = repositoryTaskData.getMappedAttribute(tag.getKey()); > if (attr == null) { >- attr = attributeFactory.createAttribute(tag.getKeyString()); >- repositoryTaskData.addAttribute(tag.getKeyString(), attr); >+ attr = BugzillaTaskDataHandler.createAttribute(repositoryTaskData, BugzillaReportElement.BUG_ID); > } > attr.setValue(parsedText); >+ >+ commentContainer = repositoryTaskData.getRoot().createAttribute(TaskAttribute.CONTAINER_COMMENTS); >+ attachmentContainer = repositoryTaskData.getRoot().createAttribute(TaskAttribute.CONTAINER_ATTACHMENTS); >+ > break; > } > > // Comment attributes > case WHO: >- if (taskComment != null) { >- RepositoryTaskAttribute attr = attributeFactory.createAttribute(tag.getKeyString()); >- attr.setValue(parsedText); >- taskComment.addAttribute(tag.getKeyString(), attr); >- } >- break; > case BUG_WHEN: > if (taskComment != null) { >- RepositoryTaskAttribute attr = attributeFactory.createAttribute(tag.getKeyString()); >- attr.setValue(parsedText); >- taskComment.addAttribute(tag.getKeyString(), attr); >+ BugzillaTaskDataHandler.createAttribute(taskComment, tag).setValue(parsedText); > } > break; > case THETEXT: > if (taskComment != null) { >- RepositoryTaskAttribute attr = attributeFactory.createAttribute(tag.getKeyString()); >- attr.setValue(parsedText); >- taskComment.addAttribute(tag.getKeyString(), attr); >+ BugzillaTaskDataHandler.createAttribute(taskComment, tag).setValue(parsedText); > > // Check for attachment > parseAttachment(taskComment, parsedText); >@@ -255,6 +262,13 @@ > > // Attachment attributes > case ATTACHID: >+ attachment = attachmentContainer.createAttribute(parsedText); >+ //attachment.putMetaDataValue(TaskAttribute.META_READ_ONLY, Boolean.toString(false)); >+ attributeMapper.setBooleanValue(attachment.createAttribute(TaskAttribute.ATTACHMENT_IS_PATCH), isPatch); >+ attributeMapper.setBooleanValue(attachment.createAttribute(TaskAttribute.ATTACHMENT_IS_DEPRECATED), >+ isDeprecated); >+ break; >+ > case DATE: > case DESC: > case FILENAME: >@@ -262,17 +276,15 @@ > case TYPE: > case SIZE: > if (attachment != null) { >- RepositoryTaskAttribute attr = attributeFactory.createAttribute(tag.getKeyString()); >- attr.setValue(parsedText); >- attachment.addAttribute(tag.getKeyString(), attr); >+ BugzillaTaskDataHandler.createAttribute(attachment, tag).setValue(parsedText); > } > break; > case DATA: > break; > case ATTACHMENT: >- if (attachment != null) { >- repositoryTaskData.addAttachment(attachment); >- } >+ isPatch = false; >+ isDeprecated = false; >+ attachment = null; > break; > > // IGNORED ELEMENTS >@@ -297,31 +309,39 @@ > // comments > int longDescsSize = longDescs.size() - 1; > if (longDescsSize == 0) { >- repositoryTaskData.setAttributeValue(RepositoryTaskAttribute.DESCRIPTION, longDescs.get(0).getText()); >+ //Description = comment 0 >+ repositoryTaskData.getRoot().createAttribute(TaskAttribute.DESCRIPTION).setValue( >+ longDescs.get(0).getMappedAttribute(BugzillaReportElement.THETEXT.getKey()).getValue()); > } else if (longDescsSize == 1) { >- if (longDescs.get(0).getCreated().compareTo(longDescs.get(1).getCreated()) <= 0) { >+ String val0 = longDescs.get(0).getMappedAttribute(BugzillaReportElement.BUG_WHEN.getKey()).getValue(); >+ String val1 = longDescs.get(1).getMappedAttribute(BugzillaReportElement.BUG_WHEN.getKey()).getValue(); >+ >+ if (val0.compareTo(val1) <= 0) { > // if created_0 is equal to created_1 we assume that longDescs at index 0 is the description. >- repositoryTaskData.setAttributeValue(RepositoryTaskAttribute.DESCRIPTION, longDescs.get(0) >- .getText()); >- repositoryTaskData.addComment(longDescs.get(1)); >+ repositoryTaskData.getRoot().createAttribute(TaskAttribute.DESCRIPTION).setValue( >+ longDescs.get(0).getMappedAttribute(BugzillaReportElement.THETEXT.getKey()).getValue()); > } else { >- repositoryTaskData.setAttributeValue(RepositoryTaskAttribute.DESCRIPTION, longDescs.get(1) >- .getText()); >- commentNum = 1; >- longDescs.get(0).setNumber(commentNum); >- repositoryTaskData.addComment(longDescs.get(0)); >+ repositoryTaskData.getRoot().createAttribute(TaskAttribute.DESCRIPTION).setValue( >+ longDescs.get(1).getMappedAttribute(BugzillaReportElement.THETEXT.getKey()).getValue()); > } > } else if (longDescsSize > 1) { >- String created_0 = longDescs.get(0).getCreated(); >- String created_1 = longDescs.get(1).getCreated(); >- String created_n = longDescs.get(longDescsSize).getCreated(); >+ String val0 = longDescs.get(0).getMappedAttribute(BugzillaReportElement.BUG_WHEN.getKey()).getValue(); >+ String val1 = longDescs.get(1).getMappedAttribute(BugzillaReportElement.BUG_WHEN.getKey()).getValue(); >+ >+ String created_0 = val0; >+ String created_1 = val1; >+ String created_n = longDescs.get(longDescsSize).getMappedAttribute( >+ BugzillaReportElement.BUG_WHEN.getKey()).getValue(); > commentNum = 1; > if (created_0.compareTo(created_1) <= 0 && created_0.compareTo(created_n) < 0) { > // if created_0 is equal to created_1 we assume that longDescs at index 0 is the description. >- repositoryTaskData.setAttributeValue(RepositoryTaskAttribute.DESCRIPTION, longDescs.get(0) >- .getText()); >+ repositoryTaskData.getRoot().createAttribute(TaskAttribute.DESCRIPTION).setValue( >+ longDescs.get(0).getMappedAttribute(BugzillaReportElement.THETEXT.getKey()).getValue()); >+ >+ // TODO: move into presentation? > if (created_1.compareTo(created_n) < 0) { > for (int i = 1; i <= longDescsSize; i++) { >+ TaskCommentMapper.createFrom(taskAttribute) > longDescs.get(i).setNumber(commentNum++); > repositoryTaskData.addComment(longDescs.get(i)); > } >@@ -332,55 +352,61 @@ > } > } > } else { >- repositoryTaskData.setAttributeValue(RepositoryTaskAttribute.DESCRIPTION, longDescs.get( >- longDescsSize).getText()); >- if (created_0.compareTo(created_1) < 0) { >- for (int i = 0; i < longDescsSize; i++) { >- longDescs.get(i).setNumber(commentNum++); >- repositoryTaskData.addComment(longDescs.get(i)); >- } >- } else { >- for (int i = longDescsSize - 1; i >= 0; i--) { >- longDescs.get(i).setNumber(commentNum++); >- repositoryTaskData.addComment(longDescs.get(i)); >- } >- } >+ repositoryTaskData.getRoot().createAttribute(TaskAttribute.DESCRIPTION).setValue( >+ longDescs.get(longDescsSize) >+ .getMappedAttribute(BugzillaReportElement.THETEXT.getKey()) >+ .getValue()); >+// if (created_0.compareTo(created_1) < 0) { >+// for (int i = 0; i < longDescsSize; i++) { >+// longDescs.get(i).setNumber(commentNum++); >+// repositoryTaskData.addComment(longDescs.get(i)); >+// } >+// } else { >+// for (int i = longDescsSize - 1; i >= 0; i--) { >+// longDescs.get(i).setNumber(commentNum++); >+// repositoryTaskData.addComment(longDescs.get(i)); >+// } >+// } > } > } > >- RepositoryTaskAttribute numCommentsAttribute = repositoryTaskData.getAttribute(BugzillaReportElement.LONGDESCLENGTH.getKeyString()); >+ TaskAttribute container = repositoryTaskData.getMappedAttribute(TaskAttribute.CONTAINER_COMMENTS); >+ TaskAttribute numCommentsAttribute = repositoryTaskData.getMappedAttribute(BugzillaReportElement.LONGDESCLENGTH.getKey()); > if (numCommentsAttribute == null) { >- numCommentsAttribute = attributeFactory.createAttribute(BugzillaReportElement.LONGDESCLENGTH.getKeyString()); >- numCommentsAttribute.setValue("" + repositoryTaskData.getComments().size()); >- repositoryTaskData.addAttribute(BugzillaReportElement.LONGDESCLENGTH.getKeyString(), >- numCommentsAttribute); >+ numCommentsAttribute = BugzillaTaskDataHandler.createAttribute(repositoryTaskData, >+ BugzillaReportElement.LONGDESCLENGTH); >+ numCommentsAttribute.setValue("" + container.getAttributes().size()); > } else { >- numCommentsAttribute.setValue("" + repositoryTaskData.getComments().size()); >+ numCommentsAttribute.setValue("" >+ + repositoryTaskData.getMappedAttribute(BugzillaReportElement.LONGDESCLENGTH.getKey()) >+ .getValue()); > } > > // Set the creator name on all attachments >- for (RepositoryAttachment attachment : repositoryTaskData.getAttachments()) { >- TaskComment taskComment = attachIdToComment.get(attachment.getId()); >+ for (TaskAttribute attachment : container.getAttributes().values()) { >+ TaskAttachmentMapper attachmentMapper = TaskAttachmentMapper.createFrom(attachment); >+ TaskAttribute taskComment = attachIdToComment.get(attachment.getId()); > if (taskComment != null) { >- attachment.setCreator(taskComment.getAuthor()); >- } >- attachment.setAttributeValue(RepositoryTaskAttribute.ATTACHMENT_URL, >- repositoryTaskData.getRepositoryUrl() + IBugzillaConstants.URL_GET_ATTACHMENT_SUFFIX >- + attachment.getId()); >- attachment.setRepositoryKind(repositoryTaskData.getConnectorKind()); >- attachment.setRepositoryUrl(repositoryTaskData.getRepositoryUrl()); >- attachment.setTaskId(repositoryTaskData.getTaskId()); >+ String commentAuthor = taskComment.getMappedAttribute(TaskAttribute.COMMENT_AUTHOR).getValue(); >+ attachmentMapper.setAuthor(repositoryTaskData.getAttributeMapper() >+ .getTaskRepository() >+ .createPerson(commentAuthor)); >+ } >+ attachmentMapper.setUrl(repositoryTaskData.getRepositoryUrl() >+ + IBugzillaConstants.URL_GET_ATTACHMENT_SUFFIX + attachment.getId()); >+// attachment.setRepositoryKind(repositoryTaskData.getConnectorKind()); >+// attachment.setRepositoryUrl(repositoryTaskData.getRepositoryUrl()); >+// attachment.setTaskId(repositoryTaskData.getTaskId()); > } > collector.accept(repositoryTaskData); > break; > > case BLOCKED: > case DEPENDSON: >- RepositoryTaskAttribute dependancyAttribute = repositoryTaskData.getAttribute(tag.getKeyString()); >+ TaskAttribute dependancyAttribute = repositoryTaskData.getMappedAttribute(tag.getKey()); > if (dependancyAttribute == null) { >- dependancyAttribute = attributeFactory.createAttribute(tag.getKeyString()); >- dependancyAttribute.setValue(parsedText); >- repositoryTaskData.addAttribute(tag.getKeyString(), dependancyAttribute); >+ BugzillaTaskDataHandler.createAttribute(repositoryTaskData, BugzillaReportElement.DEPENDSON).setValue( >+ parsedText); > } else { > if (dependancyAttribute.getValue().equals("")) { > dependancyAttribute.setValue(parsedText); >@@ -391,11 +417,10 @@ > break; > // All others added as report attribute > default: >- RepositoryTaskAttribute attribute = repositoryTaskData.getAttribute(tag.getKeyString()); >+ TaskAttribute attribute = repositoryTaskData.getMappedAttribute(tag.getKey()); > if (attribute == null) { >- attribute = attributeFactory.createAttribute(tag.getKeyString()); >+ attribute = BugzillaTaskDataHandler.createAttribute(repositoryTaskData, tag); > attribute.setValue(parsedText); >- repositoryTaskData.addAttribute(tag.getKeyString(), attribute); > } else { > attribute.addValue(parsedText); > } >@@ -405,7 +430,7 @@ > } > > /** determines attachment id from comment */ >- private void parseAttachment(TaskComment taskComment, String commentText) { >+ private void parseAttachment(TaskAttribute taskComment, String commentText) { > > String attachmentID = ""; > >@@ -414,11 +439,103 @@ > if (endIndex > 0 && endIndex < commentText.length()) { > attachmentID = commentText.substring(COMMENT_ATTACHMENT_STRING.length(), endIndex); > if (!attachmentID.equals("")) { >- taskComment.setHasAttachment(true); >- taskComment.setAttachmentId(attachmentID); >+ TaskAttribute attachmentContainer = taskComment.getMappedAttribute(TaskAttribute.CONTAINER_ATTACHMENTS); >+ if (attachmentContainer == null) { >+ attachmentContainer = taskComment.createAttribute(TaskAttribute.CONTAINER_ATTACHMENTS); >+ } >+ attachmentContainer.createAttribute(attachmentID); > attachIdToComment.put(attachmentID, taskComment); > } > } > } > } >+ >+ >+ class TaskComment { >+ >+ >+ /** Comment's number */ >+ private int number; >+ >+ private boolean hasAttachment; >+ >+ private String attachmentId; >+ >+ public TaskComment(int num) { >+ this.number = num; >+ } >+ >+ /** >+ * Get this comment's number >+ * >+ * @return This comment's number >+ */ >+ public int getNumber() { >+ return number; >+ } >+ >+ /** >+ * Set the comment number >+ * >+ * @param number >+ * the number of the comment >+ */ >+ public void setNumber(int number) { >+ this.number = number; >+ } >+ >+ /** >+ * Get the time that this comment was created >+ * >+ * @return The comments creation timestamp >+ */ >+ public String getCreated() { >+ return >+ } >+ >+ /** >+ * Get the author of the comment >+ * >+ * @return The comments author >+ */ >+ public String getAuthor() { >+ return getAttributeValue(RepositoryTaskAttribute.COMMENT_AUTHOR); >+ } >+ >+ /** >+ * Get the authors real name >+ * >+ * @return Returns author's name, or an empty string >+ */ >+ public String getAuthorName() { >+ return getAttributeValue(RepositoryTaskAttribute.COMMENT_AUTHOR_NAME); >+ } >+ >+ /** >+ * Get the text contained in the comment >+ * >+ * @return The comments text >+ */ >+ public String getText() { >+ return getAttributeValue(RepositoryTaskAttribute.COMMENT_TEXT); >+ } >+ >+ public void setHasAttachment(boolean b) { >+ this.hasAttachment = b; >+ } >+ >+ public boolean hasAttachment() { >+ return hasAttachment; >+ } >+ >+ public void setAttachmentId(String attachmentID) { >+ this.attachmentId = attachmentID; >+ } >+ >+ public String getAttachmentId() { >+ return attachmentId; >+ } >+ >+ >+ > } >Index: src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryQueryResultsFactory.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryQueryResultsFactory.java,v >retrieving revision 1.17 >diff -u -r1.17 RepositoryQueryResultsFactory.java >--- src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryQueryResultsFactory.java 4 May 2008 05:54:53 -0000 1.17 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryQueryResultsFactory.java 22 May 2008 17:18:53 -0000 >@@ -12,7 +12,8 @@ > import java.io.InputStream; > import java.security.GeneralSecurityException; > >-import org.eclipse.mylyn.internal.tasks.core.deprecated.LegacyTaskDataCollector; >+import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper; >+import org.eclipse.mylyn.tasks.core.data.TaskDataCollector; > > /** > * @author Rob Elves >@@ -28,8 +29,10 @@ > * > * @throws GeneralSecurityException > */ >- public int performQuery(String repositoryUrl, LegacyTaskDataCollector collector, int maxHits) throws IOException { >- SaxBugzillaQueryContentHandler contentHandler = new SaxBugzillaQueryContentHandler(repositoryUrl, collector); >+ public int performQuery(String repositoryUrl, TaskDataCollector collector, TaskAttributeMapper mapper, int maxHits) >+ throws IOException { >+ SaxBugzillaQueryContentHandler contentHandler = new SaxBugzillaQueryContentHandler(repositoryUrl, collector, >+ mapper); > collectResults(contentHandler, false); > return contentHandler.getResultCount(); > } >Index: src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaCorePlugin.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaCorePlugin.java,v >retrieving revision 1.30 >diff -u -r1.30 BugzillaCorePlugin.java >--- src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaCorePlugin.java 8 May 2008 17:53:45 -0000 1.30 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaCorePlugin.java 22 May 2008 17:18:52 -0000 >@@ -39,10 +39,7 @@ > > private static final String ERROR_DELETING_CONFIGURATION = "Error removing corrupt repository configuration file."; > >- /** >- * API 3.0: Rename to CONNECTOR_KIND >- */ >- public static final String REPOSITORY_KIND = "bugzilla"; >+ public static final String CONNECTOR_KIND = "bugzilla"; > > public static final String PLUGIN_ID = "org.eclipse.mylyn.bugzilla"; > >@@ -276,8 +273,8 @@ > > // set both or none > if (null != os && null != platform) { >- RepositoryTaskAttribute opSysAttribute = newBugModel.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()); >- RepositoryTaskAttribute platformAttribute = newBugModel.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()); >+ RepositoryTaskAttribute opSysAttribute = newBugModel.getAttribute(BugzillaReportElement.OP_SYS.getKey()); >+ RepositoryTaskAttribute platformAttribute = newBugModel.getAttribute(BugzillaReportElement.REP_PLATFORM.getKey()); > > // TODO something can still go wrong when the allowed values on the repository change... > opSysAttribute.setValue(os); >@@ -294,8 +291,8 @@ > // Get OS Lookup Map > // Check that the result is in Values, if it is not, set it to other > // Defaults to the first of each (sorted) list All, All >- RepositoryTaskAttribute opSysAttribute = newBugModel.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()); >- RepositoryTaskAttribute platformAttribute = newBugModel.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()); >+ RepositoryTaskAttribute opSysAttribute = newBugModel.getAttribute(BugzillaReportElement.OP_SYS.getKey()); >+ RepositoryTaskAttribute platformAttribute = newBugModel.getAttribute(BugzillaReportElement.REP_PLATFORM.getKey()); > > String OS = Platform.getOS(); > String platform = Platform.getOSArch(); >Index: src/org/eclipse/mylyn/internal/bugzilla/core/SaxBugzillaQueryContentHandler.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxBugzillaQueryContentHandler.java,v >retrieving revision 1.28 >diff -u -r1.28 SaxBugzillaQueryContentHandler.java >--- src/org/eclipse/mylyn/internal/bugzilla/core/SaxBugzillaQueryContentHandler.java 8 May 2008 17:53:45 -0000 1.28 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/SaxBugzillaQueryContentHandler.java 22 May 2008 17:18:53 -0000 >@@ -10,10 +10,10 @@ > > import java.util.Locale; > >-import org.eclipse.mylyn.internal.tasks.core.deprecated.LegacyTaskDataCollector; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskAttribute; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskData; > import org.eclipse.mylyn.tasks.core.ITask.PriorityLevel; >+import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper; >+import org.eclipse.mylyn.tasks.core.data.TaskData; >+import org.eclipse.mylyn.tasks.core.data.TaskDataCollector; > import org.xml.sax.Attributes; > import org.xml.sax.SAXException; > import org.xml.sax.helpers.DefaultHandler; >@@ -38,15 +38,18 @@ > > private StringBuffer characters; > >- private final LegacyTaskDataCollector collector; >+ private final TaskDataCollector collector; > > private final String repositoryUrl; > > private int resultCount; > >- public SaxBugzillaQueryContentHandler(String repositoryUrl, LegacyTaskDataCollector collector) { >+ private final TaskAttributeMapper mapper; >+ >+ public SaxBugzillaQueryContentHandler(String repositoryUrl, TaskDataCollector collector, TaskAttributeMapper mapper) { > this.repositoryUrl = repositoryUrl; > this.collector = collector; >+ this.mapper = mapper; > } > > @Override >@@ -113,11 +116,11 @@ > description = parsedText; > break; > case LI: >- RepositoryTaskData taskData = new RepositoryTaskData(new BugzillaAttributeFactory(), >- BugzillaCorePlugin.REPOSITORY_KIND, repositoryUrl, id); >- taskData.setAttributeValue(RepositoryTaskAttribute.SUMMARY, description); >- taskData.setAttributeValue(RepositoryTaskAttribute.PRIORITY, priority); >- taskData.setAttributeValue(RepositoryTaskAttribute.USER_OWNER, owner); >+ TaskData taskData = new TaskData(mapper, BugzillaCorePlugin.CONNECTOR_KIND, repositoryUrl, id); >+ BugzillaTaskDataHandler.createAttribute(taskData, BugzillaReportElement.SHORT_DESC).setValue( >+ description); >+ BugzillaTaskDataHandler.createAttribute(taskData, BugzillaReportElement.PRIORITY).setValue(priority); >+ BugzillaTaskDataHandler.createAttribute(taskData, BugzillaReportElement.ASSIGNED_TO).setValue(owner); > taskData.setPartial(true); > collector.accept(taskData); > resultCount++; >Index: src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java,v >retrieving revision 1.131 >diff -u -r1.131 BugzillaClient.java >--- src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java 14 May 2008 18:51:55 -0000 1.131 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java 22 May 2008 17:18:52 -0000 >@@ -19,6 +19,7 @@ > import java.nio.charset.Charset; > import java.text.ParseException; > import java.util.ArrayList; >+import java.util.Collection; > import java.util.HashMap; > import java.util.HashSet; > import java.util.Iterator; >@@ -62,13 +63,16 @@ > import org.eclipse.mylyn.internal.bugzilla.core.history.BugzillaTaskHistoryParser; > import org.eclipse.mylyn.internal.bugzilla.core.history.TaskHistory; > import org.eclipse.mylyn.internal.tasks.core.deprecated.ITaskAttachment; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.LegacyTaskDataCollector; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryOperation; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskAttribute; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskData; > import org.eclipse.mylyn.tasks.core.IRepositoryQuery; >+import org.eclipse.mylyn.tasks.core.RepositoryResponse; > import org.eclipse.mylyn.tasks.core.RepositoryStatus; >+import org.eclipse.mylyn.tasks.core.RepositoryResponse.ResponseKind; >+import org.eclipse.mylyn.tasks.core.data.TaskAttribute; >+import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper; >+import org.eclipse.mylyn.tasks.core.data.TaskAttributeProperties; >+import org.eclipse.mylyn.tasks.core.data.TaskData; > import org.eclipse.mylyn.tasks.core.data.TaskDataCollector; >+import org.eclipse.mylyn.tasks.core.data.TaskOperation; > > /** > * @author Mik Kersten >@@ -140,8 +144,6 @@ > > private static final String ATTR_CHARSET = "charset"; > >- private static final BugzillaAttributeFactory attributeFactory = new BugzillaAttributeFactory(); >- > protected Proxy proxy = Proxy.NO_PROXY; > > protected String username; >@@ -455,26 +457,27 @@ > } > } > >- public RepositoryTaskData getTaskData(int id, IProgressMonitor monitor) throws IOException, CoreException { >+ public TaskData getTaskData(int id, TaskAttributeMapper mapper, IProgressMonitor monitor) throws IOException, >+ CoreException { > final String idString = String.valueOf(id); > Set<String> data = new HashSet<String>(); > data.add(idString); > >- LegacyTaskDataCollector collector = new LegacyTaskDataCollector() { >+ TaskDataCollector collector = new TaskDataCollector() { > @Override >- public void accept(RepositoryTaskData taskData) { >+ public void accept(TaskData taskData) { > getRepositoryConfiguration().configureTaskData(taskData); > } > }; > >- Map<String, RepositoryTaskData> returnedData = getTaskData(data, collector, monitor); >+ Map<String, TaskData> returnedData = getTaskData(data, collector, mapper, monitor); > > return returnedData.get(idString); > > } > >- public boolean getSearchHits(IRepositoryQuery query, TaskDataCollector collector, IProgressMonitor monitor) >- throws IOException, CoreException { >+ public boolean getSearchHits(IRepositoryQuery query, TaskDataCollector collector, TaskAttributeMapper mapper, >+ IProgressMonitor monitor) throws IOException, CoreException { > GzipPostMethod postMethod = null; > > try { >@@ -515,8 +518,8 @@ > try { > RepositoryQueryResultsFactory queryFactory = new RepositoryQueryResultsFactory(stream, > characterEncoding); >- int count = queryFactory.performQuery(repositoryUrl.toString(), >- (LegacyTaskDataCollector) collector, TaskDataCollector.MAX_HITS); >+ int count = queryFactory.performQuery(repositoryUrl.toString(), collector, mapper, >+ TaskDataCollector.MAX_HITS); > return count > 0; > } finally { > stream.close(); >@@ -534,7 +537,7 @@ > return false; > } > >- public static void setupExistingBugAttributes(String serverUrl, RepositoryTaskData existingReport) { >+ public static void setupExistingBugAttributes(String serverUrl, TaskData existingReport) { > // ordered list of elements as they appear in UI > // and additional elements that may not appear in the incoming xml > // stream but need to be present for bug submission / not always dirty >@@ -550,8 +553,7 @@ > BugzillaReportElement.STATUS_WHITEBOARD, BugzillaReportElement.DEADLINE }; > > for (BugzillaReportElement element : reportElements) { >- RepositoryTaskAttribute reportAttribute = BugzillaClient.makeNewAttribute(element); >- existingReport.addAttribute(element.getKeyString(), reportAttribute); >+ BugzillaTaskDataHandler.createAttribute(existingReport, element); > } > } > >@@ -579,11 +581,6 @@ > return null; > } > >- protected static RepositoryTaskAttribute makeNewAttribute( >- org.eclipse.mylyn.internal.bugzilla.core.BugzillaReportElement tag) { >- return attributeFactory.createAttribute(tag.getKeyString()); >- } >- > public RepositoryConfiguration getRepositoryConfiguration(IProgressMonitor monitor) throws IOException, > CoreException { > GzipGetMethod method = null; >@@ -748,7 +745,8 @@ > > } > >- public String postTaskData(RepositoryTaskData taskData, IProgressMonitor monitor) throws IOException, CoreException { >+ public RepositoryResponse postTaskData(TaskData taskData, IProgressMonitor monitor) throws IOException, >+ CoreException { > NameValuePair[] formData = null; > String prefix = null; > String prefix2 = null; >@@ -857,8 +855,12 @@ > } > parseHtmlError(input); > } >+ if (taskData.isNew()) { >+ return new RepositoryResponse(ResponseKind.TASK_CREATED, result); >+ } else { >+ return new RepositoryResponse(ResponseKind.TASK_UPDATED, taskData.getTaskId()); >+ } > >- return result; > } catch (ParseException e) { > authenticated = false; > throw new CoreException(new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.PLUGIN_ID, >@@ -874,23 +876,26 @@ > > } > >- private NameValuePair[] getPairsForNew(RepositoryTaskData taskData) { >+ private NameValuePair[] getPairsForNew(TaskData taskData) { > Map<String, NameValuePair> fields = new HashMap<String, NameValuePair>(); > > // go through all of the attributes and add them to > // the bug post >- Iterator<RepositoryTaskAttribute> itr = taskData.getAttributes().iterator(); >+ Collection<TaskAttribute> attributes = taskData.getRoot().getAttributes().values(); >+ Iterator<TaskAttribute> itr = attributes.iterator(); > while (itr.hasNext()) { >- RepositoryTaskAttribute a = itr.next(); >+ TaskAttribute a = itr.next(); > if (a != null && a.getId() != null && a.getId().compareTo("") != 0) { > String value = null; > value = a.getValue(); > if (value == null) { > continue; > } >- if (a.getId().equals(BugzillaReportElement.NEWCC.getKeyString())) { >- RepositoryTaskAttribute b = new RepositoryTaskAttribute(BugzillaReportElement.CC.getKeyString(), >- BugzillaReportElement.CC.toString(), false); >+ if (a.getId().equals(BugzillaReportElement.NEWCC.getKey())) { >+ TaskAttribute b = taskData.getRoot().createAttribute(BugzillaReportElement.CC.getKey()); >+ TaskAttributeProperties.defaults().setReadOnly(BugzillaReportElement.CC.isReadOnly()).setKind( >+ BugzillaReportElement.CC.getKind()).setLabel(BugzillaReportElement.CC.toString()).setType( >+ BugzillaReportElement.CC.getType()).applyTo(b); > for (String val : a.getValues()) { > if (val != null) { > b.addValue(val); >@@ -905,21 +910,22 @@ > } > } > >- if (taskData.getDescription().length() != 0) { >- fields.put(KEY_COMMENT, new NameValuePair(KEY_COMMENT, taskData.getDescription())); >+ TaskAttribute descAttribute = taskData.getRoot().getMappedAttribute(TaskAttribute.DESCRIPTION); >+ if (descAttribute != null && !descAttribute.getValue().equals("")) { >+ fields.put(KEY_COMMENT, new NameValuePair(KEY_COMMENT, descAttribute.getValue())); > } > > return fields.values().toArray(new NameValuePair[fields.size()]); > > } > >- private void cleanQAContact(RepositoryTaskAttribute a) { >- if (a.getId().equals(BugzillaReportElement.QA_CONTACT.getKeyString())) { >+ private void cleanQAContact(TaskAttribute a) { >+ if (a.getId().equals(BugzillaReportElement.QA_CONTACT.getKey())) { > cleanIfShortLogin(a); > } > } > >- private void cleanIfShortLogin(RepositoryTaskAttribute a) { >+ private void cleanIfShortLogin(TaskAttribute a) { > if ("true".equals(configParameters.get(IBugzillaConstants.REPOSITORY_SETTING_SHORT_LOGIN))) { > if (a.getValue() != null && a.getValue().length() > 0) { > int atIndex = a.getValue().indexOf("@"); >@@ -931,28 +937,30 @@ > } > } > >- private NameValuePair[] getPairsForExisting(RepositoryTaskData model) { >+ private NameValuePair[] getPairsForExisting(TaskData model) { > > Map<String, NameValuePair> fields = new HashMap<String, NameValuePair>(); > fields.put(KEY_FORM_NAME, new NameValuePair(KEY_FORM_NAME, VAL_PROCESS_BUG)); > // go through all of the attributes and add them to the bug post >- for (RepositoryTaskAttribute a : model.getAttributes()) { >+ Collection<TaskAttribute> attributes = model.getRoot().getAttributes().values(); >+ Iterator<TaskAttribute> itr = attributes.iterator(); >+ while (itr.hasNext()) { >+ TaskAttribute a = itr.next(); > > if (a == null) { > continue; >- } else if (a.getId().equals(BugzillaReportElement.QA_CONTACT.getKeyString()) >- || a.getId().equals(BugzillaReportElement.ASSIGNED_TO.getKeyString())) { >+ } else if (a.getId().equals(BugzillaReportElement.QA_CONTACT.getKey()) >+ || a.getId().equals(BugzillaReportElement.ASSIGNED_TO.getKey())) { > cleanIfShortLogin(a); >- } else if (a.getId().equals(BugzillaReportElement.REPORTER.getKeyString()) >- || a.getId().equals(BugzillaReportElement.CC.getKeyString()) >- || a.getId().equals(RepositoryTaskAttribute.REMOVE_CC) >- || a.getId().equals(BugzillaReportElement.CREATION_TS.getKeyString())) { >+ } else if (a.getId().equals(BugzillaReportElement.REPORTER.getKey()) >+ || a.getId().equals(BugzillaReportElement.CC.getKey()) || a.getId().equals(TaskAttribute.REMOVE_CC) >+ || a.getId().equals(BugzillaReportElement.CREATION_TS.getKey())) { > continue; > } > > if (a.getId() != null && a.getId().compareTo("") != 0) { > String value = a.getValue(); >- if (a.getId().equals(BugzillaReportElement.DELTA_TS.getKeyString())) { >+ if (a.getId().equals(BugzillaReportElement.DELTA_TS.getKey())) { > value = stripTimeZone(value); > } > fields.put(a.getId(), new NameValuePair(a.getId(), value != null ? value : "")); >@@ -960,41 +968,51 @@ > } > > // when posting the bug id is encoded in a hidden field named 'id' >- fields.put(KEY_ID, new NameValuePair(KEY_ID, >- model.getAttributeValue(BugzillaReportElement.BUG_ID.getKeyString()))); >+ TaskAttribute attributeBugId = model.getRoot().getAttribute(BugzillaReportElement.BUG_ID.getKey()); >+ if (attributeBugId != null) { >+ fields.put(KEY_ID, new NameValuePair(KEY_ID, attributeBugId.getValue())); >+ } > > // add the operation to the bug post >- RepositoryOperation o = model.getSelectedOperation(); >- if (o == null) { >+ TaskAttribute attributeOperation = model.getMappedAttribute(TaskAttribute.OPERATION); >+ TaskOperation operation = null; >+ if (attributeOperation == null) { > fields.put(KEY_KNOB, new NameValuePair(KEY_KNOB, VAL_NONE)); > } else { >- fields.put(KEY_KNOB, new NameValuePair(KEY_KNOB, o.getKnobName())); >- if (o.hasOptions()) { >- String sel = o.getOptionValue(o.getOptionSelection()); >- fields.put(o.getOptionName(), new NameValuePair(o.getOptionName(), sel)); >- } else if (o.isInput()) { >- String sel = o.getInputValue(); >- fields.put(o.getInputName(), new NameValuePair(o.getInputName(), sel)); >+ operation = model.getAttributeMapper().getTaskOperation(attributeOperation); >+ fields.put(KEY_KNOB, new NameValuePair(KEY_KNOB, operation.getOperationId())); >+ if (attributeOperation.getOptions().size() > 0) { >+ String sel = attributeOperation.getValue(); >+ fields.put(attributeOperation.getOption(sel), new NameValuePair(attributeOperation.getOption(sel), sel)); >+ } else { >+ String sel = attributeOperation.getValue(); >+ fields.put(operation.getLabel(), new NameValuePair(operation.getLabel(), sel)); > } > } > >- if (model.getAttribute(BugzillaReportElement.SHORT_DESC.getKeyString()) != null) { >- fields.put(KEY_SHORT_DESC, new NameValuePair(KEY_SHORT_DESC, model.getAttribute( >- BugzillaReportElement.SHORT_DESC.getKeyString()).getValue())); >+ if (model.getMappedAttribute(BugzillaReportElement.SHORT_DESC.getKey()) != null) { >+ fields.put(KEY_SHORT_DESC, new NameValuePair(KEY_SHORT_DESC, model.getMappedAttribute( >+ BugzillaReportElement.SHORT_DESC.getKey()).getValue())); > } > >- if (model.getNewComment().length() != 0) { >- fields.put(KEY_COMMENT, new NameValuePair(KEY_COMMENT, model.getNewComment())); >- } else if (o != null && o.getKnobName().equals(IBugzillaConstants.BUGZILLA_OPERATION.duplicate.toString())) { >+ if (model.getMappedAttribute(TaskAttribute.COMMENT_NEW) != null >+ && model.getMappedAttribute(TaskAttribute.COMMENT_NEW).getValue().length() > 0) { >+ fields.put(KEY_COMMENT, new NameValuePair(KEY_COMMENT, model.getMappedAttribute(TaskAttribute.COMMENT_NEW) >+ .getValue())); >+ } else if (operation != null >+ && operation.getOperationId().equals(IBugzillaConstants.BUGZILLA_OPERATION.duplicate.toString())) { > // fix for bug#198677 > fields.put(KEY_COMMENT, new NameValuePair(KEY_COMMENT, "")); > } > >- List<String> removeCC = model.getAttributeValues(RepositoryTaskAttribute.REMOVE_CC); >- if (removeCC != null && removeCC.size() > 0) { >- String[] s = new String[removeCC.size()]; >- fields.put(KEY_CC, new NameValuePair(KEY_CC, toCommaSeparatedList(removeCC.toArray(s)))); >- fields.put(KEY_REMOVECC, new NameValuePair(KEY_REMOVECC, VAL_TRUE)); >+ TaskAttribute attributeRemoveCC = model.getMappedAttribute(TaskAttribute.REMOVE_CC); >+ if (attributeRemoveCC != null) { >+ List<String> removeCC = attributeRemoveCC.getValues(); >+ if (removeCC != null && removeCC.size() > 0) { >+ String[] s = new String[removeCC.size()]; >+ fields.put(KEY_CC, new NameValuePair(KEY_CC, toCommaSeparatedList(removeCC.toArray(s)))); >+ fields.put(KEY_REMOVECC, new NameValuePair(KEY_REMOVECC, VAL_TRUE)); >+ } > } > > return fields.values().toArray(new NameValuePair[fields.size()]); >@@ -1168,10 +1186,10 @@ > return null; > } > >- public Map<String, RepositoryTaskData> getTaskData(Set<String> taskIds, final TaskDataCollector collector, >- final IProgressMonitor monitor) throws IOException, CoreException { >+ public Map<String, TaskData> getTaskData(Set<String> taskIds, final TaskDataCollector collector, >+ final TaskAttributeMapper mapper, final IProgressMonitor monitor) throws IOException, CoreException { > GzipPostMethod method = null; >- HashMap<String, RepositoryTaskData> taskDataMap = new HashMap<String, RepositoryTaskData>(); >+ HashMap<String, TaskData> taskDataMap = new HashMap<String, TaskData>(); > // make a copy to modify set > taskIds = new HashSet<String>(taskIds); > while (taskIds.size() > 0) { >@@ -1195,8 +1213,8 @@ > for (; itr.hasNext(); x++) { > String taskId = itr.next(); > formData[x] = new NameValuePair("id", taskId); >- RepositoryTaskData taskData = new RepositoryTaskData(new BugzillaAttributeFactory(), >- BugzillaCorePlugin.REPOSITORY_KIND, repositoryUrl.toString(), taskId); >+ TaskData taskData = new TaskData(mapper, BugzillaCorePlugin.CONNECTOR_KIND, >+ repositoryUrl.toString(), taskId); > setupExistingBugAttributes(repositoryUrl.toString(), taskData); > taskDataMap.put(taskId, taskData); > } >@@ -1217,17 +1235,17 @@ > try { > MultiBugReportFactory factory = new MultiBugReportFactory(input, characterEncoding); > >- LegacyTaskDataCollector collector2 = new LegacyTaskDataCollector() { >+ TaskDataCollector collector2 = new TaskDataCollector() { > > @Override >- public void accept(RepositoryTaskData taskData) { >+ public void accept(TaskData taskData) { > getRepositoryConfiguration().configureTaskData(taskData); >- ((LegacyTaskDataCollector) collector).accept(taskData); >+ ((TaskDataCollector) collector).accept(taskData); > monitor.worked(1); > } > }; > >- factory.populateReport(taskDataMap, collector2, customFields); >+ factory.populateReport(taskDataMap, collector2, mapper, customFields); > taskIds.removeAll(idsToRetrieve); > parseable = true; > break; >Index: .refactorings/2008/5/20/refactorings.index >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/.refactorings/2008/5/20/refactorings.index,v >retrieving revision 1.1 >diff -u -r1.1 refactorings.index >--- .refactorings/2008/5/20/refactorings.index 14 May 2008 04:07:39 -0000 1.1 >+++ .refactorings/2008/5/20/refactorings.index 22 May 2008 17:18:52 -0000 >@@ -1 +1,4 @@ > 1210734328587 Rename type 'StackTraceDuplicateDetector' >+1210971188860 Rename field 'REPOSITORY_KIND' >+1210973071627 Delete element >+1210976615822 Rename method 'getKeyString' >Index: .refactorings/2008/5/20/refactorings.history >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/.refactorings/2008/5/20/refactorings.history,v >retrieving revision 1.1 >diff -u -r1.1 refactorings.history >--- .refactorings/2008/5/20/refactorings.history 14 May 2008 04:07:39 -0000 1.1 >+++ .refactorings/2008/5/20/refactorings.history 22 May 2008 17:18:52 -0000 >@@ -1,4 +1,3 @@ > <?xml version="1.0" encoding="UTF-8"?> >-<session version="1.0"> >-<refactoring comment="Rename type 'org.eclipse.mylyn.internal.bugzilla.core.StackTraceDuplicateDetector' to 'BugzillaStackTraceDuplicateDetector'
- Original project: 'org.eclipse.mylyn.bugzilla.core'
- Original element: 'org.eclipse.mylyn.internal.bugzilla.core.StackTraceDuplicateDetector'
- Renamed element: 'org.eclipse.mylyn.internal.bugzilla.core.BugzillaStackTraceDuplicateDetector'
- Update references to refactored element
- Update fully qualified names in 'plugin.xml,MANIFEST.MF' files
- Update textual occurrences in comments and strings" description="Rename type 'StackTraceDuplicateDetector'" flags="589830" id="org.eclipse.jdt.ui.rename.type" input="/src<org.eclipse.mylyn.internal.bugzilla.core{StackTraceDuplicateDetector.java[StackTraceDuplicateDetector" matchStrategy="1" name="BugzillaStackTraceDuplicateDetector" patterns="plugin.xml,MANIFEST.MF" qualified="true" references="true" similarDeclarations="false" stamp="1210734328587" textual="false" version="1.0"/> >+<session version="1.0">
<refactoring comment="Rename type 'org.eclipse.mylyn.internal.bugzilla.core.StackTraceDuplicateDetector' to 'BugzillaStackTraceDuplicateDetector'
- Original project: 'org.eclipse.mylyn.bugzilla.core'
- Original element: 'org.eclipse.mylyn.internal.bugzilla.core.StackTraceDuplicateDetector'
- Renamed element: 'org.eclipse.mylyn.internal.bugzilla.core.BugzillaStackTraceDuplicateDetector'
- Update references to refactored element
- Update fully qualified names in 'plugin.xml,MANIFEST.MF' files
- Update textual occurrences in comments and strings" description="Rename type 'StackTraceDuplicateDetector'" flags="589830" id="org.eclipse.jdt.ui.rename.type" input="/src<org.eclipse.mylyn.internal.bugzilla.core{StackTraceDuplicateDetector.java[StackTraceDuplicateDetector" matchStrategy="1" name="BugzillaStackTraceDuplicateDetector" patterns="plugin.xml,MANIFEST.MF" qualified="true" references="true" similarDeclarations="false" stamp="1210734328587" textual="false" version="1.0"/>
<refactoring comment="Rename field 'REPOSITORY_KIND' in 'org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin' to 'CONNECTOR_KIND'
- Original project: 'org.eclipse.mylyn.bugzilla.core'
- Original element: 'org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin.REPOSITORY_KIND'
- Renamed element: 'org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin.CONNECTOR_KIND'
- Update references to refactored element
- Update textual occurrences in comments and strings" delegate="false" deprecate="false" description="Rename field 'REPOSITORY_KIND'" flags="589830" getter="false" id="org.eclipse.jdt.ui.rename.field" input="/src<org.eclipse.mylyn.internal.bugzilla.core{BugzillaCorePlugin.java[BugzillaCorePlugin^REPOSITORY_KIND" name="CONNECTOR_KIND" references="true" setter="false" stamp="1210971188860" textual="false" version="1.0"/>
<refactoring accessors="true" comment="Delete 1 element(s) from project 'org.eclipse.mylyn.bugzilla.core'
- Original project: 'org.eclipse.mylyn.bugzilla.core'
- Original element: 'BugzillaRepositoryConnector.java.rej'" description="Delete element" element1="src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java.rej" elements="0" flags="589830" id="org.eclipse.jdt.ui.delete" resources="1" stamp="1210973071627" subPackages="false" version="1.0"/>
<refactoring comment="Rename method 'org.eclipse.mylyn.internal.bugzilla.core.BugzillaReportElement.getKeyString()' to 'getKey'
- Original project: 'org.eclipse.mylyn.bugzilla.core'
- Original element: 'org.eclipse.mylyn.internal.bugzilla.core.BugzillaReportElement.getKeyString()'
- Renamed element: 'org.eclipse.mylyn.internal.bugzilla.core.BugzillaReportElement.getKey()'
- Update references to refactored element" delegate="false" deprecate="false" description="Rename method 'getKeyString'" flags="589830" id="org.eclipse.jdt.ui.rename.method" input="/src<org.eclipse.mylyn.internal.bugzilla.core{BugzillaReportElement.java[BugzillaReportElement~getKeyString" name="getKey" references="true" stamp="1210976615822" version="1.0"/> > </session> >\ No newline at end of file >Index: .refactorings/2008/5/21/refactorings.index >=================================================================== >RCS file: .refactorings/2008/5/21/refactorings.index >diff -N .refactorings/2008/5/21/refactorings.index >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ .refactorings/2008/5/21/refactorings.index 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,2 @@ >+1211318360569 Delete element >+1211340231944 Delete element >Index: .refactorings/2008/5/21/refactorings.history >=================================================================== >RCS file: .refactorings/2008/5/21/refactorings.history >diff -N .refactorings/2008/5/21/refactorings.history >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ .refactorings/2008/5/21/refactorings.history 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,3 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<session version="1.0">
<refactoring accessors="true" comment="Delete 1 element(s) from project 'org.eclipse.mylyn.bugzilla.core'
- Original project: 'org.eclipse.mylyn.bugzilla.core'
- Original element: 'org.eclipse.mylyn.internal.bugzilla.core.BugzillaTaskDataColector.java'" description="Delete element" element1="/src<org.eclipse.mylyn.internal.bugzilla.core{BugzillaTaskDataColector.java" elements="1" flags="589830" id="org.eclipse.jdt.ui.delete" resources="0" stamp="1211318360569" subPackages="false" version="1.0"/>
<refactoring accessors="true" comment="Delete 1 element(s) from project 'org.eclipse.mylyn.bugzilla.core'
- Original project: 'org.eclipse.mylyn.bugzilla.core'
- Original element: 'org.eclipse.mylyn.internal.bugzilla.core.BugzillaTaskDataCollector.java'" description="Delete element" element1="/src<org.eclipse.mylyn.internal.bugzilla.core{BugzillaTaskDataCollector.java" elements="1" flags="589830" id="org.eclipse.jdt.ui.delete" resources="0" stamp="1211340231944" subPackages="false" version="1.0"/> >+</session> >Index: src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaComment.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaComment.java >diff -N src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaComment.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaComment.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,23 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2007 Mylyn project committers 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 >+ *******************************************************************************/ >+ >+package org.eclipse.mylyn.internal.bugzilla.core; >+ >+public class BugzillaComment { >+ >+ /** Comment's number */ >+ private final int number; >+ >+ private boolean hasAttachment; >+ >+ private String attachmentId; >+ >+ public BugzillaComment(int commentNumber) { >+ this.number = commentNumber; >+ } >+} >Index: src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeMapper.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeMapper.java >diff -N src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeMapper.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeMapper.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,129 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2007 Mylyn project committers 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 >+ *******************************************************************************/ >+ >+package org.eclipse.mylyn.internal.bugzilla.core; >+ >+import java.text.ParseException; >+import java.text.SimpleDateFormat; >+import java.util.Date; >+ >+import org.eclipse.mylyn.tasks.core.TaskRepository; >+import org.eclipse.mylyn.tasks.core.data.TaskAttribute; >+import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper; >+ >+public class BugzillaAttributeMapper extends TaskAttributeMapper { >+ >+ private static final String DATE_FORMAT_1 = "yyyy-MM-dd HH:mm"; >+ >+ private static final String DATE_FORMAT_2 = "yyyy-MM-dd HH:mm:ss"; >+ >+ private static final String delta_ts_format = DATE_FORMAT_2; >+ >+ private static final String creation_ts_format = DATE_FORMAT_1; >+ >+ /** >+ * public for testing Bugzilla 2.18 uses DATE_FORMAT_1 but later versions use DATE_FORMAT_2 Using lowest common >+ * denominator DATE_FORMAT_1 >+ */ >+ public static final String comment_creation_ts_format = DATE_FORMAT_1; >+ >+ private static final String attachment_creation_ts_format = DATE_FORMAT_1; >+ >+ public BugzillaAttributeMapper(TaskRepository taskRepository) { >+ super(taskRepository); >+ } >+ >+ @Override >+ public Date getDateValue(TaskAttribute attribute) { >+ if (attribute == null) { >+ return null; >+ } >+ try { >+ String dateString = attribute.getValue(); >+ Date parsedDate = null; >+ if (attribute.getId().equals(BugzillaReportElement.DELTA_TS.getKey())) { >+ parsedDate = new SimpleDateFormat(delta_ts_format).parse(dateString); >+ } else if (attribute.getId().equals(BugzillaReportElement.CREATION_TS.getKey())) { >+ parsedDate = new SimpleDateFormat(creation_ts_format).parse(dateString); >+ } else if (attribute.getId().equals(BugzillaReportElement.BUG_WHEN.getKey())) { >+ parsedDate = new SimpleDateFormat(comment_creation_ts_format).parse(dateString); >+ } else if (attribute.getId().equals(BugzillaReportElement.DATE.getKey())) { >+ parsedDate = new SimpleDateFormat(attachment_creation_ts_format).parse(dateString); >+ } else { >+ parsedDate = super.getDateValue(attribute); >+ } >+ return parsedDate; >+ } catch (NumberFormatException e) { >+ return null; >+ } catch (ParseException e) { >+ return null; >+ } >+ } >+ >+ @Override >+ public String mapToRepositoryKey(TaskAttribute parent, String key) { >+ if (key.equals(TaskAttribute.NEW_CC)) { >+ return BugzillaReportElement.NEWCC.getKey(); >+ } else if (key.equals(TaskAttribute.COMMENT_DATE)) { >+ return BugzillaReportElement.BUG_WHEN.getKey(); >+ } else if (key.equals(TaskAttribute.COMMENT_AUTHOR)) { >+ return BugzillaReportElement.WHO.getKey(); >+ } else if (key.equals(TaskAttribute.COMMENT_AUTHOR_NAME)) { >+ return BugzillaReportElement.WHO_NAME.getKey(); >+ } else if (key.equals(TaskAttribute.USER_CC)) { >+ return BugzillaReportElement.CC.getKey(); >+ } else if (key.equals(TaskAttribute.COMMENT_TEXT)) { >+ return BugzillaReportElement.THETEXT.getKey(); >+ } else if (key.equals(TaskAttribute.DATE_CREATION)) { >+ return BugzillaReportElement.CREATION_TS.getKey(); >+ /*} else if (key.equals(TaskAttribute.DESCRIPTION)) { >+ return BugzillaReportElement.DESC.getKey();// attachment description >+ */ >+ } else if (key.equals(TaskAttribute.ATTACHMENT_ID)) { >+ return BugzillaReportElement.ATTACHID.getKey(); >+ /*} else if (key.equals(TaskAttribute.ATTACHMENT_TYPE)) { >+ return BugzillaReportElement.TYPE.getKey();*/ >+ } else if (key.equals(TaskAttribute.ATTACHMENT_CONTENT_TYPE)) { >+ return BugzillaReportElement.CTYPE.getKey(); >+ } else if (key.equals(TaskAttribute.USER_ASSIGNED)) { >+ return BugzillaReportElement.ASSIGNED_TO.getKey(); >+ } else if (key.equals(TaskAttribute.USER_ASSIGNED_NAME)) { >+ return BugzillaReportElement.ASSIGNED_TO_NAME.getKey(); >+ } else if (key.equals(TaskAttribute.RESOLUTION)) { >+ return BugzillaReportElement.RESOLUTION.getKey(); >+ } else if (key.equals(TaskAttribute.STATUS)) { >+ return BugzillaReportElement.BUG_STATUS.getKey(); >+ } else if (key.equals(TaskAttribute.DATE_MODIFIED)) { >+ return BugzillaReportElement.DELTA_TS.getKey(); >+ } else if (key.equals(TaskAttribute.USER_REPORTER)) { >+ return BugzillaReportElement.REPORTER.getKey(); >+ } else if (key.equals(TaskAttribute.USER_REPORTER_NAME)) { >+ return BugzillaReportElement.REPORTER_NAME.getKey(); >+ } else if (key.equals(TaskAttribute.SUMMARY)) { >+ return BugzillaReportElement.SHORT_DESC.getKey(); >+ } else if (key.equals(TaskAttribute.PRODUCT)) { >+ return BugzillaReportElement.PRODUCT.getKey(); >+ } else if (key.equals(TaskAttribute.KEYWORDS)) { >+ return BugzillaReportElement.KEYWORDS.getKey(); >+ } else if (key.equals(TaskAttribute.ATTACHMENT_DATE)) { >+ return BugzillaReportElement.DATE.getKey(); >+ } else if (key.equals(TaskAttribute.ATTACHMENT_SIZE)) { >+ return BugzillaReportElement.SIZE.getKey(); >+ } else if (key.equals(TaskAttribute.ADD_SELF_CC)) { >+ return BugzillaReportElement.ADDSELFCC.getKey(); >+ } else if (key.equals(TaskAttribute.PRIORITY)) { >+ return BugzillaReportElement.PRIORITY.getKey(); >+ } else if (key.equals(TaskAttribute.COMMENT_NEW)) { >+ return BugzillaReportElement.NEW_COMMENT.getKey(); >+ } else if (key.equals(TaskAttribute.COMPONENT)) { >+ return BugzillaReportElement.COMPONENT.getKey(); >+ } >+ return super.mapToRepositoryKey(parent, key); >+ } >+ >+} >#P org.eclipse.mylyn.sandbox.ui >Index: src/org/eclipse/mylyn/internal/sandbox/bridge/bugs/BugzillaReportInfo.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.sandbox.ui/src/org/eclipse/mylyn/internal/sandbox/bridge/bugs/BugzillaReportInfo.java,v >retrieving revision 1.24 >diff -u -r1.24 BugzillaReportInfo.java >--- src/org/eclipse/mylyn/internal/sandbox/bridge/bugs/BugzillaReportInfo.java 4 May 2008 05:54:44 -0000 1.24 >+++ src/org/eclipse/mylyn/internal/sandbox/bridge/bugs/BugzillaReportInfo.java 22 May 2008 17:18:58 -0000 >@@ -107,9 +107,9 @@ > if (bug == null) { > // get the bug report > TaskRepository repository = TasksUi.getRepositoryManager().getRepository( >- BugzillaCorePlugin.REPOSITORY_KIND, hit.getRepositoryUrl()); >+ BugzillaCorePlugin.CONNECTOR_KIND, hit.getRepositoryUrl()); > BugzillaRepositoryConnector bugzillaConnector = (BugzillaRepositoryConnector) TasksUi.getRepositoryManager() >- .getRepositoryConnector(BugzillaCorePlugin.REPOSITORY_KIND); >+ .getRepositoryConnector(BugzillaCorePlugin.CONNECTOR_KIND); > AbstractTaskDataHandler handler = bugzillaConnector.getLegacyTaskDataHandler(); > bug = handler.getTaskData(repository, hit.getTaskId(), new NullProgressMonitor()); > } >Index: src/org/eclipse/mylyn/internal/sandbox/bridge/bugs/Util.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.sandbox.ui/src/org/eclipse/mylyn/internal/sandbox/bridge/bugs/Util.java,v >retrieving revision 1.15 >diff -u -r1.15 Util.java >--- src/org/eclipse/mylyn/internal/sandbox/bridge/bugs/Util.java 4 May 2008 05:54:44 -0000 1.15 >+++ src/org/eclipse/mylyn/internal/sandbox/bridge/bugs/Util.java 22 May 2008 17:18:58 -0000 >@@ -166,7 +166,7 @@ > } > sb.append("buglist.cgi?"); > >- TaskRepository repository = TasksUi.getRepositoryManager().getRepository(BugzillaCorePlugin.REPOSITORY_KIND, >+ TaskRepository repository = TasksUi.getRepositoryManager().getRepository(BugzillaCorePlugin.CONNECTOR_KIND, > repositoryUrl); > if (repository != null && repository.hasCredentials()) { > // if (BugzillaPreferencePage.getUserName() != null >Index: src/org/eclipse/mylyn/internal/sandbox/bridge/bugs/BugzillaSearchEngine.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.sandbox.ui/src/org/eclipse/mylyn/internal/sandbox/bridge/bugs/BugzillaSearchEngine.java,v >retrieving revision 1.28 >diff -u -r1.28 BugzillaSearchEngine.java >--- src/org/eclipse/mylyn/internal/sandbox/bridge/bugs/BugzillaSearchEngine.java 7 May 2008 06:05:35 -0000 1.28 >+++ src/org/eclipse/mylyn/internal/sandbox/bridge/bugs/BugzillaSearchEngine.java 22 May 2008 17:18:58 -0000 >@@ -129,7 +129,7 @@ > "summary"); > > BugzillaRepositoryConnector bugzillaConnector = (BugzillaRepositoryConnector) TasksUi.getRepositoryManager() >- .getRepositoryConnector(BugzillaCorePlugin.REPOSITORY_KIND); >+ .getRepositoryConnector(BugzillaCorePlugin.CONNECTOR_KIND); > > BugzillaClient client = bugzillaConnector.getClientManager().getClient(repository, > new NullProgressMonitor()); >Index: src/org/eclipse/mylyn/internal/sandbox/bridge/bugs/BugzillaMylynSearchOperation.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.sandbox.ui/src/org/eclipse/mylyn/internal/sandbox/bridge/bugs/BugzillaMylynSearchOperation.java,v >retrieving revision 1.19 >diff -u -r1.19 BugzillaMylynSearchOperation.java >--- src/org/eclipse/mylyn/internal/sandbox/bridge/bugs/BugzillaMylynSearchOperation.java 14 May 2008 21:39:00 -0000 1.19 >+++ src/org/eclipse/mylyn/internal/sandbox/bridge/bugs/BugzillaMylynSearchOperation.java 22 May 2008 17:18:58 -0000 >@@ -345,7 +345,7 @@ > > // get the search url > String url = Util.getExactSearchURL(repositoryUrl, javaElement); >- TaskRepository repository = TasksUi.getRepositoryManager().getRepository(BugzillaCorePlugin.REPOSITORY_KIND, >+ TaskRepository repository = TasksUi.getRepositoryManager().getRepository(BugzillaCorePlugin.CONNECTOR_KIND, > repositoryUrl); > return search(url, repository, collector, monitor); > } >@@ -366,7 +366,7 @@ > > // get the search url > String url = Util.getInexactSearchURL(repositoryUrl, javaElement); >- TaskRepository repository = TasksUi.getRepositoryManager().getRepository(BugzillaCorePlugin.REPOSITORY_KIND, >+ TaskRepository repository = TasksUi.getRepositoryManager().getRepository(BugzillaCorePlugin.CONNECTOR_KIND, > repositoryUrl); > > return search(url, repository, collector, monitor); >#P org.eclipse.mylyn.bugzilla.tests >Index: src/org/eclipse/mylyn/bugzilla/tests/DuplicateDetetionTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/DuplicateDetetionTest.java,v >retrieving revision 1.35 >diff -u -r1.35 DuplicateDetetionTest.java >--- src/org/eclipse/mylyn/bugzilla/tests/DuplicateDetetionTest.java 14 May 2008 04:07:45 -0000 1.35 >+++ src/org/eclipse/mylyn/bugzilla/tests/DuplicateDetetionTest.java 22 May 2008 17:19:01 -0000 >@@ -34,7 +34,7 @@ > @Override > protected void setUp() throws Exception { > super.setUp(); >- repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); >+ repository = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); > > } > >@@ -43,7 +43,7 @@ > String stackTrace = "java.lang.NullPointerException\nat jeff.testing.stack.trace.functionality(jeff.java:481)"; > > RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), >- BugzillaCorePlugin.REPOSITORY_KIND, repository.getRepositoryUrl(), >+ BugzillaCorePlugin.CONNECTOR_KIND, repository.getRepositoryUrl(), > TasksUiPlugin.getTaskDataStorageManager().getNewRepositoryTaskId()); > model.setDescription(stackTrace); > model.setNew(true); >@@ -62,7 +62,7 @@ > public void testNoStackTrace() throws Exception { > String fakeStackTrace = "this is not really a stacktrace"; > RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), >- BugzillaCorePlugin.REPOSITORY_KIND, repository.getRepositoryUrl(), >+ BugzillaCorePlugin.CONNECTOR_KIND, repository.getRepositoryUrl(), > TasksUiPlugin.getTaskDataStorageManager().getNewRepositoryTaskId()); > model.setDescription(fakeStackTrace); > model.setNew(true); >@@ -84,7 +84,7 @@ > String extraText = "\nExtra text that isnt' part of the stack trace java:"; > > RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), >- BugzillaCorePlugin.REPOSITORY_KIND, repository.getRepositoryUrl(), >+ BugzillaCorePlugin.CONNECTOR_KIND, repository.getRepositoryUrl(), > TasksUiPlugin.getTaskDataStorageManager().getNewRepositoryTaskId()); > > model.setDescription(extraText + "\n" + stackTrace + "\n"); >@@ -113,7 +113,7 @@ > + "at org.eclipse.jdt.internal.core.JavaElement\n.getURLContents(JavaElement.java:734)"; > > RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), >- BugzillaCorePlugin.REPOSITORY_KIND, repository.getRepositoryUrl(), >+ BugzillaCorePlugin.CONNECTOR_KIND, repository.getRepositoryUrl(), > TasksUiPlugin.getTaskDataStorageManager().getNewRepositoryTaskId()); > > model.setDescription(stackTrace); >@@ -143,7 +143,7 @@ > + " at org.eclipse.jdt.internal.core.JavaElement.getURLContents(JavaElement.java:734)"; > > RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), >- BugzillaCorePlugin.REPOSITORY_KIND, repository.getRepositoryUrl(), >+ BugzillaCorePlugin.CONNECTOR_KIND, repository.getRepositoryUrl(), > TasksUiPlugin.getTaskDataStorageManager().getNewRepositoryTaskId()); > > model.setDescription(stackTrace); >@@ -169,7 +169,7 @@ > + " at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)"; > > RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), >- BugzillaCorePlugin.REPOSITORY_KIND, repository.getRepositoryUrl(), >+ BugzillaCorePlugin.CONNECTOR_KIND, repository.getRepositoryUrl(), > TasksUiPlugin.getTaskDataStorageManager().getNewRepositoryTaskId()); > > model.setDescription(stackTrace); >@@ -193,7 +193,7 @@ > + " at java.lang.reflect.Method.Invoke (Method.java)"; > > RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), >- BugzillaCorePlugin.REPOSITORY_KIND, repository.getRepositoryUrl(), >+ BugzillaCorePlugin.CONNECTOR_KIND, repository.getRepositoryUrl(), > TasksUiPlugin.getTaskDataStorageManager().getNewRepositoryTaskId()); > > model.setDescription(stackTrace); >@@ -220,7 +220,7 @@ > + " at java/util/logging/LogManager.readConfiguration(L:555)"; > > RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), >- BugzillaCorePlugin.REPOSITORY_KIND, repository.getRepositoryUrl(), >+ BugzillaCorePlugin.CONNECTOR_KIND, repository.getRepositoryUrl(), > TasksUiPlugin.getTaskDataStorageManager().getNewRepositoryTaskId()); > > model.setDescription(stackTrace); >@@ -245,7 +245,7 @@ > + " at java.lang.VirtualMachine.main (VirtualMachine.java:108)"; > > RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), >- BugzillaCorePlugin.REPOSITORY_KIND, repository.getRepositoryUrl(), >+ BugzillaCorePlugin.CONNECTOR_KIND, repository.getRepositoryUrl(), > TasksUiPlugin.getTaskDataStorageManager().getNewRepositoryTaskId()); > > model.setDescription(stackTrace); >Index: src/org/eclipse/mylyn/bugzilla/tests/EncodingTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/EncodingTest.java,v >retrieving revision 1.30 >diff -u -r1.30 EncodingTest.java >--- src/org/eclipse/mylyn/bugzilla/tests/EncodingTest.java 15 May 2008 19:13:21 -0000 1.30 >+++ src/org/eclipse/mylyn/bugzilla/tests/EncodingTest.java 22 May 2008 17:19:01 -0000 >@@ -69,13 +69,13 @@ > String priority = null; > if (task.getPriority().equals("P1")) { > priority = "P2"; >- taskData.setAttributeValue(BugzillaReportElement.PRIORITY.getKeyString(), priority); >+ taskData.setAttributeValue(BugzillaReportElement.PRIORITY.getKey(), priority); > } else { > priority = "P1"; >- taskData.setAttributeValue(BugzillaReportElement.PRIORITY.getKeyString(), priority); >+ taskData.setAttributeValue(BugzillaReportElement.PRIORITY.getKey(), priority); > } > >- submit(task, taskData); >+ submit(task, taskData, null); > taskList.deleteTask(task); > task = (BugzillaTask) TasksUiInternal.createTask(repository, "57", new NullProgressMonitor()); > assertNotNull(task); >Index: src/org/eclipse/mylyn/bugzilla/tests/RepositoryReportFactoryTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryReportFactoryTest.java,v >retrieving revision 1.43 >diff -u -r1.43 RepositoryReportFactoryTest.java >--- src/org/eclipse/mylyn/bugzilla/tests/RepositoryReportFactoryTest.java 7 May 2008 18:30:58 -0000 1.43 >+++ src/org/eclipse/mylyn/bugzilla/tests/RepositoryReportFactoryTest.java 22 May 2008 17:19:02 -0000 >@@ -46,7 +46,7 @@ > > private TaskRepository setRepository(String kind, String url) { > connector = (BugzillaRepositoryConnector) TasksUiPlugin.getRepositoryManager().getRepositoryConnector( >- BugzillaCorePlugin.REPOSITORY_KIND); >+ BugzillaCorePlugin.CONNECTOR_KIND); > repository = new TaskRepository(kind, url); > Credentials credentials = TestUtil.readCredentials(); > repository.setAuthenticationCredentials(credentials.username, credentials.password); >@@ -57,7 +57,7 @@ > String bugid = "1"; > String errorMessage = ""; > try { >- setRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); >+ setRepository(BugzillaCorePlugin.CONNECTOR_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); > repository.setAuthenticationCredentials("invalid", "invalid"); > init(bugid); > } catch (CoreException e) { >@@ -72,7 +72,7 @@ > String bugid = "-1"; > String errorMessage = ""; > try { >- setRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); >+ setRepository(BugzillaCorePlugin.CONNECTOR_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); > // If this isn't called the BugzillaClient will be reused (with old > // credentials) so > // force drop of old client connection. >@@ -131,31 +131,31 @@ > > public void testReadingReport222() throws Exception { > String bugid = "2"; >- setRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); >+ setRepository(BugzillaCorePlugin.CONNECTOR_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); > RepositoryTaskData report = init(bugid); > > assertNotNull(report); >- assertEquals("search-match-test 1", report.getAttribute(BugzillaReportElement.SHORT_DESC.getKeyString()) >+ assertEquals("search-match-test 1", report.getAttribute(BugzillaReportElement.SHORT_DESC.getKey()) > .getValue()); > assertEquals("search-match-test 1", report.getSummary()); > assertEquals("search-match-test 1", report.getDescription()); >- assertEquals("TestProduct", report.getAttribute(BugzillaReportElement.PRODUCT.getKeyString()).getValue()); >+ assertEquals("TestProduct", report.getAttribute(BugzillaReportElement.PRODUCT.getKey()).getValue()); > assertEquals("TestProduct", report.getProduct()); >- assertEquals("TestComponent", report.getAttribute(BugzillaReportElement.COMPONENT.getKeyString()).getValue()); >- assertEquals("PC", report.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()).getValue()); >- assertEquals("Windows", report.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()).getValue()); >- assertEquals("other", report.getAttribute(BugzillaReportElement.VERSION.getKeyString()).getValue()); >- assertEquals("P1", report.getAttribute(BugzillaReportElement.PRIORITY.getKeyString()).getValue()); >- assertEquals("normal", report.getAttribute(BugzillaReportElement.BUG_SEVERITY.getKeyString()).getValue()); >- assertEquals("" + bugid, report.getAttribute(BugzillaReportElement.BUG_ID.getKeyString()).getValue()); >- assertEquals("NEW", report.getAttribute(BugzillaReportElement.BUG_STATUS.getKeyString()).getValue()); >- assertEquals("2006-05-23 17:46", report.getAttribute(BugzillaReportElement.CREATION_TS.getKeyString()) >- .getValue()); >- assertEquals("2008-02-15 12:55:32", report.getAttribute(BugzillaReportElement.DELTA_TS.getKeyString()) >- .getValue()); >- assertEquals("---", report.getAttribute(BugzillaReportElement.TARGET_MILESTONE.getKeyString()).getValue()); >- assertEquals("relves@cs.ubc.ca", report.getAttribute(BugzillaReportElement.REPORTER.getKeyString()).getValue()); >- assertEquals("nhapke@cs.ubc.ca", report.getAttribute(BugzillaReportElement.ASSIGNED_TO.getKeyString()) >+ assertEquals("TestComponent", report.getAttribute(BugzillaReportElement.COMPONENT.getKey()).getValue()); >+ assertEquals("PC", report.getAttribute(BugzillaReportElement.REP_PLATFORM.getKey()).getValue()); >+ assertEquals("Windows", report.getAttribute(BugzillaReportElement.OP_SYS.getKey()).getValue()); >+ assertEquals("other", report.getAttribute(BugzillaReportElement.VERSION.getKey()).getValue()); >+ assertEquals("P1", report.getAttribute(BugzillaReportElement.PRIORITY.getKey()).getValue()); >+ assertEquals("normal", report.getAttribute(BugzillaReportElement.BUG_SEVERITY.getKey()).getValue()); >+ assertEquals("" + bugid, report.getAttribute(BugzillaReportElement.BUG_ID.getKey()).getValue()); >+ assertEquals("NEW", report.getAttribute(BugzillaReportElement.BUG_STATUS.getKey()).getValue()); >+ assertEquals("2006-05-23 17:46", report.getAttribute(BugzillaReportElement.CREATION_TS.getKey()) >+ .getValue()); >+ assertEquals("2008-02-15 12:55:32", report.getAttribute(BugzillaReportElement.DELTA_TS.getKey()) >+ .getValue()); >+ assertEquals("---", report.getAttribute(BugzillaReportElement.TARGET_MILESTONE.getKey()).getValue()); >+ assertEquals("relves@cs.ubc.ca", report.getAttribute(BugzillaReportElement.REPORTER.getKey()).getValue()); >+ assertEquals("nhapke@cs.ubc.ca", report.getAttribute(BugzillaReportElement.ASSIGNED_TO.getKey()) > .getValue()); > assertEquals(5, report.getComments().size()); > // assertEquals("relves@cs.ubc.ca", >@@ -172,34 +172,34 @@ > > public void testReadingReport2201() throws Exception { > String bugid = "1"; >- setRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_2201_URL); >+ setRepository(BugzillaCorePlugin.CONNECTOR_KIND, IBugzillaConstants.TEST_BUGZILLA_2201_URL); > RepositoryTaskData report = init(bugid); > > assertNotNull(report); >- assertEquals("1", report.getAttribute(BugzillaReportElement.BUG_ID.getKeyString()).getValue()); >- assertEquals("search-match-test 1", report.getAttribute(BugzillaReportElement.SHORT_DESC.getKeyString()) >+ assertEquals("1", report.getAttribute(BugzillaReportElement.BUG_ID.getKey()).getValue()); >+ assertEquals("search-match-test 1", report.getAttribute(BugzillaReportElement.SHORT_DESC.getKey()) > .getValue()); >- assertEquals("TestProduct", report.getAttribute(BugzillaReportElement.PRODUCT.getKeyString()).getValue()); >- assertEquals("TestComponent", report.getAttribute(BugzillaReportElement.COMPONENT.getKeyString()).getValue()); >- assertEquals("PC", report.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()).getValue()); >- assertEquals("Windows", report.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()).getValue()); >- assertEquals("other", report.getAttribute(BugzillaReportElement.VERSION.getKeyString()).getValue()); >- assertEquals("P2", report.getAttribute(BugzillaReportElement.PRIORITY.getKeyString()).getValue()); >- assertEquals("normal", report.getAttribute(BugzillaReportElement.BUG_SEVERITY.getKeyString()).getValue()); >- assertEquals("NEW", report.getAttribute(BugzillaReportElement.BUG_STATUS.getKeyString()).getValue()); >- assertEquals("2006-03-02 18:13", report.getAttribute(BugzillaReportElement.CREATION_TS.getKeyString()) >+ assertEquals("TestProduct", report.getAttribute(BugzillaReportElement.PRODUCT.getKey()).getValue()); >+ assertEquals("TestComponent", report.getAttribute(BugzillaReportElement.COMPONENT.getKey()).getValue()); >+ assertEquals("PC", report.getAttribute(BugzillaReportElement.REP_PLATFORM.getKey()).getValue()); >+ assertEquals("Windows", report.getAttribute(BugzillaReportElement.OP_SYS.getKey()).getValue()); >+ assertEquals("other", report.getAttribute(BugzillaReportElement.VERSION.getKey()).getValue()); >+ assertEquals("P2", report.getAttribute(BugzillaReportElement.PRIORITY.getKey()).getValue()); >+ assertEquals("normal", report.getAttribute(BugzillaReportElement.BUG_SEVERITY.getKey()).getValue()); >+ assertEquals("NEW", report.getAttribute(BugzillaReportElement.BUG_STATUS.getKey()).getValue()); >+ assertEquals("2006-03-02 18:13", report.getAttribute(BugzillaReportElement.CREATION_TS.getKey()) > .getValue()); >- assertEquals("2006-05-03 13:06:11", report.getAttribute(BugzillaReportElement.DELTA_TS.getKeyString()) >+ assertEquals("2006-05-03 13:06:11", report.getAttribute(BugzillaReportElement.DELTA_TS.getKey()) > .getValue()); >- assertEquals("---", report.getAttribute(BugzillaReportElement.TARGET_MILESTONE.getKeyString()).getValue()); >- RepositoryTaskAttribute attribute = report.getAttribute(BugzillaReportElement.BLOCKED.getKeyString()); >+ assertEquals("---", report.getAttribute(BugzillaReportElement.TARGET_MILESTONE.getKey()).getValue()); >+ RepositoryTaskAttribute attribute = report.getAttribute(BugzillaReportElement.BLOCKED.getKey()); > assertEquals("2, 9", attribute.getValue()); >- attribute = report.getAttribute(BugzillaReportElement.CC.getKeyString()); >+ attribute = report.getAttribute(BugzillaReportElement.CC.getKey()); > assertEquals(2, attribute.getValues().size()); > assertEquals("relves@cs.ubc.ca", attribute.getValues().get(0)); > assertEquals("relves@gmail.com", attribute.getValues().get(1)); >- assertEquals("relves@cs.ubc.ca", report.getAttribute(BugzillaReportElement.REPORTER.getKeyString()).getValue()); >- assertEquals("relves@cs.ubc.ca", report.getAttribute(BugzillaReportElement.ASSIGNED_TO.getKeyString()) >+ assertEquals("relves@cs.ubc.ca", report.getAttribute(BugzillaReportElement.REPORTER.getKey()).getValue()); >+ assertEquals("relves@cs.ubc.ca", report.getAttribute(BugzillaReportElement.ASSIGNED_TO.getKey()) > .getValue()); > } > >@@ -342,38 +342,38 @@ > > public void testReadingReport218() throws Exception { > String bugid = "1"; >- setRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_218_URL); >+ setRepository(BugzillaCorePlugin.CONNECTOR_KIND, IBugzillaConstants.TEST_BUGZILLA_218_URL); > RepositoryTaskData report = init(bugid); > assertNotNull(report); >- assertEquals("1", report.getAttribute(BugzillaReportElement.BUG_ID.getKeyString()).getValue()); >- assertEquals("search-match-test 1", report.getAttribute(BugzillaReportElement.SHORT_DESC.getKeyString()) >+ assertEquals("1", report.getAttribute(BugzillaReportElement.BUG_ID.getKey()).getValue()); >+ assertEquals("search-match-test 1", report.getAttribute(BugzillaReportElement.SHORT_DESC.getKey()) > .getValue()); >- assertEquals("TestProduct", report.getAttribute(BugzillaReportElement.PRODUCT.getKeyString()).getValue()); >- assertEquals("TestComponent", report.getAttribute(BugzillaReportElement.COMPONENT.getKeyString()).getValue()); >- assertEquals("PC", report.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()).getValue()); >- assertEquals("Windows XP", report.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()).getValue()); >- assertEquals("other", report.getAttribute(BugzillaReportElement.VERSION.getKeyString()).getValue()); >- assertEquals("P2", report.getAttribute(BugzillaReportElement.PRIORITY.getKeyString()).getValue()); >- assertEquals("normal", report.getAttribute(BugzillaReportElement.BUG_SEVERITY.getKeyString()).getValue()); >- assertEquals("NEW", report.getAttribute(BugzillaReportElement.BUG_STATUS.getKeyString()).getValue()); >- assertEquals("2006-03-02 18:09", report.getAttribute(BugzillaReportElement.CREATION_TS.getKeyString()) >- .getValue()); >- assertEquals("2006-05-05 17:45:24", report.getAttribute(BugzillaReportElement.DELTA_TS.getKeyString()) >- .getValue()); >- assertEquals("---", report.getAttribute(BugzillaReportElement.TARGET_MILESTONE.getKeyString()).getValue()); >- assertEquals("relves@cs.ubc.ca", report.getAttribute(BugzillaReportElement.REPORTER.getKeyString()).getValue()); >- assertEquals("relves@cs.ubc.ca", report.getAttribute(BugzillaReportElement.ASSIGNED_TO.getKeyString()) >+ assertEquals("TestProduct", report.getAttribute(BugzillaReportElement.PRODUCT.getKey()).getValue()); >+ assertEquals("TestComponent", report.getAttribute(BugzillaReportElement.COMPONENT.getKey()).getValue()); >+ assertEquals("PC", report.getAttribute(BugzillaReportElement.REP_PLATFORM.getKey()).getValue()); >+ assertEquals("Windows XP", report.getAttribute(BugzillaReportElement.OP_SYS.getKey()).getValue()); >+ assertEquals("other", report.getAttribute(BugzillaReportElement.VERSION.getKey()).getValue()); >+ assertEquals("P2", report.getAttribute(BugzillaReportElement.PRIORITY.getKey()).getValue()); >+ assertEquals("normal", report.getAttribute(BugzillaReportElement.BUG_SEVERITY.getKey()).getValue()); >+ assertEquals("NEW", report.getAttribute(BugzillaReportElement.BUG_STATUS.getKey()).getValue()); >+ assertEquals("2006-03-02 18:09", report.getAttribute(BugzillaReportElement.CREATION_TS.getKey()) >+ .getValue()); >+ assertEquals("2006-05-05 17:45:24", report.getAttribute(BugzillaReportElement.DELTA_TS.getKey()) >+ .getValue()); >+ assertEquals("---", report.getAttribute(BugzillaReportElement.TARGET_MILESTONE.getKey()).getValue()); >+ assertEquals("relves@cs.ubc.ca", report.getAttribute(BugzillaReportElement.REPORTER.getKey()).getValue()); >+ assertEquals("relves@cs.ubc.ca", report.getAttribute(BugzillaReportElement.ASSIGNED_TO.getKey()) > .getValue()); > assertEquals(0, report.getAttachments().size()); > } > > public void testTimeTracking222() throws Exception { >- setRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); >+ setRepository(BugzillaCorePlugin.CONNECTOR_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); > RepositoryTaskData report = init("11"); >- assertEquals("7.50", report.getAttribute(BugzillaReportElement.ESTIMATED_TIME.getKeyString()).getValue()); >- assertEquals("4.00", report.getAttribute(BugzillaReportElement.ACTUAL_TIME.getKeyString()).getValue()); >- assertEquals("3.00", report.getAttribute(BugzillaReportElement.REMAINING_TIME.getKeyString()).getValue()); >- assertEquals("2005-03-04", report.getAttribute(BugzillaReportElement.DEADLINE.getKeyString()).getValue()); >+ assertEquals("7.50", report.getAttribute(BugzillaReportElement.ESTIMATED_TIME.getKey()).getValue()); >+ assertEquals("4.00", report.getAttribute(BugzillaReportElement.ACTUAL_TIME.getKey()).getValue()); >+ assertEquals("3.00", report.getAttribute(BugzillaReportElement.REMAINING_TIME.getKey()).getValue()); >+ assertEquals("2005-03-04", report.getAttribute(BugzillaReportElement.DEADLINE.getKey()).getValue()); > } > > // public void testTimeTracking2201() throws Exception { >@@ -405,26 +405,26 @@ > // } > > public void testTimeTracking218() throws Exception { >- setRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_218_URL); >+ setRepository(BugzillaCorePlugin.CONNECTOR_KIND, IBugzillaConstants.TEST_BUGZILLA_218_URL); > RepositoryTaskData report = init("19"); >- assertEquals("7.50", report.getAttribute(BugzillaReportElement.ESTIMATED_TIME.getKeyString()).getValue()); >- assertEquals("1.00", report.getAttribute(BugzillaReportElement.ACTUAL_TIME.getKeyString()).getValue()); >- assertEquals("3.00", report.getAttribute(BugzillaReportElement.REMAINING_TIME.getKeyString()).getValue()); >+ assertEquals("7.50", report.getAttribute(BugzillaReportElement.ESTIMATED_TIME.getKey()).getValue()); >+ assertEquals("1.00", report.getAttribute(BugzillaReportElement.ACTUAL_TIME.getKey()).getValue()); >+ assertEquals("3.00", report.getAttribute(BugzillaReportElement.REMAINING_TIME.getKey()).getValue()); > } > > public void testMultipleDepensOn() throws Exception { > String bugid = "5"; >- setRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_218_URL); >+ setRepository(BugzillaCorePlugin.CONNECTOR_KIND, IBugzillaConstants.TEST_BUGZILLA_218_URL); > RepositoryTaskData report = init(bugid); > assertNotNull(report); >- assertEquals("5", report.getAttribute(BugzillaReportElement.BUG_ID.getKeyString()).getValue()); >- assertEquals("6, 7", report.getAttribute(BugzillaReportElement.DEPENDSON.getKeyString()).getValue()); >- assertEquals("13, 14", report.getAttribute(BugzillaReportElement.BLOCKED.getKeyString()).getValue()); >+ assertEquals("5", report.getAttribute(BugzillaReportElement.BUG_ID.getKey()).getValue()); >+ assertEquals("6, 7", report.getAttribute(BugzillaReportElement.DEPENDSON.getKey()).getValue()); >+ assertEquals("13, 14", report.getAttribute(BugzillaReportElement.BLOCKED.getKey()).getValue()); > } > > public void testBugReportAPI() throws Exception { > String bugid = "3"; >- setRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); >+ setRepository(BugzillaCorePlugin.CONNECTOR_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); > RepositoryTaskData report = init(bugid); > assertNotNull(report); > assertTrue(report != null); >Index: src/org/eclipse/mylyn/bugzilla/tests/BugzillaConfigurationTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaConfigurationTest.java,v >retrieving revision 1.53 >diff -u -r1.53 BugzillaConfigurationTest.java >--- src/org/eclipse/mylyn/bugzilla/tests/BugzillaConfigurationTest.java 8 May 2008 17:53:48 -0000 1.53 >+++ src/org/eclipse/mylyn/bugzilla/tests/BugzillaConfigurationTest.java 22 May 2008 17:19:01 -0000 >@@ -52,7 +52,7 @@ > > private BugzillaClient createClient(String hostUrl, String username, String password, String htAuthUser, > String htAuthPass, String encoding) throws MalformedURLException, CoreException { >- TaskRepository taskRepository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, hostUrl); >+ TaskRepository taskRepository = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, hostUrl); > > AuthenticationCredentials credentials = new AuthenticationCredentials(username, password); > taskRepository.setCredentials(AuthenticationType.REPOSITORY, credentials, false); >Index: src/org/eclipse/mylyn/bugzilla/tests/RepositoryEditorWizardTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryEditorWizardTest.java,v >retrieving revision 1.34 >diff -u -r1.34 RepositoryEditorWizardTest.java >--- src/org/eclipse/mylyn/bugzilla/tests/RepositoryEditorWizardTest.java 12 May 2008 17:20:17 -0000 1.34 >+++ src/org/eclipse/mylyn/bugzilla/tests/RepositoryEditorWizardTest.java 22 May 2008 17:19:02 -0000 >@@ -44,7 +44,7 @@ > super.setUp(); > manager = TasksUiPlugin.getRepositoryManager(); > manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); >- repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); >+ repository = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); > Credentials credentials = TestUtil.readCredentials(); > repository.setAuthenticationCredentials(credentials.username, credentials.password); > repository.setAnonymous(false); >@@ -53,7 +53,7 @@ > > private BugzillaClient createClient(String hostUrl, String username, String password, String htAuthUser, > String htAuthPass, String encoding) throws MalformedURLException { >- TaskRepository taskRepository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, hostUrl); >+ TaskRepository taskRepository = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, hostUrl); > > AuthenticationCredentials credentials = new AuthenticationCredentials(username, password); > taskRepository.setCredentials(AuthenticationType.REPOSITORY, credentials, false); >@@ -149,7 +149,7 @@ > page.setUrl(IBugzillaConstants.TEST_BUGZILLA_218_URL); > wizard.performFinish(); > assertEquals(1, manager.getAllRepositories().size()); >- TaskRepository repositoryTest = manager.getRepository(BugzillaCorePlugin.REPOSITORY_KIND, >+ TaskRepository repositoryTest = manager.getRepository(BugzillaCorePlugin.CONNECTOR_KIND, > IBugzillaConstants.TEST_BUGZILLA_218_URL); > assertNotNull(repositoryTest); > assertEquals(tempUid, repositoryTest.getUserName()); >@@ -168,7 +168,7 @@ > page.setUserId("bogus"); > wizard.performFinish(); > assertEquals(1, manager.getAllRepositories().size()); >- TaskRepository repositoryTest = manager.getRepository(BugzillaCorePlugin.REPOSITORY_KIND, >+ TaskRepository repositoryTest = manager.getRepository(BugzillaCorePlugin.CONNECTOR_KIND, > IBugzillaConstants.TEST_BUGZILLA_222_URL); > assertNotNull(repositoryTest); > wizard = new EditRepositoryWizard(repositoryTest); >Index: src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchEngineTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchEngineTest.java,v >retrieving revision 1.40 >diff -u -r1.40 BugzillaSearchEngineTest.java >--- src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchEngineTest.java 12 May 2008 17:20:17 -0000 1.40 >+++ src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchEngineTest.java 22 May 2008 17:19:01 -0000 >@@ -43,7 +43,7 @@ > super.setUp(); > TasksUiPlugin.getRepositoryManager().clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); > assertEquals(NUM_REPOSITORIES, TasksUiPlugin.getRepositoryManager().getRepositories( >- BugzillaCorePlugin.REPOSITORY_KIND).size()); >+ BugzillaCorePlugin.CONNECTOR_KIND).size()); > } > > @Override >@@ -64,7 +64,7 @@ > // } > > public void testSearching218() throws Exception { >- TaskRepository repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, >+ TaskRepository repository = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, > IBugzillaConstants.TEST_BUGZILLA_218_URL); > repository.setVersion(IBugzillaConstants.BugzillaServerVersion.SERVER_218.toString()); > TasksUiPlugin.getRepositoryManager().addRepository(repository); >@@ -72,7 +72,7 @@ > } > > public void testSearching220() throws Exception { >- TaskRepository repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, >+ TaskRepository repository = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, > IBugzillaConstants.TEST_BUGZILLA_220_URL); > repository.setVersion(IBugzillaConstants.BugzillaServerVersion.SERVER_220.toString()); > TasksUiPlugin.getRepositoryManager().addRepository(repository); >@@ -80,7 +80,7 @@ > } > > public void testSearching2201() throws Exception { >- TaskRepository repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, >+ TaskRepository repository = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, > IBugzillaConstants.TEST_BUGZILLA_2201_URL); > repository.setVersion(IBugzillaConstants.BugzillaServerVersion.SERVER_220.toString()); > TasksUiPlugin.getRepositoryManager().addRepository(repository); >@@ -88,7 +88,7 @@ > } > > public void testSearching222() throws Exception { >- TaskRepository repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, >+ TaskRepository repository = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, > IBugzillaConstants.TEST_BUGZILLA_222_URL); > repository.setVersion(IBugzillaConstants.BugzillaServerVersion.SERVER_222.toString()); > TasksUiPlugin.getRepositoryManager().addRepository(repository); >@@ -99,14 +99,14 @@ > @SuppressWarnings("deprecation") > private Set<AbstractTask> runQuery(String repositoryURL, String SearchString) throws Exception { > TaskRepository repository = TasksUiPlugin.getRepositoryManager().getRepository( >- BugzillaCorePlugin.REPOSITORY_KIND, repositoryURL); >+ BugzillaCorePlugin.CONNECTOR_KIND, repositoryURL); > assertNotNull(repository); > > final BugzillaRepositoryQuery repositoryQuery = new BugzillaRepositoryQuery(repository.getRepositoryUrl(), > repository.getRepositoryUrl() + BUG_DESC_SUBSTRING_SEARCH + SearchString, QUERY_NAME); > > AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector( >- BugzillaCorePlugin.REPOSITORY_KIND); >+ BugzillaCorePlugin.CONNECTOR_KIND); > // TaskList taskList = TasksUiPlugin.getTaskList(); > QueryHitCollector collector = new QueryHitCollector(new TaskFactory(repository)); > >Index: src/org/eclipse/mylyn/bugzilla/tests/TaskEditorTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskEditorTest.java,v >retrieving revision 1.36 >diff -u -r1.36 TaskEditorTest.java >--- src/org/eclipse/mylyn/bugzilla/tests/TaskEditorTest.java 8 May 2008 17:53:48 -0000 1.36 >+++ src/org/eclipse/mylyn/bugzilla/tests/TaskEditorTest.java 22 May 2008 17:19:02 -0000 >@@ -54,11 +54,11 @@ > * @throws Exception > */ > public void testAccessNewEditor() throws Exception { >- TaskRepository repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, >+ TaskRepository repository = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, > IBugzillaConstants.TEST_BUGZILLA_222_URL); > > RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), >- BugzillaCorePlugin.REPOSITORY_KIND, repository.getRepositoryUrl(), >+ BugzillaCorePlugin.CONNECTOR_KIND, repository.getRepositoryUrl(), > TasksUiPlugin.getTaskDataStorageManager().getNewRepositoryTaskId()); > model.setNew(true); > AbstractLegacyRepositoryConnector connector = (AbstractLegacyRepositoryConnector) TasksUiPlugin.getRepositoryManager() >@@ -84,11 +84,11 @@ > } > > public void testinitializeTaskData() throws Exception { >- TaskRepository repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, >+ TaskRepository repository = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, > IBugzillaConstants.TEST_BUGZILLA_222_URL); > > RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), >- BugzillaCorePlugin.REPOSITORY_KIND, repository.getRepositoryUrl(), >+ BugzillaCorePlugin.CONNECTOR_KIND, repository.getRepositoryUrl(), > TasksUiPlugin.getTaskDataStorageManager().getNewRepositoryTaskId()); > model.setNew(true); > AbstractLegacyRepositoryConnector connector = (AbstractLegacyRepositoryConnector) TasksUiPlugin.getRepositoryManager() >Index: src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java,v >retrieving revision 1.39 >diff -u -r1.39 BugzillaTaskListManagerTest.java >--- src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java 13 May 2008 06:35:48 -0000 1.39 >+++ src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java 22 May 2008 17:19:01 -0000 >@@ -41,7 +41,7 @@ > manager.readExistingOrCreateNewList(); > manager.resetTaskList(); > manager.saveTaskList(); >- repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.ECLIPSE_BUGZILLA_URL); >+ repository = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, IBugzillaConstants.ECLIPSE_BUGZILLA_URL); > TasksUiPlugin.getRepositoryManager().addRepository(repository); > assertEquals(0, manager.getTaskList().getAllTasks().size()); > } >Index: src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchDialogTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchDialogTest.java,v >retrieving revision 1.13 >diff -u -r1.13 BugzillaSearchDialogTest.java >--- src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchDialogTest.java 12 May 2008 17:20:17 -0000 1.13 >+++ src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchDialogTest.java 22 May 2008 17:19:01 -0000 >@@ -49,7 +49,7 @@ > * @throws Exception > */ > public void testSearchDialogInit() throws Exception { >- TaskRepository repo = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, >+ TaskRepository repo = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, > IBugzillaConstants.TEST_BUGZILLA_222_URL); > repo.setVersion(IBugzillaConstants.BugzillaServerVersion.SERVER_222.toString()); > manager.addRepository(repo); >Index: src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskHyperlinkDetectorTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskHyperlinkDetectorTest.java,v >retrieving revision 1.20 >diff -u -r1.20 BugzillaTaskHyperlinkDetectorTest.java >--- src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskHyperlinkDetectorTest.java 12 May 2008 17:20:17 -0000 1.20 >+++ src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskHyperlinkDetectorTest.java 22 May 2008 17:19:01 -0000 >@@ -72,8 +72,8 @@ > > detector = new TaskHyperlinkDetector(); > >- repository1 = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, "repository_url1"); >- repository2 = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, "repository_url2"); >+ repository1 = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, "repository_url1"); >+ repository2 = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, "repository_url2"); > > shell = new Shell(); > viewer = new RepositoryTextViewer(repository1, shell, SWT.NONE); >Index: src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskDataHandlerTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskDataHandlerTest.java,v >retrieving revision 1.6 >diff -u -r1.6 BugzillaTaskDataHandlerTest.java >--- src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskDataHandlerTest.java 7 May 2008 18:30:58 -0000 1.6 >+++ src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskDataHandlerTest.java 22 May 2008 17:19:01 -0000 >@@ -43,7 +43,7 @@ > > private TaskRepository setRepository(String kind, String url) { > connector = (BugzillaRepositoryConnector) TasksUiPlugin.getRepositoryManager().getRepositoryConnector( >- BugzillaCorePlugin.REPOSITORY_KIND); >+ BugzillaCorePlugin.CONNECTOR_KIND); > repository = new TaskRepository(kind, url); > Credentials credentials = TestUtil.readCredentials(); > repository.setAuthenticationCredentials(credentials.username, credentials.password); >@@ -51,66 +51,66 @@ > } > > private void testAttributesFromCloneBug(RepositoryTaskData repositoryTaskData, boolean valueFromBug9) { >- assertEquals("Clone Bug 1", repositoryTaskData.getAttribute(BugzillaReportElement.SHORT_DESC.getKeyString()) >+ assertEquals("Clone Bug 1", repositoryTaskData.getAttribute(BugzillaReportElement.SHORT_DESC.getKey()) > .getValue()); > assertEquals("Clone Bug 1", repositoryTaskData.getSummary()); > assertEquals("This Bug is used to test the cloneTaskData", repositoryTaskData.getDescription()); >- assertEquals("TestProduct", repositoryTaskData.getAttribute(BugzillaReportElement.PRODUCT.getKeyString()) >+ assertEquals("TestProduct", repositoryTaskData.getAttribute(BugzillaReportElement.PRODUCT.getKey()) > .getValue()); > assertEquals("TestProduct", repositoryTaskData.getProduct()); >- assertEquals("TestComponent", repositoryTaskData.getAttribute(BugzillaReportElement.COMPONENT.getKeyString()) >+ assertEquals("TestComponent", repositoryTaskData.getAttribute(BugzillaReportElement.COMPONENT.getKey()) > .getValue()); >- assertEquals("PC", repositoryTaskData.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()) >+ assertEquals("PC", repositoryTaskData.getAttribute(BugzillaReportElement.REP_PLATFORM.getKey()) > .getValue()); >- assertEquals("Windows", repositoryTaskData.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()).getValue()); >- assertEquals("unspecified", repositoryTaskData.getAttribute(BugzillaReportElement.VERSION.getKeyString()) >+ assertEquals("Windows", repositoryTaskData.getAttribute(BugzillaReportElement.OP_SYS.getKey()).getValue()); >+ assertEquals("unspecified", repositoryTaskData.getAttribute(BugzillaReportElement.VERSION.getKey()) > .getValue()); >- assertEquals("P3", repositoryTaskData.getAttribute(BugzillaReportElement.PRIORITY.getKeyString()).getValue()); >- assertEquals("enhancement", repositoryTaskData.getAttribute(BugzillaReportElement.BUG_SEVERITY.getKeyString()) >+ assertEquals("P3", repositoryTaskData.getAttribute(BugzillaReportElement.PRIORITY.getKey()).getValue()); >+ assertEquals("enhancement", repositoryTaskData.getAttribute(BugzillaReportElement.BUG_SEVERITY.getKey()) > .getValue()); >- assertEquals("---", repositoryTaskData.getAttribute(BugzillaReportElement.TARGET_MILESTONE.getKeyString()) >+ assertEquals("---", repositoryTaskData.getAttribute(BugzillaReportElement.TARGET_MILESTONE.getKey()) > .getValue()); > assertEquals("Unclassified", repositoryTaskData.getAttribute( >- BugzillaReportElement.CLASSIFICATION.getKeyString()).getValue()); >+ BugzillaReportElement.CLASSIFICATION.getKey()).getValue()); > if (valueFromBug9) { >- assertEquals("9", repositoryTaskData.getAttribute(BugzillaReportElement.BUG_ID.getKeyString()).getValue()); >- assertEquals("1.00", repositoryTaskData.getAttribute(BugzillaReportElement.REMAINING_TIME.getKeyString()) >+ assertEquals("9", repositoryTaskData.getAttribute(BugzillaReportElement.BUG_ID.getKey()).getValue()); >+ assertEquals("1.00", repositoryTaskData.getAttribute(BugzillaReportElement.REMAINING_TIME.getKey()) > .getValue()); >- assertEquals("1.00", repositoryTaskData.getAttribute(BugzillaReportElement.ESTIMATED_TIME.getKeyString()) >+ assertEquals("1.00", repositoryTaskData.getAttribute(BugzillaReportElement.ESTIMATED_TIME.getKey()) > .getValue()); >- assertEquals("2007-12-12", repositoryTaskData.getAttribute(BugzillaReportElement.DEADLINE.getKeyString()) >+ assertEquals("2007-12-12", repositoryTaskData.getAttribute(BugzillaReportElement.DEADLINE.getKey()) > .getValue()); >- assertEquals("NEW", repositoryTaskData.getAttribute(BugzillaReportElement.BUG_STATUS.getKeyString()) >+ assertEquals("NEW", repositoryTaskData.getAttribute(BugzillaReportElement.BUG_STATUS.getKey()) > .getValue()); > assertEquals("2007-11-14 15:12", repositoryTaskData.getAttribute( >- BugzillaReportElement.CREATION_TS.getKeyString()).getValue()); >+ BugzillaReportElement.CREATION_TS.getKey()).getValue()); > assertEquals("2007-11-14 15:14:46", repositoryTaskData.getAttribute( >- BugzillaReportElement.DELTA_TS.getKeyString()).getValue()); >+ BugzillaReportElement.DELTA_TS.getKey()).getValue()); > assertEquals("tests@mylyn.eclipse.org", repositoryTaskData.getAttribute( >- BugzillaReportElement.REPORTER.getKeyString()).getValue()); >+ BugzillaReportElement.REPORTER.getKey()).getValue()); > assertEquals("tests2@mylyn.eclipse.org", repositoryTaskData.getAttribute( >- BugzillaReportElement.ASSIGNED_TO.getKeyString()).getValue()); >+ BugzillaReportElement.ASSIGNED_TO.getKey()).getValue()); > } else { >- assertEquals("2.00", repositoryTaskData.getAttribute(BugzillaReportElement.REMAINING_TIME.getKeyString()) >+ assertEquals("2.00", repositoryTaskData.getAttribute(BugzillaReportElement.REMAINING_TIME.getKey()) > .getValue()); >- assertEquals("2.00", repositoryTaskData.getAttribute(BugzillaReportElement.ESTIMATED_TIME.getKeyString()) >+ assertEquals("2.00", repositoryTaskData.getAttribute(BugzillaReportElement.ESTIMATED_TIME.getKey()) > .getValue()); >- assertEquals("2008-01-01", repositoryTaskData.getAttribute(BugzillaReportElement.DEADLINE.getKeyString()) >+ assertEquals("2008-01-01", repositoryTaskData.getAttribute(BugzillaReportElement.DEADLINE.getKey()) > .getValue()); > assertEquals("2007-11-14 15:30", repositoryTaskData.getAttribute( >- BugzillaReportElement.CREATION_TS.getKeyString()).getValue()); >+ BugzillaReportElement.CREATION_TS.getKey()).getValue()); > assertEquals("2007-11-14 15:30:38", repositoryTaskData.getAttribute( >- BugzillaReportElement.DELTA_TS.getKeyString()).getValue()); >+ BugzillaReportElement.DELTA_TS.getKey()).getValue()); > assertEquals("tests2@mylyn.eclipse.org", repositoryTaskData.getAttribute( >- BugzillaReportElement.REPORTER.getKeyString()).getValue()); >+ BugzillaReportElement.REPORTER.getKey()).getValue()); > assertEquals("tests@mylyn.eclipse.org", repositoryTaskData.getAttribute( >- BugzillaReportElement.ASSIGNED_TO.getKeyString()).getValue()); >+ BugzillaReportElement.ASSIGNED_TO.getKey()).getValue()); > } > } > > public void testCloneTaskData() throws Exception { > String bugid = "9"; >- setRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_30_URL); >+ setRepository(BugzillaCorePlugin.CONNECTOR_KIND, IBugzillaConstants.TEST_BUGZILLA_30_URL); > RepositoryTaskData report1 = init(bugid); > > assertNotNull(report1); >@@ -118,35 +118,35 @@ > testAttributesFromCloneBug(report1, true); > > bugid = "10"; >- setRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_30_URL); >+ setRepository(BugzillaCorePlugin.CONNECTOR_KIND, IBugzillaConstants.TEST_BUGZILLA_30_URL); > RepositoryTaskData report2 = init(bugid); > > assertNotNull(report2); >- assertEquals("" + bugid, report2.getAttribute(BugzillaReportElement.BUG_ID.getKeyString()).getValue()); >- assertEquals("2.00", report2.getAttribute(BugzillaReportElement.REMAINING_TIME.getKeyString()).getValue()); >- assertEquals("2.00", report2.getAttribute(BugzillaReportElement.ESTIMATED_TIME.getKeyString()).getValue()); >- assertEquals("2008-01-01", report2.getAttribute(BugzillaReportElement.DEADLINE.getKeyString()).getValue()); >+ assertEquals("" + bugid, report2.getAttribute(BugzillaReportElement.BUG_ID.getKey()).getValue()); >+ assertEquals("2.00", report2.getAttribute(BugzillaReportElement.REMAINING_TIME.getKey()).getValue()); >+ assertEquals("2.00", report2.getAttribute(BugzillaReportElement.ESTIMATED_TIME.getKey()).getValue()); >+ assertEquals("2008-01-01", report2.getAttribute(BugzillaReportElement.DEADLINE.getKey()).getValue()); > >- assertEquals("Clone Bug 2", report2.getAttribute(BugzillaReportElement.SHORT_DESC.getKeyString()).getValue()); >+ assertEquals("Clone Bug 2", report2.getAttribute(BugzillaReportElement.SHORT_DESC.getKey()).getValue()); > assertEquals("Clone Bug 2", report2.getSummary()); > assertEquals("other Bug for cloneTaskData", report2.getDescription()); >- assertEquals("TestProduct", report2.getAttribute(BugzillaReportElement.PRODUCT.getKeyString()).getValue()); >+ assertEquals("TestProduct", report2.getAttribute(BugzillaReportElement.PRODUCT.getKey()).getValue()); > assertEquals("TestProduct", report2.getProduct()); >- assertEquals("TestComponent", report2.getAttribute(BugzillaReportElement.COMPONENT.getKeyString()).getValue()); >- assertEquals("PC", report2.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()).getValue()); >- assertEquals("Mac OS", report2.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()).getValue()); >- assertEquals("unspecified", report2.getAttribute(BugzillaReportElement.VERSION.getKeyString()).getValue()); >- assertEquals("P2", report2.getAttribute(BugzillaReportElement.PRIORITY.getKeyString()).getValue()); >- assertEquals("critical", report2.getAttribute(BugzillaReportElement.BUG_SEVERITY.getKeyString()).getValue()); >- assertEquals("ASSIGNED", report2.getAttribute(BugzillaReportElement.BUG_STATUS.getKeyString()).getValue()); >- assertEquals("2007-11-14 15:30", report2.getAttribute(BugzillaReportElement.CREATION_TS.getKeyString()) >+ assertEquals("TestComponent", report2.getAttribute(BugzillaReportElement.COMPONENT.getKey()).getValue()); >+ assertEquals("PC", report2.getAttribute(BugzillaReportElement.REP_PLATFORM.getKey()).getValue()); >+ assertEquals("Mac OS", report2.getAttribute(BugzillaReportElement.OP_SYS.getKey()).getValue()); >+ assertEquals("unspecified", report2.getAttribute(BugzillaReportElement.VERSION.getKey()).getValue()); >+ assertEquals("P2", report2.getAttribute(BugzillaReportElement.PRIORITY.getKey()).getValue()); >+ assertEquals("critical", report2.getAttribute(BugzillaReportElement.BUG_SEVERITY.getKey()).getValue()); >+ assertEquals("ASSIGNED", report2.getAttribute(BugzillaReportElement.BUG_STATUS.getKey()).getValue()); >+ assertEquals("2007-11-14 15:30", report2.getAttribute(BugzillaReportElement.CREATION_TS.getKey()) > .getValue()); >- assertEquals("2007-11-14 15:30:38", report2.getAttribute(BugzillaReportElement.DELTA_TS.getKeyString()) >+ assertEquals("2007-11-14 15:30:38", report2.getAttribute(BugzillaReportElement.DELTA_TS.getKey()) > .getValue()); >- assertEquals("---", report2.getAttribute(BugzillaReportElement.TARGET_MILESTONE.getKeyString()).getValue()); >- assertEquals("tests2@mylyn.eclipse.org", report2.getAttribute(BugzillaReportElement.REPORTER.getKeyString()) >+ assertEquals("---", report2.getAttribute(BugzillaReportElement.TARGET_MILESTONE.getKey()).getValue()); >+ assertEquals("tests2@mylyn.eclipse.org", report2.getAttribute(BugzillaReportElement.REPORTER.getKey()) > .getValue()); >- assertEquals("tests@mylyn.eclipse.org", report2.getAttribute(BugzillaReportElement.ASSIGNED_TO.getKeyString()) >+ assertEquals("tests@mylyn.eclipse.org", report2.getAttribute(BugzillaReportElement.ASSIGNED_TO.getKey()) > .getValue()); > > AbstractTaskDataHandler handler = connector.getLegacyTaskDataHandler(); >@@ -157,7 +157,7 @@ > > public void testCharacterEscaping() throws CoreException { > String bugid = "17"; >- setRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_30_URL); >+ setRepository(BugzillaCorePlugin.CONNECTOR_KIND, IBugzillaConstants.TEST_BUGZILLA_30_URL); > RepositoryTaskData report1 = init(bugid); > assertEquals("Testing! \"&@ $\" &", report1.getSummary()); > } >Index: src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskTest.java,v >retrieving revision 1.30 >diff -u -r1.30 BugzillaTaskTest.java >--- src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskTest.java 8 May 2008 17:53:48 -0000 1.30 >+++ src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskTest.java 22 May 2008 17:19:01 -0000 >@@ -38,7 +38,7 @@ > protected void setUp() throws Exception { > super.setUp(); > new BugzillaTaskDataHandler((BugzillaRepositoryConnector) TasksUiPlugin.getRepositoryManager() >- .getRepositoryConnector(BugzillaCorePlugin.REPOSITORY_KIND)); >+ .getRepositoryConnector(BugzillaCorePlugin.CONNECTOR_KIND)); > } > > @Override >@@ -49,7 +49,7 @@ > public void testCompletionDate() throws Exception { > BugzillaTask task = new BugzillaTask("repo", "1", "summary"); > RepositoryTaskData taskData = new RepositoryTaskData(new BugzillaAttributeFactory(), >- BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.ECLIPSE_BUGZILLA_URL, "1"); >+ BugzillaCorePlugin.CONNECTOR_KIND, IBugzillaConstants.ECLIPSE_BUGZILLA_URL, "1"); > > //XXX rewrite test > >@@ -59,22 +59,22 @@ > String nowTimeStamp = new SimpleDateFormat(BugzillaAttributeFactory.comment_creation_ts_format).format(now); > > TaskComment taskComment = new TaskComment(new BugzillaAttributeFactory(), 1); >- RepositoryTaskAttribute attribute = attributeFactory.createAttribute(BugzillaReportElement.BUG_WHEN.getKeyString()); >+ RepositoryTaskAttribute attribute = attributeFactory.createAttribute(BugzillaReportElement.BUG_WHEN.getKey()); > attribute.setValue(nowTimeStamp); >- taskComment.addAttribute(BugzillaReportElement.BUG_WHEN.getKeyString(), attribute); >+ taskComment.addAttribute(BugzillaReportElement.BUG_WHEN.getKey(), attribute); > taskData.addComment(taskComment); > assertNull(task.getCompletionDate()); > >- RepositoryTaskAttribute resolvedAttribute = attributeFactory.createAttribute(BugzillaReportElement.BUG_STATUS.getKeyString()); >+ RepositoryTaskAttribute resolvedAttribute = attributeFactory.createAttribute(BugzillaReportElement.BUG_STATUS.getKey()); > resolvedAttribute.setValue(IBugzillaConstants.VALUE_STATUS_RESOLVED); >- taskData.addAttribute(BugzillaReportElement.BUG_STATUS.getKeyString(), resolvedAttribute); >+ taskData.addAttribute(BugzillaReportElement.BUG_STATUS.getKey(), resolvedAttribute); > AbstractLegacyRepositoryConnector connector = (AbstractLegacyRepositoryConnector) TasksUiPlugin.getRepositoryManager() >- .getRepositoryConnector(BugzillaCorePlugin.REPOSITORY_KIND); >- connector.updateTaskFromTaskData(new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, "http://eclipse.org"), >+ .getRepositoryConnector(BugzillaCorePlugin.CONNECTOR_KIND); >+ connector.updateTaskFromTaskData(new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, "http://eclipse.org"), > task, taskData); > assertNotNull(task.getCompletionDate()); > assertEquals(taskData.getAttributeFactory().getDateForAttributeType( >- BugzillaReportElement.BUG_WHEN.getKeyString(), nowTimeStamp), task.getCompletionDate()); >+ BugzillaReportElement.BUG_WHEN.getKey(), nowTimeStamp), task.getCompletionDate()); > > } > >Index: src/org/eclipse/mylyn/bugzilla/tests/NewBugWizardTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/NewBugWizardTest.java,v >retrieving revision 1.41 >diff -u -r1.41 NewBugWizardTest.java >--- src/org/eclipse/mylyn/bugzilla/tests/NewBugWizardTest.java 8 May 2008 17:53:48 -0000 1.41 >+++ src/org/eclipse/mylyn/bugzilla/tests/NewBugWizardTest.java 22 May 2008 17:19:01 -0000 >@@ -30,9 +30,9 @@ > public void testPlatformOptions() throws Exception { > > RepositoryTaskData newReport = new RepositoryTaskData(new BugzillaAttributeFactory(), >- BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_220_URL, "1"); >+ BugzillaCorePlugin.CONNECTOR_KIND, IBugzillaConstants.TEST_BUGZILLA_220_URL, "1"); > >- TaskRepository repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, >+ TaskRepository repository = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, > IBugzillaConstants.TEST_BUGZILLA_220_URL); > AbstractLegacyRepositoryConnector connector = (AbstractLegacyRepositoryConnector) TasksUiPlugin.getRepositoryManager() > .getRepositoryConnector(repository.getConnectorKind()); >@@ -44,43 +44,43 @@ > > String os = Platform.getOS(); > if (os.equals("win32")) { >- assertEquals("Windows", newReport.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()).getValue()); >+ assertEquals("Windows", newReport.getAttribute(BugzillaReportElement.OP_SYS.getKey()).getValue()); > } else if (os.equals("solaris")) { >- assertEquals("Solaris", newReport.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()).getValue()); >+ assertEquals("Solaris", newReport.getAttribute(BugzillaReportElement.OP_SYS.getKey()).getValue()); > } else if (os.equals("qnx")) { >- assertEquals("QNX-Photon", newReport.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()).getValue()); >+ assertEquals("QNX-Photon", newReport.getAttribute(BugzillaReportElement.OP_SYS.getKey()).getValue()); > } else if (os.equals("macosx")) { >- assertEquals("Mac OS", newReport.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()).getValue()); >+ assertEquals("Mac OS", newReport.getAttribute(BugzillaReportElement.OP_SYS.getKey()).getValue()); > } else if (os.equals("linux")) { >- assertEquals("Linux", newReport.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()).getValue()); >+ assertEquals("Linux", newReport.getAttribute(BugzillaReportElement.OP_SYS.getKey()).getValue()); > } else if (os.equals("hpux")) { >- assertEquals("HP-UX", newReport.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()).getValue()); >+ assertEquals("HP-UX", newReport.getAttribute(BugzillaReportElement.OP_SYS.getKey()).getValue()); > } else if (os.equals("aix")) { >- assertEquals("AIX", newReport.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()).getValue()); >+ assertEquals("AIX", newReport.getAttribute(BugzillaReportElement.OP_SYS.getKey()).getValue()); > } > > String platform = Platform.getOSArch(); > if (platform.equals("x86")) { > if (os.equals("macosx")) { >- assertEquals("Macintosh", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()) >+ assertEquals("Macintosh", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKey()) > .getValue()); > } else { >- assertEquals("PC", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()).getValue()); >+ assertEquals("PC", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKey()).getValue()); > } > } else if (platform.equals("x86_64")) { >- assertEquals("PC", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()).getValue()); >+ assertEquals("PC", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKey()).getValue()); > } else if (platform.equals("ia64")) { >- assertEquals("PC", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()).getValue()); >+ assertEquals("PC", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKey()).getValue()); > } else if (platform.equals("ia64_32")) { >- assertEquals("PC", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()).getValue()); >+ assertEquals("PC", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKey()).getValue()); > } else if (platform.equals("sparc")) { >- assertEquals("Sun", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()).getValue()); >+ assertEquals("Sun", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKey()).getValue()); > } else if (platform.equals("ppc")) { > if (os.equals("macosx")) { >- assertEquals("Macintosh", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()) >+ assertEquals("Macintosh", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKey()) > .getValue()); > } else { >- assertEquals("Power", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()) >+ assertEquals("Power", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKey()) > .getValue()); > } > } >Index: src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java,v >retrieving revision 1.152 >diff -u -r1.152 BugzillaRepositoryConnectorTest.java >--- src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java 20 May 2008 19:52:32 -0000 1.152 >+++ src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java 22 May 2008 17:19:01 -0000 >@@ -8,38 +8,26 @@ > > package org.eclipse.mylyn.bugzilla.tests; > >-import java.io.BufferedWriter; >-import java.io.File; >-import java.io.FileWriter; > import java.util.Date; > import java.util.HashSet; >-import java.util.Iterator; > import java.util.Set; > > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.NullProgressMonitor; >-import org.eclipse.mylyn.context.core.ContextCore; >-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient; > import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin; > import org.eclipse.mylyn.internal.bugzilla.core.BugzillaReportElement; > import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryQuery; >-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaTask; > import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants; > import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration; >-import org.eclipse.mylyn.internal.tasks.core.AbstractTask; >-import org.eclipse.mylyn.internal.tasks.core.LocalAttachment; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryAttachment; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryOperation; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskAttribute; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskData; >-import org.eclipse.mylyn.internal.tasks.core.sync.SynchronizationContext; >-import org.eclipse.mylyn.internal.tasks.ui.AttachmentUtil; > import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin; > import org.eclipse.mylyn.internal.tasks.ui.search.RepositorySearchResult; > import org.eclipse.mylyn.internal.tasks.ui.search.SearchHitCollector; > import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal; > import org.eclipse.mylyn.tasks.core.ITask; > import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState; >+import org.eclipse.mylyn.tasks.core.data.ITaskDataWorkingCopy; >+import org.eclipse.mylyn.tasks.core.data.TaskAttribute; >+import org.eclipse.mylyn.tasks.core.data.TaskData; > > /** > * @author Mik Kersten >@@ -90,20 +78,20 @@ > // } > // } > >- BugzillaTask fruitTask; >+ ITask fruitTask; > >- RepositoryTaskData fruitTaskData; >+ TaskData fruitTaskData; > > private void setFruitValueTo(String newValue) throws CoreException { >- Set<RepositoryTaskAttribute> changed = new HashSet<RepositoryTaskAttribute>(); >- fruitTaskData.setAttributeValue("cf_fruit", newValue); >- assertEquals(newValue, fruitTaskData.getAttributeValue("cf_fruit")); >- changed.add(fruitTaskData.getAttribute("cf_fruit")); >- submit(fruitTask, fruitTaskData); >+ Set<TaskAttribute> changed = new HashSet<TaskAttribute>(); >+ TaskAttribute att = fruitTaskData.getRoot().createAttribute("cf_fruit"); >+ att.setValue(newValue); >+ assertEquals(newValue, fruitTaskData.getRoot().getAttribute("cf_fruit").getValue()); >+ changed.add(fruitTaskData.getRoot().getAttribute("cf_fruit")); >+ submit(fruitTask, fruitTaskData, changed); > TasksUiInternal.synchronizeTask(connector, fruitTask, true, null); >- fruitTaskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(fruitTask.getRepositoryUrl(), >- fruitTask.getTaskId()); >- assertEquals(newValue, fruitTaskData.getAttributeValue("cf_fruit")); >+ fruitTaskData = TasksUiPlugin.getTaskDataManager().getTaskData(fruitTask, fruitTask.getConnectorKind()); >+ assertEquals(newValue, fruitTaskData.getRoot().getAttribute("cf_fruit").getValue()); > > } > >@@ -116,19 +104,19 @@ > // Get the task > fruitTask = generateLocalTaskAndDownload(taskNumber); > >- fruitTaskData = TasksUiPlugin.getTaskDataStorageManager().getEditableCopy(fruitTask.getRepositoryUrl(), >- fruitTask.getTaskId()); >- assertNotNull(fruitTaskData); >+ ITaskDataWorkingCopy working = TasksUiPlugin.getTaskDataManager().getWorkingCopy(fruitTask, >+ fruitTask.getConnectorKind()); >+ assertNotNull(working); > >- if (fruitTaskData.getAttributeValue("cf_fruit").equals("---")) { >+ if (fruitTaskData.getRoot().getAttribute("cf_fruit").getValue().equals("---")) { > setFruitValueTo("apple"); > setFruitValueTo("orange"); > setFruitValueTo("---"); >- } else if (fruitTaskData.getAttributeValue("cf_fruit").equals("apple")) { >+ } else if (fruitTaskData.getRoot().getAttribute("cf_fruit").getValue().equals("apple")) { > setFruitValueTo("orange"); > setFruitValueTo("apple"); > setFruitValueTo("---"); >- } else if (fruitTaskData.getAttributeValue("cf_fruit").equals("orange")) { >+ } else if (fruitTaskData.getRoot().getAttribute("cf_fruit").getValue().equals("orange")) { > setFruitValueTo("apple"); > setFruitValueTo("orange"); > setFruitValueTo("---"); >@@ -147,57 +135,58 @@ > > TasksUiPlugin.getTaskDataStorageManager().clear(); > >- // Get the task >- BugzillaTask task = generateLocalTaskAndDownload(taskNumber); >+ ITask task = generateLocalTaskAndDownload(taskNumber); > >- RepositoryTaskData taskData = TasksUiPlugin.getTaskDataStorageManager().getEditableCopy( >- task.getRepositoryUrl(), task.getTaskId()); >- assertNotNull(taskData); >+ TaskData taskData = TasksUiPlugin.getTaskDataManager().getTaskData(task, task.getConnectorKind()); > > TasksUiPlugin.getTaskList().addTask(task); > > String newCommentText = "BugzillaRepositoryClientTest.testMidAirCollision(): test " + (new Date()).toString(); >- taskData.setNewComment(newCommentText); >- Set<RepositoryTaskAttribute> changed = new HashSet<RepositoryTaskAttribute>(); >- changed.add(taskData.getAttribute(RepositoryTaskAttribute.COMMENT_NEW)); >- taskData.setAttributeValue("delta_ts", "2007-01-01 00:00:00"); >- changed.add(taskData.getAttribute("delta_ts")); >+ TaskAttribute attrNewComment = taskData.getRoot().getAttribute(TaskAttribute.COMMENT_NEW); >+ attrNewComment.setValue(newCommentText); >+ >+ TaskAttribute attrDeltaTs = taskData.getRoot().getAttribute(BugzillaReportElement.DELTA_TS.getKey()); >+ attrDeltaTs.setValue("2007-01-01 00:00:00"); > >- TasksUiPlugin.getTaskDataStorageManager().saveEdits(task.getRepositoryUrl(), task.getTaskId(), changed); >+ Set<TaskAttribute> changed = new HashSet<TaskAttribute>(); >+ changed.add(attrNewComment); >+ changed.add(attrDeltaTs); >+// TasksUiPlugin.getTaskDataManager().saveWorkingCopy(itask, kind, state)saveEdits(task.getRepositoryUrl(), task.getTaskId(), changed); > > try { > // Submit changes >- submit(task, taskData); >+ submit(task, taskData, changed); > fail("Mid-air collision expected"); > } catch (CoreException e) { > assertTrue(e.getStatus().getMessage().indexOf("Mid-air collision occurred while submitting") != -1); > } > } > >- public void testAuthenticationCredentials() throws Exception { >- init218(); >- BugzillaTask task = this.generateLocalTaskAndDownload("3"); >- assertNotNull(task); >- assertNotNull(TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), >- task.getTaskId())); >- TasksUiPlugin.getTaskListManager().activateTask(task); >- File sourceContextFile = ContextCore.getContextManager().getFileForContext(task.getHandleIdentifier()); >- assertEquals(SynchronizationState.SYNCHRONIZED, task.getSynchronizationState()); >- sourceContextFile.createNewFile(); >- sourceContextFile.deleteOnExit(); >- >- repository.setAuthenticationCredentials("wrong", "wrong"); >- TasksUiPlugin.getRepositoryManager().notifyRepositorySettingsChanged(repository); >- try { >- AttachmentUtil.attachContext(connector.getAttachmentHandler(), repository, task, "", >- new NullProgressMonitor()); >- } catch (CoreException e) { >- assertEquals(SynchronizationState.SYNCHRONIZED, task.getSynchronizationState()); >- assertTrue(e.getStatus().getMessage().indexOf("Invalid repository credentials.") != -1); >- return; >- } >- fail("Should have failed due to invalid userid and password."); >- } >+ // XXX: restore >+// public void testAuthenticationCredentials() throws Exception { >+// init218(); >+// BugzillaTask task = this.generateLocalTaskAndDownload("3"); >+// assertNotNull(task); >+// assertNotNull(TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), >+// task.getTaskId())); >+// TasksUiPlugin.getTaskListManager().activateTask(task); >+// File sourceContextFile = ContextCore.getContextManager().getFileForContext(task.getHandleIdentifier()); >+// assertEquals(SynchronizationState.SYNCHRONIZED, task.getSynchronizationState()); >+// sourceContextFile.createNewFile(); >+// sourceContextFile.deleteOnExit(); >+// >+// repository.setAuthenticationCredentials("wrong", "wrong"); >+// TasksUiPlugin.getRepositoryManager().notifyRepositorySettingsChanged(repository); >+// try { >+// AttachmentUtil.attachContext(connector.getAttachmentHandler(), repository, task, "", >+// new NullProgressMonitor()); >+// } catch (CoreException e) { >+// assertEquals(SynchronizationState.SYNCHRONIZED, task.getSynchronizationState()); >+// assertTrue(e.getStatus().getMessage().indexOf("Invalid repository credentials.") != -1); >+// return; >+// } >+// fail("Should have failed due to invalid userid and password."); >+// } > > // testReassign Bugs > // Version BugNr assigned reporter >@@ -205,188 +194,193 @@ > // 3.0 5 tests@mylar.eclipse.org tests2@mylar.eclipse.org > // 3.1 1 rob.elves@eclipse.org tests@mylar.eclipse.org > >- public void testReassign222() throws CoreException { >- init222(); >- String taskNumber = "92"; >- doReassignOld(taskNumber, "user@mylar.eclipse.org"); >- } >- >- public void testReassign30() throws CoreException { >- init30(); >- String taskNumber = "5"; >- doReassignOld(taskNumber, "tests@mylyn.eclipse.org"); >- } >- >- public void testReassign31() throws CoreException { >- init31(); >- String taskNumber = "1"; >- >- TasksUiPlugin.getTaskDataStorageManager().clear(); >- >- // Get the task >- BugzillaTask task = generateLocalTaskAndDownload(taskNumber); >- >- RepositoryTaskData taskData = TasksUiPlugin.getTaskDataStorageManager().getEditableCopy( >- task.getRepositoryUrl(), task.getTaskId()); >- assertNotNull(taskData); >- >- TasksUiPlugin.getTaskList().addTask(task); >- if (taskData.getAssignedTo().equals("rob.elves@eclipse.org")) { >- assertEquals("rob.elves@eclipse.org", taskData.getAssignedTo()); >- reassingToUser31(task, taskData); >- TasksUiInternal.synchronizeTask(connector, task, true, null); >- taskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), >- task.getTaskId()); >- assertEquals("tests2@mylyn.eclipse.org", taskData.getAssignedTo()); >- >- reassignToDefault31(task, taskData); >- TasksUiInternal.synchronizeTask(connector, task, true, null); >- taskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), >- task.getTaskId()); >- assertEquals("rob.elves@eclipse.org", taskData.getAssignedTo()); >- } else if (taskData.getAssignedTo().equals("tests2@mylyn.eclipse.org")) { >- assertEquals("tests2@mylyn.eclipse.org", taskData.getAssignedTo()); >- reassignToDefault31(task, taskData); >- TasksUiInternal.synchronizeTask(connector, task, true, null); >- taskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), >- task.getTaskId()); >- assertEquals("rob.elves@eclipse.org", taskData.getAssignedTo()); >- >- reassingToUser31(task, taskData); >- TasksUiInternal.synchronizeTask(connector, task, true, null); >- taskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), >- task.getTaskId()); >- assertEquals("tests2@mylyn.eclipse.org", taskData.getAssignedTo()); >- } else { >- fail("Bug with unexpected user assigned"); >- } >- >- } >- >- private void reassignToDefault31(BugzillaTask task, RepositoryTaskData taskData) throws CoreException { >- // Modify it (reassignbycomponent) >- String newCommentText = "BugzillaRepositoryClientTest.testReassign31(): reassignbycomponent " >- + (new Date()).toString(); >- taskData.setNewComment(newCommentText); >- Set<RepositoryTaskAttribute> changed = new HashSet<RepositoryTaskAttribute>(); >- changed.add(taskData.getAttribute(RepositoryTaskAttribute.COMMENT_NEW)); >- >- taskData.setAttributeValue(BugzillaReportElement.SET_DEFAULT_ASSIGNEE.getKeyString(), "1"); >- changed.add(taskData.getAttribute(BugzillaReportElement.SET_DEFAULT_ASSIGNEE.getKeyString())); >- >- TasksUiPlugin.getTaskDataStorageManager().saveEdits(task.getRepositoryUrl(), task.getTaskId(), changed); >- >- // Submit changes >- submit(task, taskData); >- } >- >- private void reassingToUser31(BugzillaTask task, RepositoryTaskData taskData) throws CoreException { >- // Modify it (reassign to tests2@mylyn.eclipse.org) >- String newCommentText = "BugzillaRepositoryClientTest.testReassign31(): reassign " + (new Date()).toString(); >- taskData.setNewComment(newCommentText); >- Set<RepositoryTaskAttribute> changed = new HashSet<RepositoryTaskAttribute>(); >- changed.add(taskData.getAttribute(RepositoryTaskAttribute.COMMENT_NEW)); >- >- taskData.setAttributeValue(RepositoryTaskAttribute.USER_ASSIGNED, "tests2@mylyn.eclipse.org"); >- changed.add(taskData.getAttribute(RepositoryTaskAttribute.USER_ASSIGNED)); >- TasksUiPlugin.getTaskDataStorageManager().saveEdits(task.getRepositoryUrl(), task.getTaskId(), changed); >- >- // Submit changes >- submit(task, taskData); >- } >- >- private void doReassignOld(String taskNumber, String defaultAssignee) throws CoreException { >- TasksUiPlugin.getTaskDataStorageManager().clear(); >- >- // Get the task >- BugzillaTask task = generateLocalTaskAndDownload(taskNumber); >- >- RepositoryTaskData taskData = TasksUiPlugin.getTaskDataStorageManager().getEditableCopy( >- task.getRepositoryUrl(), task.getTaskId()); >- assertNotNull(taskData); >- >- TasksUiPlugin.getTaskList().addTask(task, TasksUiPlugin.getTaskList().getDefaultCategory()); >- >- if (taskData.getAssignedTo().equals(defaultAssignee)) { >- assertEquals(defaultAssignee, taskData.getAssignedTo()); >- reassingToUserOld(task, taskData); >- TasksUiInternal.synchronizeTask(connector, task, true, null); >- taskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), >- task.getTaskId()); >- assertEquals("tests2@mylyn.eclipse.org", taskData.getAssignedTo()); >- >- reassignToDefaultOld(task, taskData); >- TasksUiInternal.synchronizeTask(connector, task, true, null); >- taskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), >- task.getTaskId()); >- assertEquals(defaultAssignee, taskData.getAssignedTo()); >- } else if (taskData.getAssignedTo().equals("tests2@mylyn.eclipse.org")) { >- assertEquals("tests2@mylyn.eclipse.org", taskData.getAssignedTo()); >- reassignToDefaultOld(task, taskData); >- TasksUiInternal.synchronizeTask(connector, task, true, null); >- taskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), >- task.getTaskId()); >- assertEquals(defaultAssignee, taskData.getAssignedTo()); >- >- reassingToUserOld(task, taskData); >- TasksUiInternal.synchronizeTask(connector, task, true, null); >- taskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), >- task.getTaskId()); >- assertEquals("tests2@mylyn.eclipse.org", taskData.getAssignedTo()); >- } else { >- fail("Bug with unexpected user assigned"); >- } >- } >- >- private void reassignToDefaultOld(BugzillaTask task, RepositoryTaskData taskData) throws CoreException { >- // Modify it (reassignbycomponent) >- String newCommentText = "BugzillaRepositoryClientTest.testReassignOld(): reassignbycomponent " >- + (new Date()).toString(); >- taskData.setNewComment(newCommentText); >- Set<RepositoryTaskAttribute> changed = new HashSet<RepositoryTaskAttribute>(); >- changed.add(taskData.getAttribute(RepositoryTaskAttribute.COMMENT_NEW)); >- for (RepositoryOperation o : taskData.getOperations()) { >- if (o.isChecked()) { >- o.setChecked(false); >- } >- if (o.getKnobName().compareTo("reassignbycomponent") == 0) { >- o.setChecked(true); >- taskData.setSelectedOperation(o); >- } >- } >- TasksUiPlugin.getTaskDataStorageManager().saveEdits(task.getRepositoryUrl(), task.getTaskId(), changed); >- >- // Submit changes >- submit(task, taskData); >- } >- >- private void reassingToUserOld(BugzillaTask task, RepositoryTaskData taskData) throws CoreException { >- // Modify it (reassign to tests2@mylyn.eclipse.org) >- String newCommentText = "BugzillaRepositoryClientTest.testReassignOld(): reassign " + (new Date()).toString(); >- taskData.setNewComment(newCommentText); >- Set<RepositoryTaskAttribute> changed = new HashSet<RepositoryTaskAttribute>(); >- changed.add(taskData.getAttribute(RepositoryTaskAttribute.COMMENT_NEW)); >- for (RepositoryOperation o : taskData.getOperations()) { >- if (o.isChecked()) { >- o.setChecked(false); >- } >- if (o.getKnobName().compareTo("reassign") == 0) { >- o.setInputValue("tests2@mylyn.eclipse.org"); >- o.setChecked(true); >- taskData.setSelectedOperation(o); >- } >- } >- TasksUiPlugin.getTaskDataStorageManager().saveEdits(task.getRepositoryUrl(), task.getTaskId(), changed); >- >- // Submit changes >- submit(task, taskData); >- >- } >+// XXX: restore >+// public void testReassign222() throws CoreException { >+// init222(); >+// String taskNumber = "92"; >+// doReassignOld(taskNumber, "user@mylar.eclipse.org"); >+// } >+// >+// public void testReassign30() throws CoreException { >+// init30(); >+// String taskNumber = "5"; >+// doReassignOld(taskNumber, "tests@mylyn.eclipse.org"); >+// } >+// >+// public void testReassign31() throws CoreException { >+// init31(); >+// String taskNumber = "1"; >+// >+// TasksUiPlugin.getTaskDataStorageManager().clear(); >+// >+// // Get the task >+// ITask task = generateLocalTaskAndDownload(taskNumber); >+// >+// ITaskDataWorkingCopy workingCopy = TasksUiPlugin.getTaskDataManager().getWorkingCopy(task, >+// task.getConnectorKind()); >+// >+// TaskData taskData = workingCopy.getLocalData(); >+// assertNotNull(taskData); >+// >+// TaskMapper mapper = new TaskMapper(taskData); >+// >+// TasksUiPlugin.getTaskList().addTask(task); >+// if (taskData.getAssignedTo().equals("rob.elves@eclipse.org")) { >+// assertEquals("rob.elves@eclipse.org", taskData.getAssignedTo()); >+// reassingToUser31(task, taskData); >+// TasksUiInternal.synchronizeTask(connector, task, true, null); >+// taskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), >+// task.getTaskId()); >+// assertEquals("tests2@mylyn.eclipse.org", taskData.getAssignedTo()); >+// >+// reassignToDefault31(task, taskData); >+// TasksUiInternal.synchronizeTask(connector, task, true, null); >+// taskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), >+// task.getTaskId()); >+// assertEquals("rob.elves@eclipse.org", taskData.getAssignedTo()); >+// } else if (taskData.getAssignedTo().equals("tests2@mylyn.eclipse.org")) { >+// assertEquals("tests2@mylyn.eclipse.org", taskData.getAssignedTo()); >+// reassignToDefault31(task, taskData); >+// TasksUiInternal.synchronizeTask(connector, task, true, null); >+// taskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), >+// task.getTaskId()); >+// assertEquals("rob.elves@eclipse.org", taskData.getAssignedTo()); >+// >+// reassingToUser31(task, taskData); >+// TasksUiInternal.synchronizeTask(connector, task, true, null); >+// taskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), >+// task.getTaskId()); >+// assertEquals("tests2@mylyn.eclipse.org", taskData.getAssignedTo()); >+// } else { >+// fail("Bug with unexpected user assigned"); >+// } >+// >+// } >+// >+// private void reassignToDefault31(BugzillaTask task, RepositoryTaskData taskData) throws CoreException { >+// // Modify it (reassignbycomponent) >+// String newCommentText = "BugzillaRepositoryClientTest.testReassign31(): reassignbycomponent " >+// + (new Date()).toString(); >+// taskData.setNewComment(newCommentText); >+// Set<RepositoryTaskAttribute> changed = new HashSet<RepositoryTaskAttribute>(); >+// changed.add(taskData.getAttribute(RepositoryTaskAttribute.COMMENT_NEW)); >+// >+// taskData.setAttributeValue(BugzillaReportElement.SET_DEFAULT_ASSIGNEE.getKey(), "1"); >+// changed.add(taskData.getAttribute(BugzillaReportElement.SET_DEFAULT_ASSIGNEE.getKey())); >+// >+// TasksUiPlugin.getTaskDataStorageManager().saveEdits(task.getRepositoryUrl(), task.getTaskId(), changed); >+// >+// // Submit changes >+// submit(task, taskData, changed); >+// } >+// >+// private void reassingToUser31(BugzillaTask task, RepositoryTaskData taskData) throws CoreException { >+// // Modify it (reassign to tests2@mylyn.eclipse.org) >+// String newCommentText = "BugzillaRepositoryClientTest.testReassign31(): reassign " + (new Date()).toString(); >+// taskData.setNewComment(newCommentText); >+// Set<RepositoryTaskAttribute> changed = new HashSet<RepositoryTaskAttribute>(); >+// changed.add(taskData.getAttribute(RepositoryTaskAttribute.COMMENT_NEW)); >+// >+// taskData.setAttributeValue(RepositoryTaskAttribute.USER_ASSIGNED, "tests2@mylyn.eclipse.org"); >+// changed.add(taskData.getAttribute(RepositoryTaskAttribute.USER_ASSIGNED)); >+// TasksUiPlugin.getTaskDataStorageManager().saveEdits(task.getRepositoryUrl(), task.getTaskId(), changed); >+// >+// // Submit changes >+// submit(task, taskData, null); >+// } >+// >+// private void doReassignOld(String taskNumber, String defaultAssignee) throws CoreException { >+// TasksUiPlugin.getTaskDataStorageManager().clear(); >+// >+// // Get the task >+// BugzillaTask task = generateLocalTaskAndDownload(taskNumber); >+// >+// RepositoryTaskData taskData = TasksUiPlugin.getTaskDataStorageManager().getEditableCopy( >+// task.getRepositoryUrl(), task.getTaskId()); >+// assertNotNull(taskData); >+// >+// TasksUiPlugin.getTaskList().addTask(task, TasksUiPlugin.getTaskList().getDefaultCategory()); >+// >+// if (taskData.getAssignedTo().equals(defaultAssignee)) { >+// assertEquals(defaultAssignee, taskData.getAssignedTo()); >+// reassingToUserOld(task, taskData); >+// TasksUiInternal.synchronizeTask(connector, task, true, null); >+// taskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), >+// task.getTaskId()); >+// assertEquals("tests2@mylyn.eclipse.org", taskData.getAssignedTo()); >+// >+// reassignToDefaultOld(task, taskData); >+// TasksUiInternal.synchronizeTask(connector, task, true, null); >+// taskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), >+// task.getTaskId()); >+// assertEquals(defaultAssignee, taskData.getAssignedTo()); >+// } else if (taskData.getAssignedTo().equals("tests2@mylyn.eclipse.org")) { >+// assertEquals("tests2@mylyn.eclipse.org", taskData.getAssignedTo()); >+// reassignToDefaultOld(task, taskData); >+// TasksUiInternal.synchronizeTask(connector, task, true, null); >+// taskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), >+// task.getTaskId()); >+// assertEquals(defaultAssignee, taskData.getAssignedTo()); >+// >+// reassingToUserOld(task, taskData); >+// TasksUiInternal.synchronizeTask(connector, task, true, null); >+// taskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), >+// task.getTaskId()); >+// assertEquals("tests2@mylyn.eclipse.org", taskData.getAssignedTo()); >+// } else { >+// fail("Bug with unexpected user assigned"); >+// } >+// } >+// >+// private void reassignToDefaultOld(BugzillaTask task, RepositoryTaskData taskData) throws CoreException { >+// // Modify it (reassignbycomponent) >+// String newCommentText = "BugzillaRepositoryClientTest.testReassignOld(): reassignbycomponent " >+// + (new Date()).toString(); >+// taskData.setNewComment(newCommentText); >+// Set<RepositoryTaskAttribute> changed = new HashSet<RepositoryTaskAttribute>(); >+// changed.add(taskData.getAttribute(RepositoryTaskAttribute.COMMENT_NEW)); >+// for (RepositoryOperation o : taskData.getOperations()) { >+// if (o.isChecked()) { >+// o.setChecked(false); >+// } >+// if (o.getKnobName().compareTo("reassignbycomponent") == 0) { >+// o.setChecked(true); >+// taskData.setSelectedOperation(o); >+// } >+// } >+// TasksUiPlugin.getTaskDataStorageManager().saveEdits(task.getRepositoryUrl(), task.getTaskId(), changed); >+// >+// // Submit changes >+// submit(task, taskData, null); >+// } >+// >+// private void reassingToUserOld(BugzillaTask task, RepositoryTaskData taskData) throws CoreException { >+// // Modify it (reassign to tests2@mylyn.eclipse.org) >+// String newCommentText = "BugzillaRepositoryClientTest.testReassignOld(): reassign " + (new Date()).toString(); >+// taskData.setNewComment(newCommentText); >+// Set<RepositoryTaskAttribute> changed = new HashSet<RepositoryTaskAttribute>(); >+// changed.add(taskData.getAttribute(RepositoryTaskAttribute.COMMENT_NEW)); >+// for (RepositoryOperation o : taskData.getOperations()) { >+// if (o.isChecked()) { >+// o.setChecked(false); >+// } >+// if (o.getKnobName().compareTo("reassign") == 0) { >+// o.setInputValue("tests2@mylyn.eclipse.org"); >+// o.setChecked(true); >+// taskData.setSelectedOperation(o); >+// } >+// } >+// TasksUiPlugin.getTaskDataStorageManager().saveEdits(task.getRepositoryUrl(), task.getTaskId(), changed); >+// >+// // Submit changes >+// submit(task, taskData, null); >+// >+// } > > public void testSubTaskHasIncoming() throws CoreException { > init30(); > String taskNumber = "6"; >- BugzillaTask task = generateLocalTaskAndDownload(taskNumber); >+ ITask task = generateLocalTaskAndDownload(taskNumber); > assertNotNull(task); > assertEquals(2, task.getChildren().size()); > ITask child = task.getChildren().iterator().next(); >@@ -427,13 +421,13 @@ > > } > >- BugzillaTask task = generateLocalTaskAndDownload("1"); >+ ITask task = generateLocalTaskAndDownload("1"); > assertNotNull(task); > assertNotNull(TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), > task.getTaskId())); > assertEquals(SynchronizationState.SYNCHRONIZED, task.getSynchronizationState()); > >- BugzillaTask retrievedTask = (BugzillaTask) taskList.getTask(task.getHandleIdentifier()); >+ ITask retrievedTask = taskList.getTask(task.getHandleIdentifier()); > assertNotNull(retrievedTask); > assertEquals(task.getHandleIdentifier(), retrievedTask.getHandleIdentifier()); > } >@@ -443,7 +437,7 @@ > assertNotNull(repository); > repository.setAuthenticationCredentials("", ""); > // test anonymous task retrieval >- BugzillaTask task = this.generateLocalTaskAndDownload("2"); >+ ITask task = this.generateLocalTaskAndDownload("2"); > assertNotNull(task); > > // // test anonymous query (note that this demonstrates query via >@@ -482,11 +476,11 @@ > String taskNumber = "3"; > TasksUiPlugin.getTaskDataStorageManager().clear(); > assertEquals(0, TasksUiPlugin.getTaskList().getAllTasks().size()); >- BugzillaTask task = this.generateLocalTaskAndDownload(taskNumber); >+ ITask task = this.generateLocalTaskAndDownload(taskNumber); > assertEquals("search-match-test 2", task.getSummary()); >- assertEquals("TestProduct", task.getProduct()); >+ assertEquals("TestProduct", task.getAttribute(TaskAttribute.PRODUCT)); > assertEquals("P1", task.getPriority()); >- assertEquals("blocker", task.getSeverity()); >+ assertEquals("blocker", task.getAttribute(BugzillaReportElement.BUG_SEVERITY.getKey())); > assertEquals("nhapke@cs.ubc.ca", task.getOwner()); > // assertEquals("2007-04-18 14:21:40", > // task.getCompletionDate().toString()); >@@ -499,486 +493,492 @@ > String taskNumber = "23"; > TasksUiPlugin.getTaskDataStorageManager().clear(); > assertEquals(0, TasksUiPlugin.getTaskList().getAllTasks().size()); >- BugzillaTask task = this.generateLocalTaskAndDownload(taskNumber); >+ ITask task = this.generateLocalTaskAndDownload(taskNumber); > assertNotNull(task.getChildren()); > assertEquals(2, task.getChildren().size()); > } > >- public void testContextAttachFailure() throws Exception { >- init218(); >- BugzillaTask task = this.generateLocalTaskAndDownload("3"); >- assertNotNull(task); >- assertNotNull(TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), >- task.getTaskId())); >- TasksUiPlugin.getTaskListManager().activateTask(task); >- File sourceContextFile = ContextCore.getContextManager().getFileForContext(task.getHandleIdentifier()); >- assertEquals(SynchronizationState.SYNCHRONIZED, task.getSynchronizationState()); >- sourceContextFile.createNewFile(); >- sourceContextFile.deleteOnExit(); >- repository.setAuthenticationCredentials("wrong", "wrong"); >- try { >- AttachmentUtil.attachContext(connector.getAttachmentHandler(), repository, task, "", >- new NullProgressMonitor()); >- } catch (CoreException e) { >- assertEquals(SynchronizationState.SYNCHRONIZED, task.getSynchronizationState()); >- return; >- } >- fail("Should have failed due to invalid userid and password."); >- } >- >- public void testSynchronize() throws CoreException { >- init222(); >- >- TasksUiPlugin.getTaskDataStorageManager().clear(); >- >- // Get the task >- BugzillaTask task = generateLocalTaskAndDownload("3"); >- >- RepositoryTaskData taskData = TasksUiPlugin.getTaskDataStorageManager().getEditableCopy( >- task.getRepositoryUrl(), task.getTaskId()); >- assertNotNull(taskData); >- >- TasksUiPlugin.getTaskList().addTask(task); >- int numComments = taskData.getComments().size(); >- >- // Modify it >- String newCommentText = "BugzillaRepositoryClientTest.testSynchronize(): " + (new Date()).toString(); >- taskData.setNewComment(newCommentText); >- Set<RepositoryTaskAttribute> changed = new HashSet<RepositoryTaskAttribute>(); >- changed.add(taskData.getAttribute(RepositoryTaskAttribute.COMMENT_NEW)); >- TasksUiPlugin.getTaskDataStorageManager().saveEdits(task.getRepositoryUrl(), task.getTaskId(), changed); >- >- // Submit changes >- submit(task, taskData); >- >- TasksUiInternal.synchronizeTask(connector, task, true, null); >- // After submit task should be in SYNCHRONIZED state >- assertEquals(SynchronizationState.SYNCHRONIZED, task.getSynchronizationState()); >- RepositoryTaskData taskData2 = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData( >- task.getRepositoryUrl(), task.getTaskId()); >- assertFalse(taskData2.getLastModified().equals(taskData.getLastModified())); >- // Still not read >- assertFalse(taskData2.getLastModified().equals(task.getLastReadTimeStamp())); >- TasksUiPlugin.getTaskDataManager().setTaskRead(task, true); >- assertEquals(taskData2.getLastModified(), task.getLastReadTimeStamp()); >- assertTrue(taskData2.getComments().size() > numComments); >- >- // Has no outgoing changes or conflicts yet needs synch >- // because task doesn't have bug report (new query hit) >- // Result: retrieved with no incoming status >- // task.setSyncState(SynchronizationState.SYNCHRONIZED); >- TasksUiPlugin.getTaskDataStorageManager().remove(task.getRepositoryUrl(), task.getTaskId()); >- TasksUiInternal.synchronizeTask(connector, task, false, null); >- assertEquals(SynchronizationState.SYNCHRONIZED, task.getSynchronizationState()); >- RepositoryTaskData bugReport2 = null; >- bugReport2 = TasksUiPlugin.getTaskDataStorageManager() >- .getNewTaskData(task.getRepositoryUrl(), task.getTaskId()); >- assertNotNull(bugReport2); >- assertEquals(task.getTaskId(), bugReport2.getTaskId()); >- >- assertEquals(newCommentText, bugReport2.getComments().get(numComments).getText()); >- // TODO: Test that comment was appended >- // ArrayList<Comment> comments = task.getTaskData().getComments(); >- // assertNotNull(comments); >- // assertTrue(comments.size() > 0); >- // Comment lastComment = comments.get(comments.size() - 1); >- // assertEquals(newCommentText, lastComment.getText()); >- >- } >- >- public void testUniqueQueryHitObjects() { >- init222(); >- BugzillaRepositoryQuery query1 = new BugzillaRepositoryQuery(IBugzillaConstants.TEST_BUGZILLA_222_URL, >- "queryurl", "description1"); >- BugzillaTask query1Hit = new BugzillaTask(IBugzillaConstants.TEST_BUGZILLA_222_URL, "1", "description1"); >- taskList.addQuery(query1); >- taskList.addTask(query1Hit, query1); >- >- BugzillaRepositoryQuery query2 = new BugzillaRepositoryQuery(IBugzillaConstants.TEST_BUGZILLA_222_URL, >- "queryurl2", "description2"); >- BugzillaTask query2Hit = new BugzillaTask(IBugzillaConstants.TEST_BUGZILLA_222_URL, "1", "description2"); >- taskList.addQuery(query2); >- taskList.addTask(query2Hit, query1); >- >- assertEquals(2, taskList.getQueries().size()); >- assertEquals(1, taskList.getAllTasks().size()); >- for (ITask hit : query1.getChildren()) { >- for (ITask hit2 : query2.getChildren()) { >- assertTrue(hit.getClass().equals(hit2.getClass())); >- } >- } >- >- taskList.deleteQuery(query1); >- taskList.deleteQuery(query2); >- assertEquals(1, taskList.getAllTasks().size()); >- } >- >- public void testAttachToExistingReport() throws Exception { >- init222(); >- String taskNumber = "33"; >- BugzillaTask task = generateLocalTaskAndDownload(taskNumber); >- RepositoryTaskData taskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), >- task.getTaskId()); >- >- assertNotNull(task); >- assertNotNull(taskData); >- TasksUiPlugin.getTaskDataManager().setTaskRead(task, true); >- assertEquals(SynchronizationState.SYNCHRONIZED, task.getSynchronizationState()); >- assertEquals(taskNumber, taskData.getTaskId()); >- int numAttached = taskData.getAttachments().size(); >- String fileName = "test-attach-" + System.currentTimeMillis() + ".txt"; >- >- assertNotNull(repository.getUserName()); >- assertNotNull(repository.getPassword()); >- >- /* Initialize a local attachment */ >- LocalAttachment attachment = new LocalAttachment(); >- attachment.setDescription("Test attachment " + new Date()); >- attachment.setContentType("text/plain"); >- attachment.setPatch(false); >- attachment.setReport(taskData); >- attachment.setComment("Automated JUnit attachment test"); // optional >- >- /* Test attempt to upload a non-existent file */ >- attachment.setFilePath("/this/is/not/a/real-file"); >- attachment.setFile(new File(attachment.getFilePath())); >- attachment.setFilename("real-file"); >- // IAttachmentHandler attachmentHandler = >- // connector.getAttachmentHandler(); >- BugzillaClient client = connector.getClientManager().getClient(repository, new NullProgressMonitor()); >- try { >- client.postAttachment(attachment.getReport().getTaskId(), attachment.getComment(), attachment, null); >- fail(); >- } catch (Exception e) { >- } >- // attachmentHandler.uploadAttachment(repository, task, comment, >- // summary, file, contentType, isPatch, proxySettings) >- // assertFalse(attachmentHandler.uploadAttachment(attachment, >- // repository.getUserName(), repository.getPassword(), >- // Proxy.NO_PROXY)); >- assertEquals(SynchronizationState.SYNCHRONIZED, task.getSynchronizationState()); >- task = (BugzillaTask) TasksUiInternal.createTask(repository, taskNumber, new NullProgressMonitor()); >- TasksUiInternal.synchronizeTask(connector, task, true, null); >- >- assertEquals(numAttached, taskData.getAttachments().size()); >- >- /* Test attempt to upload an empty file */ >- File attachFile = new File(fileName); >- attachment.setFilePath(attachFile.getAbsolutePath()); >- BufferedWriter write = new BufferedWriter(new FileWriter(attachFile)); >- attachFile = new File(attachment.getFilePath()); >- attachment.setFile(attachFile); >- attachment.setFilename(attachFile.getName()); >- // assertFalse(attachmentHandler.uploadAttachment(attachment, >- // repository.getUserName(), repository.getPassword(), >- // Proxy.NO_PROXY)); >- try { >- client.postAttachment(attachment.getReport().getTaskId(), attachment.getComment(), attachment, null); >- fail(); >- } catch (Exception e) { >- } >- task = (BugzillaTask) TasksUiInternal.createTask(repository, taskNumber, new NullProgressMonitor()); >- TasksUiInternal.synchronizeTask(connector, task, true, null); >- taskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId()); >- assertEquals(numAttached, taskData.getAttachments().size()); >- >- /* Test uploading a proper file */ >- write.write("test file"); >- write.close(); >- attachment.setFilePath(attachFile.getAbsolutePath()); >- // assertTrue(attachmentHandler.uploadAttachment(attachment, >- // repository.getUserName(), repository.getPassword(), >- // Proxy.NO_PROXY)); >- File fileToAttach = new File(attachment.getFilePath()); >- assertTrue(fileToAttach.exists()); >- attachment.setFile(fileToAttach); >- attachment.setFilename(fileToAttach.getName()); >- client.postAttachment(attachment.getReport().getTaskId(), attachment.getComment(), attachment, null); >- >- task = (BugzillaTask) TasksUiInternal.createTask(repository, taskNumber, new NullProgressMonitor()); >- TasksUiInternal.synchronizeTask(connector, task, true, null); >- taskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId()); >- assertEquals(numAttached + 1, taskData.getAttachments().size()); >- >- // use assertion to track clean-up >- assertTrue(attachFile.delete()); >- } >- >- public void testSynchChangedReports() throws Exception { >- >- init222(); >- String taskID = "4"; >- BugzillaTask task4 = generateLocalTaskAndDownload(taskID); >- RepositoryTaskData taskData4 = TasksUiPlugin.getTaskDataStorageManager().getEditableCopy( >- task4.getRepositoryUrl(), task4.getTaskId()); >- assertNotNull(task4); >- assertNotNull(taskData4); >- assertEquals(SynchronizationState.SYNCHRONIZED, task4.getSynchronizationState()); >- assertEquals(taskID, taskData4.getTaskId()); >- >- BugzillaTask task5 = generateLocalTaskAndDownload("5"); >- RepositoryTaskData taskData5 = TasksUiPlugin.getTaskDataStorageManager().getEditableCopy( >- task5.getRepositoryUrl(), task5.getTaskId()); >- assertNotNull(task5); >- assertNotNull(taskData5); >- assertEquals(SynchronizationState.SYNCHRONIZED, task5.getSynchronizationState()); >- assertEquals("5", taskData5.getTaskId()); >- >- Set<ITask> tasks = new HashSet<ITask>(); >- tasks.add(task4); >- tasks.add(task5); >- >- // Precondition for test passing is that task5's modification data is >- // AFTER >- // task4's >- >- TasksUiPlugin.getRepositoryManager().setSynchronizationTime(repository, task5.getLastReadTimeStamp(), >- TasksUiPlugin.getDefault().getRepositoriesFilePath()); >- >- SynchronizationContext event = new SynchronizationContext(); >- event.setTasks(tasks); >- event.setNeedsPerformQueries(true); >- event.setTaskRepository(repository); >- event.setFullSynchronization(true); >- connector.preSynchronization(event, null); >- assertTrue(event.needsPerformQueries()); >- // Always last known changed returned >- assertFalse(task4.isStale()); >- assertTrue(task5.isStale()); >- >- String priority4 = null; >- if (task4.getPriority().equals("P1")) { >- priority4 = "P2"; >- taskData4.setAttributeValue(BugzillaReportElement.PRIORITY.getKeyString(), priority4); >- } else { >- priority4 = "P1"; >- taskData4.setAttributeValue(BugzillaReportElement.PRIORITY.getKeyString(), priority4); >- } >- >- String priority5 = null; >- if (task5.getPriority().equals("P1")) { >- priority5 = "P2"; >- taskData5.setAttributeValue(BugzillaReportElement.PRIORITY.getKeyString(), priority5); >- } else { >- priority5 = "P1"; >- taskData5.setAttributeValue(BugzillaReportElement.PRIORITY.getKeyString(), priority5); >- } >- >- assertNotNull(repository.getUserName()); >- assertNotNull(repository.getPassword()); >- >- submit(task4, taskData4); >- submit(task5, taskData5); >- >- event = new SynchronizationContext(); >- event.setTasks(tasks); >- event.setNeedsPerformQueries(true); >- event.setTaskRepository(repository); >- event.setFullSynchronization(true); >- connector.preSynchronization(event, null); >- >- assertTrue(task4.isStale()); >- assertTrue(task5.isStale()); >- >- TasksUiInternal.synchronizeTasks(connector, tasks, true, null); >- >- for (ITask task : tasks) { >- if (task.getTaskId() == "4") { >- assertEquals(priority4, task4.getPriority()); >- } >- if (task.getTaskId() == "5") { >- assertEquals(priority5, task5.getPriority()); >- } >- } >- } >- >- public void testIncomingWhenOfflineDeleted() throws Exception { >- >- init222(); >- BugzillaTask task7 = generateLocalTaskAndDownload("7"); >- RepositoryTaskData recentTaskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData( >- task7.getRepositoryUrl(), task7.getTaskId()); >- assertNotNull(recentTaskData); >- TasksUiPlugin.getTaskDataManager().setTaskRead(task7, true); >- assertEquals(SynchronizationState.SYNCHRONIZED, task7.getSynchronizationState()); >- assertEquals("7", recentTaskData.getTaskId()); >- >- Set<AbstractTask> tasks = new HashSet<AbstractTask>(); >- tasks.add(task7); >- >- TasksUiPlugin.getRepositoryManager().setSynchronizationTime(repository, task7.getLastReadTimeStamp(), >- TasksUiPlugin.getDefault().getRepositoriesFilePath()); >- >- assertNotNull(TasksUiPlugin.getTaskDataStorageManager().getNewTaskData( >- IBugzillaConstants.TEST_BUGZILLA_222_URL, "7")); >- TasksUiPlugin.getTaskDataStorageManager().remove(task7.getRepositoryUrl(), task7.getTaskId()); >- >- assertNull(TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(IBugzillaConstants.TEST_BUGZILLA_222_URL, >- "7")); >- >- assertEquals(SynchronizationState.SYNCHRONIZED, task7.getSynchronizationState()); >- assertNotNull(task7.getLastReadTimeStamp()); >- // Task no longer stored offline >- // make an external change >- assertNotNull(repository.getUserName()); >- assertNotNull(repository.getPassword()); >- >- String priority = null; >- if (task7.getPriority().equals("P1")) { >- priority = "P2"; >- recentTaskData.setAttributeValue(BugzillaReportElement.PRIORITY.getKeyString(), priority); >- } else { >- priority = "P1"; >- recentTaskData.setAttributeValue(BugzillaReportElement.PRIORITY.getKeyString(), priority); >- } >- >- // disabled due to TasksUi.synchronizeChanged(connector, repository) being removed >- // REMOVE ALL TASK DATA >-// TasksUiPlugin.getTaskDataManager().clear(); >-// connector.getTaskDataHandler().postTaskData(repository, recentTaskData, new NullProgressMonitor()); >-// TasksUi.synchronizeChanged(connector, repository); >-// assertEquals(SynchronizationState.INCOMING, task7.getSynchronizationState()); >- } >- >- public void testTimeTracker222() throws Exception { >- init222(); >- timeTracker(15, true); >- } >- >- // We'll skip these two for now and just test 222 and 218 since >- // they are the most common. If problems arise we can re-enable. >- // public void testTimeTracker2201() throws Exception { >- // init2201(); >- // timeTracker(22, true); >- // } >- // >- // public void testTimeTracker220() throws Exception { >- // init220(); >- // timeTracker(8, true); >- // } >- >- public void testTimeTracker218() throws Exception { >- init218(); >- timeTracker(20, false); >- } >- >- /** >- * @param enableDeadline >- * bugzilla 218 doesn't support deadlines >- */ >- protected void timeTracker(int taskid, boolean enableDeadline) throws Exception { >- BugzillaTask bugtask = generateLocalTaskAndDownload("" + taskid); >- RepositoryTaskData bugtaskdata = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData( >- bugtask.getRepositoryUrl(), bugtask.getTaskId()); >- assertNotNull(bugtaskdata); >- assertEquals(taskid + "", bugtaskdata.getTaskId()); >- assertEquals(SynchronizationState.SYNCHRONIZED, bugtask.getSynchronizationState()); >- >- Set<AbstractTask> tasks = new HashSet<AbstractTask>(); >- tasks.add(bugtask); >- >- // synchAndAssertState(tasks, SynchronizationState.SYNCHRONIZED); >- >- TasksUiPlugin.getRepositoryManager().setSynchronizationTime(repository, bugtask.getLastReadTimeStamp(), >- TasksUiPlugin.getDefault().getRepositoriesFilePath()); >- // connector.synchronizeChanged(repository); >- >- // Set<AbstractTask> changedTasks = >- // connector.getOfflineTaskHandler().getChangedSinceLastSync(repository, >- // tasks); >- // assertEquals(1, changedTasks.size()); >- >- assertNotNull(repository.getUserName()); >- assertNotNull(repository.getPassword()); >- >- float estimatedTime, remainingTime, actualTime, addTime; >- String deadline = null; >- >- estimatedTime = Float.parseFloat(bugtaskdata.getAttributeValue(BugzillaReportElement.ESTIMATED_TIME.getKeyString())); >- remainingTime = Float.parseFloat(bugtaskdata.getAttributeValue(BugzillaReportElement.REMAINING_TIME.getKeyString())); >- actualTime = Float.parseFloat(bugtaskdata.getAttributeValue(BugzillaReportElement.ACTUAL_TIME.getKeyString())); >- if (enableDeadline) { >- deadline = bugtaskdata.getAttributeValue(BugzillaReportElement.DEADLINE.getKeyString()); >- } >- >- estimatedTime += 2; >- remainingTime += 1.5; >- addTime = 0.75f; >- if (enableDeadline) { >- deadline = generateNewDay(); >- } >- >- bugtaskdata.setAttributeValue(BugzillaReportElement.ESTIMATED_TIME.getKeyString(), "" + estimatedTime); >- bugtaskdata.setAttributeValue(BugzillaReportElement.REMAINING_TIME.getKeyString(), "" + remainingTime); >- bugtaskdata.setAttributeValue(BugzillaReportElement.WORK_TIME.getKeyString(), "" + addTime); >- if (enableDeadline) { >- bugtaskdata.setAttributeValue(BugzillaReportElement.DEADLINE.getKeyString(), deadline); >- } >- >-// for (AbstractTask task : tasks) { >-// RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData( >-// task.getHandleIdentifier()); >- bugtaskdata.setAttributeValue(BugzillaReportElement.ADD_COMMENT.getKeyString(), "New Estimate: " >- + estimatedTime + "\nNew Remaining: " + remainingTime + "\nAdd: " + addTime); >- submit(bugtask, bugtaskdata); >-// } >- >- synchAndAssertState(tasks, SynchronizationState.SYNCHRONIZED); >- >- bugtaskdata = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(bugtask.getRepositoryUrl(), >- bugtask.getTaskId()); >- >- assertEquals(estimatedTime, >- Float.parseFloat(bugtaskdata.getAttributeValue(BugzillaReportElement.ESTIMATED_TIME.getKeyString()))); >- assertEquals(remainingTime, >- Float.parseFloat(bugtaskdata.getAttributeValue(BugzillaReportElement.REMAINING_TIME.getKeyString()))); >- assertEquals(actualTime + addTime, >- Float.parseFloat(bugtaskdata.getAttributeValue(BugzillaReportElement.ACTUAL_TIME.getKeyString()))); >- if (enableDeadline) { >- assertEquals(deadline, bugtaskdata.getAttributeValue(BugzillaReportElement.DEADLINE.getKeyString())); >- } >- >- } >- >- private String generateNewDay() { >- int year = 2006; >- int month = (int) (Math.random() * 12 + 1); >- int day = (int) (Math.random() * 28 + 1); >- return "" + year + "-" + ((month <= 9) ? "0" : "") + month + "-" + ((day <= 9) ? "0" : "") + day; >- } >- >- /** >- * Ensure obsoletes and patches are marked as such by the parser. >- */ >- public void testAttachmentAttributes() throws Exception { >- init222(); >- int bugId = 19; >- String taskNumber = "" + bugId; >- BugzillaTask task = generateLocalTaskAndDownload(taskNumber); >- >- // TasksUiPlugin.getSynchronizationManager().synchronize(connector, >- // task, true, null); >- >- assertNotNull(task); >- >- boolean isPatch[] = { false, true, false, false, false, false, false, true, false, false }; >- boolean isObsolete[] = { false, true, false, true, false, false, false, false, false, false }; >- >- RepositoryTaskData taskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), >- task.getTaskId()); >- >- Iterator<RepositoryAttachment> iter = taskData.getAttachments().iterator(); >- >- int index = 0; >- while (iter.hasNext()) { >- assertTrue(validateAttachmentAttributes(iter.next(), isPatch[index], isObsolete[index])); >- index++; >- } >- } >+ // XXX: restore >+// public void testContextAttachFailure() throws Exception { >+// init218(); >+// BugzillaTask task = this.generateLocalTaskAndDownload("3"); >+// assertNotNull(task); >+// assertNotNull(TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), >+// task.getTaskId())); >+// TasksUiPlugin.getTaskListManager().activateTask(task); >+// File sourceContextFile = ContextCore.getContextManager().getFileForContext(task.getHandleIdentifier()); >+// assertEquals(SynchronizationState.SYNCHRONIZED, task.getSynchronizationState()); >+// sourceContextFile.createNewFile(); >+// sourceContextFile.deleteOnExit(); >+// repository.setAuthenticationCredentials("wrong", "wrong"); >+// try { >+// AttachmentUtil.attachContext(connector.getAttachmentHandler(), repository, task, "", >+// new NullProgressMonitor()); >+// } catch (CoreException e) { >+// assertEquals(SynchronizationState.SYNCHRONIZED, task.getSynchronizationState()); >+// return; >+// } >+// fail("Should have failed due to invalid userid and password."); >+// } > >- private boolean validateAttachmentAttributes(RepositoryAttachment att, boolean isPatch, boolean isObsolete) { >- return (att.isPatch() == isPatch) && (att.isObsolete() == isObsolete); >- } >+// public void testSynchronize() throws CoreException { >+// init222(); >+// >+// TasksUiPlugin.getTaskDataStorageManager().clear(); >+// >+// // Get the task >+// ITask task = generateLocalTaskAndDownload("3"); >+// >+// ITaskDataWorkingCopy workingCopy = TasksUiPlugin.getTaskDataManager().getWorkingCopy(task, >+// task.getConnectorKind()); >+// assertNotNull(workingCopy); >+// TaskData taskData = workingCopy.getLocalData(); >+// assertNotNull(taskData); >+// >+// TasksUiPlugin.getTaskList().addTask(task); >+// int numComments = taskData.getMappedAttribute(TaskAttribute.CONTAINER_COMMENTS).getAttributes().size(); >+// >+// // Modify it >+// String newCommentText = "BugzillaRepositoryClientTest.testSynchronize(): " + (new Date()).toString(); >+// TaskAttribute attrNewComment = taskData.getRoot().getAttribute(TaskAttribute.COMMENT_NEW); >+// attrNewComment.setValue(newCommentText); >+// >+// Set<TaskAttribute> changed = new HashSet<TaskAttribute>(); >+// changed.add(attrNewComment); >+// >+// workingCopy.save(new NullProgressMonitor(), changed); >+// >+// // Submit changes >+// submit(task, taskData, changed); >+// >+// TasksUiInternal.synchronizeTask(connector, task, true, null); >+// // After submit task should be in SYNCHRONIZED state >+// assertEquals(SynchronizationState.SYNCHRONIZED, task.getSynchronizationState()); >+// TaskData taskData2 = TasksUiPlugin.getTaskDataManager().getTaskData(task, task.getConnectorKind()); >+// assertFalse(taskData2.getLastModified().equals(taskData.getLastModified())); >+// // Still not read >+// assertFalse(taskData2.getLastModified().equals(task.getLastReadTimeStamp())); >+// TasksUiPlugin.getTaskDataManager().setTaskRead(task, true); >+// assertEquals(taskData2.getLastModified(), task.getLastReadTimeStamp()); >+// assertTrue(taskData2.getComments().size() > numComments); >+// >+// // Has no outgoing changes or conflicts yet needs synch >+// // because task doesn't have bug report (new query hit) >+// // Result: retrieved with no incoming status >+// // task.setSyncState(SynchronizationState.SYNCHRONIZED); >+// TasksUiPlugin.getTaskDataStorageManager().remove(task.getRepositoryUrl(), task.getTaskId()); >+// TasksUiInternal.synchronizeTask(connector, task, false, null); >+// assertEquals(SynchronizationState.SYNCHRONIZED, task.getSynchronizationState()); >+// RepositoryTaskData bugReport2 = null; >+// bugReport2 = TasksUiPlugin.getTaskDataStorageManager() >+// .getNewTaskData(task.getRepositoryUrl(), task.getTaskId()); >+// assertNotNull(bugReport2); >+// assertEquals(task.getTaskId(), bugReport2.getTaskId()); >+// >+// assertEquals(newCommentText, bugReport2.getComments().get(numComments).getText()); >+// // TODO: Test that comment was appended >+// // ArrayList<Comment> comments = task.getTaskData().getComments(); >+// // assertNotNull(comments); >+// // assertTrue(comments.size() > 0); >+// // Comment lastComment = comments.get(comments.size() - 1); >+// // assertEquals(newCommentText, lastComment.getText()); >+// >+// } >+// >+// public void testUniqueQueryHitObjects() { >+// init222(); >+// BugzillaRepositoryQuery query1 = new BugzillaRepositoryQuery(IBugzillaConstants.TEST_BUGZILLA_222_URL, >+// "queryurl", "description1"); >+// BugzillaTask query1Hit = new BugzillaTask(IBugzillaConstants.TEST_BUGZILLA_222_URL, "1", "description1"); >+// taskList.addQuery(query1); >+// taskList.addTask(query1Hit, query1); >+// >+// BugzillaRepositoryQuery query2 = new BugzillaRepositoryQuery(IBugzillaConstants.TEST_BUGZILLA_222_URL, >+// "queryurl2", "description2"); >+// BugzillaTask query2Hit = new BugzillaTask(IBugzillaConstants.TEST_BUGZILLA_222_URL, "1", "description2"); >+// taskList.addQuery(query2); >+// taskList.addTask(query2Hit, query1); >+// >+// assertEquals(2, taskList.getQueries().size()); >+// assertEquals(1, taskList.getAllTasks().size()); >+// for (ITask hit : query1.getChildren()) { >+// for (ITask hit2 : query2.getChildren()) { >+// assertTrue(hit.getClass().equals(hit2.getClass())); >+// } >+// } >+// >+// taskList.deleteQuery(query1); >+// taskList.deleteQuery(query2); >+// assertEquals(1, taskList.getAllTasks().size()); >+// } >+// >+// public void testAttachToExistingReport() throws Exception { >+// init222(); >+// String taskNumber = "33"; >+// BugzillaTask task = generateLocalTaskAndDownload(taskNumber); >+// RepositoryTaskData taskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), >+// task.getTaskId()); >+// >+// assertNotNull(task); >+// assertNotNull(taskData); >+// TasksUiPlugin.getTaskDataManager().setTaskRead(task, true); >+// assertEquals(SynchronizationState.SYNCHRONIZED, task.getSynchronizationState()); >+// assertEquals(taskNumber, taskData.getTaskId()); >+// int numAttached = taskData.getAttachments().size(); >+// String fileName = "test-attach-" + System.currentTimeMillis() + ".txt"; >+// >+// assertNotNull(repository.getUserName()); >+// assertNotNull(repository.getPassword()); >+// >+// /* Initialize a local attachment */ >+// LocalAttachment attachment = new LocalAttachment(); >+// attachment.setDescription("Test attachment " + new Date()); >+// attachment.setContentType("text/plain"); >+// attachment.setPatch(false); >+// attachment.setReport(taskData); >+// attachment.setComment("Automated JUnit attachment test"); // optional >+// >+// /* Test attempt to upload a non-existent file */ >+// attachment.setFilePath("/this/is/not/a/real-file"); >+// attachment.setFile(new File(attachment.getFilePath())); >+// attachment.setFilename("real-file"); >+// // IAttachmentHandler attachmentHandler = >+// // connector.getAttachmentHandler(); >+// BugzillaClient client = connector.getClientManager().getClient(repository, new NullProgressMonitor()); >+// try { >+// client.postAttachment(attachment.getReport().getTaskId(), attachment.getComment(), attachment, null); >+// fail(); >+// } catch (Exception e) { >+// } >+// // attachmentHandler.uploadAttachment(repository, task, comment, >+// // summary, file, contentType, isPatch, proxySettings) >+// // assertFalse(attachmentHandler.uploadAttachment(attachment, >+// // repository.getUserName(), repository.getPassword(), >+// // Proxy.NO_PROXY)); >+// assertEquals(SynchronizationState.SYNCHRONIZED, task.getSynchronizationState()); >+// task = (BugzillaTask) TasksUiInternal.createTask(repository, taskNumber, new NullProgressMonitor()); >+// TasksUiInternal.synchronizeTask(connector, task, true, null); >+// >+// assertEquals(numAttached, taskData.getAttachments().size()); >+// >+// /* Test attempt to upload an empty file */ >+// File attachFile = new File(fileName); >+// attachment.setFilePath(attachFile.getAbsolutePath()); >+// BufferedWriter write = new BufferedWriter(new FileWriter(attachFile)); >+// attachFile = new File(attachment.getFilePath()); >+// attachment.setFile(attachFile); >+// attachment.setFilename(attachFile.getName()); >+// // assertFalse(attachmentHandler.uploadAttachment(attachment, >+// // repository.getUserName(), repository.getPassword(), >+// // Proxy.NO_PROXY)); >+// try { >+// client.postAttachment(attachment.getReport().getTaskId(), attachment.getComment(), attachment, null); >+// fail(); >+// } catch (Exception e) { >+// } >+// task = (BugzillaTask) TasksUiInternal.createTask(repository, taskNumber, new NullProgressMonitor()); >+// TasksUiInternal.synchronizeTask(connector, task, true, null); >+// taskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId()); >+// assertEquals(numAttached, taskData.getAttachments().size()); >+// >+// /* Test uploading a proper file */ >+// write.write("test file"); >+// write.close(); >+// attachment.setFilePath(attachFile.getAbsolutePath()); >+// // assertTrue(attachmentHandler.uploadAttachment(attachment, >+// // repository.getUserName(), repository.getPassword(), >+// // Proxy.NO_PROXY)); >+// File fileToAttach = new File(attachment.getFilePath()); >+// assertTrue(fileToAttach.exists()); >+// attachment.setFile(fileToAttach); >+// attachment.setFilename(fileToAttach.getName()); >+// client.postAttachment(attachment.getReport().getTaskId(), attachment.getComment(), attachment, null); >+// >+// task = (BugzillaTask) TasksUiInternal.createTask(repository, taskNumber, new NullProgressMonitor()); >+// TasksUiInternal.synchronizeTask(connector, task, true, null); >+// taskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId()); >+// assertEquals(numAttached + 1, taskData.getAttachments().size()); >+// >+// // use assertion to track clean-up >+// assertTrue(attachFile.delete()); >+// } >+// >+// public void testSynchChangedReports() throws Exception { >+// >+// init222(); >+// String taskID = "4"; >+// BugzillaTask task4 = generateLocalTaskAndDownload(taskID); >+// RepositoryTaskData taskData4 = TasksUiPlugin.getTaskDataStorageManager().getEditableCopy( >+// task4.getRepositoryUrl(), task4.getTaskId()); >+// assertNotNull(task4); >+// assertNotNull(taskData4); >+// assertEquals(SynchronizationState.SYNCHRONIZED, task4.getSynchronizationState()); >+// assertEquals(taskID, taskData4.getTaskId()); >+// >+// BugzillaTask task5 = generateLocalTaskAndDownload("5"); >+// RepositoryTaskData taskData5 = TasksUiPlugin.getTaskDataStorageManager().getEditableCopy( >+// task5.getRepositoryUrl(), task5.getTaskId()); >+// assertNotNull(task5); >+// assertNotNull(taskData5); >+// assertEquals(SynchronizationState.SYNCHRONIZED, task5.getSynchronizationState()); >+// assertEquals("5", taskData5.getTaskId()); >+// >+// Set<ITask> tasks = new HashSet<ITask>(); >+// tasks.add(task4); >+// tasks.add(task5); >+// >+// // Precondition for test passing is that task5's modification data is >+// // AFTER >+// // task4's >+// >+// TasksUiPlugin.getRepositoryManager().setSynchronizationTime(repository, task5.getLastReadTimeStamp(), >+// TasksUiPlugin.getDefault().getRepositoriesFilePath()); >+// >+// SynchronizationContext event = new SynchronizationContext(); >+// event.setTasks(tasks); >+// event.setNeedsPerformQueries(true); >+// event.setTaskRepository(repository); >+// event.setFullSynchronization(true); >+// connector.preSynchronization(event, null); >+// assertTrue(event.needsPerformQueries()); >+// // Always last known changed returned >+// assertFalse(task4.isStale()); >+// assertTrue(task5.isStale()); >+// >+// String priority4 = null; >+// if (task4.getPriority().equals("P1")) { >+// priority4 = "P2"; >+// taskData4.setAttributeValue(BugzillaReportElement.PRIORITY.getKey(), priority4); >+// } else { >+// priority4 = "P1"; >+// taskData4.setAttributeValue(BugzillaReportElement.PRIORITY.getKey(), priority4); >+// } >+// >+// String priority5 = null; >+// if (task5.getPriority().equals("P1")) { >+// priority5 = "P2"; >+// taskData5.setAttributeValue(BugzillaReportElement.PRIORITY.getKey(), priority5); >+// } else { >+// priority5 = "P1"; >+// taskData5.setAttributeValue(BugzillaReportElement.PRIORITY.getKey(), priority5); >+// } >+// >+// assertNotNull(repository.getUserName()); >+// assertNotNull(repository.getPassword()); >+// >+// submit(task4, taskData4, null); >+// submit(task5, taskData5, null); >+// >+// event = new SynchronizationContext(); >+// event.setTasks(tasks); >+// event.setNeedsPerformQueries(true); >+// event.setTaskRepository(repository); >+// event.setFullSynchronization(true); >+// connector.preSynchronization(event, null); >+// >+// assertTrue(task4.isStale()); >+// assertTrue(task5.isStale()); >+// >+// TasksUiInternal.synchronizeTasks(connector, tasks, true, null); >+// >+// for (ITask task : tasks) { >+// if (task.getTaskId() == "4") { >+// assertEquals(priority4, task4.getPriority()); >+// } >+// if (task.getTaskId() == "5") { >+// assertEquals(priority5, task5.getPriority()); >+// } >+// } >+// } >+// >+// public void testIncomingWhenOfflineDeleted() throws Exception { >+// >+// init222(); >+// BugzillaTask task7 = generateLocalTaskAndDownload("7"); >+// RepositoryTaskData recentTaskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData( >+// task7.getRepositoryUrl(), task7.getTaskId()); >+// assertNotNull(recentTaskData); >+// TasksUiPlugin.getTaskDataManager().setTaskRead(task7, true); >+// assertEquals(SynchronizationState.SYNCHRONIZED, task7.getSynchronizationState()); >+// assertEquals("7", recentTaskData.getTaskId()); >+// >+// Set<AbstractTask> tasks = new HashSet<AbstractTask>(); >+// tasks.add(task7); >+// >+// TasksUiPlugin.getRepositoryManager().setSynchronizationTime(repository, task7.getLastReadTimeStamp(), >+// TasksUiPlugin.getDefault().getRepositoriesFilePath()); >+// >+// assertNotNull(TasksUiPlugin.getTaskDataStorageManager().getNewTaskData( >+// IBugzillaConstants.TEST_BUGZILLA_222_URL, "7")); >+// TasksUiPlugin.getTaskDataStorageManager().remove(task7.getRepositoryUrl(), task7.getTaskId()); >+// >+// assertNull(TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(IBugzillaConstants.TEST_BUGZILLA_222_URL, >+// "7")); >+// >+// assertEquals(SynchronizationState.SYNCHRONIZED, task7.getSynchronizationState()); >+// assertNotNull(task7.getLastReadTimeStamp()); >+// // Task no longer stored offline >+// // make an external change >+// assertNotNull(repository.getUserName()); >+// assertNotNull(repository.getPassword()); >+// >+// String priority = null; >+// if (task7.getPriority().equals("P1")) { >+// priority = "P2"; >+// recentTaskData.setAttributeValue(BugzillaReportElement.PRIORITY.getKey(), priority); >+// } else { >+// priority = "P1"; >+// recentTaskData.setAttributeValue(BugzillaReportElement.PRIORITY.getKey(), priority); >+// } >+// >+// // disabled due to TasksUi.synchronizeChanged(connector, repository) being removed >+// // REMOVE ALL TASK DATA >+//// TasksUiPlugin.getTaskDataManager().clear(); >+//// connector.getTaskDataHandler().postTaskData(repository, recentTaskData, new NullProgressMonitor()); >+//// TasksUi.synchronizeChanged(connector, repository); >+//// assertEquals(SynchronizationState.INCOMING, task7.getSynchronizationState()); >+// } >+// >+// public void testTimeTracker222() throws Exception { >+// init222(); >+// timeTracker(15, true); >+// } >+// >+// // We'll skip these two for now and just test 222 and 218 since >+// // they are the most common. If problems arise we can re-enable. >+// // public void testTimeTracker2201() throws Exception { >+// // init2201(); >+// // timeTracker(22, true); >+// // } >+// // >+// // public void testTimeTracker220() throws Exception { >+// // init220(); >+// // timeTracker(8, true); >+// // } >+// >+// public void testTimeTracker218() throws Exception { >+// init218(); >+// timeTracker(20, false); >+// } >+// >+// /** >+// * @param enableDeadline >+// * bugzilla 218 doesn't support deadlines >+// */ >+// protected void timeTracker(int taskid, boolean enableDeadline) throws Exception { >+// BugzillaTask bugtask = generateLocalTaskAndDownload("" + taskid); >+// RepositoryTaskData bugtaskdata = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData( >+// bugtask.getRepositoryUrl(), bugtask.getTaskId()); >+// assertNotNull(bugtaskdata); >+// assertEquals(taskid + "", bugtaskdata.getTaskId()); >+// assertEquals(SynchronizationState.SYNCHRONIZED, bugtask.getSynchronizationState()); >+// >+// Set<AbstractTask> tasks = new HashSet<AbstractTask>(); >+// tasks.add(bugtask); >+// >+// // synchAndAssertState(tasks, SynchronizationState.SYNCHRONIZED); >+// >+// TasksUiPlugin.getRepositoryManager().setSynchronizationTime(repository, bugtask.getLastReadTimeStamp(), >+// TasksUiPlugin.getDefault().getRepositoriesFilePath()); >+// // connector.synchronizeChanged(repository); >+// >+// // Set<AbstractTask> changedTasks = >+// // connector.getOfflineTaskHandler().getChangedSinceLastSync(repository, >+// // tasks); >+// // assertEquals(1, changedTasks.size()); >+// >+// assertNotNull(repository.getUserName()); >+// assertNotNull(repository.getPassword()); >+// >+// float estimatedTime, remainingTime, actualTime, addTime; >+// String deadline = null; >+// >+// estimatedTime = Float.parseFloat(bugtaskdata.getAttributeValue(BugzillaReportElement.ESTIMATED_TIME.getKey())); >+// remainingTime = Float.parseFloat(bugtaskdata.getAttributeValue(BugzillaReportElement.REMAINING_TIME.getKey())); >+// actualTime = Float.parseFloat(bugtaskdata.getAttributeValue(BugzillaReportElement.ACTUAL_TIME.getKey())); >+// if (enableDeadline) { >+// deadline = bugtaskdata.getAttributeValue(BugzillaReportElement.DEADLINE.getKey()); >+// } >+// >+// estimatedTime += 2; >+// remainingTime += 1.5; >+// addTime = 0.75f; >+// if (enableDeadline) { >+// deadline = generateNewDay(); >+// } >+// >+// bugtaskdata.setAttributeValue(BugzillaReportElement.ESTIMATED_TIME.getKey(), "" + estimatedTime); >+// bugtaskdata.setAttributeValue(BugzillaReportElement.REMAINING_TIME.getKey(), "" + remainingTime); >+// bugtaskdata.setAttributeValue(BugzillaReportElement.WORK_TIME.getKey(), "" + addTime); >+// if (enableDeadline) { >+// bugtaskdata.setAttributeValue(BugzillaReportElement.DEADLINE.getKey(), deadline); >+// } >+// >+//// for (AbstractTask task : tasks) { >+//// RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData( >+//// task.getHandleIdentifier()); >+// bugtaskdata.setAttributeValue(BugzillaReportElement.ADD_COMMENT.getKey(), "New Estimate: " + estimatedTime >+// + "\nNew Remaining: " + remainingTime + "\nAdd: " + addTime); >+// submit(bugtask, bugtaskdata, null); >+//// } >+// >+// synchAndAssertState(tasks, SynchronizationState.SYNCHRONIZED); >+// >+// bugtaskdata = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(bugtask.getRepositoryUrl(), >+// bugtask.getTaskId()); >+// >+// assertEquals(estimatedTime, >+// Float.parseFloat(bugtaskdata.getAttributeValue(BugzillaReportElement.ESTIMATED_TIME.getKey()))); >+// assertEquals(remainingTime, >+// Float.parseFloat(bugtaskdata.getAttributeValue(BugzillaReportElement.REMAINING_TIME.getKey()))); >+// assertEquals(actualTime + addTime, >+// Float.parseFloat(bugtaskdata.getAttributeValue(BugzillaReportElement.ACTUAL_TIME.getKey()))); >+// if (enableDeadline) { >+// assertEquals(deadline, bugtaskdata.getAttributeValue(BugzillaReportElement.DEADLINE.getKey())); >+// } >+// >+// } >+// >+// private String generateNewDay() { >+// int year = 2006; >+// int month = (int) (Math.random() * 12 + 1); >+// int day = (int) (Math.random() * 28 + 1); >+// return "" + year + "-" + ((month <= 9) ? "0" : "") + month + "-" + ((day <= 9) ? "0" : "") + day; >+// } >+// >+// /** >+// * Ensure obsoletes and patches are marked as such by the parser. >+// */ >+// public void testAttachmentAttributes() throws Exception { >+// init222(); >+// int bugId = 19; >+// String taskNumber = "" + bugId; >+// BugzillaTask task = generateLocalTaskAndDownload(taskNumber); >+// >+// // TasksUiPlugin.getSynchronizationManager().synchronize(connector, >+// // task, true, null); >+// >+// assertNotNull(task); >+// >+// boolean isPatch[] = { false, true, false, false, false, false, false, true, false, false }; >+// boolean isObsolete[] = { false, true, false, true, false, false, false, false, false, false }; >+// >+// RepositoryTaskData taskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(task.getRepositoryUrl(), >+// task.getTaskId()); >+// >+// Iterator<RepositoryAttachment> iter = taskData.getAttachments().iterator(); >+// >+// int index = 0; >+// while (iter.hasNext()) { >+// assertTrue(validateAttachmentAttributes(iter.next(), isPatch[index], isObsolete[index])); >+// index++; >+// } >+// } >+// >+// >+// private boolean validateAttachmentAttributes(RepositoryAttachment att, boolean isPatch, boolean isObsolete) { >+// return (att.isPatch() == isPatch) && (att.isObsolete() == isObsolete); >+// } > > // public void testSimpleLoad() throws Exception { > // repository = new TaskRepository(DEFAULT_KIND, >Index: src/org/eclipse/mylyn/bugzilla/tests/BugzillaProductParserTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaProductParserTest.java,v >retrieving revision 1.34 >diff -u -r1.34 BugzillaProductParserTest.java >--- src/org/eclipse/mylyn/bugzilla/tests/BugzillaProductParserTest.java 14 Apr 2008 04:25:48 -0000 1.34 >+++ src/org/eclipse/mylyn/bugzilla/tests/BugzillaProductParserTest.java 22 May 2008 17:19:01 -0000 >@@ -43,7 +43,7 @@ > } > > private TaskRepository setRepository(String url) { >- repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, url); >+ repository = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, url); > Credentials credentials = TestUtil.readCredentials(); > repository.setAuthenticationCredentials(credentials.username, credentials.password); > return repository; >Index: src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java,v >retrieving revision 1.55 >diff -u -r1.55 AbstractBugzillaTest.java >--- src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java 16 May 2008 19:52:52 -0000 1.55 >+++ src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java 22 May 2008 17:19:01 -0000 >@@ -14,16 +14,16 @@ > > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.NullProgressMonitor; >+import org.eclipse.mylyn.commons.net.AuthenticationCredentials; >+import org.eclipse.mylyn.commons.net.AuthenticationType; > import org.eclipse.mylyn.context.tests.support.TestUtil; > import org.eclipse.mylyn.context.tests.support.TestUtil.Credentials; > import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin; > import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector; >-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaTask; > import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants; > import org.eclipse.mylyn.internal.tasks.core.AbstractTask; > import org.eclipse.mylyn.internal.tasks.core.TaskList; > import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskData; > import org.eclipse.mylyn.internal.tasks.ui.ITasksUiPreferenceConstants; > import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin; > import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal; >@@ -31,6 +31,8 @@ > import org.eclipse.mylyn.tasks.core.ITask; > import org.eclipse.mylyn.tasks.core.TaskRepository; > import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState; >+import org.eclipse.mylyn.tasks.core.data.TaskAttribute; >+import org.eclipse.mylyn.tasks.core.data.TaskData; > > /** > * @author Mik Kersten >@@ -39,7 +41,7 @@ > */ > public abstract class AbstractBugzillaTest extends TestCase { > >- static final String DEFAULT_KIND = BugzillaCorePlugin.REPOSITORY_KIND; >+ static final String DEFAULT_KIND = BugzillaCorePlugin.CONNECTOR_KIND; > > protected BugzillaRepositoryConnector connector; > >@@ -58,7 +60,7 @@ > super.setUp(); > TasksUiPlugin.getDefault().getPreferenceStore().setValue( > ITasksUiPreferenceConstants.REPOSITORY_SYNCH_SCHEDULE_ENABLED, false); >- TasksUiPlugin.getTaskDataStorageManager().clear(); >+ //TasksUiPlugin.getTaskDataManager().clear(); > manager = TasksUiPlugin.getRepositoryManager(); > TasksUiPlugin.getDefault().reloadDataDirectory(); > manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); >@@ -99,7 +101,8 @@ > protected void init(String url) { > repository = new TaskRepository(DEFAULT_KIND, url); > Credentials credentials = TestUtil.readCredentials(); >- repository.setAuthenticationCredentials(credentials.username, credentials.password); >+ repository.setCredentials(AuthenticationType.REPOSITORY, new AuthenticationCredentials(credentials.username, >+ credentials.password), false); > > repository.setTimeZoneId("Canada/Eastern"); > assertNotNull(manager); >@@ -114,17 +117,17 @@ > connector = (BugzillaRepositoryConnector) abstractRepositoryClient; > } > >- protected BugzillaTask generateLocalTaskAndDownload(String taskNumber) throws CoreException { >- BugzillaTask task = (BugzillaTask) TasksUiInternal.createTask(repository, taskNumber, new NullProgressMonitor()); >+ protected ITask generateLocalTaskAndDownload(String taskNumber) throws CoreException { >+ ITask task = TasksUiInternal.createTask(repository, taskNumber, new NullProgressMonitor()); > TasksUiPlugin.getTaskDataManager().setTaskRead(task, true); > assertNotNull(task); >- TasksUiPlugin.getTaskList().addTask(task, TasksUiPlugin.getTaskList().getDefaultCategory()); >+ //TasksUiPlugin.getTaskList().addTask(task, TasksUiPlugin.getTaskList().getDefaultCategory()); > > return task; > } > >- protected void submit(ITask task, RepositoryTaskData taskData) throws CoreException { >- connector.getLegacyTaskDataHandler().postTaskData(repository, taskData, new NullProgressMonitor()); >+ protected void submit(ITask task, TaskData taskData, Set<TaskAttribute> changedAttributes) throws CoreException { >+ connector.getTaskDataHandler().postTaskData(repository, taskData, changedAttributes, new NullProgressMonitor()); > ((AbstractTask) task).setSubmitting(true); > } > >Index: src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaTaskHistoryTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaTaskHistoryTest.java,v >retrieving revision 1.11 >diff -u -r1.11 BugzillaTaskHistoryTest.java >--- src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaTaskHistoryTest.java 15 Apr 2008 02:27:17 -0000 1.11 >+++ src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaTaskHistoryTest.java 22 May 2008 17:19:02 -0000 >@@ -44,7 +44,7 @@ > super.setUp(); > connector = new BugzillaRepositoryConnector(); > connector.init(new TaskList()); >- repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); >+ repository = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); > > Credentials credentials = TestUtil.readCredentials(); > repository.setAuthenticationCredentials(credentials.username, credentials.password); >Index: src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaQueryTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaQueryTest.java,v >retrieving revision 1.49 >diff -u -r1.49 BugzillaQueryTest.java >--- src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaQueryTest.java 8 May 2008 17:53:48 -0000 1.49 >+++ src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaQueryTest.java 22 May 2008 17:19:02 -0000 >@@ -53,7 +53,7 @@ > super.setUp(); > > connectorOriginal = (AbstractLegacyRepositoryConnector) TasksUiPlugin.getRepositoryManager() >- .getRepositoryConnector(BugzillaCorePlugin.REPOSITORY_KIND); >+ .getRepositoryConnector(BugzillaCorePlugin.CONNECTOR_KIND); > > BugzillaLanguageSettings language = BugzillaCorePlugin.getDefault().getLanguageSetting( > IBugzillaConstants.DEFAULT_LANG); >@@ -62,7 +62,7 @@ > connector.init(new TaskList()); > connector.addLanguageSetting(language); > handler = connector.getLegacyTaskDataHandler(); >- repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); >+ repository = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); > Credentials credentials = TestUtil.readCredentials(); > repository.setAuthenticationCredentials(credentials.username, credentials.password); > } >@@ -94,7 +94,7 @@ > > // You can use the getAttributeValue to pull up the information on any > // part of the bug >- assertEquals("P1", taskData.getAttributeValue(BugzillaReportElement.PRIORITY.getKeyString())); >+ assertEquals("P1", taskData.getAttributeValue(BugzillaReportElement.PRIORITY.getKey())); > } > > // TODO: Uncomment when bug#176513 completed >Index: .refactorings/2008/5/21/refactorings.index >=================================================================== >RCS file: .refactorings/2008/5/21/refactorings.index >diff -N .refactorings/2008/5/21/refactorings.index >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ .refactorings/2008/5/21/refactorings.index 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,1 @@ >+1211341606664 Change method 'submit' >Index: .refactorings/2008/5/21/refactorings.history >=================================================================== >RCS file: .refactorings/2008/5/21/refactorings.history >diff -N .refactorings/2008/5/21/refactorings.history >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ .refactorings/2008/5/21/refactorings.history 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,4 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<session version="1.0"> >+<refactoring comment="Change method 'protected void org.eclipse.mylyn.bugzilla.tests.AbstractBugzillaTest.submit(ITask task, TaskData taskData) throws CoreException' to 'protected void submit(ITask task, TaskData taskData, Set<TaskAttribute> changedAttributes) throws CoreException'
- Original project: 'org.eclipse.mylyn.bugzilla.tests'
- Original element: 'org.eclipse.mylyn.bugzilla.tests.AbstractBugzillaTest.submit(...)'
- Added parameters:
 Set<TaskAttribute> changedAttributes" default3="null" delegate="false" deprecate="true" description="Change method 'submit'" element1="=org.eclipse.mylyn.jira.core/C:\/apps\/eclipse-3.4\/M7\/head\/plugins\/org.eclipse.equinox.common_3.4.0.v20080421-2006.jar<org.eclipse.core.runtime(CoreException.class[CoreException" flags="589830" id="org.eclipse.jdt.ui.change.method.signature" input="/src<org.eclipse.mylyn.bugzilla.tests{AbstractBugzillaTest.java[AbstractBugzillaTest~submit~QITask;~QTaskData;" kind1="0" name="submit" parameter1="ITask task 0 ITask task false" parameter2="TaskData taskData 1 TaskData taskData false" parameter3="{added} {added} -1 Set<TaskAttribute> changedAttributes false" stamp="1211341606664" version="1.0"/> >+</session> >Index: src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest2.java >=================================================================== >RCS file: src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest2.java >diff -N src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest2.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest2.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,63 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2007 Mylyn project committers 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 >+ *******************************************************************************/ >+ >+package org.eclipse.mylyn.bugzilla.tests; >+ >+import java.text.ParseException; >+import java.text.SimpleDateFormat; >+ >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.NullProgressMonitor; >+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaReportElement; >+import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants; >+import org.eclipse.mylyn.tasks.core.ITask.PriorityLevel; >+import org.eclipse.mylyn.tasks.core.data.TaskAttribute; >+import org.eclipse.mylyn.tasks.core.data.TaskCommentMapper; >+import org.eclipse.mylyn.tasks.core.data.TaskData; >+import org.eclipse.mylyn.tasks.core.data.TaskMapper; >+ >+public class BugzillaRepositoryConnectorTest2 extends AbstractBugzillaTest { >+ >+ public void testDataRetrieval() throws CoreException, ParseException { >+ init(IBugzillaConstants.TEST_BUGZILLA_30_URL); >+ TaskData data = connector.getTaskData(repository, "2", new NullProgressMonitor()); >+ assertNotNull(data); >+ TaskMapper mapper = new TaskMapper(data); >+ assertEquals("2", data.getTaskId()); >+ assertEquals("New bug submit", mapper.getSummary()); >+ assertEquals("Test new bug submission", mapper.getDescription()); >+ assertEquals(PriorityLevel.P2, mapper.getPriority()); >+ assertEquals("TestComponent", mapper.getComponent()); >+ assertEquals("nhapke@cs.ubc.ca", mapper.getOwner()); >+ assertEquals("TestProduct", mapper.getProduct()); >+ assertEquals("PC", mapper.getValue(BugzillaReportElement.REP_PLATFORM.getKey())); >+ assertEquals("Windows", mapper.getValue(BugzillaReportElement.OP_SYS.getKey())); >+ assertEquals("ASSIGNED", mapper.getValue(BugzillaReportElement.BUG_STATUS.getKey())); >+ SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm"); >+ SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); >+ assertEquals(format1.parse("2007-03-20 16:37"), mapper.getCreationDate()); >+ assertEquals(format2.parse("2007-12-06 20:50:00"), mapper.getModificationDate()); >+ >+ //assertEquals("", mapper.getTaskUrl()); >+ //assertEquals("bugzilla", mapper.getTaskKind()); >+ //assertEquals("", mapper.getTaskKey()); >+ >+ // test comments >+ TaskAttribute comments = data.getMappedAttribute(TaskAttribute.CONTAINER_COMMENTS); >+ assertEquals(12, comments.getAttributes().size()); >+ TaskCommentMapper commentMap = TaskCommentMapper.createFrom(comments.getAttribute("0")); >+ assertEquals("Rob Elves", commentMap.getAuthor().getName()); >+ assertEquals("Test new bug submission", commentMap.getText()); >+ commentMap = TaskCommentMapper.createFrom(comments.getAttribute("1")); >+ assertEquals("Rob Elves", commentMap.getAuthor().getName()); >+ assertEquals("Created an attachment (id=1)\ntest\n\ntest attachments", commentMap.getText()); >+ commentMap = TaskCommentMapper.createFrom(comments.getAttribute("11")); >+ assertEquals("Tests", commentMap.getAuthor().getName()); >+ assertEquals("test", commentMap.getText()); >+ } >+} >#P org.eclipse.mylyn.bugzilla.ui >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.ui/plugin.xml,v >retrieving revision 1.98 >diff -u -r1.98 plugin.xml >--- plugin.xml 20 May 2008 01:29:35 -0000 1.98 >+++ plugin.xml 22 May 2008 17:19:06 -0000 >@@ -18,10 +18,9 @@ > class="org.eclipse.mylyn.internal.bugzilla.ui.tasklist.BugzillaConnectorUi" > name="Bugzilla Repository Ui" > overlayIcon="icons/eview16/overlay-bugzilla.gif"/> >- >- <taskListFactory >- class="org.eclipse.mylyn.internal.bugzilla.ui.tasklist.BugzillaTaskListFactory" >- id="org.eclipse.mylyn.bugzilla.tasklist.factory"/> >+ >+ <taskListMigrator >+ class="org.eclipse.mylyn.internal.bugzilla.ui.tasklist.BugzillaTaskListMigrator"/> > </extension> > <extension > point="org.eclipse.mylyn.bugzilla.core.languages"> >@@ -60,9 +59,12 @@ > </language> > </extension> > >- <extension >+ <extension > point="org.eclipse.mylyn.tasks.ui.editors"> >- <editorFactory class="org.eclipse.mylyn.internal.bugzilla.ui.tasklist.BugzillaTaskEditorFactory"/> >+ <pageFactory >+ class="org.eclipse.mylyn.internal.bugzilla.ui.editor.BugzillaTaskEditorPageFactory" >+ id="org.eclipse.mylyn.bugzilla.ui.pageFactory"> >+ </pageFactory> > </extension> > > </plugin> >Index: src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskEditorFactory.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskEditorFactory.java,v >retrieving revision 1.18 >diff -u -r1.18 BugzillaTaskEditorFactory.java >--- src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskEditorFactory.java 13 May 2008 06:35:46 -0000 1.18 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskEditorFactory.java 22 May 2008 17:19:06 -0000 >@@ -52,7 +52,7 @@ > if (task instanceof BugzillaTask) { > BugzillaTask bugzillaTask = (BugzillaTask) task; > final TaskRepository repository = TasksUi.getRepositoryManager().getRepository( >- BugzillaCorePlugin.REPOSITORY_KIND, bugzillaTask.getRepositoryUrl()); >+ BugzillaCorePlugin.CONNECTOR_KIND, bugzillaTask.getRepositoryUrl()); > BugzillaTaskEditorInput input = new BugzillaTaskEditorInput(repository, bugzillaTask, true); > return input; > } >@@ -77,7 +77,7 @@ > @Override > public boolean canCreateEditorFor(IEditorInput input) { > if (input instanceof RepositoryTaskEditorInput) { >- return BugzillaCorePlugin.REPOSITORY_KIND.equals(((RepositoryTaskEditorInput) input).getRepository() >+ return BugzillaCorePlugin.CONNECTOR_KIND.equals(((RepositoryTaskEditorInput) input).getRepository() > .getConnectorKind()); > } > return false; >Index: src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaConnectorUi.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaConnectorUi.java,v >retrieving revision 1.21 >diff -u -r1.21 BugzillaConnectorUi.java >--- src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaConnectorUi.java 9 May 2008 19:58:37 -0000 1.21 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaConnectorUi.java 22 May 2008 17:19:06 -0000 >@@ -199,7 +199,7 @@ > > @Override > public String getConnectorKind() { >- return BugzillaCorePlugin.REPOSITORY_KIND; >+ return BugzillaCorePlugin.CONNECTOR_KIND; > } > > @SuppressWarnings("restriction") >@@ -210,7 +210,7 @@ > // we wouldn't have to get the task data this way from here > RepositoryTaskData taskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData( > task.getRepositoryUrl(), task.getTaskId()); >- if (taskData != null && taskData.getAttribute(BugzillaReportElement.ESTIMATED_TIME.getKeyString()) != null) { >+ if (taskData != null && taskData.getAttribute(BugzillaReportElement.ESTIMATED_TIME.getKey()) != null) { > return true; > } > } >Index: src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskEditorInput.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskEditorInput.java,v >retrieving revision 1.45 >diff -u -r1.45 BugzillaTaskEditorInput.java >--- src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskEditorInput.java 7 May 2008 18:31:01 -0000 1.45 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskEditorInput.java 22 May 2008 17:19:06 -0000 >@@ -14,9 +14,9 @@ > import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin; > import org.eclipse.mylyn.internal.bugzilla.core.BugzillaTask; > import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration; >-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskData; > import org.eclipse.mylyn.internal.tasks.ui.deprecated.RepositoryTaskEditorInput; > import org.eclipse.mylyn.tasks.core.TaskRepository; >+import org.eclipse.mylyn.tasks.core.data.TaskData; > import org.eclipse.ui.IPersistableElement; > > /** >@@ -33,8 +33,8 @@ > public BugzillaTaskEditorInput(TaskRepository repository, BugzillaTask bugzillaTask, boolean offline) { > super(repository, bugzillaTask.getTaskId(), bugzillaTask.getUrl()); > this.bugTask = bugzillaTask; >- updateOptions(getTaskData()); >- updateOptions(getOldTaskData()); >+// updateOptions(getTaskData()); >+// updateOptions(getOldTaskData()); > } > > protected void setBugTitle(String str) { >@@ -70,7 +70,7 @@ > return bugTask; > } > >- private void updateOptions(RepositoryTaskData taskData) { >+ private void updateOptions(TaskData taskData) { > try { > if (taskData != null) { > RepositoryConfiguration config = BugzillaCorePlugin.getRepositoryConfiguration(repository, false, >Index: src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/NewBugzillaQueryWizard.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/NewBugzillaQueryWizard.java,v >retrieving revision 1.44 >diff -u -r1.44 NewBugzillaQueryWizard.java >--- src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/NewBugzillaQueryWizard.java 8 May 2008 17:53:42 -0000 1.44 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/NewBugzillaQueryWizard.java 22 May 2008 17:19:06 -0000 >@@ -57,7 +57,7 @@ > BugzillaRepositoryQuery queryCategory = (BugzillaRepositoryQuery) page.getQuery(); > TasksUiInternal.getTaskList().addQuery(queryCategory); > AbstractLegacyRepositoryConnector connector = (AbstractLegacyRepositoryConnector) TasksUi.getRepositoryManager() >- .getRepositoryConnector(BugzillaCorePlugin.REPOSITORY_KIND); >+ .getRepositoryConnector(BugzillaCorePlugin.CONNECTOR_KIND); > TasksUiInternal.synchronizeQuery(connector, queryCategory, null, true); > return true; > } >Index: src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskListFactory.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskListFactory.java,v >retrieving revision 1.9 >diff -u -r1.9 BugzillaTaskListFactory.java >--- src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskListFactory.java 9 May 2008 19:58:37 -0000 1.9 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskListFactory.java 22 May 2008 17:19:06 -0000 >@@ -22,7 +22,9 @@ > > /** > * @author Mik Kersten >+ * @deprecated see BugzillaTaskListMigrator > */ >+@Deprecated > public class BugzillaTaskListFactory extends AbstractTaskListFactory { > > private static final String KEY_SEVERITY = "bugzilla.severity"; >Index: src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java,v >retrieving revision 1.84 >diff -u -r1.84 BugzillaRepositorySettingsPage.java >--- src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java 9 May 2008 19:58:37 -0000 1.84 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java 22 May 2008 17:19:06 -0000 >@@ -535,7 +535,7 @@ > > @Override > public String getConnectorKind() { >- return BugzillaCorePlugin.REPOSITORY_KIND; >+ return BugzillaCorePlugin.CONNECTOR_KIND; > } > > } >Index: src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditor.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditor.java,v >retrieving revision 1.114 >diff -u -r1.114 BugzillaTaskEditor.java >--- src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditor.java 13 May 2008 06:35:46 -0000 1.114 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditor.java 22 May 2008 17:19:06 -0000 >@@ -198,7 +198,7 @@ > // ignore > } > >- attribute = this.taskData.getAttribute(BugzillaReportElement.DEPENDSON.getKeyString()); >+ attribute = this.taskData.getAttribute(BugzillaReportElement.DEPENDSON.getKey()); > if (attribute != null && !attribute.isReadOnly()) { > Label label = createLabel(composite, attribute); > GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(label); >@@ -216,7 +216,7 @@ > getManagedForm().getToolkit().paintBordersFor(textFieldComposite); > } > >- attribute = this.taskData.getAttribute(BugzillaReportElement.BLOCKED.getKeyString()); >+ attribute = this.taskData.getAttribute(BugzillaReportElement.BLOCKED.getKey()); > if (attribute != null && !attribute.isReadOnly()) { > Label label = createLabel(composite, attribute); > GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(label); >@@ -234,23 +234,23 @@ > getManagedForm().getToolkit().paintBordersFor(textFieldComposite); > } > >- String dependson = taskData.getAttributeValue(BugzillaReportElement.DEPENDSON.getKeyString()); >- String blocked = taskData.getAttributeValue(BugzillaReportElement.BLOCKED.getKeyString()); >+ String dependson = taskData.getAttributeValue(BugzillaReportElement.DEPENDSON.getKey()); >+ String blocked = taskData.getAttributeValue(BugzillaReportElement.BLOCKED.getKey()); > boolean addHyperlinks = (dependson != null && dependson.length() > 0) > || (blocked != null && blocked.length() > 0); > > if (addHyperlinks) { > getManagedForm().getToolkit().createLabel(composite, ""); >- addBugHyperlinks(composite, BugzillaReportElement.DEPENDSON.getKeyString()); >+ addBugHyperlinks(composite, BugzillaReportElement.DEPENDSON.getKey()); > } > > if (addHyperlinks) { > getManagedForm().getToolkit().createLabel(composite, ""); >- addBugHyperlinks(composite, BugzillaReportElement.BLOCKED.getKeyString()); >+ addBugHyperlinks(composite, BugzillaReportElement.BLOCKED.getKey()); > } > > // NOTE: urlText should not be back ported to 3.3 due to background color failure >- attribute = this.taskData.getAttribute(BugzillaReportElement.BUG_FILE_LOC.getKeyString()); >+ attribute = this.taskData.getAttribute(BugzillaReportElement.BUG_FILE_LOC.getKey()); > if (attribute != null && !attribute.isReadOnly()) { > Label label = createLabel(composite, attribute); > GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(label); >@@ -280,10 +280,10 @@ > } > } > >- attribute = this.taskData.getAttribute(BugzillaReportElement.STATUS_WHITEBOARD.getKeyString()); >+ attribute = this.taskData.getAttribute(BugzillaReportElement.STATUS_WHITEBOARD.getKey()); > if (attribute == null) { >- this.taskData.setAttributeValue(BugzillaReportElement.STATUS_WHITEBOARD.getKeyString(), ""); >- attribute = this.taskData.getAttribute(BugzillaReportElement.STATUS_WHITEBOARD.getKeyString()); >+ this.taskData.setAttributeValue(BugzillaReportElement.STATUS_WHITEBOARD.getKey(), ""); >+ attribute = this.taskData.getAttribute(BugzillaReportElement.STATUS_WHITEBOARD.getKey()); > } > if (attribute != null && !attribute.isReadOnly()) { > Label label = createLabel(composite, attribute); >@@ -303,11 +303,11 @@ > addVoting(composite); > > // If groups is available add roles >- if (taskData.getAttribute(BugzillaReportElement.GROUP.getKeyString()) != null) { >+ if (taskData.getAttribute(BugzillaReportElement.GROUP.getKey()) != null) { > addRoles(composite); > } > >- if (taskData.getAttribute(BugzillaReportElement.ESTIMATED_TIME.getKeyString()) != null) { >+ if (taskData.getAttribute(BugzillaReportElement.ESTIMATED_TIME.getKey()) != null) { > addBugzillaTimeTracker(getManagedForm().getToolkit(), composite); > } > } >@@ -316,14 +316,14 @@ > if (taskData == null) { > return false; > } >- String customAttributeKeys[] = { BugzillaReportElement.BUG_FILE_LOC.getKeyString(), >- BugzillaReportElement.DEPENDSON.getKeyString(), BugzillaReportElement.BLOCKED.getKeyString(), >- BugzillaReportElement.KEYWORDS.getKeyString(), BugzillaReportElement.VOTES.getKeyString(), >- BugzillaReportElement.REPORTER_ACCESSIBLE.getKeyString(), >- BugzillaReportElement.CCLIST_ACCESSIBLE.getKeyString(), >- BugzillaReportElement.ESTIMATED_TIME.getKeyString(), >- BugzillaReportElement.REMAINING_TIME.getKeyString(), BugzillaReportElement.ACTUAL_TIME.getKeyString(), >- BugzillaReportElement.DEADLINE.getKeyString(), BugzillaReportElement.STATUS_WHITEBOARD.getKeyString() }; >+ String customAttributeKeys[] = { BugzillaReportElement.BUG_FILE_LOC.getKey(), >+ BugzillaReportElement.DEPENDSON.getKey(), BugzillaReportElement.BLOCKED.getKey(), >+ BugzillaReportElement.KEYWORDS.getKey(), BugzillaReportElement.VOTES.getKey(), >+ BugzillaReportElement.REPORTER_ACCESSIBLE.getKey(), >+ BugzillaReportElement.CCLIST_ACCESSIBLE.getKey(), >+ BugzillaReportElement.ESTIMATED_TIME.getKey(), >+ BugzillaReportElement.REMAINING_TIME.getKey(), BugzillaReportElement.ACTUAL_TIME.getKey(), >+ BugzillaReportElement.DEADLINE.getKey(), BugzillaReportElement.STATUS_WHITEBOARD.getKey() }; > for (String key : customAttributeKeys) { > RepositoryTaskAttribute attribute = taskData.getAttribute(key); > if (hasChanged(attribute)) { >@@ -383,10 +383,10 @@ > rolesComposite.setLayoutData(attributesData); > rolesSection.setClient(rolesComposite); > >- RepositoryTaskAttribute attribute = taskData.getAttribute(BugzillaReportElement.REPORTER_ACCESSIBLE.getKeyString()); >+ RepositoryTaskAttribute attribute = taskData.getAttribute(BugzillaReportElement.REPORTER_ACCESSIBLE.getKey()); > if (attribute == null) { >- taskData.setAttributeValue(BugzillaReportElement.REPORTER_ACCESSIBLE.getKeyString(), "0"); >- attribute = taskData.getAttribute(BugzillaReportElement.REPORTER_ACCESSIBLE.getKeyString()); >+ taskData.setAttributeValue(BugzillaReportElement.REPORTER_ACCESSIBLE.getKey(), "0"); >+ attribute = taskData.getAttribute(BugzillaReportElement.REPORTER_ACCESSIBLE.getKey()); > } > Button button = addButtonField(rolesComposite, attribute, SWT.CHECK); > if (hasChanged(attribute)) { >@@ -394,10 +394,10 @@ > } > > attribute = null; >- attribute = taskData.getAttribute(BugzillaReportElement.CCLIST_ACCESSIBLE.getKeyString()); >+ attribute = taskData.getAttribute(BugzillaReportElement.CCLIST_ACCESSIBLE.getKey()); > if (attribute == null) { >- taskData.setAttributeValue(BugzillaReportElement.CCLIST_ACCESSIBLE.getKeyString(), "0"); >- attribute = taskData.getAttribute(BugzillaReportElement.CCLIST_ACCESSIBLE.getKeyString()); >+ taskData.setAttributeValue(BugzillaReportElement.CCLIST_ACCESSIBLE.getKey(), "0"); >+ attribute = taskData.getAttribute(BugzillaReportElement.CCLIST_ACCESSIBLE.getKey()); > } > button = addButtonField(rolesComposite, attribute, SWT.CHECK); > if (hasChanged(attribute)) { >@@ -407,7 +407,7 @@ > > @Override > protected boolean hasContentAssist(RepositoryTaskAttribute attribute) { >- return BugzillaReportElement.NEWCC.getKeyString().equals(attribute.getId()); >+ return BugzillaReportElement.NEWCC.getKey().equals(attribute.getId()); > } > > @Override >@@ -477,7 +477,7 @@ > gd.horizontalSpan = 5; > timeComposite.setLayoutData(gd); > >- RepositoryTaskAttribute attribute = this.taskData.getAttribute(BugzillaReportElement.ESTIMATED_TIME.getKeyString()); >+ RepositoryTaskAttribute attribute = this.taskData.getAttribute(BugzillaReportElement.ESTIMATED_TIME.getKey()); > if (attribute != null && !attribute.isReadOnly()) { > createLabel(timeComposite, attribute); > estimateText = createTextField(timeComposite, attribute, SWT.FLAT); >@@ -488,7 +488,7 @@ > label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE)); > float total = 0; > try { >- total = (Float.parseFloat(taskData.getAttributeValue(BugzillaReportElement.ACTUAL_TIME.getKeyString())) + Float.parseFloat(taskData.getAttributeValue(BugzillaReportElement.REMAINING_TIME.getKeyString()))); >+ total = (Float.parseFloat(taskData.getAttributeValue(BugzillaReportElement.ACTUAL_TIME.getKey())) + Float.parseFloat(taskData.getAttributeValue(BugzillaReportElement.REMAINING_TIME.getKey()))); > } catch (Exception e) { > // ignore likely NumberFormatException > } >@@ -498,7 +498,7 @@ > currentEstimate.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); > currentEstimate.setEditable(false); > >- attribute = this.taskData.getAttribute(BugzillaReportElement.ACTUAL_TIME.getKeyString()); >+ attribute = this.taskData.getAttribute(BugzillaReportElement.ACTUAL_TIME.getKey()); > if (attribute != null) { > > createLabel(timeComposite, attribute); >@@ -508,13 +508,13 @@ > } > > // Add Time >- taskData.setAttributeValue(BugzillaReportElement.WORK_TIME.getKeyString(), "0"); >- final RepositoryTaskAttribute addTimeAttribute = this.taskData.getAttribute(BugzillaReportElement.WORK_TIME.getKeyString()); >+ taskData.setAttributeValue(BugzillaReportElement.WORK_TIME.getKey(), "0"); >+ final RepositoryTaskAttribute addTimeAttribute = this.taskData.getAttribute(BugzillaReportElement.WORK_TIME.getKey()); > if (addTimeAttribute != null) { > > createLabel(timeComposite, addTimeAttribute); > addTimeText = toolkit.createText(timeComposite, >- taskData.getAttributeValue(BugzillaReportElement.WORK_TIME.getKeyString()), SWT.BORDER); >+ taskData.getAttributeValue(BugzillaReportElement.WORK_TIME.getKey()), SWT.BORDER); > addTimeText.setFont(TEXT_FONT); > addTimeText.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); > addTimeText.addModifyListener(new ModifyListener() { >@@ -524,13 +524,13 @@ > } > }); > } >- attribute = this.taskData.getAttribute(BugzillaReportElement.REMAINING_TIME.getKeyString()); >+ attribute = this.taskData.getAttribute(BugzillaReportElement.REMAINING_TIME.getKey()); > if (attribute != null) { > createLabel(timeComposite, attribute); > createTextField(timeComposite, attribute, SWT.FLAT); > } > >- attribute = this.taskData.getAttribute(BugzillaReportElement.DEADLINE.getKeyString()); >+ attribute = this.taskData.getAttribute(BugzillaReportElement.DEADLINE.getKey()); > if (attribute != null) { > createLabel(timeComposite, attribute); > >@@ -540,7 +540,7 @@ > dateWithClear.setLayout(layout); > > deadlinePicker = new DatePicker(dateWithClear, /* SWT.NONE */SWT.BORDER, >- taskData.getAttributeValue(BugzillaReportElement.DEADLINE.getKeyString()), false, 0); >+ taskData.getAttributeValue(BugzillaReportElement.DEADLINE.getKey()), false, 0); > deadlinePicker.setFont(TEXT_FONT); > deadlinePicker.setDatePattern("yyyy-MM-dd"); > if (hasChanged(attribute)) { >@@ -559,13 +559,13 @@ > SimpleDateFormat f = (SimpleDateFormat) DateFormat.getDateInstance(); > f.applyPattern("yyyy-MM-dd"); > >- taskData.setAttributeValue(BugzillaReportElement.DEADLINE.getKeyString(), f.format(d)); >- attributeChanged(taskData.getAttribute(BugzillaReportElement.DEADLINE.getKeyString())); >+ taskData.setAttributeValue(BugzillaReportElement.DEADLINE.getKey(), f.format(d)); >+ attributeChanged(taskData.getAttribute(BugzillaReportElement.DEADLINE.getKey())); > // TODO goes dirty even if user presses cancel > // markDirty(true); > } else { >- taskData.setAttributeValue(BugzillaReportElement.DEADLINE.getKeyString(), ""); >- attributeChanged(taskData.getAttribute(BugzillaReportElement.DEADLINE.getKeyString())); >+ taskData.setAttributeValue(BugzillaReportElement.DEADLINE.getKey(), ""); >+ attributeChanged(taskData.getAttribute(BugzillaReportElement.DEADLINE.getKey())); > deadlinePicker.setDate(null); > } > } >@@ -578,8 +578,8 @@ > > @Override > public void linkActivated(HyperlinkEvent e) { >- taskData.setAttributeValue(BugzillaReportElement.DEADLINE.getKeyString(), ""); >- attributeChanged(taskData.getAttribute(BugzillaReportElement.DEADLINE.getKeyString())); >+ taskData.setAttributeValue(BugzillaReportElement.DEADLINE.getKey(), ""); >+ attributeChanged(taskData.getAttribute(BugzillaReportElement.DEADLINE.getKey())); > deadlinePicker.setDate(null); > } > }); >@@ -661,7 +661,7 @@ > layout.marginWidth = 0; > votingComposite.setLayout(layout); > >- RepositoryTaskAttribute votesAttribute = taskData.getAttribute(BugzillaReportElement.VOTES.getKeyString()); >+ RepositoryTaskAttribute votesAttribute = taskData.getAttribute(BugzillaReportElement.VOTES.getKey()); > > votesText = createTextField(votingComposite, votesAttribute, SWT.FLAT | SWT.READ_ONLY); > votesText.setFont(TEXT_FONT); >@@ -755,10 +755,10 @@ > FormToolkit toolkit = getManagedForm().getToolkit(); > Label dummylabel = toolkit.createLabel(peopleComposite, ""); > GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(dummylabel); >- RepositoryTaskAttribute attribute = taskData.getAttribute(BugzillaReportElement.SET_DEFAULT_ASSIGNEE.getKeyString()); >+ RepositoryTaskAttribute attribute = taskData.getAttribute(BugzillaReportElement.SET_DEFAULT_ASSIGNEE.getKey()); > if (attribute == null) { >- taskData.setAttributeValue(BugzillaReportElement.SET_DEFAULT_ASSIGNEE.getKeyString(), "0"); >- attribute = taskData.getAttribute(BugzillaReportElement.SET_DEFAULT_ASSIGNEE.getKeyString()); >+ taskData.setAttributeValue(BugzillaReportElement.SET_DEFAULT_ASSIGNEE.getKey(), "0"); >+ attribute = taskData.getAttribute(BugzillaReportElement.SET_DEFAULT_ASSIGNEE.getKey()); > } > addButtonField(peopleComposite, attribute, SWT.CHECK); > } >@@ -771,7 +771,7 @@ > } > > // Support comment wrapping for bugzilla 2.18 >- if (attribute.getId().equals(BugzillaReportElement.NEW_COMMENT.getKeyString())) { >+ if (attribute.getId().equals(BugzillaReportElement.NEW_COMMENT.getKey())) { > if (repository.getVersion().startsWith("2.18")) { > attribute.setValue(BugzillaUiPlugin.formatTextToLineWrap(attribute.getValue(), true)); > } >@@ -784,9 +784,9 @@ > > // XXX: Work around for adding QAContact to People section. Update once bug#179254 is complete > boolean haveRealName = false; >- RepositoryTaskAttribute qaContact = taskData.getAttribute(BugzillaReportElement.QA_CONTACT_NAME.getKeyString()); >+ RepositoryTaskAttribute qaContact = taskData.getAttribute(BugzillaReportElement.QA_CONTACT_NAME.getKey()); > if (qaContact == null) { >- qaContact = taskData.getAttribute(BugzillaReportElement.QA_CONTACT.getKeyString()); >+ qaContact = taskData.getAttribute(BugzillaReportElement.QA_CONTACT.getKey()); > } else { > haveRealName = true; > } >@@ -809,7 +809,7 @@ > GridDataFactory.fillDefaults().grab(true, false).applyTo(textField); > if (haveRealName) { > textField.setText(textField.getText() + " <" >- + taskData.getAttributeValue(BugzillaReportElement.QA_CONTACT.getKeyString()) + ">"); >+ + taskData.getAttributeValue(BugzillaReportElement.QA_CONTACT.getKey()) + ">"); > } > } > >Index: src/org/eclipse/mylyn/internal/bugzilla/ui/editor/NewBugzillaTaskEditor.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/NewBugzillaTaskEditor.java,v >retrieving revision 1.51 >diff -u -r1.51 NewBugzillaTaskEditor.java >--- src/org/eclipse/mylyn/internal/bugzilla/ui/editor/NewBugzillaTaskEditor.java 8 May 2008 17:53:42 -0000 1.51 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/editor/NewBugzillaTaskEditor.java 22 May 2008 17:19:06 -0000 >@@ -99,7 +99,7 @@ > descriptionTextViewer.getTextWidget().setFocus(); > return; > } >- RepositoryTaskAttribute attribute = taskData.getAttribute(BugzillaReportElement.COMPONENT.getKeyString()); >+ RepositoryTaskAttribute attribute = taskData.getAttribute(BugzillaReportElement.COMPONENT.getKey()); > String componentValue = attribute.getValue(); > if (componentValue.equals("")) { > MessageDialog.openInformation(this.getSite().getShell(), "Submit Error", >@@ -113,7 +113,7 @@ > @Override > protected void createCustomAttributeLayout(Composite composite) { > >- RepositoryTaskAttribute attribute = this.taskData.getAttribute(BugzillaReportElement.DEPENDSON.getKeyString()); >+ RepositoryTaskAttribute attribute = this.taskData.getAttribute(BugzillaReportElement.DEPENDSON.getKey()); > if (attribute != null && !attribute.isReadOnly()) { > Label label = createLabel(composite, attribute); > GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(label); >@@ -132,7 +132,7 @@ > getManagedForm().getToolkit().paintBordersFor(textFieldComposite); > } > >- attribute = this.taskData.getAttribute(BugzillaReportElement.BLOCKED.getKeyString()); >+ attribute = this.taskData.getAttribute(BugzillaReportElement.BLOCKED.getKey()); > if (attribute != null && !attribute.isReadOnly()) { > Label label = createLabel(composite, attribute); > GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(label); >@@ -153,7 +153,7 @@ > > @Override > protected boolean hasContentAssist(RepositoryTaskAttribute attribute) { >- return BugzillaReportElement.NEWCC.getKeyString().equals(attribute.getId()); >+ return BugzillaReportElement.NEWCC.getKey().equals(attribute.getId()); > } > > /** >@@ -205,10 +205,10 @@ > FormToolkit toolkit = getManagedForm().getToolkit(); > Label dummylabel = toolkit.createLabel(peopleComposite, ""); > GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(dummylabel); >- RepositoryTaskAttribute attribute = taskData.getAttribute(BugzillaReportElement.SET_DEFAULT_ASSIGNEE.getKeyString()); >+ RepositoryTaskAttribute attribute = taskData.getAttribute(BugzillaReportElement.SET_DEFAULT_ASSIGNEE.getKey()); > if (attribute == null) { >- taskData.setAttributeValue(BugzillaReportElement.SET_DEFAULT_ASSIGNEE.getKeyString(), "0"); >- attribute = taskData.getAttribute(BugzillaReportElement.SET_DEFAULT_ASSIGNEE.getKeyString()); >+ taskData.setAttributeValue(BugzillaReportElement.SET_DEFAULT_ASSIGNEE.getKey(), "0"); >+ attribute = taskData.getAttribute(BugzillaReportElement.SET_DEFAULT_ASSIGNEE.getKey()); > } > addButtonField(peopleComposite, attribute, SWT.CHECK); > } >Index: src/org/eclipse/mylyn/internal/bugzilla/ui/wizard/NewBugzillaTaskWizard.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/wizard/NewBugzillaTaskWizard.java,v >retrieving revision 1.30 >diff -u -r1.30 NewBugzillaTaskWizard.java >--- src/org/eclipse/mylyn/internal/bugzilla/ui/wizard/NewBugzillaTaskWizard.java 13 May 2008 06:35:46 -0000 1.30 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/wizard/NewBugzillaTaskWizard.java 22 May 2008 17:19:06 -0000 >@@ -58,7 +58,7 @@ > > public NewBugzillaTaskWizard(TaskRepository repository) { > this(false, repository); >- taskData = new RepositoryTaskData(new BugzillaAttributeFactory(), BugzillaCorePlugin.REPOSITORY_KIND, >+ taskData = new RepositoryTaskData(new BugzillaAttributeFactory(), BugzillaCorePlugin.CONNECTOR_KIND, > repository.getRepositoryUrl(), TasksUiPlugin.getDefault().getNextNewRepositoryTaskId()); > taskData.setNew(true); > super.setDefaultPageImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin( >Index: src/org/eclipse/mylyn/internal/bugzilla/ui/wizard/BugzillaProductPage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/wizard/BugzillaProductPage.java,v >retrieving revision 1.89 >diff -u -r1.89 BugzillaProductPage.java >--- src/org/eclipse/mylyn/internal/bugzilla/ui/wizard/BugzillaProductPage.java 8 May 2008 17:53:42 -0000 1.89 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/wizard/BugzillaProductPage.java 22 May 2008 17:19:06 -0000 >@@ -420,7 +420,7 @@ > */ > public void saveDataToModel() throws CoreException { > RepositoryTaskData model = bugWizard.taskData; >- model.setAttributeValue(BugzillaReportElement.PRODUCT.getKeyString(), >+ model.setAttributeValue(BugzillaReportElement.PRODUCT.getKey(), > (String) ((IStructuredSelection) productList.getViewer().getSelection()).getFirstElement()); > AbstractLegacyRepositoryConnector connector = (AbstractLegacyRepositoryConnector) TasksUi.getRepositoryManager() > .getRepositoryConnector(repository.getConnectorKind()); >Index: src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaCompareNode.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaCompareNode.java,v >retrieving revision 1.15 >diff -u -r1.15 BugzillaCompareNode.java >--- src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaCompareNode.java 8 May 2008 17:53:42 -0000 1.15 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaCompareNode.java 22 May 2008 17:19:06 -0000 >@@ -199,7 +199,7 @@ > for (TaskComment taskComment : bug.getComments()) { > String bodyString = "Comment from " + taskComment.getAuthorName() + ":\n\n" + taskComment.getText(); > comments.addChild(new BugzillaCompareNode( >- taskComment.getAttributeValue(BugzillaReportElement.BUG_WHEN.getKeyString()), bodyString, >+ taskComment.getAttributeValue(BugzillaReportElement.BUG_WHEN.getKey()), bodyString, > defaultImage)); > } > topNode.addChild(comments); >Index: src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaUiExtensionReader.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaUiExtensionReader.java,v >retrieving revision 1.7 >diff -u -r1.7 BugzillaUiExtensionReader.java >--- src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaUiExtensionReader.java 8 May 2008 17:53:42 -0000 1.7 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaUiExtensionReader.java 22 May 2008 17:19:06 -0000 >@@ -75,7 +75,7 @@ > > if (languageName != null) { > BugzillaRepositoryConnector connector = (BugzillaRepositoryConnector) TasksUi.getRepositoryManager() >- .getRepositoryConnector(BugzillaCorePlugin.REPOSITORY_KIND); >+ .getRepositoryConnector(BugzillaCorePlugin.CONNECTOR_KIND); > > BugzillaLanguageSettings bugzillaLanguageSettings = new BugzillaLanguageSettings(languageName); > >Index: src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaUiPlugin.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaUiPlugin.java,v >retrieving revision 1.54 >diff -u -r1.54 BugzillaUiPlugin.java >--- src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaUiPlugin.java 8 May 2008 17:53:42 -0000 1.54 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaUiPlugin.java 22 May 2008 17:19:06 -0000 >@@ -87,7 +87,7 @@ > } > > BugzillaRepositoryConnector bugzillaConnector = (BugzillaRepositoryConnector) TasksUi.getRepositoryManager() >- .getRepositoryConnector(BugzillaCorePlugin.REPOSITORY_KIND); >+ .getRepositoryConnector(BugzillaCorePlugin.CONNECTOR_KIND); > > TasksUi.getRepositoryManager().addListener(bugzillaConnector.getClientManager()); > >@@ -116,7 +116,7 @@ > public void stop(BundleContext context) throws Exception { > > BugzillaRepositoryConnector bugzillaConnector = (BugzillaRepositoryConnector) TasksUi.getRepositoryManager() >- .getRepositoryConnector(BugzillaCorePlugin.REPOSITORY_KIND); >+ .getRepositoryConnector(BugzillaCorePlugin.CONNECTOR_KIND); > > TasksUi.getRepositoryManager().removeListener(bugzillaConnector.getClientManager()); > >Index: src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPageFactory.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPageFactory.java >diff -N src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPageFactory.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPageFactory.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,58 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2007 Mylyn project committers 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 >+ *******************************************************************************/ >+ >+package org.eclipse.mylyn.internal.bugzilla.ui.editor; >+ >+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin; >+import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages; >+import org.eclipse.mylyn.tasks.ui.ITasksUiConstants; >+import org.eclipse.mylyn.tasks.ui.TasksUi; >+import org.eclipse.mylyn.tasks.ui.TasksUiImages; >+import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPageFactory; >+import org.eclipse.mylyn.tasks.ui.editors.TaskEditor; >+import org.eclipse.mylyn.tasks.ui.editors.TaskEditorInput; >+import org.eclipse.swt.graphics.Image; >+import org.eclipse.ui.forms.editor.FormPage; >+ >+/** >+ * @author Rob Elves >+ */ >+public class BugzillaTaskEditorPageFactory extends AbstractTaskEditorPageFactory { >+ >+ @Override >+ public boolean canCreatePageFor(TaskEditorInput input) { >+ if (input.getTask().getConnectorKind().equals(BugzillaCorePlugin.CONNECTOR_KIND)) { >+ return true; >+ } >+ return TasksUi.getTaskDataManager().hasTaskData(input.getTask()); >+ } >+ >+ @Override >+ public FormPage createPage(TaskEditor parentEditor) { >+ return new BugzillaTaskEditorPage(parentEditor); >+ } >+ >+ @Override >+ public String[] getConflictingIds(TaskEditorInput input) { >+ if (!input.getTask().getConnectorKind().equals(BugzillaCorePlugin.CONNECTOR_KIND)) { >+ return new String[] { ITasksUiConstants.ID_PAGE_PLANNING }; >+ } >+ return null; >+ } >+ >+ @Override >+ public Image getPageImage() { >+ return CommonImages.getImage(TasksUiImages.REPOSITORY); >+ } >+ >+ @Override >+ public String getPageText() { >+ return "Bugzilla"; >+ } >+ >+} >Index: src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskListMigrator.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskListMigrator.java >diff -N src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskListMigrator.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskListMigrator.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,75 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2007 Mylyn project committers 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 >+ *******************************************************************************/ >+ >+package org.eclipse.mylyn.internal.bugzilla.ui.tasklist; >+ >+import java.util.HashSet; >+import java.util.Set; >+ >+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin; >+import org.eclipse.mylyn.tasks.core.AbstractTaskListMigrator; >+import org.eclipse.mylyn.tasks.core.IRepositoryQuery; >+import org.eclipse.mylyn.tasks.core.ITask; >+import org.w3c.dom.Element; >+ >+/** >+ * @author Rob Elves >+ * @since 3.0 >+ */ >+public class BugzillaTaskListMigrator extends AbstractTaskListMigrator { >+ >+ private static final String KEY_QUERY = "Query"; >+ >+ private static final String TAG_BUGZILLA = "Bugzilla"; >+ >+ private static final String TAG_BUGZILLA_QUERY = TAG_BUGZILLA + KEY_QUERY; >+ >+ private static final String TAG_BUGZILLA_CUSTOM_QUERY = "BugzillaCustom" + KEY_QUERY; >+ >+ private static final String TAG_BUGZILLA_REPORT = "BugzillaReport"; >+ >+ private static final String KEY_SEVERITY = "bugzilla.severity"; >+ >+ private static final String KEY_PRODUCT = "bugzilla.product"; >+ >+ @Override >+ public String getConnectorKind() { >+ return BugzillaCorePlugin.CONNECTOR_KIND; >+ } >+ >+ @Override >+ public Set<String> getQueryElementNames() { >+ Set<String> names = new HashSet<String>(); >+ names.add(TAG_BUGZILLA_QUERY); >+ names.add(TAG_BUGZILLA_CUSTOM_QUERY); >+ return names; >+ } >+ >+ @Override >+ public String getTaskElementName() { >+ return TAG_BUGZILLA_REPORT; >+ } >+ >+ @Override >+ public void migrateQuery(IRepositoryQuery query, Element element) { >+ if (element.getNodeName().equals(TAG_BUGZILLA_CUSTOM_QUERY)) { >+ query.setAttribute(TAG_BUGZILLA_CUSTOM_QUERY, "true"); >+ } >+ } >+ >+ @Override >+ public void migrateTask(ITask task, Element element) { >+ if (element.hasAttribute(KEY_SEVERITY)) { >+ task.setAttribute(KEY_SEVERITY, element.getAttribute(KEY_SEVERITY)); >+ } >+ if (element.hasAttribute(KEY_PRODUCT)) { >+ task.setAttribute(KEY_PRODUCT, element.getAttribute(KEY_PRODUCT)); >+ } >+ } >+ >+} >Index: src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java >diff -N src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,24 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2007 Mylyn project committers 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 >+ *******************************************************************************/ >+ >+package org.eclipse.mylyn.internal.bugzilla.ui.editor; >+ >+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin; >+import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage; >+import org.eclipse.mylyn.tasks.ui.editors.TaskEditor; >+ >+/** >+ * @author Rob Elves >+ */ >+public class BugzillaTaskEditorPage extends AbstractTaskEditorPage { >+ >+ public BugzillaTaskEditorPage(TaskEditor editor) { >+ super(editor, BugzillaCorePlugin.CONNECTOR_KIND); >+ } >+ >+} >Index: .refactorings/2008/5/20/refactorings.history >=================================================================== >RCS file: .refactorings/2008/5/20/refactorings.history >diff -N .refactorings/2008/5/20/refactorings.history >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ .refactorings/2008/5/20/refactorings.history 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,4 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<session version="1.0"> >+<refactoring comment="Move 1 elements(s) to 'org.eclipse.mylyn.bugzilla.ui/src/org.eclipse.mylyn.internal.bugzilla.ui.tasklist'
- Original project: 'org.eclipse.mylyn.bugzilla.ui'
- Destination element: 'org.eclipse.mylyn.bugzilla.ui/src/org.eclipse.mylyn.internal.bugzilla.ui.tasklist'
- Original element: 'org.eclipse.mylyn.internal.bugzilla.ui.BugzillaTaskListMigrator.java'
- Update references to refactored element" description="Move compilation unit" destination="/src<org.eclipse.mylyn.internal.bugzilla.ui.tasklist" element1="/src<org.eclipse.mylyn.internal.bugzilla.ui{BugzillaTaskListMigrator.java" files="0" flags="589830" folders="0" id="org.eclipse.jdt.ui.move" policy="org.eclipse.jdt.ui.moveResources" qualified="false" references="true" stamp="1210972267786" units="1" version="1.0"/> >+</session> >Index: .refactorings/2008/5/20/refactorings.index >=================================================================== >RCS file: .refactorings/2008/5/20/refactorings.index >diff -N .refactorings/2008/5/20/refactorings.index >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ .refactorings/2008/5/20/refactorings.index 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,1 @@ >+1210972267786 Move compilation unit
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 Raw
Actions:
View
Attachments on
bug 229655
:
101414
| 101563 |
101652
|
101845
|
101869
|
102075