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 101414 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.
[patch]
In progress 1
BugzillaPort.patch (text/plain), 80.89 KB, created by
Robert Elves
on 2008-05-21 22:08:18 EDT
(
hide
)
Description:
In progress 1
Filename:
MIME Type:
Creator:
Robert Elves
Created:
2008-05-21 22:08:18 EDT
Size:
80.89 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#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 21 May 2008 22:30:37 -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/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 21 May 2008 22:30:37 -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/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 21 May 2008 22:30:37 -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/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 21 May 2008 22:30:36 -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/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 21 May 2008 22:30:36 -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/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 21 May 2008 22:30:36 -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/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 21 May 2008 22:30:37 -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 21 May 2008 22:30:36 -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/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 21 May 2008 22:30:36 -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: .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: 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.tasks.core >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.8 >diff -u -r1.8 TaskDataState.java >--- src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataState.java 5 May 2008 16:40:31 -0000 1.8 >+++ src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataState.java 21 May 2008 22:30:40 -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) { >#P org.eclipse.mylyn.bugzilla.core >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 21 May 2008 22:30:44 -0000 >@@ -14,12 +14,11 @@ > import java.util.Locale; > 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.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.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 +36,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 List<TaskComment> longDescs; >+ private TaskData repositoryTaskData; >+ >+ private List<TaskAttribute> 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 +124,21 @@ > 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++); > 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); >+ taskComment.createAttribute(BugzillaReportElement.WHO_NAME.getKey()).setValue(name); > } > } > } >@@ -136,9 +147,9 @@ > 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); >+ repositoryTaskData.getRoot() >+ .createAttribute(BugzillaReportElement.REPORTER_NAME.getKey()) >+ .setValue(name); > } > } > break; >@@ -146,23 +157,16 @@ > 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); >+ repositoryTaskData.getRoot() >+ .createAttribute(BugzillaReportElement.ASSIGNED_TO_NAME.getKey()) >+ .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 +179,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 +187,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 +216,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 +251,12 @@ > > // Attachment attributes > case ATTACHID: >+ attachment = attachmentContainer.createAttribute(parsedText); >+ 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 +264,15 @@ > case TYPE: > case SIZE: > if (attachment != null) { >- RepositoryTaskAttribute attr = attributeFactory.createAttribute(tag.getKeyString()); >- attr.setValue(parsedText); >- attachment.addAttribute(tag.getKeyString(), attr); >+ attachment.createAttribute(tag.getKey()).setValue(parsedText); > } > break; > case DATA: > break; > case ATTACHMENT: >- if (attachment != null) { >- repositoryTaskData.addAttachment(attachment); >- } >+ isPatch = false; >+ isDeprecated = false; >+ attachment = null; > break; > > // IGNORED ELEMENTS >@@ -297,90 +297,103 @@ > // 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()); >- if (created_1.compareTo(created_n) < 0) { >- for (int i = 1; i <= longDescsSize; i++) { >- longDescs.get(i).setNumber(commentNum++); >- repositoryTaskData.addComment(longDescs.get(i)); >- } >- } else { >- for (int i = longDescsSize; i > 0; i--) { >- longDescs.get(i).setNumber(commentNum++); >- repositoryTaskData.addComment(longDescs.get(i)); >- } >- } >+ 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++) { >+// longDescs.get(i).setNumber(commentNum++); >+// repositoryTaskData.addComment(longDescs.get(i)); >+// } >+// } else { >+// for (int i = longDescsSize; i > 0; i--) { >+// longDescs.get(i).setNumber(commentNum++); >+// repositoryTaskData.addComment(longDescs.get(i)); >+// } >+// } > } 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 +404,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 +417,7 @@ > } > > /** determines attachment id from comment */ >- private void parseAttachment(TaskComment taskComment, String commentText) { >+ private void parseAttachment(TaskAttribute taskComment, String commentText) { > > String attachmentID = ""; > >@@ -414,8 +426,11 @@ > 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); > } > } >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 21 May 2008 22:30:44 -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/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 21 May 2008 22:30:44 -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: .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 21 May 2008 22:30:44 -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 21 May 2008 22:30:44 -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 >#P org.eclipse.mylyn.bugzilla.ui >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 21 May 2008 22:30:49 -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: .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>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 229655
: 101414 |
101563
|
101652
|
101845
|
101869
|
102075