From 201185d5309bf5300b1041bee7650a248d5e81df Mon Sep 17 00:00:00 2001 From: cvs2git Date: Thu, 28 Jun 2007 18:20:31 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'R_2_0_0'. Sprout from master 2007-06-28 18:20:30 UTC mkersten 'Version update' Delete: org.eclipse.mylyn.bugzilla.tests/.classpath org.eclipse.mylyn.bugzilla.tests/.cvsignore org.eclipse.mylyn.bugzilla.tests/.project org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.jdt.core.prefs org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.jdt.ui.prefs org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.ltk.core.refactoring.prefs org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.mylar.tasklist.prefs org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.mylyn.tasklist.prefs org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.mylyn.tasks.ui.prefs org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.pde.prefs org.eclipse.mylyn.bugzilla.tests/META-INF/MANIFEST.MF org.eclipse.mylyn.bugzilla.tests/about.html org.eclipse.mylyn.bugzilla.tests/build.properties org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaTests.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaConfigurationTest.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaProductParserTest.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchDialogTest.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchEngineTest.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskHyperlinkDetectorTest.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskTest.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTestPlugin.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTestUtil.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/DuplicateDetetionTest.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/EncodingTest.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/NewBugWizardTest.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryEditorWizardTest.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryReportFactoryTest.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryTaskHandleTest.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskEditorTest.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListNotificationManagerTest.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListStandaloneTest.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskReportGeneratorTest.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaQueryTest.java org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaTaskHistoryTest.java org.eclipse.mylyn.bugzilla.tests/test-attach-1181009324093.txt org.eclipse.mylyn.bugzilla.tests/test-attach-1182233735875.txt org.eclipse.mylyn.bugzilla.tests/testdata/configuration/rdfconfig218.txt org.eclipse.mylyn.bugzilla.tests/testdata/contexts/.cvsignore org.eclipse.mylyn.bugzilla.tests/testdata/contexts/empty.txt org.eclipse.mylyn.bugzilla.tests/testdata/pages/bug-1-full.html org.eclipse.mylyn.bugzilla.tests/testdata/pages/bug-not-found-eclipse.html org.eclipse.mylyn.bugzilla.tests/testdata/pages/bug-not-found-hipikat.html org.eclipse.mylyn.bugzilla.tests/testdata/pages/cdt-page.html org.eclipse.mylyn.bugzilla.tests/testdata/pages/enter-bug220.html org.eclipse.mylyn.bugzilla.tests/testdata/pages/enter-bug2201.html org.eclipse.mylyn.bugzilla.tests/testdata/pages/equinox-page.html org.eclipse.mylyn.bugzilla.tests/testdata/pages/gmt-page.html org.eclipse.mylyn.bugzilla.tests/testdata/pages/hipikat-copy-bug-1-full.html org.eclipse.mylyn.bugzilla.tests/testdata/pages/platform-page.html org.eclipse.mylyn.bugzilla.tests/testdata/pages/product-page-1-product-hipikat.html org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-220.html org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-2201.html org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-222attachment.html org.eclipse.mylyn.bugzilla.tests/testdata/pages/ve-page.html org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/1.html org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/2.html org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/40152.html org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/4548.html org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/4862.html org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/67395.html org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/76146.html org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/76388.html org.eclipse.mylyn.tasks.tests/.classpath org.eclipse.mylyn.tasks.tests/.cvsignore org.eclipse.mylyn.tasks.tests/.project org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.jdt.core.prefs org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.jdt.ui.prefs org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.ltk.core.refactoring.prefs org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.mylar.tasklist.prefs org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.mylyn.tasklist.prefs org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.mylyn.tasks.ui.prefs org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.pde.prefs org.eclipse.mylyn.tasks.tests/META-INF/MANIFEST.MF org.eclipse.mylyn.tasks.tests/about.html org.eclipse.mylyn.tasks.tests/build.properties org.eclipse.mylyn.tasks.tests/plugin.xml org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AttachmentJobTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/BackgroundSaveTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CommentQuoterTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/OfflineCachingStorageTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/OfflineStorageTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ProjectRepositoryAssociationTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RepositorySettingsPageTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RepositoryTaskSynchronizationTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RetrieveTitleFromUrlTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TableSorterTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskActivityTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataExportTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataImportTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataManagerTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskHistoryTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskKeyComparatorTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskList06DataMigrationTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListBackupManagerTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListContentProviderTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListDnDTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListUiTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskPlanningEditorTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoriesExternalizerTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositorySorterTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskTestUtil.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TasksTestsPlugin.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/UrlConnectionUtilTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockAttachmentHandler.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockAttributeFactory.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryConnector.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryQuery.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryTask.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockStatusHandler.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockTaskConnectorUi.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockTaskListFactory.java org.eclipse.mylyn.tasks.tests/testdata/legacy/tasklist_0_4_8.xml org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/context-history.xml org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/local-69.xml org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/local-70.xml org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/mylardata-2006-02-16.zip org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/mylardata-2007-01-19.zip org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/repositories.xml org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/tasklist.xml org.eclipse.mylyn.tasks.tests/testdata/tasklistdatamigrationtest/empty.txt org.eclipse.mylyn.trac.tests/.classpath org.eclipse.mylyn.trac.tests/.cvsignore org.eclipse.mylyn.trac.tests/.project org.eclipse.mylyn.trac.tests/.settings/org.eclipse.jdt.core.prefs org.eclipse.mylyn.trac.tests/.settings/org.eclipse.jdt.ui.prefs org.eclipse.mylyn.trac.tests/.settings/org.eclipse.ltk.core.refactoring.prefs org.eclipse.mylyn.trac.tests/.settings/org.eclipse.mylar.tasklist.prefs org.eclipse.mylyn.trac.tests/.settings/org.eclipse.mylyn.tasklist.prefs org.eclipse.mylyn.trac.tests/.settings/org.eclipse.mylyn.tasks.ui.prefs org.eclipse.mylyn.trac.tests/.settings/org.eclipse.pde.prefs org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF org.eclipse.mylyn.trac.tests/about.html org.eclipse.mylyn.trac.tests/build.properties org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkUtilTest.java org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientRepositoryTest.java org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientSearchTest.java org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientTest.java org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracTests.java org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/RepositorySearchQueryTest.java org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TestProxy.java org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracAttachmentHandlerTest.java org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientFactoryTest.java org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientManagerTest.java org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientProxyTest.java org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracQueryTest.java org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryQueryTest.java org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositorySettingsPageTest.java org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracSearchTest.java org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskDataHandlerTest.java org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskTest.java org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTestConstants.java org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTestPlugin.java org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTicketTest.java org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracWebClientSearchTest.java org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracWebClientTest.java org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcClientSearchTest.java org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcClientTest.java org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcTest.java org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TestCleanupUtil.java org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TestFixture.java org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/XmlRpcServer.java--- org.eclipse.mylyn.bugzilla.tests/.classpath | 11 - org.eclipse.mylyn.bugzilla.tests/.cvsignore | 2 - org.eclipse.mylyn.bugzilla.tests/.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 316 ----- .../.settings/org.eclipse.jdt.ui.prefs | 6 - .../org.eclipse.ltk.core.refactoring.prefs | 3 - .../.settings/org.eclipse.mylar.tasklist.prefs | 4 - .../.settings/org.eclipse.mylyn.tasklist.prefs | 4 - .../.settings/org.eclipse.mylyn.tasks.ui.prefs | 4 - .../.settings/org.eclipse.pde.prefs | 12 - .../META-INF/MANIFEST.MF | 30 - org.eclipse.mylyn.bugzilla.tests/about.html | 27 - org.eclipse.mylyn.bugzilla.tests/build.properties | 17 - .../mylyn/bugzilla/tests/AbstractBugzillaTest.java | 157 --- .../mylyn/bugzilla/tests/AllBugzillaTests.java | 57 - .../bugzilla/tests/BugzillaConfigurationTest.java | 231 ---- .../bugzilla/tests/BugzillaProductParserTest.java | 101 -- .../tests/BugzillaRepositoryConnectorTest.java | 659 ----------- .../bugzilla/tests/BugzillaSearchDialogTest.java | 68 -- .../bugzilla/tests/BugzillaSearchEngineTest.java | 125 -- .../tests/BugzillaTaskHyperlinkDetectorTest.java | 135 --- .../tests/BugzillaTaskListManagerTest.java | 232 ---- .../mylyn/bugzilla/tests/BugzillaTaskTest.java | 81 -- .../mylyn/bugzilla/tests/BugzillaTestPlugin.java | 96 -- .../mylyn/bugzilla/tests/BugzillaTestUtil.java | 51 - .../bugzilla/tests/DuplicateDetetionTest.java | 271 ----- .../eclipse/mylyn/bugzilla/tests/EncodingTest.java | 86 -- .../mylyn/bugzilla/tests/NewBugWizardTest.java | 79 -- .../bugzilla/tests/RepositoryEditorWizardTest.java | 180 --- .../tests/RepositoryReportFactoryTest.java | 452 ------- .../bugzilla/tests/RepositoryTaskHandleTest.java | 74 -- .../mylyn/bugzilla/tests/TaskEditorTest.java | 79 -- .../tests/TaskListNotificationManagerTest.java | 134 --- .../bugzilla/tests/TaskListStandaloneTest.java | 208 ---- .../bugzilla/tests/TaskReportGeneratorTest.java | 186 --- .../bugzilla/tests/headless/BugzillaQueryTest.java | 175 --- .../tests/headless/BugzillaTaskHistoryTest.java | 161 --- .../test-attach-1181009324093.txt | 1 - .../test-attach-1182233735875.txt | 1 - .../testdata/configuration/rdfconfig218.txt | 461 -------- .../testdata/contexts/.cvsignore | 1 - .../testdata/contexts/empty.txt | 0 .../testdata/pages/bug-1-full.html | 719 ------------ .../testdata/pages/bug-not-found-eclipse.html | 158 --- .../testdata/pages/bug-not-found-hipikat.html | 142 --- .../testdata/pages/cdt-page.html | 184 --- .../testdata/pages/enter-bug220.html | 441 ------- .../testdata/pages/enter-bug2201.html | 493 -------- .../testdata/pages/equinox-page.html | 177 --- .../testdata/pages/gmt-page.html | 175 --- .../testdata/pages/hipikat-copy-bug-1-full.html | 157 --- .../testdata/pages/platform-page.html | 299 ----- .../pages/product-page-1-product-hipikat.html | 256 ---- .../testdata/pages/test-report-220.html | 667 ----------- .../testdata/pages/test-report-2201.html | 859 -------------- .../testdata/pages/test-report-222attachment.html | 859 -------------- .../testdata/pages/ve-page.html | 178 --- .../testdata/reports-stacktrace/1.html | 377 ------ .../testdata/reports-stacktrace/2.html | 406 ------- .../testdata/reports-stacktrace/40152.html | 1228 -------------------- .../testdata/reports-stacktrace/4548.html | 377 ------ .../testdata/reports-stacktrace/4862.html | 401 ------- .../testdata/reports-stacktrace/67395.html | 390 ------- .../testdata/reports-stacktrace/76146.html | 406 ------- .../testdata/reports-stacktrace/76388.html | 426 ------- org.eclipse.mylyn.tasks.tests/.classpath | 15 - org.eclipse.mylyn.tasks.tests/.cvsignore | 1 - org.eclipse.mylyn.tasks.tests/.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 316 ----- .../.settings/org.eclipse.jdt.ui.prefs | 6 - .../org.eclipse.ltk.core.refactoring.prefs | 3 - .../.settings/org.eclipse.mylar.tasklist.prefs | 4 - .../.settings/org.eclipse.mylyn.tasklist.prefs | 4 - .../.settings/org.eclipse.mylyn.tasks.ui.prefs | 4 - .../.settings/org.eclipse.pde.prefs | 12 - org.eclipse.mylyn.tasks.tests/META-INF/MANIFEST.MF | 29 - org.eclipse.mylyn.tasks.tests/about.html | 27 - org.eclipse.mylyn.tasks.tests/build.properties | 18 - org.eclipse.mylyn.tasks.tests/plugin.xml | 21 - .../eclipse/mylyn/tasks/tests/AllTasksTests.java | 59 - .../mylyn/tasks/tests/AttachmentJobTest.java | 115 -- .../mylyn/tasks/tests/BackgroundSaveTest.java | 63 - .../mylyn/tasks/tests/CommentQuoterTest.java | 70 -- .../mylyn/tasks/tests/CopyDetailsActionTest.java | 27 - .../tasks/tests/OfflineCachingStorageTest.java | 151 --- .../mylyn/tasks/tests/OfflineStorageTest.java | 309 ----- .../tests/ProjectRepositoryAssociationTest.java | 70 -- .../tasks/tests/RepositorySettingsPageTest.java | 178 --- .../tests/RepositoryTaskSynchronizationTest.java | 454 -------- .../tasks/tests/RetrieveTitleFromUrlTest.java | 40 - .../eclipse/mylyn/tasks/tests/TableSorterTest.java | 34 - .../mylyn/tasks/tests/TaskActivityTest.java | 773 ------------ .../mylyn/tasks/tests/TaskDataExportTest.java | 160 --- .../mylyn/tasks/tests/TaskDataImportTest.java | 127 -- .../mylyn/tasks/tests/TaskDataManagerTest.java | 257 ---- .../eclipse/mylyn/tasks/tests/TaskHistoryTest.java | 242 ---- .../mylyn/tasks/tests/TaskKeyComparatorTest.java | 61 - .../tasks/tests/TaskList06DataMigrationTest.java | 323 ----- .../tasks/tests/TaskListBackupManagerTest.java | 97 -- .../tasks/tests/TaskListContentProviderTest.java | 63 - .../eclipse/mylyn/tasks/tests/TaskListDnDTest.java | 74 -- .../mylyn/tasks/tests/TaskListManagerTest.java | 918 --------------- .../eclipse/mylyn/tasks/tests/TaskListTest.java | 27 - .../eclipse/mylyn/tasks/tests/TaskListUiTest.java | 393 ------- .../mylyn/tasks/tests/TaskPlanningEditorTest.java | 113 -- .../tests/TaskRepositoriesExternalizerTest.java | 108 -- .../tasks/tests/TaskRepositoryManagerTest.java | 223 ---- .../tasks/tests/TaskRepositorySorterTest.java | 72 -- .../mylyn/tasks/tests/TaskRepositoryTest.java | 29 - .../org/eclipse/mylyn/tasks/tests/TaskTest.java | 59 - .../eclipse/mylyn/tasks/tests/TaskTestUtil.java | 51 - .../mylyn/tasks/tests/TasksTestsPlugin.java | 46 - .../mylyn/tasks/tests/UrlConnectionUtilTest.java | 74 -- .../tests/connector/MockAttachmentHandler.java | 81 -- .../tests/connector/MockAttributeFactory.java | 51 - .../tests/connector/MockRepositoryConnector.java | 170 --- .../tasks/tests/connector/MockRepositoryQuery.java | 35 - .../tasks/tests/connector/MockRepositoryTask.java | 62 - .../tasks/tests/connector/MockStatusHandler.java | 32 - .../tasks/tests/connector/MockTaskConnectorUi.java | 49 - .../tasks/tests/connector/MockTaskListFactory.java | 80 -- .../testdata/legacy/tasklist_0_4_8.xml | 1 - .../taskdataimporttest/context-history.xml | 1 - .../testdata/taskdataimporttest/local-69.xml | 1 - .../testdata/taskdataimporttest/local-70.xml | 1 - .../taskdataimporttest/mylardata-2006-02-16.zip | Bin 2670 -> 0 bytes .../taskdataimporttest/mylardata-2007-01-19.zip | Bin 3275 -> 0 bytes .../testdata/taskdataimporttest/repositories.xml | 4 - .../testdata/taskdataimporttest/tasklist.xml | 1 - .../testdata/tasklistdatamigrationtest/empty.txt | 0 org.eclipse.mylyn.trac.tests/.classpath | 7 - org.eclipse.mylyn.trac.tests/.cvsignore | 3 - org.eclipse.mylyn.trac.tests/.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 316 ----- .../.settings/org.eclipse.jdt.ui.prefs | 6 - .../org.eclipse.ltk.core.refactoring.prefs | 3 - .../.settings/org.eclipse.mylar.tasklist.prefs | 4 - .../.settings/org.eclipse.mylyn.tasklist.prefs | 4 - .../.settings/org.eclipse.mylyn.tasks.ui.prefs | 4 - .../.settings/org.eclipse.pde.prefs | 12 - org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF | 23 - org.eclipse.mylyn.trac.tests/about.html | 27 - org.eclipse.mylyn.trac.tests/build.properties | 11 - .../internal/trac/ui/TracHyperlinkUtilTest.java | 204 ---- .../tests/AbstractTracClientRepositoryTest.java | 113 -- .../trac/tests/AbstractTracClientSearchTest.java | 233 ---- .../mylyn/trac/tests/AbstractTracClientTest.java | 100 -- .../org/eclipse/mylyn/trac/tests/AllTracTests.java | 53 - .../trac/tests/RepositorySearchQueryTest.java | 90 -- .../org/eclipse/mylyn/trac/tests/TestProxy.java | 234 ---- .../trac/tests/TracAttachmentHandlerTest.java | 210 ---- .../mylyn/trac/tests/TracClientFactoryTest.java | 96 -- .../mylyn/trac/tests/TracClientManagerTest.java | 79 -- .../mylyn/trac/tests/TracClientProxyTest.java | 75 -- .../eclipse/mylyn/trac/tests/TracQueryTest.java | 37 - .../trac/tests/TracRepositoryConnectorTest.java | 348 ------ .../mylyn/trac/tests/TracRepositoryQueryTest.java | 80 -- .../trac/tests/TracRepositorySettingsPageTest.java | 108 -- .../eclipse/mylyn/trac/tests/TracSearchTest.java | 136 --- .../mylyn/trac/tests/TracTaskDataHandlerTest.java | 167 --- .../org/eclipse/mylyn/trac/tests/TracTaskTest.java | 44 - .../mylyn/trac/tests/TracTestConstants.java | 33 - .../eclipse/mylyn/trac/tests/TracTestPlugin.java | 54 - .../eclipse/mylyn/trac/tests/TracTicketTest.java | 70 -- .../mylyn/trac/tests/TracWebClientSearchTest.java | 51 - .../mylyn/trac/tests/TracWebClientTest.java | 84 -- .../trac/tests/TracXmlRpcClientSearchTest.java | 56 - .../mylyn/trac/tests/TracXmlRpcClientTest.java | 85 -- .../eclipse/mylyn/trac/tests/TracXmlRpcTest.java | 507 -------- .../mylyn/trac/tests/support/TestCleanupUtil.java | 58 - .../mylyn/trac/tests/support/TestFixture.java | 97 -- .../mylyn/trac/tests/support/XmlRpcServer.java | 370 ------ 172 files changed, 26018 deletions(-) delete mode 100644 org.eclipse.mylyn.bugzilla.tests/.classpath delete mode 100644 org.eclipse.mylyn.bugzilla.tests/.cvsignore delete mode 100644 org.eclipse.mylyn.bugzilla.tests/.project delete mode 100644 org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.jdt.core.prefs delete mode 100644 org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.ltk.core.refactoring.prefs delete mode 100644 org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.mylar.tasklist.prefs delete mode 100644 org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.mylyn.tasklist.prefs delete mode 100644 org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.mylyn.tasks.ui.prefs delete mode 100644 org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.pde.prefs delete mode 100644 org.eclipse.mylyn.bugzilla.tests/META-INF/MANIFEST.MF delete mode 100644 org.eclipse.mylyn.bugzilla.tests/about.html delete mode 100644 org.eclipse.mylyn.bugzilla.tests/build.properties delete mode 100644 org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java delete mode 100644 org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaTests.java delete mode 100644 org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaConfigurationTest.java delete mode 100644 org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaProductParserTest.java delete mode 100644 org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java delete mode 100644 org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchDialogTest.java delete mode 100644 org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchEngineTest.java delete mode 100644 org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskHyperlinkDetectorTest.java delete mode 100644 org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java delete mode 100644 org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskTest.java delete mode 100644 org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTestPlugin.java delete mode 100644 org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTestUtil.java delete mode 100644 org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/DuplicateDetetionTest.java delete mode 100644 org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/EncodingTest.java delete mode 100644 org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/NewBugWizardTest.java delete mode 100644 org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryEditorWizardTest.java delete mode 100644 org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryReportFactoryTest.java delete mode 100644 org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryTaskHandleTest.java delete mode 100644 org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskEditorTest.java delete mode 100644 org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListNotificationManagerTest.java delete mode 100644 org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListStandaloneTest.java delete mode 100644 org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskReportGeneratorTest.java delete mode 100644 org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaQueryTest.java delete mode 100644 org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaTaskHistoryTest.java delete mode 100644 org.eclipse.mylyn.bugzilla.tests/test-attach-1181009324093.txt delete mode 100644 org.eclipse.mylyn.bugzilla.tests/test-attach-1182233735875.txt delete mode 100644 org.eclipse.mylyn.bugzilla.tests/testdata/configuration/rdfconfig218.txt delete mode 100644 org.eclipse.mylyn.bugzilla.tests/testdata/contexts/.cvsignore delete mode 100644 org.eclipse.mylyn.bugzilla.tests/testdata/contexts/empty.txt delete mode 100644 org.eclipse.mylyn.bugzilla.tests/testdata/pages/bug-1-full.html delete mode 100644 org.eclipse.mylyn.bugzilla.tests/testdata/pages/bug-not-found-eclipse.html delete mode 100644 org.eclipse.mylyn.bugzilla.tests/testdata/pages/bug-not-found-hipikat.html delete mode 100644 org.eclipse.mylyn.bugzilla.tests/testdata/pages/cdt-page.html delete mode 100644 org.eclipse.mylyn.bugzilla.tests/testdata/pages/enter-bug220.html delete mode 100644 org.eclipse.mylyn.bugzilla.tests/testdata/pages/enter-bug2201.html delete mode 100644 org.eclipse.mylyn.bugzilla.tests/testdata/pages/equinox-page.html delete mode 100644 org.eclipse.mylyn.bugzilla.tests/testdata/pages/gmt-page.html delete mode 100644 org.eclipse.mylyn.bugzilla.tests/testdata/pages/hipikat-copy-bug-1-full.html delete mode 100644 org.eclipse.mylyn.bugzilla.tests/testdata/pages/platform-page.html delete mode 100644 org.eclipse.mylyn.bugzilla.tests/testdata/pages/product-page-1-product-hipikat.html delete mode 100644 org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-220.html delete mode 100644 org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-2201.html delete mode 100644 org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-222attachment.html delete mode 100644 org.eclipse.mylyn.bugzilla.tests/testdata/pages/ve-page.html delete mode 100644 org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/1.html delete mode 100644 org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/2.html delete mode 100644 org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/40152.html delete mode 100644 org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/4548.html delete mode 100644 org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/4862.html delete mode 100644 org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/67395.html delete mode 100644 org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/76146.html delete mode 100644 org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/76388.html delete mode 100644 org.eclipse.mylyn.tasks.tests/.classpath delete mode 100644 org.eclipse.mylyn.tasks.tests/.cvsignore delete mode 100644 org.eclipse.mylyn.tasks.tests/.project delete mode 100644 org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.jdt.core.prefs delete mode 100644 org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.ltk.core.refactoring.prefs delete mode 100644 org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.mylar.tasklist.prefs delete mode 100644 org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.mylyn.tasklist.prefs delete mode 100644 org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.mylyn.tasks.ui.prefs delete mode 100644 org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.pde.prefs delete mode 100644 org.eclipse.mylyn.tasks.tests/META-INF/MANIFEST.MF delete mode 100644 org.eclipse.mylyn.tasks.tests/about.html delete mode 100644 org.eclipse.mylyn.tasks.tests/build.properties delete mode 100644 org.eclipse.mylyn.tasks.tests/plugin.xml delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AttachmentJobTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/BackgroundSaveTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CommentQuoterTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/OfflineCachingStorageTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/OfflineStorageTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ProjectRepositoryAssociationTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RepositorySettingsPageTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RepositoryTaskSynchronizationTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RetrieveTitleFromUrlTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TableSorterTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskActivityTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataExportTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataImportTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataManagerTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskHistoryTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskKeyComparatorTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskList06DataMigrationTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListBackupManagerTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListContentProviderTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListDnDTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListUiTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskPlanningEditorTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoriesExternalizerTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositorySorterTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskTestUtil.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TasksTestsPlugin.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/UrlConnectionUtilTest.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockAttachmentHandler.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockAttributeFactory.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryConnector.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryQuery.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryTask.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockStatusHandler.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockTaskConnectorUi.java delete mode 100644 org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockTaskListFactory.java delete mode 100644 org.eclipse.mylyn.tasks.tests/testdata/legacy/tasklist_0_4_8.xml delete mode 100644 org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/context-history.xml delete mode 100644 org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/local-69.xml delete mode 100644 org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/local-70.xml delete mode 100644 org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/mylardata-2006-02-16.zip delete mode 100644 org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/mylardata-2007-01-19.zip delete mode 100644 org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/repositories.xml delete mode 100644 org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/tasklist.xml delete mode 100644 org.eclipse.mylyn.tasks.tests/testdata/tasklistdatamigrationtest/empty.txt delete mode 100644 org.eclipse.mylyn.trac.tests/.classpath delete mode 100644 org.eclipse.mylyn.trac.tests/.cvsignore delete mode 100644 org.eclipse.mylyn.trac.tests/.project delete mode 100644 org.eclipse.mylyn.trac.tests/.settings/org.eclipse.jdt.core.prefs delete mode 100644 org.eclipse.mylyn.trac.tests/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 org.eclipse.mylyn.trac.tests/.settings/org.eclipse.ltk.core.refactoring.prefs delete mode 100644 org.eclipse.mylyn.trac.tests/.settings/org.eclipse.mylar.tasklist.prefs delete mode 100644 org.eclipse.mylyn.trac.tests/.settings/org.eclipse.mylyn.tasklist.prefs delete mode 100644 org.eclipse.mylyn.trac.tests/.settings/org.eclipse.mylyn.tasks.ui.prefs delete mode 100644 org.eclipse.mylyn.trac.tests/.settings/org.eclipse.pde.prefs delete mode 100644 org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF delete mode 100644 org.eclipse.mylyn.trac.tests/about.html delete mode 100644 org.eclipse.mylyn.trac.tests/build.properties delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkUtilTest.java delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientRepositoryTest.java delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientSearchTest.java delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientTest.java delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracTests.java delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/RepositorySearchQueryTest.java delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TestProxy.java delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracAttachmentHandlerTest.java delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientFactoryTest.java delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientManagerTest.java delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientProxyTest.java delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracQueryTest.java delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryQueryTest.java delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositorySettingsPageTest.java delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracSearchTest.java delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskDataHandlerTest.java delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskTest.java delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTestConstants.java delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTestPlugin.java delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTicketTest.java delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracWebClientSearchTest.java delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracWebClientTest.java delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcClientSearchTest.java delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcClientTest.java delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcTest.java delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TestCleanupUtil.java delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TestFixture.java delete mode 100644 org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/XmlRpcServer.java diff --git a/org.eclipse.mylyn.bugzilla.tests/.classpath b/org.eclipse.mylyn.bugzilla.tests/.classpath deleted file mode 100644 index 85a4bb4b4..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/.classpath +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/org.eclipse.mylyn.bugzilla.tests/.cvsignore b/org.eclipse.mylyn.bugzilla.tests/.cvsignore deleted file mode 100644 index 0a2b58025..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -bin -credentials.properties diff --git a/org.eclipse.mylyn.bugzilla.tests/.project b/org.eclipse.mylyn.bugzilla.tests/.project deleted file mode 100644 index 003d9ae61..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.mylyn.bugzilla.test - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 888de1277..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,316 +0,0 @@ -#Sun Jun 24 11:52:58 EDT 2007 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=error -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nullReference=error -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore -org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.5 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=80 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=1 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=false -org.eclipse.jdt.core.formatter.comment.format_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=false -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=120 -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=120 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=true -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true \ No newline at end of file diff --git a/org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 276c2e6d8..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,6 +0,0 @@ -#Mon Feb 05 18:45:19 PST 2007 -eclipse.preferences.version=1 -formatter_profile=_Mylar based on Eclipse [built-in] -formatter_settings_version=11 -internal.default.compliance=default -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.ltk.core.refactoring.prefs b/org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.ltk.core.refactoring.prefs deleted file mode 100644 index 7ab03bdac..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.ltk.core.refactoring.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Fri Jun 02 15:30:09 PDT 2006 -eclipse.preferences.version=1 -org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=true diff --git a/org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.mylar.tasklist.prefs b/org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.mylar.tasklist.prefs deleted file mode 100644 index a6cf96a98..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.mylar.tasklist.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Fri Oct 20 16:54:30 PDT 2006 -eclipse.preferences.version=1 -project.repository.kind=bugzilla -project.repository.url=https\://bugs.eclipse.org/bugs diff --git a/org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.mylyn.tasklist.prefs b/org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.mylyn.tasklist.prefs deleted file mode 100644 index 0a2cc0b30..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.mylyn.tasklist.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Mon Jun 18 17:14:59 PDT 2007 -eclipse.preferences.version=1 -project.repository.kind=bugzilla -project.repository.url=https\://bugs.eclipse.org/bugs diff --git a/org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.mylyn.tasks.ui.prefs b/org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.mylyn.tasks.ui.prefs deleted file mode 100644 index d8c6d26af..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.mylyn.tasks.ui.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Mon Jun 25 03:02:37 GMT 2007 -eclipse.preferences.version=1 -project.repository.kind=bugzilla -project.repository.url=https\://bugs.eclipse.org/bugs diff --git a/org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.pde.prefs b/org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.pde.prefs deleted file mode 100644 index 769b229ff..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.pde.prefs +++ /dev/null @@ -1,12 +0,0 @@ -#Thu Nov 03 15:45:55 PST 2005 -compilers.p.deprecated=2 -compilers.p.no-required-att=0 -compilers.p.not-externalized-att=2 -compilers.p.unknown-attribute=0 -compilers.p.unknown-class=0 -compilers.p.unknown-element=0 -compilers.p.unknown-resource=0 -compilers.p.unresolved-ex-points=0 -compilers.p.unresolved-import=0 -compilers.use-project=true -eclipse.preferences.version=1 diff --git a/org.eclipse.mylyn.bugzilla.tests/META-INF/MANIFEST.MF b/org.eclipse.mylyn.bugzilla.tests/META-INF/MANIFEST.MF deleted file mode 100644 index f97945062..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,30 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Bugzilla Tests Plug-in -Bundle-SymbolicName: org.eclipse.mylyn.bugzilla.tests -Bundle-Version: 0.0.0 -Bundle-Activator: org.eclipse.mylyn.bugzilla.tests.BugzillaTestPlugin -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.junit, - org.eclipse.jface.text, - org.eclipse.ui.ide, - org.eclipse.ui.views, - org.eclipse.ui.editors, - org.eclipse.ui.workbench.texteditor, - org.eclipse.mylyn.bugzilla.core, - org.eclipse.mylyn.bugzilla.ui, - org.eclipse.mylyn.tasks.ui, - org.eclipse.mylyn.context.tests, - org.eclipse.mylyn.tasks.tests, - org.eclipse.mylyn.context.core, - org.eclipse.mylyn.tasks.core, - org.eclipse.ui.forms, - org.eclipse.mylyn, - org.eclipse.search, - org.eclipse.mylyn.web.core -Eclipse-AutoStart: true -Bundle-Vendor: Eclipse.org -Bundle-ClassPath: bugzilla-test.jar -Export-Package: org.eclipse.mylyn.bugzilla.tests -Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/org.eclipse.mylyn.bugzilla.tests/about.html b/org.eclipse.mylyn.bugzilla.tests/about.html deleted file mode 100644 index 0dd939c09..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/about.html +++ /dev/null @@ -1,27 +0,0 @@ - - - -About - - - -

About This Content

- -

June 7, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/org.eclipse.mylyn.bugzilla.tests/build.properties b/org.eclipse.mylyn.bugzilla.tests/build.properties deleted file mode 100644 index f10e5a80c..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/build.properties +++ /dev/null @@ -1,17 +0,0 @@ -############################################################################### -# 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 -############################################################################### -bin.includes = bugzilla-test.jar,\ - META-INF/,\ - about.html -jars.compile.order = bugzilla-test.jar -source.bugzilla-test.jar = src/ -output.bugzilla-test.jar = bin/ -src.includes = src/,\ - about.html,\ - META-INF/ -jre.compilation.profile = J2SE-1.5 diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java deleted file mode 100644 index 517bb6b48..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java +++ /dev/null @@ -1,157 +0,0 @@ -/******************************************************************************* - * 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.util.Set; - -import junit.framework.TestCase; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -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.tasks.core.AbstractRepositoryConnector; -import org.eclipse.mylyn.tasks.core.AbstractTask; -import org.eclipse.mylyn.tasks.core.ITaskFactory; -import org.eclipse.mylyn.tasks.core.RepositoryTaskData; -import org.eclipse.mylyn.tasks.core.TaskList; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.TaskRepositoryManager; -import org.eclipse.mylyn.tasks.core.AbstractTask.RepositoryTaskSyncState; -import org.eclipse.mylyn.tasks.ui.TaskFactory; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; - -/** - * @author Mik Kersten - * @author Rob Elves - * @author Nathan Hapke - */ -public abstract class AbstractBugzillaTest extends TestCase { - - static final String DEFAULT_KIND = BugzillaCorePlugin.REPOSITORY_KIND; - - protected BugzillaRepositoryConnector connector; - - protected TaskRepositoryManager manager; - - protected TaskRepository repository; - - protected TaskList taskList; - - protected ITaskFactory taskFactory; - - public AbstractBugzillaTest() { - super(); - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - TasksUiPlugin.getTaskDataManager().clear(); - manager = TasksUiPlugin.getRepositoryManager(); - TasksUiPlugin.getTaskListManager().getTaskList().reset(); - manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - TasksUiPlugin.getTaskListManager().resetTaskList(); - manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); - } - - protected void init222() { - init(IBugzillaConstants.TEST_BUGZILLA_222_URL); - } - - protected void init2201() { - init(IBugzillaConstants.TEST_BUGZILLA_2201_URL); - } - - protected void init220() { - init(IBugzillaConstants.TEST_BUGZILLA_220_URL); - } - - protected void init218() { - init(IBugzillaConstants.TEST_BUGZILLA_218_URL); - } - - @SuppressWarnings("deprecation") - protected void init(String url) { - repository = new TaskRepository(DEFAULT_KIND, url); - Credentials credentials = TestUtil.readCredentials(); - repository.setAuthenticationCredentials(credentials.username, credentials.password); - - repository.setTimeZoneId("Canada/Eastern"); - assertNotNull(manager); - manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath()); - - taskList = TasksUiPlugin.getTaskListManager().getTaskList(); - - AbstractRepositoryConnector abstractRepositoryClient = manager.getRepositoryConnector(DEFAULT_KIND); - - assertEquals(abstractRepositoryClient.getConnectorKind(), DEFAULT_KIND); - - connector = (BugzillaRepositoryConnector) abstractRepositoryClient; - - taskFactory = new TaskFactory(repository); -// connector.setForceSynchExecForTesting(true); - TasksUiPlugin.getSynchronizationManager().setForceSyncExec(true); - } - - protected BugzillaTask generateLocalTaskAndDownload(String taskNumber) throws CoreException { - BugzillaTask task = (BugzillaTask) connector.createTaskFromExistingId(repository, taskNumber, - new NullProgressMonitor()); - TasksUiPlugin.getSynchronizationManager().setTaskRead(task, true); - assertNotNull(task); - TasksUiPlugin.getTaskListManager().getTaskList().moveToContainer(task, - TasksUiPlugin.getTaskListManager().getTaskList().getDefaultCategory()); - - return task; - } - - protected void submit(AbstractTask task, RepositoryTaskData taskData) throws CoreException { - connector.getTaskDataHandler().postTaskData(repository, taskData, new NullProgressMonitor()); - task.setSubmitting(true); - } - - // protected BugzillaReportSubmitForm makeExistingBugPost(RepositoryTaskData - // taskData) - // throws UnsupportedEncodingException { - // return BugzillaReportSubmitForm.makeExistingBugPost(taskData, - // repository.getUrl(), repository.getUserName(), - // repository.getPassword(), repository.getCharacterEncoding()); - // } - - protected void synchAndAssertState(Set tasks, RepositoryTaskSyncState state) { - for (AbstractTask task : tasks) { - TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null); - assertEquals(task.getSynchronizationState(), state); - } - } - - // class MockBugzillaReportSubmitForm extends BugzillaReportSubmitForm { - // - // public MockBugzillaReportSubmitForm() { - // super(); - // } - // - // @Override - // public String submitReportToRepository(BugzillaClient client) throws - // BugzillaException, LoginException, - // PossibleBugzillaFailureException { - // return "test-submit"; - // } - // - // } -} diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaTests.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaTests.java deleted file mode 100644 index a5c869b95..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaTests.java +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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 junit.framework.Test; -import junit.framework.TestSuite; - -import org.eclipse.mylyn.bugzilla.tests.headless.BugzillaQueryTest; -import org.eclipse.mylyn.bugzilla.tests.headless.BugzillaTaskHistoryTest; - -/** - * @author Mik Kersten - */ -public class AllBugzillaTests { - - public static Test suite() { - TestSuite suite = new TestSuite("Test for org.eclipse.mylyn.bugzilla.tests"); - // $JUnit-BEGIN$ - suite.addTestSuite(RepositoryTaskHandleTest.class); - suite.addTestSuite(TaskListNotificationManagerTest.class); - suite.addTestSuite(BugzillaTaskTest.class); - suite.addTestSuite(TaskReportGeneratorTest.class); - suite.addTestSuite(TaskListStandaloneTest.class); - suite.addTestSuite(BugzillaTaskListManagerTest.class); - suite.addTestSuite(TaskEditorTest.class); - suite.addTestSuite(BugzillaQueryTest.class); - suite.addTestSuite(RepositoryEditorWizardTest.class); - suite.addTestSuite(RepositoryReportFactoryTest.class); - suite.addTestSuite(BugzillaConfigurationTest.class); - suite.addTestSuite(BugzillaTaskHyperlinkDetectorTest.class); - suite.addTestSuite(BugzillaSearchEngineTest.class); - // suite.addTestSuite(Bugzilla220ParserTest.class); - suite.addTestSuite(BugzillaRepositoryConnectorTest.class); - suite.addTestSuite(EncodingTest.class); - // suite.addTestSuite(NewBugWizardTest.class); - // suite.addTestSuite(RegularExpressionMatchTest.class); - // suite.addTestSuite(BugzillaNewBugParserTestCDT.class); - // suite.addTestSuite(BugzillaNewBugParserTestEquinox.class); - // suite.addTestSuite(BugzillaNewBugParserTestGMT.class); - // suite.addTestSuite(BugzillaNewBugParserTestPlatform.class); - // suite.addTestSuite(BugzillaNewBugParserTestVE.class); - // suite.addTestSuite(BugzillaParserTestNoBug.class); - suite.addTestSuite(BugzillaProductParserTest.class); - // TODO: enable - // suite.addTest(new TestSuite(BugzillaParserTest.class)); - suite.addTestSuite(BugzillaSearchDialogTest.class); - suite.addTestSuite(DuplicateDetetionTest.class); - suite.addTestSuite(BugzillaTaskHistoryTest.class); - // $JUnit-END$ - return suite; - } -} diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaConfigurationTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaConfigurationTest.java deleted file mode 100644 index 944396d14..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaConfigurationTest.java +++ /dev/null @@ -1,231 +0,0 @@ -/******************************************************************************* - * 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.io.BufferedReader; -import java.io.FileInputStream; -import java.io.InputStreamReader; -import java.io.StringReader; -import java.net.URL; - -import junit.framework.TestCase; - -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin; -import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants; -import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration; -import org.eclipse.mylyn.internal.bugzilla.core.SaxConfigurationContentHandler; -import org.eclipse.mylyn.internal.bugzilla.core.XmlCleaner; -import org.xml.sax.ErrorHandler; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; -import org.xml.sax.SAXParseException; -import org.xml.sax.XMLReader; -import org.xml.sax.helpers.XMLReaderFactory; - -public class BugzillaConfigurationTest extends TestCase { - - @Override - protected void setUp() throws Exception { - super.setUp(); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void test222RDFProductConfig() throws Exception { - BugzillaClient client = new BugzillaClient(new URL(IBugzillaConstants.TEST_BUGZILLA_222_URL), "", "", "", "", - "UTF-8"); - RepositoryConfiguration config = client.getRepositoryConfiguration(); - assertNotNull(config); - assertEquals("2.22.1", config.getInstallVersion()); - assertEquals(7, config.getStatusValues().size()); - assertEquals(8, config.getResolutions().size()); - assertEquals(4, config.getPlatforms().size()); - assertEquals(5, config.getOSs().size()); - assertEquals(5, config.getPriorities().size()); - assertEquals(7, config.getSeverities().size()); - assertEquals(3, config.getProducts().size()); - assertEquals(4, config.getOpenStatusValues().size()); - assertEquals(1, config.getComponents("TestProduct").size()); - assertEquals(1, config.getVersions("TestProduct").size()); - assertEquals(0, config.getTargetMilestones("TestProduct").size()); - } - - public void test2201RDFProductConfig() throws Exception { - BugzillaClient client = new BugzillaClient(new URL(IBugzillaConstants.TEST_BUGZILLA_2201_URL), "", "", "", "", - "UTF-8"); - RepositoryConfiguration config = client.getRepositoryConfiguration(); - assertNotNull(config); - assertEquals("2.20.1", config.getInstallVersion()); - assertEquals(7, config.getStatusValues().size()); - assertEquals(8, config.getResolutions().size()); - assertEquals(4, config.getPlatforms().size()); - assertEquals(5, config.getOSs().size()); - assertEquals(5, config.getPriorities().size()); - assertEquals(7, config.getSeverities().size()); - assertEquals(1, config.getProducts().size()); - assertEquals(4, config.getOpenStatusValues().size()); - assertEquals(2, config.getComponents("TestProduct").size()); - assertEquals(1, config.getVersions("TestProduct").size()); - // assertEquals(1, config.getTargetMilestones("TestProduct").size()); - } - - public void test220RDFProductConfig() throws Exception { - BugzillaClient client = new BugzillaClient(new URL(IBugzillaConstants.TEST_BUGZILLA_220_URL), "", "", "", "", - "UTF-8"); - RepositoryConfiguration config = client.getRepositoryConfiguration(); - assertNotNull(config); - assertEquals("2.20.3", config.getInstallVersion()); - assertEquals(7, config.getStatusValues().size()); - assertEquals(8, config.getResolutions().size()); - assertEquals(4, config.getPlatforms().size()); - assertEquals(5, config.getOSs().size()); - assertEquals(5, config.getPriorities().size()); - assertEquals(7, config.getSeverities().size()); - assertEquals(2, config.getProducts().size()); - assertEquals(4, config.getOpenStatusValues().size()); - assertEquals(2, config.getComponents("TestProduct").size()); - assertEquals(1, config.getVersions("TestProduct").size()); - // assertEquals(1, config.getTargetMilestones("TestProduct").size()); - } - - public void test218RDFProductConfig() throws Exception { - BugzillaClient client = new BugzillaClient(new URL(IBugzillaConstants.TEST_BUGZILLA_218_URL), "", "", "", "", - "UTF-8"); - RepositoryConfiguration config = client.getRepositoryConfiguration(); - assertNotNull(config); - assertEquals("2.18.6", config.getInstallVersion()); - assertEquals(7, config.getStatusValues().size()); - assertEquals(8, config.getResolutions().size()); - assertEquals(8, config.getPlatforms().size()); - assertEquals(36, config.getOSs().size()); - assertEquals(5, config.getPriorities().size()); - assertEquals(7, config.getSeverities().size()); - assertEquals(1, config.getProducts().size()); - assertEquals(4, config.getOpenStatusValues().size()); - assertEquals(1, config.getComponents("TestProduct").size()); - assertEquals(1, config.getVersions("TestProduct").size()); - // assertEquals(1, config.getTargetMilestones("TestProduct").size()); - } - - public void testEclipseRDFProductConfig() throws Exception { - BugzillaClient client = new BugzillaClient(new URL(IBugzillaConstants.ECLIPSE_BUGZILLA_URL), "", "", "", "", - "UTF-8"); - RepositoryConfiguration config = client.getRepositoryConfiguration(); - assertNotNull(config); - assertEquals("2.22.1", config.getInstallVersion()); - assertEquals(7, config.getStatusValues().size()); - assertEquals(8, config.getResolutions().size()); - assertEquals(6, config.getPlatforms().size()); - assertEquals(29, config.getOSs().size()); - assertEquals(5, config.getPriorities().size()); - assertEquals(7, config.getSeverities().size()); - assertTrue(config.getProducts().size() > 50); - assertEquals(4, config.getOpenStatusValues().size()); - assertEquals(13, config.getComponents("Mylyn").size()); - assertEquals(24, config.getKeywords().size()); - // assertEquals(10, config.getComponents("Hyades").size()); - // assertEquals(1, config.getTargetMilestones("TestProduct").size()); - } - - public void testRepositoryConfigurationCachePersistance() throws Exception { - RepositoryConfiguration configuration1 = new RepositoryConfiguration(); - configuration1.setRepositoryUrl("url1"); - configuration1.addProduct("Test Product 1"); - assertEquals(1, configuration1.getProducts().size()); - - RepositoryConfiguration configuration2 = new RepositoryConfiguration(); - configuration1.setRepositoryUrl("url2"); - configuration2.addProduct("Test Product 2"); - assertEquals(1, configuration2.getProducts().size()); - - BugzillaCorePlugin.addRepositoryConfiguration(configuration1); - BugzillaCorePlugin.addRepositoryConfiguration(configuration2); - BugzillaCorePlugin.writeRepositoryConfigFile(); - BugzillaCorePlugin.removeConfiguration(configuration1); - BugzillaCorePlugin.removeConfiguration(configuration2); - assertNull(BugzillaCorePlugin.getRepositoryConfiguration(configuration1.getRepositoryUrl())); - assertNull(BugzillaCorePlugin.getRepositoryConfiguration(configuration2.getRepositoryUrl())); - BugzillaCorePlugin.readRepositoryConfigurationFile(); - assertNotNull(BugzillaCorePlugin.getRepositoryConfiguration(configuration1.getRepositoryUrl())); - assertNotNull(BugzillaCorePlugin.getRepositoryConfiguration(configuration2.getRepositoryUrl())); - RepositoryConfiguration testLoadedConfig = BugzillaCorePlugin.getRepositoryConfiguration(configuration1.getRepositoryUrl()); - assertEquals(1, testLoadedConfig.getProducts().size()); - assertEquals(configuration1.getProducts().get(0), testLoadedConfig.getProducts().get(0)); - } - -// @SuppressWarnings("deprecation") -// public void testHtmlCleaner() throws IOException, BugzillaException, GeneralSecurityException { -// StringBuffer incoming = new StringBuffer(); -// incoming.append(""); -// incoming.append("
  • "); -// incoming.append(""); -// incoming.append("
  • "); -// incoming.append("
    "); -// -// StringBuffer result = XmlCleaner.clean(new StringReader(incoming.toString())); -// System.err.println(result); -// } - - /** - * Can use this to test config data submitted by users. Be sure not to commit user's config file though. The file - * included (rdfconfig218.txt) is from mylar.eclipse.org/bugs218 - */ - public void testRepositoryConfigurationFromFile() throws Exception { - - URL entryURL = BugzillaTestPlugin.getDefault().getBundle().getEntry("testdata/configuration/rdfconfig218.txt"); - assertNotNull(entryURL); - URL fileURL = FileLocator.toFileURL(entryURL); - assertNotNull(fileURL); - - BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(fileURL.getFile()))); - - if (true) { - StringBuffer result = XmlCleaner.clean(in); - StringReader strReader = new StringReader(result.toString()); - in = new BufferedReader(strReader); - } - - SaxConfigurationContentHandler contentHandler = new SaxConfigurationContentHandler(); - final XMLReader reader = XMLReaderFactory.createXMLReader(); - reader.setContentHandler(contentHandler); - reader.setErrorHandler(new ErrorHandler() { - - public void error(SAXParseException exception) throws SAXException { - throw exception; - } - - public void fatalError(SAXParseException exception) throws SAXException { - throw exception; - } - - public void warning(SAXParseException exception) throws SAXException { - throw exception; - } - }); - reader.parse(new InputSource(in)); - - RepositoryConfiguration config = contentHandler.getConfiguration(); - assertNotNull(config); - - assertTrue(config.getProducts().contains( - "Test-Long-Named-Product-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")); - - // Add your additional checking for valid data here if necessary - - } - -} diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaProductParserTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaProductParserTest.java deleted file mode 100644 index 291523b72..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaProductParserTest.java +++ /dev/null @@ -1,101 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.util.Iterator; -import java.util.List; - -import junit.framework.TestCase; - -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.IBugzillaConstants; -import org.eclipse.mylyn.tasks.core.TaskRepository; - -/** - * Tests for parsing Product Page for new Bugzilla reports - * - * @author Mik Kersten - * @author Rob Elves - */ -public class BugzillaProductParserTest extends TestCase { - - private TaskRepository repository; - - @Override - protected void setUp() throws Exception { - super.setUp(); - // repository = new TaskRepository(BugzillaPlugin.REPOSITORY_KIND, - // new URL(IBugzillaConstants.ECLIPSE_BUGZILLA_URL)); - // MylarTaskListPlugin.getRepositoryManager().addRepository(repository); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - // MylarTaskListPlugin.getRepositoryManager().removeRepository(repository); - } - - public BugzillaProductParserTest(String arg0) { - super(arg0); - } - - private TaskRepository setRepository(String url) { - repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, url); - Credentials credentials = TestUtil.readCredentials(); - repository.setAuthenticationCredentials(credentials.username, credentials.password); - return repository; - } - - public void test222Products() throws Exception { - setRepository(IBugzillaConstants.TEST_BUGZILLA_222_URL); - List productList = BugzillaCorePlugin.getRepositoryConfiguration(repository, false).getProducts(); - Iterator itr = productList.iterator(); - assertTrue(itr.hasNext()); - assertEquals("Read Only Test Cases", itr.next()); - } - - public void test2201Products() throws Exception { - setRepository(IBugzillaConstants.TEST_BUGZILLA_2201_URL); - List productList = BugzillaCorePlugin.getRepositoryConfiguration(repository, false).getProducts(); - Iterator itr = productList.iterator(); - assertTrue(itr.hasNext()); - assertEquals("TestProduct", "TestProduct", itr.next()); - - } - - public void test220Products() throws Exception { - setRepository(IBugzillaConstants.TEST_BUGZILLA_220_URL); - List productList = BugzillaCorePlugin.getRepositoryConfiguration(repository, false).getProducts(); - assertEquals(2, productList.size()); - assertTrue(productList.contains("TestProduct")); - assertTrue(productList.contains("Widget")); - - } - - public void test218Products() throws Exception { - setRepository(IBugzillaConstants.TEST_BUGZILLA_218_URL); - List productList = BugzillaCorePlugin.getRepositoryConfiguration(repository, false).getProducts(); - assertEquals(1, productList.size()); - assertTrue(productList.contains("TestProduct")); - } - -// No longer supporting 216 -// public void test216Products() throws Exception { -// -// repository = new TaskRepository(BugzillaPlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_216_URL, -// IBugzillaConstants.BugzillaServerVersion.SERVER_216.toString()); -// -// List productList = BugzillaRepositoryUtil.getProductList(repository); -// Iterator itr = productList.iterator(); -// assertTrue(itr.hasNext()); -// assertEquals("TestProduct", "TestProduct", itr.next()); -// } - -} diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java deleted file mode 100644 index 5a4d7f2fb..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java +++ /dev/null @@ -1,659 +0,0 @@ -/******************************************************************************* - * 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.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.ContextCorePlugin; -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.LocalAttachment; -import org.eclipse.mylyn.tasks.core.AbstractTask; -import org.eclipse.mylyn.tasks.core.RepositoryAttachment; -import org.eclipse.mylyn.tasks.core.RepositoryTaskAttribute; -import org.eclipse.mylyn.tasks.core.RepositoryTaskData; -import org.eclipse.mylyn.tasks.core.AbstractTask.RepositoryTaskSyncState; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; -import org.eclipse.mylyn.tasks.ui.search.RepositorySearchResult; -import org.eclipse.mylyn.tasks.ui.search.SearchHitCollector; - -/** - * @author Mik Kersten - * @author Rob Elves - * @author Nathan Hapke - */ -public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest { - - public void testFocedQuerySynchronization() throws CoreException { - init222(); - TasksUiPlugin.getSynchronizationManager().setForceSyncExec(true); - TasksUiPlugin.getTaskDataManager().clear(); - assertEquals(0, taskList.getAllTasks().size()); - BugzillaRepositoryQuery bugQuery = new BugzillaRepositoryQuery( - IBugzillaConstants.TEST_BUGZILLA_222_URL, - "http://mylyn.eclipse.org/bugs222/buglist.cgi?short_desc_type=allwordssubstr&short_desc=&product=Read+Only+Test+Cases&long_desc_type=allwordssubstr&long_desc=&bug_status=NEW&order=Importance", - "testFocedQuerySynchronization"); - - taskList.addQuery(bugQuery); - - TasksUiPlugin.getSynchronizationManager().synchronize(connector, bugQuery, null, false); - - assertEquals(1, bugQuery.getChildren().size()); - AbstractTask hit = (AbstractTask) bugQuery.getChildren().toArray()[0]; - assertTrue(TasksUiPlugin.getTaskDataManager().getNewTaskData(hit.getRepositoryUrl(), hit.getTaskId()) != null); - TasksUiPlugin.getTaskDataManager().remove(hit.getRepositoryUrl(), hit.getTaskId()); - - TasksUiPlugin.getSynchronizationManager().synchronize(connector, bugQuery, null, true); - assertEquals(1, bugQuery.getChildren().size()); - hit = (AbstractTask) bugQuery.getChildren().toArray()[0]; - assertTrue(TasksUiPlugin.getTaskDataManager().getNewTaskData(hit.getRepositoryUrl(), hit.getTaskId()) != null); - - } - - public void testCreateTaskFromExistingId() throws Exception { - init222(); - try { - connector.createTaskFromExistingId(repository, "9999", new NullProgressMonitor()); - fail(); - } catch (CoreException ce) { - - } - - BugzillaTask task = generateLocalTaskAndDownload("1"); - assertNotNull(task); - assertNotNull(TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId())); - assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState()); - - BugzillaTask retrievedTask = (BugzillaTask) taskList.getTask(task.getHandleIdentifier()); - assertNotNull(retrievedTask); - assertEquals(task.getHandleIdentifier(), retrievedTask.getHandleIdentifier()); - } - - public void testAnonymousRepositoryAccess() throws Exception { - init218(); - assertNotNull(repository); - repository.setAuthenticationCredentials("", ""); - // test anonymous task retrieval - BugzillaTask task = this.generateLocalTaskAndDownload("2"); - assertNotNull(task); - - // // test anonymous query (note that this demonstrates query via - // eclipse search (ui) - // SearchHitCollector collector = new SearchHitCollector(taskList); - // collector.setProgressMonitor(new NullProgressMonitor()); - // BugzillaSearchOperation operation = new BugzillaSearchOperation( - // repository, - // "http://mylyn.eclipse.org/bugs218/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=search-match-test&product=TestProduct&long_desc_type=substring&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&deadlinefrom=&deadlineto=&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&emailassigned_to1=1&emailtype1=substring&email1=&emailassigned_to2=1&emailreporter2=1&emailcc2=1&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0=", - // null, collector, "-1"); - // - String queryUrl = "http://mylyn.eclipse.org/bugs218/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=search-match-test&product=TestProduct&long_desc_type=substring&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&deadlinefrom=&deadlineto=&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&emailassigned_to1=1&emailtype1=substring&email1=&emailassigned_to2=1&emailreporter2=1&emailcc2=1&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0="; - BugzillaRepositoryQuery bugzillaQuery = new BugzillaRepositoryQuery(repository.getUrl(), queryUrl, "search"); - - SearchHitCollector collector = new SearchHitCollector(taskList, repository, bugzillaQuery, taskFactory); - RepositorySearchResult result = (RepositorySearchResult) collector.getSearchResult(); - - // operation.run(new NullProgressMonitor()); - // BugzillaSearchQuery searchQuery = new BugzillaSearchQuery(collector); - collector.run(new NullProgressMonitor()); - assertEquals(2, result.getElements().length); - - for (AbstractTask hit : collector.getTasks()) { - assertTrue(hit.getSummary().contains("search-match-test")); - } - - // test anonymous update of configuration - RepositoryConfiguration config = BugzillaCorePlugin.getRepositoryConfiguration(repository, false); - assertNotNull(config); - assertTrue(config.getComponents().size() > 0); - } - - public void testUpdate() throws Exception { - init222(); - String taskNumber = "3"; - TasksUiPlugin.getTaskDataManager().clear(); - assertEquals(0, TasksUiPlugin.getTaskListManager().getTaskList().getAllTasks().size()); - BugzillaTask task = this.generateLocalTaskAndDownload(taskNumber); - assertEquals("search-match-test 2", task.getSummary()); - assertEquals("TestProduct", task.getProduct()); - assertEquals("P1", task.getPriority()); - assertEquals("blocker", task.getSeverity()); - assertEquals("nhapke@cs.ubc.ca", task.getOwner()); - // assertEquals("2007-04-18 14:21:40", - // task.getCompletionDate().toString()); - assertFalse(task.isCompleted()); - assertEquals("http://mylyn.eclipse.org/bugs222/show_bug.cgi?id=3", task.getUrl()); - } - - public void testUpdateWithSubTasks() throws Exception { - init222(); - String taskNumber = "23"; - TasksUiPlugin.getTaskDataManager().clear(); - assertEquals(0, TasksUiPlugin.getTaskListManager().getTaskList().getAllTasks().size()); - BugzillaTask 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.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId())); - TasksUiPlugin.getTaskListManager().activateTask(task); - File sourceContextFile = ContextCorePlugin.getContextManager().getFileForContext(task.getHandleIdentifier()); - assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState()); - sourceContextFile.createNewFile(); - sourceContextFile.deleteOnExit(); - repository.setAuthenticationCredentials("wrong", "wrong"); - try { - connector.getAttachmentHandler().attachContext(repository, task, "", new NullProgressMonitor()); - } catch (CoreException e) { - assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState()); - return; - } - fail("Should have failed due to invalid userid and password."); - } - - public void testSynchronize() throws CoreException { - init222(); - - TasksUiPlugin.getTaskDataManager().clear(); - - // Get the task - BugzillaTask task = generateLocalTaskAndDownload("3"); - - RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getEditableCopy(task.getRepositoryUrl(), - task.getTaskId()); - assertNotNull(taskData); - - TasksUiPlugin.getTaskListManager().getTaskList().moveToContainer(task, - TasksUiPlugin.getTaskListManager().getTaskList().getDefaultCategory()); - int numComments = taskData.getComments().size(); - - // Modify it - String newCommentText = "BugzillaRepositoryClientTest.testSynchronize(): " + (new Date()).toString(); - taskData.setNewComment(newCommentText); - Set changed = new HashSet(); - changed.add(taskData.getAttribute(RepositoryTaskAttribute.COMMENT_NEW)); - TasksUiPlugin.getTaskDataManager().saveEdits(task.getRepositoryUrl(), task.getTaskId(), changed); - - // Submit changes - submit(task, taskData); - - TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null); - // After submit task should be in SYNCHRONIZED state - assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState()); - RepositoryTaskData taskData2 = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), - task.getTaskId()); - assertFalse(taskData2.getLastModified().equals(taskData.getLastModified())); - // Still not read - assertFalse(taskData2.getLastModified().equals(task.getLastReadTimeStamp())); - TasksUiPlugin.getSynchronizationManager().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(RepositoryTaskSyncState.SYNCHRONIZED); - TasksUiPlugin.getTaskDataManager().remove(task.getRepositoryUrl(), task.getTaskId()); - TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, false, null); - assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState()); - RepositoryTaskData bugReport2 = null; - bugReport2 = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId()); - assertNotNull(bugReport2); - assertEquals(task.getTaskId(), bugReport2.getId()); - - assertEquals(newCommentText, bugReport2.getComments().get(numComments).getText()); - // TODO: Test that comment was appended - // ArrayList 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 (AbstractTask hit : query1.getChildren()) { - for (AbstractTask 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.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), - task.getTaskId()); - - assertNotNull(task); - assertNotNull(taskData); - TasksUiPlugin.getSynchronizationManager().setTaskRead(task, true); - assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState()); - assertEquals(taskNumber, taskData.getId()); - 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); - try { - client.postAttachment(attachment.getReport().getId(), attachment.getComment(), attachment); - 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(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState()); - task = (BugzillaTask) connector.createTaskFromExistingId(repository, taskNumber, new NullProgressMonitor()); - TasksUiPlugin.getSynchronizationManager().synchronize(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().getId(), attachment.getComment(), attachment); - fail(); - } catch (Exception e) { - } - task = (BugzillaTask) connector.createTaskFromExistingId(repository, taskNumber, new NullProgressMonitor()); - TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null); - taskData = TasksUiPlugin.getTaskDataManager().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().getId(), attachment.getComment(), attachment); - - task = (BugzillaTask) connector.createTaskFromExistingId(repository, taskNumber, new NullProgressMonitor()); - TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null); - taskData = TasksUiPlugin.getTaskDataManager().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.getTaskDataManager().getEditableCopy(task4.getRepositoryUrl(), - task4.getTaskId()); - assertNotNull(task4); - assertNotNull(taskData4); - assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task4.getSynchronizationState()); - assertEquals(taskID, taskData4.getId()); - - BugzillaTask task5 = generateLocalTaskAndDownload("5"); - RepositoryTaskData taskData5 = TasksUiPlugin.getTaskDataManager().getEditableCopy(task5.getRepositoryUrl(), - task5.getTaskId()); - assertNotNull(task5); - assertNotNull(taskData5); - assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task5.getSynchronizationState()); - assertEquals("5", taskData5.getId()); - - Set tasks = new HashSet(); - 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()); - - boolean changed = connector.markStaleTasks(repository, tasks, new NullProgressMonitor()); - assertTrue(changed); - // 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); - - changed = connector.markStaleTasks(repository, tasks, new NullProgressMonitor()); - - assertTrue(task4.isStale()); - assertTrue(task5.isStale()); - - TasksUiPlugin.getSynchronizationManager().synchronize(connector, tasks, true, null); - - for (AbstractTask 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.getTaskDataManager().getNewTaskData(task7.getRepositoryUrl(), - task7.getTaskId()); - assertNotNull(recentTaskData); - TasksUiPlugin.getSynchronizationManager().setTaskRead(task7, true); - assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task7.getSynchronizationState()); - assertEquals("7", recentTaskData.getId()); - - Set tasks = new HashSet(); - tasks.add(task7); - - TasksUiPlugin.getRepositoryManager().setSynchronizationTime(repository, task7.getLastReadTimeStamp(), - TasksUiPlugin.getDefault().getRepositoriesFilePath()); - - assertNotNull(TasksUiPlugin.getTaskDataManager().getNewTaskData(IBugzillaConstants.TEST_BUGZILLA_222_URL, "7")); - TasksUiPlugin.getTaskDataManager().remove(task7.getRepositoryUrl(), task7.getTaskId()); - - assertNull(TasksUiPlugin.getTaskDataManager().getNewTaskData(IBugzillaConstants.TEST_BUGZILLA_222_URL, "7")); - - assertEquals(RepositoryTaskSyncState.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); - } - // REMOVE ALL TASK DATA - TasksUiPlugin.getTaskDataManager().clear(); - connector.getTaskDataHandler().postTaskData(repository, recentTaskData, new NullProgressMonitor()); - TasksUiPlugin.getSynchronizationManager().synchronizeChanged(connector, repository); - assertEquals(RepositoryTaskSyncState.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.getTaskDataManager().getNewTaskData(bugtask.getRepositoryUrl(), - bugtask.getTaskId()); - assertNotNull(bugtaskdata); - assertEquals(taskid + "", bugtaskdata.getId()); - assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, bugtask.getSynchronizationState()); - - Set tasks = new HashSet(); - tasks.add(bugtask); - - // synchAndAssertState(tasks, RepositoryTaskSyncState.SYNCHRONIZED); - - TasksUiPlugin.getRepositoryManager().setSynchronizationTime(repository, bugtask.getLastReadTimeStamp(), - TasksUiPlugin.getDefault().getRepositoriesFilePath()); - // connector.synchronizeChanged(repository); - - // Set 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, RepositoryTaskSyncState.SYNCHRONIZED); - - bugtaskdata = TasksUiPlugin.getTaskDataManager() - .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.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), - task.getTaskId()); - - Iterator 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, -// IBugzillaConstants.ECLIPSE_BUGZILLA_URL); -// //Credentials credentials = MylarTestUtils.readCredentials(); -// //repository.setAuthenticationCredentials(credentials.username, -// credentials.password); -// -// //repository.setTimeZoneId("Canada/Eastern"); -// assertNotNull(manager); -// manager.addRepository(repository, -// TasksUiPlugin.getDefault().getRepositoriesFilePath()); -// -// taskList = TasksUiPlugin.getTaskListManager().getTaskList(); -// -// AbstractRepositoryConnector abstractRepositoryConnector = -// manager.getRepositoryConnector(DEFAULT_KIND); -// -// assertEquals(abstractRepositoryConnector.getRepositoryType(), DEFAULT_KIND); -// -// connector = (BugzillaRepositoryConnector) abstractRepositoryConnector; -// -// long start = System.currentTimeMillis(); -// BugzillaTask task = null; -// for(int x = 1; x < 5; x++) { -// if(task != null) -// taskList.deleteTask(task); -// -// task = this.generateLocalTaskAndDownload("154100"); -// assertNotNull(task); -// } -// System.err.println("Total: "+((System.currentTimeMillis() - start)/1000)); -// } - - // class MockBugzillaReportSubmitForm extends BugzillaReportSubmitForm { - // - // public MockBugzillaReportSubmitForm(String encoding_utf_8) { - // super(encoding_utf_8); - // } - // - // @Override - // public String submitReportToRepository() throws BugzillaException, - // LoginException, - // PossibleBugzillaFailureException { - // return "test-submit"; - // } - // - // } -} diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchDialogTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchDialogTest.java deleted file mode 100644 index b7c742a27..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchDialogTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * 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 junit.framework.TestCase; - -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin; -import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants; -import org.eclipse.mylyn.internal.bugzilla.ui.search.BugzillaSearchPage; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.TaskRepositoryManager; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; -import org.eclipse.swt.widgets.Shell; - -/** - * Test the bugzilla search dialog. - * - * @author Jeff Pound - */ -public class BugzillaSearchDialogTest extends TestCase { - - private TaskRepositoryManager manager; - - @Override - public void setUp() throws Exception { - super.setUp(); - manager = TasksUiPlugin.getRepositoryManager(); - assertNotNull(manager); - manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - if (manager != null) { - manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); - } - } - - /** - * Test that the search dialog is initialized properly with the given repository. - * - * @throws Exception - */ - public void testSearchDialogInit() throws Exception { - TaskRepository repo = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, - IBugzillaConstants.TEST_BUGZILLA_222_URL, - IBugzillaConstants.BugzillaServerVersion.SERVER_222.toString()); - manager.addRepository(repo, TasksUiPlugin.getDefault().getRepositoriesFilePath()); - BugzillaSearchPage page = new BugzillaSearchPage(repo); - Shell shell = BugzillaTestPlugin.getDefault().getWorkbench().getDisplay().getShells()[0]; - page.createControl(shell); - page.setVisible(true); - - /* - * This assertion will fail with a 0 product count if the options are - * not retrieved properly, throw an exception if the page is not - * initialized properly, or pass otherwise. - */ - assertFalse(page.getProductCount() == 0); - } -} diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchEngineTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchEngineTest.java deleted file mode 100644 index 3b384757f..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchEngineTest.java +++ /dev/null @@ -1,125 +0,0 @@ -/******************************************************************************* - * 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.util.Set; - -import junit.framework.TestCase; - -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryQuery; -import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants; -import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; -import org.eclipse.mylyn.tasks.core.AbstractTask; -import org.eclipse.mylyn.tasks.core.QueryHitCollector; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.ui.TaskFactory; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; - -/** - * @author Rob Elves - */ -public class BugzillaSearchEngineTest extends TestCase { - - private static final String QUERY_NAME = "Query Page Name"; - - private static final String BUG_DESC_SUBSTRING_SEARCH = "/buglist.cgi?short_desc_type=allwordssubstr&short_desc=";// search-match-test&"; - - private static final String SEARCH_DESCRIPTION = "search-match-test"; - - private static final int NUM_EXPECTED_HITS = 2; - - private static final int NUM_REPOSITORIES = 0; - - @Override - protected void setUp() throws Exception { - super.setUp(); - TasksUiPlugin.getRepositoryManager().clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); - assertEquals(NUM_REPOSITORIES, TasksUiPlugin.getRepositoryManager().getRepositories( - BugzillaCorePlugin.REPOSITORY_KIND).size()); - } - - @Override - protected void tearDown() throws Exception { - TasksUiPlugin.getRepositoryManager().clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); - super.tearDown(); - } - -// public void testSearching216() throws Exception { -// TaskRepository repository = new -// TaskRepository(BugzillaPlugin.REPOSITORY_KIND, -// IBugzillaConstants.TEST_BUGZILLA_216_URL, -// IBugzillaConstants.BugzillaServerVersion.SERVER_216.toString()); -// MylarTaskListPlugin.getRepositoryManager().addRepository(repository); -// List hits = -// runQuery(IBugzillaConstants.TEST_BUGZILLA_216_URL, SEARCH_DESCRIPTION); -// assertEquals(NUM_EXPECTED_HITS, hits.size()); -// } - - public void testSearching218() throws Exception { - TaskRepository repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, - IBugzillaConstants.TEST_BUGZILLA_218_URL, - IBugzillaConstants.BugzillaServerVersion.SERVER_218.toString()); - TasksUiPlugin.getRepositoryManager().addRepository(repository, - TasksUiPlugin.getDefault().getRepositoriesFilePath()); - assertEquals(NUM_EXPECTED_HITS, runQuery(IBugzillaConstants.TEST_BUGZILLA_218_URL, SEARCH_DESCRIPTION).size()); - } - - public void testSearching220() throws Exception { - TaskRepository repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, - IBugzillaConstants.TEST_BUGZILLA_220_URL, - IBugzillaConstants.BugzillaServerVersion.SERVER_220.toString()); - TasksUiPlugin.getRepositoryManager().addRepository(repository, - TasksUiPlugin.getDefault().getRepositoriesFilePath()); - assertEquals(NUM_EXPECTED_HITS, runQuery(IBugzillaConstants.TEST_BUGZILLA_220_URL, SEARCH_DESCRIPTION).size()); - } - - public void testSearching2201() throws Exception { - TaskRepository repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, - IBugzillaConstants.TEST_BUGZILLA_2201_URL, - IBugzillaConstants.BugzillaServerVersion.SERVER_220.toString()); - TasksUiPlugin.getRepositoryManager().addRepository(repository, - TasksUiPlugin.getDefault().getRepositoriesFilePath()); - assertEquals(NUM_EXPECTED_HITS, runQuery(IBugzillaConstants.TEST_BUGZILLA_2201_URL, SEARCH_DESCRIPTION).size()); - } - - public void testSearching222() throws Exception { - TaskRepository repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, - IBugzillaConstants.TEST_BUGZILLA_222_URL, - IBugzillaConstants.BugzillaServerVersion.SERVER_222.toString()); - TasksUiPlugin.getRepositoryManager().addRepository(repository, - TasksUiPlugin.getDefault().getRepositoriesFilePath()); - Set hits = runQuery(IBugzillaConstants.TEST_BUGZILLA_222_URL, SEARCH_DESCRIPTION); - assertEquals(NUM_EXPECTED_HITS, hits.size()); - } - - @SuppressWarnings("deprecation") - private Set runQuery(String repositoryURL, String SearchString) throws Exception { - TaskRepository repository = TasksUiPlugin.getRepositoryManager().getRepository( - BugzillaCorePlugin.REPOSITORY_KIND, repositoryURL); - assertNotNull(repository); - - final BugzillaRepositoryQuery repositoryQuery = new BugzillaRepositoryQuery(repository.getUrl(), - repository.getUrl() + BUG_DESC_SUBSTRING_SEARCH + SearchString, QUERY_NAME); - - AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector( - BugzillaCorePlugin.REPOSITORY_KIND); -// TaskList taskList = TasksUiPlugin.getTaskListManager().getTaskList(); - QueryHitCollector collector = new QueryHitCollector(new TaskFactory(repository)); - - connector.performQuery(repositoryQuery, repository, new NullProgressMonitor(), collector); - - // results.addAll(connector.performQuery(repositoryQuery, new - // NullProgressMonitor(), new MultiStatus(TasksUiPlugin.PLUGIN_ID, - // IStatus.OK, "Query result", null))); - return collector.getTasks(); - } - -} diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskHyperlinkDetectorTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskHyperlinkDetectorTest.java deleted file mode 100644 index a4dfe3d9e..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskHyperlinkDetectorTest.java +++ /dev/null @@ -1,135 +0,0 @@ -/******************************************************************************* - * 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 junit.framework.TestCase; - -import org.eclipse.jface.text.Document; -import org.eclipse.jface.text.Region; -import org.eclipse.jface.text.hyperlink.IHyperlink; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin; -import org.eclipse.mylyn.internal.tasks.ui.editors.RepositoryTextViewer; -import org.eclipse.mylyn.internal.tasks.ui.editors.TaskHyperlinkDetector; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Shell; - -/** - * @author Rob Elves - */ -public class BugzillaTaskHyperlinkDetectorTest extends TestCase { - - private static final String DUPLICATE_NUMBER = "112233"; - - private static final String DUPLICATE = "duplicate of " + DUPLICATE_NUMBER; - - private String TASK_FORMAT_1 = "task#1"; - - private String TASK_FORMAT_2 = "task# 1"; - - private String TASK_FORMAT_3 = "task1"; - - private String TASK_FORMAT_4 = "task #1"; - - private String BUG_FORMAT_1 = "bug# 1"; - - private String BUG_FORMAT_2 = "bug # 1"; - - private String BUG_FORMAT_3 = "bug1"; - - private String BUG_FORMAT_4 = "bug #1"; - - private String BUG_FORMAT_1_2 = "bug# 2"; - - //private BugzillaTaskHyperlinkDetector detector = new BugzillaTaskHyperlinkDetector(); - private TaskHyperlinkDetector detector = new TaskHyperlinkDetector(); - - private TaskRepository dummyRepository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, "repository_url"); - - private RepositoryTextViewer viewer = new RepositoryTextViewer(dummyRepository, new Shell(), SWT.NONE); - - private String[] formats = { TASK_FORMAT_1, TASK_FORMAT_2, TASK_FORMAT_3, TASK_FORMAT_4, BUG_FORMAT_1, - BUG_FORMAT_2, BUG_FORMAT_3, BUG_FORMAT_4 }; - - @Override - protected void setUp() throws Exception { - super.setUp(); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void testBeginning() { - for (String format : formats) { - String testString = format + " is at the beginning"; - viewer.setDocument(new Document(testString)); - Region region = new Region(0, testString.length()); - IHyperlink[] links = detector.detectHyperlinks(viewer, region, false); - assertNotNull(links); - assertEquals(1, links.length); - assertEquals(testString.indexOf(format), links[0].getHyperlinkRegion().getOffset()); - } - } - - public void testEnd() { - for (String format : formats) { - String testString = "is ends with " + format; - viewer.setDocument(new Document(testString)); - Region region = new Region(testString.indexOf(format), testString.length()); - IHyperlink[] links = detector.detectHyperlinks(viewer, region, false); - assertNotNull(links); - assertEquals(1, links.length); - assertEquals(testString.indexOf(format), links[0].getHyperlinkRegion().getOffset()); - } - } - - public void testMiddle() { - for (String format : formats) { - String testString = "is a " + format + " in the middle"; - viewer.setDocument(new Document(testString)); - Region region = new Region(testString.indexOf(format), testString.length()); - IHyperlink[] links = detector.detectHyperlinks(viewer, region, false); - assertNotNull(links); - assertEquals(1, links.length); - assertEquals(testString.indexOf(format), links[0].getHyperlinkRegion().getOffset()); - } - } - - public void testTwoOnSingleLine() { - String testString = "is a " + BUG_FORMAT_1 + " in the middle and at the end " + BUG_FORMAT_1_2; - viewer.setDocument(new Document(testString)); - Region region = new Region(testString.indexOf(BUG_FORMAT_1_2), testString.length()); - IHyperlink[] links = detector.detectHyperlinks(viewer, region, false); - assertNotNull(links); - assertEquals(1, links.length); - assertEquals(testString.indexOf(BUG_FORMAT_1_2), links[0].getHyperlinkRegion().getOffset()); - } - - public void testMultiLine() { - String testString = "is a the first line\n this is the second which ends with a bug, " + BUG_FORMAT_1_2; - viewer.setDocument(new Document(testString)); - Region region = new Region(testString.indexOf(BUG_FORMAT_1_2), testString.length()); - IHyperlink[] links = detector.detectHyperlinks(viewer, region, false); - assertNotNull(links); - assertEquals(1, links.length); - assertEquals(testString.indexOf(BUG_FORMAT_1_2), links[0].getHyperlinkRegion().getOffset()); - } - - public void testDuplicate() { - String testString = "*** This bug has been marked as a " + DUPLICATE + " ***"; - viewer.setDocument(new Document(testString)); - Region region = new Region(testString.indexOf(DUPLICATE), testString.length()); - IHyperlink[] links = detector.detectHyperlinks(viewer, region, false); - assertNotNull(links); - assertEquals(1, links.length); - assertEquals(testString.indexOf(DUPLICATE_NUMBER), links[0].getHyperlinkRegion().getOffset()); - } -} diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java deleted file mode 100644 index 98716236f..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java +++ /dev/null @@ -1,232 +0,0 @@ -/******************************************************************************* - * 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.io.File; -import java.io.IOException; -import java.util.Collection; -import java.util.Set; - -import junit.framework.TestCase; - -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin; -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.tasks.core.AbstractRepositoryQuery; -import org.eclipse.mylyn.tasks.core.AbstractTask; -import org.eclipse.mylyn.tasks.core.AbstractTaskCategory; -import org.eclipse.mylyn.tasks.core.AbstractTaskContainer; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.TaskList; -import org.eclipse.mylyn.tasks.ui.TaskListManager; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; - -/** - * @author Mik Kersten - */ -public class BugzillaTaskListManagerTest extends TestCase { - - private TaskListManager manager; - - private TaskRepository repository; - - @Override - protected void setUp() throws Exception { - super.setUp(); - manager = TasksUiPlugin.getTaskListManager(); - manager.readExistingOrCreateNewList(); - manager.resetTaskList(); - manager.saveTaskList(); - repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.ECLIPSE_BUGZILLA_URL); - TasksUiPlugin.getRepositoryManager().addRepository(repository, - TasksUiPlugin.getDefault().getRepositoriesFilePath()); - assertEquals(0, manager.getTaskList().getAllTasks().size()); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - manager.resetTaskList(); - TasksUiPlugin.getTaskListManager().saveTaskList(); -// TasksUiPlugin.getDefault().getTaskListSaveManager().saveTaskList(true); - TasksUiPlugin.getRepositoryManager().removeRepository(repository, - TasksUiPlugin.getDefault().getRepositoriesFilePath()); - } - - // TODO: move - public void testRemindedPersistance() { - - String repositoryUrl = "https://bugs.eclipse.org/bugs"; - - String bugNumber = "106939"; - - BugzillaTask task1 = new BugzillaTask(repositoryUrl, bugNumber, "label"); - manager.getTaskList().addTask(task1); - - task1.setReminded(true); - - TasksUiPlugin.getTaskListManager().saveTaskList(); - TasksUiPlugin.getTaskListManager().resetTaskList(); - TasksUiPlugin.getTaskListManager().readExistingOrCreateNewList(); - - TaskList taskList = manager.getTaskList(); - assertEquals(1, taskList.getAllTasks().size()); - Set tasksReturned = taskList.getRepositoryTasks(repositoryUrl); - assertNotNull(tasksReturned); - assertEquals(1, tasksReturned.size()); - for (AbstractTask task : tasksReturned) { - assertTrue(task.isReminded()); - } - } - - public void testRepositoryTaskExternalization() { - BugzillaTask repositoryTask = new BugzillaTask("repo", "1", "label"); - repositoryTask.setTaskKind("kind"); - manager.getTaskList().moveToContainer(repositoryTask, - TasksUiPlugin.getTaskListManager().getTaskList().getDefaultCategory()); - manager.saveTaskList(); - - manager.resetTaskList(); - // manager.getTaskList().clear(); - // TaskList list = new TaskList(); - // manager.setTaskList(list); - manager.readExistingOrCreateNewList(); - assertEquals(1, manager.getTaskList().getDefaultCategory().getChildren().size()); - AbstractTask readTask = manager.getTaskList().getDefaultCategory().getChildren().iterator().next(); - - assertEquals(repositoryTask.getHandleIdentifier(), readTask.getHandleIdentifier()); - assertEquals(repositoryTask.getSummary(), readTask.getSummary()); - assertEquals(repositoryTask.getTaskKind(), readTask.getTaskKind()); - } - - public void testQueryExternalization() { - AbstractRepositoryQuery query = new BugzillaRepositoryQuery("repositoryUrl", "queryUrl", "label"); - // long time = 1234; - // Date oldDate = new Date(time); - // query.setLastRefresh(oldDate); - assertEquals("repositoryUrl", query.getRepositoryUrl()); - assertEquals("queryUrl", query.getUrl()); - assertEquals("", query.getLastSynchronizedTimeStamp()); - query.setLastSynchronizedStamp("today"); - // assertEquals(time, query.getLastSynchronized().getTime()); - manager.getTaskList().addQuery(query); - manager.saveTaskList(); - assertNotNull(manager.getTaskList()); - - manager.resetTaskList(); - manager.readExistingOrCreateNewList(); - assertEquals(1, manager.getTaskList().getQueries().size()); - AbstractRepositoryQuery readQuery = manager.getTaskList().getQueries().iterator().next(); - assertEquals(query.getUrl(), readQuery.getUrl()); - assertEquals(query.getRepositoryUrl(), readQuery.getRepositoryUrl()); - assertEquals("today", query.getLastSynchronizedTimeStamp()); - assertEquals("repositoryUrl", readQuery.getRepositoryUrl()); - // assertEquals(time, readQuery.getLastSynchronized().getTime()); - } - - public void testBugzillaCustomQueryExternalization() { - BugzillaRepositoryQuery query = new BugzillaRepositoryQuery("repositoryUrl", "queryUrl", "label"); - query.setCustomQuery(true); - manager.getTaskList().addQuery(query); - manager.saveTaskList(); - - manager.resetTaskList(); - // manager.getTaskList().clear(); - // TaskList list = new TaskList(); - // manager.setTaskList(list); - manager.readExistingOrCreateNewList(); - assertEquals(1, manager.getTaskList().getQueries().size()); - BugzillaRepositoryQuery readQuery = (BugzillaRepositoryQuery) manager.getTaskList() - .getQueries() - .iterator() - .next(); - assertTrue(readQuery.isCustomQuery()); - } - - public void testLegacyTaskListReading() throws IOException { - File originalFile = manager.getTaskListFile(); - File legacyListFile = new File("temptasklist.xml"); - legacyListFile.deleteOnExit(); - BugzillaTestUtil.copy(BugzillaTestUtil.getLocalFile("testdata/legacy/tasklist_0_4_8.xml"), legacyListFile); - - assertEquals(362451, legacyListFile.length()); - assertTrue(legacyListFile.exists()); - - manager.setTaskListFile(legacyListFile); - manager.readExistingOrCreateNewList(); - manager.setTaskListFile(originalFile); - - Collection allTasks = manager.getTaskList().getAllTasks(); - Set allRootTasks = manager.getTaskList().getDefaultCategory().getChildren(); - Set allCategories = manager.getTaskList().getCategories(); - Set allRoots = manager.getTaskList().getRootElements(); - assertEquals(0, allRootTasks.size()); - - manager.saveTaskList(); - // manager.getTaskList().clear(); - manager.resetTaskList(); - // TaskList list = new TaskList(); - // manager.setTaskList(list); - manager.readExistingOrCreateNewList(); - - assertEquals(allRootTasks.size(), manager.getTaskList().getDefaultCategory().getChildren().size()); - assertEquals(allCategories, manager.getTaskList().getCategories()); - assertEquals(allRoots.size(), manager.getTaskList().getRootElements().size()); - assertEquals(allTasks.size(), manager.getTaskList().getAllTasks().size()); - - // rewrite and test again - manager.saveTaskList(); - // manager.getTaskList().clear(); - manager.resetTaskList(); - // list = new TaskList(); - // manager.setTaskList(list); - manager.readExistingOrCreateNewList(); - - assertEquals(allRootTasks.size(), manager.getTaskList().getDefaultCategory().getChildren().size()); - assertEquals(allCategories, manager.getTaskList().getCategories()); - assertEquals(allRoots.size(), manager.getTaskList().getRootElements().size()); - assertEquals(allTasks.size(), manager.getTaskList().getAllTasks().size()); - - manager.deactivateTask(manager.getTaskList().getActiveTask()); - } - - public void testDeleteQuery() { - AbstractRepositoryQuery query = new BugzillaRepositoryQuery("repositoryUrl", "queryUrl", "label"); - manager.getTaskList().addQuery(query); - - AbstractRepositoryQuery readQuery = manager.getTaskList().getQueries().iterator().next(); - assertEquals(query, readQuery); - - manager.getTaskList().deleteQuery(query); - assertEquals(0, manager.getTaskList().getQueries().size()); - } - - public void testDeleteQueryAfterRename() { - AbstractRepositoryQuery query = new BugzillaRepositoryQuery("repositoryUrl", "queryUrl", "label"); - manager.getTaskList().addQuery(query); - - AbstractRepositoryQuery readQuery = manager.getTaskList().getQueries().iterator().next(); - assertEquals(query, readQuery); - manager.getTaskList().renameContainer(query, "newName"); - manager.getTaskList().deleteQuery(query); - assertEquals(0, manager.getTaskList().getQueries().size()); - } - - public void testCreateQueryWithSameName() { - AbstractRepositoryQuery query = new BugzillaRepositoryQuery("repositoryUrl", "queryUrl", "label"); - manager.getTaskList().addQuery(query); - assertEquals(1, manager.getTaskList().getQueries().size()); - AbstractRepositoryQuery readQuery = manager.getTaskList().getQueries().iterator().next(); - assertEquals(query, readQuery); - - manager.getTaskList().addQuery(new BugzillaRepositoryQuery("repositoryUrl", "queryUrl", "label")); - assertEquals(1, manager.getTaskList().getQueries().size()); - } -} diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskTest.java deleted file mode 100644 index 27916eebd..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskTest.java +++ /dev/null @@ -1,81 +0,0 @@ -/******************************************************************************* - * 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.SimpleDateFormat; -import java.util.Date; - -import junit.framework.TestCase; - -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttributeFactory; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaReportElement; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaTask; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaTaskDataHandler; -import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants; -import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; -import org.eclipse.mylyn.tasks.core.RepositoryTaskAttribute; -import org.eclipse.mylyn.tasks.core.RepositoryTaskData; -import org.eclipse.mylyn.tasks.core.TaskComment; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; - -/** - * @author Mik Kersten - */ -public class BugzillaTaskTest extends TestCase { - - private BugzillaAttributeFactory attributeFactory = new BugzillaAttributeFactory(); - - @Override - protected void setUp() throws Exception { - super.setUp(); - new BugzillaTaskDataHandler((BugzillaRepositoryConnector) TasksUiPlugin.getRepositoryManager() - .getRepositoryConnector(BugzillaCorePlugin.REPOSITORY_KIND)); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - } - - 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"); - - //XXX rewrite test - - assertNull(task.getCompletionDate()); - - Date now = new Date(); - 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()); - attribute.setValue(nowTimeStamp); - taskComment.addAttribute(BugzillaReportElement.BUG_WHEN.getKeyString(), attribute); - taskData.addComment(taskComment); - assertNull(task.getCompletionDate()); - - RepositoryTaskAttribute resolvedAttribute = attributeFactory.createAttribute(BugzillaReportElement.BUG_STATUS.getKeyString()); - resolvedAttribute.setValue(IBugzillaConstants.VALUE_STATUS_RESOLVED); - taskData.addAttribute(BugzillaReportElement.BUG_STATUS.getKeyString(), resolvedAttribute); - AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector( - BugzillaCorePlugin.REPOSITORY_KIND); - connector.updateTaskFromTaskData(new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, "http://eclipse.org"), - task, taskData); - assertNotNull(task.getCompletionDate()); - assertEquals(taskData.getAttributeFactory().getDateForAttributeType( - BugzillaReportElement.BUG_WHEN.getKeyString(), nowTimeStamp), task.getCompletionDate()); - - } - -} diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTestPlugin.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTestPlugin.java deleted file mode 100644 index 0b9aa30cd..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTestPlugin.java +++ /dev/null @@ -1,96 +0,0 @@ -/******************************************************************************* - * 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.util.MissingResourceException; -import java.util.ResourceBundle; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The main plugin class to be used in the desktop. - */ -public class BugzillaTestPlugin extends AbstractUIPlugin { - // The shared instance. - private static BugzillaTestPlugin plugin; - - // Resource bundle. - private ResourceBundle resourceBundle; - - /** - * The constructor. - */ - public BugzillaTestPlugin() { - super(); - plugin = this; - } - - /** - * This method is called upon plug-in activation - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - } - - /** - * This method is called when the plug-in is stopped - */ - @Override - public void stop(BundleContext context) throws Exception { - super.stop(context); - plugin = null; - resourceBundle = null; - } - - /** - * Returns the shared instance. - */ - public static BugzillaTestPlugin getDefault() { - return plugin; - } - - /** - * Returns the string from the plugin's resource bundle, or 'key' if not found. - */ - public static String getResourceString(String key) { - ResourceBundle bundle = BugzillaTestPlugin.getDefault().getResourceBundle(); - try { - return (bundle != null) ? bundle.getString(key) : key; - } catch (MissingResourceException e) { - return key; - } - } - - /** - * Returns the plugin's resource bundle, - */ - public ResourceBundle getResourceBundle() { - try { - if (resourceBundle == null) - resourceBundle = ResourceBundle.getBundle("org.eclipse.mylyn.bugzilla.tests.TestsPluginResources"); - } catch (MissingResourceException x) { - resourceBundle = null; - } - return resourceBundle; - } - - /** - * Returns an image descriptor for the image file at the given plug-in relative path. - * - * @param path - * the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.mylyn.bugzilla.tests", path); - } -} diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTestUtil.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTestUtil.java deleted file mode 100644 index 10ddf2f31..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTestUtil.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * 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.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URL; - -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.mylyn.tasks.tests.TasksTestsPlugin; - -/** - * @author Mik Kersten - */ -public class BugzillaTestUtil { - - public static File getLocalFile(String path) { - try { - URL installURL = TasksTestsPlugin.getDefault().getBundle().getEntry(path); - URL localURL = FileLocator.toFileURL(installURL); - return new File(localURL.getFile()); - } catch (IOException e) { - return null; - } - } - - /** - * Adapted from Java Developers' almanac - */ - public static void copy(File source, File dest) throws IOException { - InputStream in = new FileInputStream(source); - OutputStream out = new FileOutputStream(dest); - byte[] buf = new byte[1024]; - int len; - while ((len = in.read(buf)) > 0) { - out.write(buf, 0, len); - } - in.close(); - out.close(); - } -} diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/DuplicateDetetionTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/DuplicateDetetionTest.java deleted file mode 100644 index 161147940..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/DuplicateDetetionTest.java +++ /dev/null @@ -1,271 +0,0 @@ -/******************************************************************************* - * 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 junit.framework.TestCase; - -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttributeFactory; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin; -import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants; -import org.eclipse.mylyn.internal.bugzilla.ui.editor.NewBugzillaTaskEditor; -import org.eclipse.mylyn.tasks.core.RepositoryTaskData; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; -import org.eclipse.mylyn.tasks.ui.TasksUiUtil; -import org.eclipse.mylyn.tasks.ui.editors.AbstractNewRepositoryTaskEditor; -import org.eclipse.mylyn.tasks.ui.editors.NewTaskEditorInput; -import org.eclipse.mylyn.tasks.ui.editors.TaskEditor; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.PlatformUI; - -/** - * @author Jeff Pound - */ -public class DuplicateDetetionTest extends TestCase { - - private TaskRepository repository; - - @Override - protected void setUp() throws Exception { - super.setUp(); - repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); - - } - - public void testDuplicateDetection() throws Exception { - - String stackTrace = "java.lang.NullPointerException\nat jeff.testing.stack.trace.functionality(jeff.java:481)"; - - RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), - BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager() - .getNewRepositoryTaskId()); - model.setDescription(stackTrace); - model.setNew(true); - IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - NewTaskEditorInput input = new NewTaskEditorInput(repository, model); - TasksUiUtil.openEditor(input, TaskEditor.ID_EDITOR, page); - - TaskEditor taskEditor = (TaskEditor) page.getActiveEditor(); - NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance(); - assertTrue(editor.searchForDuplicates()); - - editor.markDirty(false); - editor.close(); - } - - public void testNoStackTrace() throws Exception { - String fakeStackTrace = "this is not really a stacktrace"; - RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), - BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager() - .getNewRepositoryTaskId()); - model.setDescription(fakeStackTrace); - model.setNew(true); - IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - NewTaskEditorInput input = new NewTaskEditorInput(repository, model); - TasksUiUtil.openEditor(input, TaskEditor.ID_EDITOR, page); - - TaskEditor taskEditor = (TaskEditor) page.getActiveEditor(); - NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance(); - assertNull(AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription())); - - editor.markDirty(false); - editor.close(); - } - - public void testStackTraceWithAppendedText() throws Exception { - - String stackTrace = "java.lang.NullPointerException\nat jeff.testing.stack.trace.functionality(jeff.java:481)"; - String extraText = "\nExtra text that isnt' part of the stack trace java:"; - - RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), - BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager() - .getNewRepositoryTaskId()); - - model.setDescription(extraText + "\n" + stackTrace + "\n"); - model.setNew(true); - IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - NewTaskEditorInput input = new NewTaskEditorInput(repository, model); - TasksUiUtil.openEditor(input, TaskEditor.ID_EDITOR, page); - - TaskEditor taskEditor = (TaskEditor) page.getActiveEditor(); - NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance(); - assertEquals(stackTrace, AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()) - .trim()); - - editor.markDirty(false); - editor.close(); - } - - public void testStackTraceMisaligned() throws Exception { - - String stackTrace = "java.lang.IllegalStateException: zip file closed\n" - + " at java.util.zip.ZipFile.ensureOpen (ZipFile.java:518)\n" - + "at java.util.zip.ZipFile.getEntry (ZipFile.java:251)\n" - + " at java.util.jar.JarFile.getEntry(JarFile.java:200)\n" - + "at sun.net.www.protocol.jar.URLJarFile.getEntry\n" + " (URLJarFile.java:90)\n" - + "at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:112)\n" - + "at sun.net.www.protocol.jar.JarURLConnection.getInputStream\n" + "(JarURLConnection.java:124)\n" - + "at org.eclipse.jdt.internal.core.JavaElement\n.getURLContents(JavaElement.java:734)"; - - RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), - BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager() - .getNewRepositoryTaskId()); - - model.setDescription(stackTrace); - model.setNew(true); - IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - NewTaskEditorInput input = new NewTaskEditorInput(repository, model); - TasksUiUtil.openEditor(input, TaskEditor.ID_EDITOR, page); - - TaskEditor taskEditor = (TaskEditor) page.getActiveEditor(); - NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance(); - assertEquals(stackTrace, AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()) - .trim()); - - editor.markDirty(false); - editor.close(); - } - - public void testStackTraceSUN() throws Exception { - - // SUN, IBM (no space before brackets, one set of brackets) - String stackTrace = "java.lang.IllegalStateException: zip file closed\n" - + " at java.util.zip.ZipFile.ensureOpen(ZipFile.java:518)\n" - + " at java.util.zip.ZipFile.getEntry(ZipFile.java:251)\n" - + " at java.util.jar.JarFile.getEntry(JarFile.java:200)\n" - + " at sun.net.www.protocol.jar.URLJarFile.getEntry(URLJarFile.java:90)\n" - + " at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:112)\n" - + " at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:124)\n" - + " at org.eclipse.jdt.internal.core.JavaElement.getURLContents(JavaElement.java:734)"; - - RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), - BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager() - .getNewRepositoryTaskId()); - - model.setDescription(stackTrace); - model.setNew(true); - IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - NewTaskEditorInput input = new NewTaskEditorInput(repository, model); - TasksUiUtil.openEditor(input, TaskEditor.ID_EDITOR, page); - - TaskEditor taskEditor = (TaskEditor) page.getActiveEditor(); - NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance(); - assertEquals(stackTrace, AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()) - .trim()); - - editor.markDirty(false); - editor.close(); - } - - public void testStackTraceGCJ() throws Exception { - - // gcj/gij (path and lib names in additional brackets) - String stackTrace = "java.lang.Error: Something bad happened\n" - + " at testcase.main(java.lang.String[]) (Unknown Source)\n" - + " at gnu.java.lang.MainThread.call_main() (/usr/lib/libgcj.so.6.0.0)\n" - + " at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)"; - - RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), - BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager() - .getNewRepositoryTaskId()); - - model.setDescription(stackTrace); - model.setNew(true); - IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - NewTaskEditorInput input = new NewTaskEditorInput(repository, model); - TasksUiUtil.openEditor(input, TaskEditor.ID_EDITOR, page); - - TaskEditor taskEditor = (TaskEditor) page.getActiveEditor(); - NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance(); - assertEquals(stackTrace, AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()) - .trim()); - - editor.markDirty(false); - editor.close(); - } - - public void testStackTraceNoLineNums() throws Exception { - - // ikvm (no line numbers) - String stackTrace = "java.lang.Error: Something bad happened\n" + " at testcase.main (testcase.java)\n" - + " at java.lang.reflect.Method.Invoke (Method.java)"; - - RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), - BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager() - .getNewRepositoryTaskId()); - - model.setDescription(stackTrace); - model.setNew(true); - IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - NewTaskEditorInput input = new NewTaskEditorInput(repository, model); - TasksUiUtil.openEditor(input, TaskEditor.ID_EDITOR, page); - - TaskEditor taskEditor = (TaskEditor) page.getActiveEditor(); - NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance(); - assertEquals(stackTrace, AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()) - .trim()); - - editor.markDirty(false); - editor.close(); - } - - public void testStackTraceJRockit() throws Exception { - - // jrockit (slash delimiters) - String stackTrace = "java.lang.Error: Something bad happened\n" - + " at java/io/BufferedReader.readLine(BufferedReader.java:331)\n" - + " at java/io/BufferedReader.readLine(BufferedReader.java:362)\n" - + " at java/util/Properties.load(Properties.java:192)\n" - + " at java/util/logging/LogManager.readConfiguration(L:555)"; - - RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), - BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager() - .getNewRepositoryTaskId()); - - model.setDescription(stackTrace); - model.setNew(true); - IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - NewTaskEditorInput input = new NewTaskEditorInput(repository, model); - TasksUiUtil.openEditor(input, TaskEditor.ID_EDITOR, page); - - TaskEditor taskEditor = (TaskEditor) page.getActiveEditor(); - NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance(); - assertEquals(stackTrace, AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()) - .trim()); - - editor.markDirty(false); - editor.close(); - } - - public void testStackTraceOther() throws Exception { - - // jamvm, sablevm, kaffe, cacao (space before brackets, one set of brackets) - String stackTrace = "java.lang.Error: Something bad happened\n" + " at testcase.main (testcase.java:3)\n" - + " at java.lang.VirtualMachine.invokeMain (VirtualMachine.java)\n" - + " at java.lang.VirtualMachine.main (VirtualMachine.java:108)"; - - RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), - BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager() - .getNewRepositoryTaskId()); - - model.setDescription(stackTrace); - model.setNew(true); - IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - NewTaskEditorInput input = new NewTaskEditorInput(repository, model); - TasksUiUtil.openEditor(input, TaskEditor.ID_EDITOR, page); - - TaskEditor taskEditor = (TaskEditor) page.getActiveEditor(); - NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance(); - assertEquals(stackTrace, AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()) - .trim()); - - editor.markDirty(false); - editor.close(); - } -} diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/EncodingTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/EncodingTest.java deleted file mode 100644 index b3e8c7e7f..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/EncodingTest.java +++ /dev/null @@ -1,86 +0,0 @@ -/******************************************************************************* - * 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 org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaReportElement; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaTask; -import org.eclipse.mylyn.tasks.core.RepositoryTaskData; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; - -/** - * @author Mik Kersten - */ -public class EncodingTest extends AbstractBugzillaTest { - - public void testEncodingSetting() { - - String charset = BugzillaClient.getCharsetFromString("text/html; charset=UTF-8"); - assertEquals("UTF-8", charset); - - charset = BugzillaClient.getCharsetFromString("text/html"); - assertEquals(null, charset); - - charset = BugzillaClient.getCharsetFromString("<>"); - assertEquals("iso-8859-2", charset); - - charset = BugzillaClient.getCharsetFromString("<>"); - assertEquals(null, charset); - } - - /** - * This test just shows that when the encoding is changed on the repository synchronization does in fact return in a - * different encoding (though it may not be legible) - */ - public void testDifferentReportEncoding() throws CoreException { - init222(); - repository.setCharacterEncoding("UTF-8"); - BugzillaTask task = (BugzillaTask) connector.createTaskFromExistingId(repository, "57", - new NullProgressMonitor()); - assertNotNull(task); - //TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null); - assertTrue(task.getSummary().equals("\u00E6"));//"\u05D0")); - taskList.deleteTask(task); - connector.getClientManager().repositoryRemoved(repository); - repository.setCharacterEncoding("ISO-8859-1"); - task = (BugzillaTask) connector.createTaskFromExistingId(repository, "57", new NullProgressMonitor()); - assertNotNull(task); - //TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null); - // iso-8859-1 'incorrect' interpretation - assertFalse(task.getSummary().equals("\u00E6"));//"\u05D0")); - } - - public void testProperEncodingUponPost() throws CoreException { - init222(); - repository.setCharacterEncoding("UTF-8"); - BugzillaTask task = (BugzillaTask) connector.createTaskFromExistingId(repository, "57", - new NullProgressMonitor()); - RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), - task.getTaskId()); - assertNotNull(task); - assertTrue(task.getSummary().equals("\u00E6"));//"\u05D0")); - String priority = null; - if (task.getPriority().equals("P1")) { - priority = "P2"; - taskData.setAttributeValue(BugzillaReportElement.PRIORITY.getKeyString(), priority); - } else { - priority = "P1"; - taskData.setAttributeValue(BugzillaReportElement.PRIORITY.getKeyString(), priority); - } - - submit(task, taskData); - taskList.deleteTask(task); - task = (BugzillaTask) connector.createTaskFromExistingId(repository, "57", new NullProgressMonitor()); - assertNotNull(task); - assertTrue(task.getSummary().equals("\u00E6"));//"\u05D0")); - } - -} diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/NewBugWizardTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/NewBugWizardTest.java deleted file mode 100644 index 12bea4912..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/NewBugWizardTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/******************************************************************************* - * 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 junit.framework.TestCase; - -import org.eclipse.core.runtime.Platform; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttributeFactory; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaReportElement; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector; -import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants; -import org.eclipse.mylyn.tasks.core.RepositoryTaskData; -import org.eclipse.mylyn.tasks.core.TaskRepository; - -/** - * @author Mik Kersten - * @author Ian Bull - */ -public class NewBugWizardTest extends TestCase { - - public void testPlatformOptions() throws Exception { - - RepositoryTaskData newReport = new RepositoryTaskData(new BugzillaAttributeFactory(), - BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_220_URL, "1"); - - TaskRepository repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, - IBugzillaConstants.TEST_BUGZILLA_220_URL); - BugzillaRepositoryConnector.setupNewBugAttributes(repository, newReport); - BugzillaCorePlugin.getDefault().setPlatformOptions(newReport); - - String os = Platform.getOS(); - if (os.equals("win32")) - assertEquals("Windows", newReport.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()).getValue()); - else if (os.equals("solaris")) - assertEquals("Solaris", newReport.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()).getValue()); - else if (os.equals("qnx")) - assertEquals("QNX-Photon", newReport.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()).getValue()); - else if (os.equals("macosx")) - assertEquals("Mac OS", newReport.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()).getValue()); - else if (os.equals("linux")) - assertEquals("Linux", newReport.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()).getValue()); - else if (os.equals("hpux")) - assertEquals("HP-UX", newReport.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()).getValue()); - else if (os.equals("aix")) - assertEquals("AIX", newReport.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()).getValue()); - - String platform = Platform.getOSArch(); - if (platform.equals("x86")) { - if (os.equals("macosx")) - assertEquals("Macintosh", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()) - .getValue()); - else - assertEquals("PC", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()).getValue()); - } else if (platform.equals("x86_64")) - assertEquals("PC", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()).getValue()); - else if (platform.equals("ia64")) - assertEquals("PC", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()).getValue()); - else if (platform.equals("ia64_32")) - assertEquals("PC", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()).getValue()); - else if (platform.equals("sparc")) - assertEquals("Sun", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()).getValue()); - else if (platform.equals("ppc")) { - if (os.equals("macosx")) - assertEquals("Macintosh", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()) - .getValue()); - else - assertEquals("Power", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()) - .getValue()); - } - } - -} diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryEditorWizardTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryEditorWizardTest.java deleted file mode 100644 index 0a3b33989..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryEditorWizardTest.java +++ /dev/null @@ -1,180 +0,0 @@ -/******************************************************************************* - * 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.net.UnknownHostException; - -import junit.framework.TestCase; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.mylyn.context.tests.support.TestUtil; -import org.eclipse.mylyn.context.tests.support.TestUtil.Credentials; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClientFactory; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin; -import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants; -import org.eclipse.mylyn.internal.bugzilla.ui.tasklist.BugzillaRepositorySettingsPage; -import org.eclipse.mylyn.internal.tasks.ui.wizards.EditRepositoryWizard; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.TaskRepositoryManager; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; -import org.eclipse.mylyn.web.core.WebClientUtil; -import org.eclipse.ui.PlatformUI; - -/** - * @author Rob Elves - */ -public class RepositoryEditorWizardTest extends TestCase { - - private TaskRepositoryManager manager; - - private TaskRepository repository; - - @Override - protected void setUp() throws Exception { - super.setUp(); - manager = TasksUiPlugin.getRepositoryManager(); - manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); - repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); - Credentials credentials = TestUtil.readCredentials(); - repository.setAuthenticationCredentials(credentials.username, credentials.password); - repository.setAnonymous(false); - TasksUiPlugin.getRepositoryManager().addRepository(repository, - TasksUiPlugin.getDefault().getRepositoriesFilePath()); - } - - public void testValidationInvalidPassword() throws Exception { - - EditRepositoryWizard wizard = new EditRepositoryWizard(repository); - WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), wizard); - dialog.create(); - BugzillaRepositorySettingsPage page = (BugzillaRepositorySettingsPage) wizard.getSettingsPage(); - // BugzillaClient client = - // BugzillaClientFactory.createClient(page.getServerUrl(), - // page.getUserName(), page.getPassword(), page.getHttpAuthUserId(), - // page.getHttpAuthPassword(), page.getCharacterEncoding()); - page.setPassword("bogus"); - try { - BugzillaClient client = BugzillaClientFactory.createClient(page.getServerUrl(), page.getUserName(), - page.getPassword(), page.getHttpAuthUserId(), page.getHttpAuthPassword(), - WebClientUtil.getPlatformProxy(), page.getCharacterEncoding()); - client.validate(); - } catch (CoreException e) { - return; - } - fail("LoginException didn't occur!"); - } - - public void testValidationInvalidUserid() throws Exception { - EditRepositoryWizard wizard = new EditRepositoryWizard(repository); - WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), wizard); - dialog.create(); - BugzillaRepositorySettingsPage page = (BugzillaRepositorySettingsPage) wizard.getSettingsPage(); - page.setUserId("bogus"); - try { - BugzillaClient client = BugzillaClientFactory.createClient(page.getServerUrl(), page.getUserName(), - page.getPassword(), page.getHttpAuthUserId(), page.getHttpAuthPassword(), - WebClientUtil.getPlatformProxy(), page.getCharacterEncoding()); - client.validate(); - } catch (CoreException e) { - return; - } - fail("LoginException didn't occur!"); - } - - public void testValidationInvalidUrl() throws Exception { - EditRepositoryWizard wizard = new EditRepositoryWizard(repository); - WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), wizard); - dialog.create(); - BugzillaRepositorySettingsPage page = (BugzillaRepositorySettingsPage) wizard.getSettingsPage(); - page.setUrl("http://invalid"); - try { - BugzillaClient client = BugzillaClientFactory.createClient(page.getServerUrl(), page.getUserName(), - page.getPassword(), page.getHttpAuthUserId(), page.getHttpAuthPassword(), - WebClientUtil.getPlatformProxy(), page.getCharacterEncoding()); - client.validate(); - } catch (CoreException e) { - assertTrue(e.getStatus().getException() instanceof UnknownHostException); - return; - } - fail("UnknownHostException didn't occur!"); - } - - // TODO: Test locking up? - // public void testAutoVersion() throws Exception { - // repository.setVersion(BugzillaRepositorySettingsPage.LABEL_AUTOMATIC_VERSION); - // EditRepositoryWizard wizard = new EditRepositoryWizard(repository); - // WizardDialog dialog = new - // WizardDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), - // wizard); - // dialog.create(); - // BugzillaRepositorySettingsPage page = (BugzillaRepositorySettingsPage) - // wizard.getSettingsPage(); - // page.setTesting(true); - // assertEquals(BugzillaRepositorySettingsPage.LABEL_AUTOMATIC_VERSION, - // page.getVersion()); - // page.validateSettings(); - // assertEquals("2.22", page.getVersion()); - // } - - public void testPersistChangeOfUrl() throws Exception { - assertEquals(1, manager.getAllRepositories().size()); - String tempUid = repository.getUserName(); - String tempPass = repository.getPassword(); - EditRepositoryWizard wizard = new EditRepositoryWizard(repository); - WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), wizard); - dialog.create(); - BugzillaRepositorySettingsPage page = (BugzillaRepositorySettingsPage) wizard.getSettingsPage(); - BugzillaClient client = BugzillaClientFactory.createClient(page.getServerUrl(), page.getUserName(), - page.getPassword(), page.getHttpAuthUserId(), page.getHttpAuthPassword(), - WebClientUtil.getPlatformProxy(), page.getCharacterEncoding()); - client.validate(); - page.setUrl(IBugzillaConstants.TEST_BUGZILLA_218_URL); - wizard.performFinish(); - assertEquals(1, manager.getAllRepositories().size()); - TaskRepository repositoryTest = manager.getRepository(BugzillaCorePlugin.REPOSITORY_KIND, - IBugzillaConstants.TEST_BUGZILLA_218_URL); - assertNotNull(repositoryTest); - assertEquals(tempUid, repositoryTest.getUserName()); - assertEquals(tempPass, repositoryTest.getPassword()); - } - - public void testPersistChangeUserId() throws Exception { - assertEquals(1, manager.getAllRepositories().size()); - EditRepositoryWizard wizard = new EditRepositoryWizard(repository); - WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), wizard); - dialog.create(); - BugzillaRepositorySettingsPage page = (BugzillaRepositorySettingsPage) wizard.getSettingsPage(); - BugzillaClient client = BugzillaClientFactory.createClient(page.getServerUrl(), page.getUserName(), - page.getPassword(), page.getHttpAuthUserId(), page.getHttpAuthPassword(), - WebClientUtil.getPlatformProxy(), page.getCharacterEncoding()); - client.validate(); - page.setUserId("bogus"); - wizard.performFinish(); - assertEquals(1, manager.getAllRepositories().size()); - TaskRepository repositoryTest = manager.getRepository(BugzillaCorePlugin.REPOSITORY_KIND, - IBugzillaConstants.TEST_BUGZILLA_222_URL); - assertNotNull(repositoryTest); - wizard = new EditRepositoryWizard(repositoryTest); - dialog = new WizardDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), wizard); - dialog.create(); - page = (BugzillaRepositorySettingsPage) wizard.getSettingsPage(); - try { - client = BugzillaClientFactory.createClient(page.getServerUrl(), page.getUserName(), page.getPassword(), - page.getHttpAuthUserId(), page.getHttpAuthPassword(), WebClientUtil.getPlatformProxy(), - page.getCharacterEncoding()); - client.validate(); - } catch (CoreException e) { - return; - } - fail("LoginException didn't occur!"); - } - -} diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryReportFactoryTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryReportFactoryTest.java deleted file mode 100644 index 84587230f..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryReportFactoryTest.java +++ /dev/null @@ -1,452 +0,0 @@ -/******************************************************************************* - * 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 junit.framework.TestCase; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.mylyn.context.tests.support.TestUtil; -import org.eclipse.mylyn.context.tests.support.TestUtil.Credentials; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttributeFactory; -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.BugzillaRepositoryConnector; -import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants; -import org.eclipse.mylyn.tasks.core.AbstractTaskDataHandler; -import org.eclipse.mylyn.tasks.core.RepositoryTaskAttribute; -import org.eclipse.mylyn.tasks.core.RepositoryTaskData; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; - -/** - * @author Rob Elves - * @author Mik Kersten - */ -public class RepositoryReportFactoryTest extends TestCase { - - BugzillaAttributeFactory attributeFactory = new BugzillaAttributeFactory(); - - TaskRepository repository; - - BugzillaRepositoryConnector connector; - - private RepositoryTaskData init(String taskId) throws CoreException { - AbstractTaskDataHandler handler = connector.getTaskDataHandler(); - RepositoryTaskData taskData = handler.getTaskData(repository, taskId, new NullProgressMonitor()); - return taskData; - } - - private TaskRepository setRepository(String kind, String url) { - connector = (BugzillaRepositoryConnector) TasksUiPlugin.getRepositoryManager().getRepositoryConnector( - BugzillaCorePlugin.REPOSITORY_KIND); - repository = new TaskRepository(kind, url); - Credentials credentials = TestUtil.readCredentials(); - repository.setAuthenticationCredentials(credentials.username, credentials.password); - return repository; - } - - public void testInvalidCredentials222() throws Exception { - String bugid = "1"; - String errorMessage = ""; - try { - setRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); - repository.setAuthenticationCredentials("invalid", "invalid"); - init(bugid); - } catch (CoreException e) { - errorMessage = e.getStatus().getMessage(); - } - assertTrue(errorMessage.startsWith("Unable to login")); - repository.flushAuthenticationCredentials(); - } - - public void testBugNotFound222() { - - String bugid = "-1"; - String errorMessage = ""; - try { - setRepository(BugzillaCorePlugin.REPOSITORY_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. - // Note that this is usually called by notification - connector.getClientManager().repositoryAdded(repository); - init(bugid); - } catch (CoreException e) { - errorMessage = e.getStatus().getMessage(); - } - assertTrue(errorMessage.startsWith("Repository error from")); - } - - // public void testReadingReport() throws Exception { - // String bugid = "2"; - // setRepository(BugzillaCorePlugin.REPOSITORY_KIND, - // IBugzillaConstants.TEST_BUGZILLA_222_URL); - // RepositoryTaskData report = init(bugid); - // - // assertNotNull(report); - // assertEquals("search-match-test 1", - // report.getAttribute(BugzillaReportElement.SHORT_DESC.getKeyString()) - // .getValue()); - // assertEquals("TestProduct", - // report.getAttribute(BugzillaReportElement.PRODUCT.getKeyString()).getValue()); - // assertEquals("PC", - // report.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()).getValue()); - // assertEquals("Windows", - // report.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()).getValue()); - // // first comment (#0) is the summary so this value is always 1 - // // greater - // // than what is shown on the report ui - // assertEquals(3, report.getComments().size()); - // assertEquals("search-match-test 1", - // report.getComments().get(0).getAttribute( - // BugzillaReportElement.THETEXT.getKeyString()).getValue()); - // // assertEquals(15, report.getAttachments().size()); - // // assertEquals("1", - // // - // report.getAttachments().get(0).getAttribute(BugzillaReportElement.ATTACHID).getValue()); - // // assertEquals("2006-03-10 14:11", - // // - // report.getAttachments().get(0).getAttribute(BugzillaReportElement.DATE) - // // .getValue()); - // // assertEquals("Testing upload", - // // - // report.getAttachments().get(0).getAttribute(BugzillaReportElement.DESC) - // // .getValue()); - // // assertEquals("patch130217.txt", - // // - // report.getAttachments().get(0).getAttribute(BugzillaReportElement.FILENAME) - // // .getValue()); - // // assertEquals("text/plain", - // // - // report.getAttachments().get(0).getAttribute(BugzillaReportElement.TYPE).getValue()); - // } - - public void testReadingReport222() throws Exception { - String bugid = "2"; - setRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); - RepositoryTaskData report = init(bugid); - - assertNotNull(report); - assertEquals("search-match-test 1", report.getAttribute(BugzillaReportElement.SHORT_DESC.getKeyString()) - .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.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("2007-05-08 12:44:41", 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()) - .getValue()); - assertEquals(2, report.getComments().size()); - // assertEquals("relves@cs.ubc.ca", - // report.getComments().get(0).getAttribute( - // BugzillaReportElement.WHO.getKeyString()).getValue()); - // assertEquals("2006-05-23 17:46:24", - // report.getComments().get(0).getAttribute( - // BugzillaReportElement.BUG_WHEN.getKeyString()).getValue()); - // assertEquals("search-match-test 1", - // report.getComments().get(0).getAttribute( - // BugzillaReportElement.THETEXT.getKeyString()).getValue()); - // assertEquals(0, report.getAttachments().size()); - } - - public void testReadingReport2201() throws Exception { - String bugid = "1"; - setRepository(BugzillaCorePlugin.REPOSITORY_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()) - .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()) - .getValue()); - assertEquals("2006-05-03 13:06:11", report.getAttribute(BugzillaReportElement.DELTA_TS.getKeyString()) - .getValue()); - assertEquals("---", report.getAttribute(BugzillaReportElement.TARGET_MILESTONE.getKeyString()).getValue()); - RepositoryTaskAttribute attribute = report.getAttribute(BugzillaReportElement.BLOCKED.getKeyString()); - assertEquals("2, 9", attribute.getValue()); - attribute = report.getAttribute(BugzillaReportElement.CC.getKeyString()); - 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()) - .getValue()); - } - - // public void testReadingReport2201Eclipse() throws Exception { - // String bugid = "24448"; - // TaskRepository repository = new - // TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, - // IBugzillaConstants.ECLIPSE_BUGZILLA_URL); - // - // RepositoryTaskData report = new RepositoryTaskData(attributeFactory, - // BugzillaCorePlugin.REPOSITORY_KIND, repository - // .getUrl(), bugid); - // BugzillaServerFacade.setupExistingBugAttributes(repository.getUrl(), - // report); - // factory.populateReport(report, repository.getUrl(), null, - // repository.getUserName(), repository.getPassword(), - // null); - // - // assertNotNull(report); - // assertEquals("24448", - // report.getAttribute(BugzillaReportElement.BUG_ID.getKeyString()).getValue()); - // assertEquals("Ant causing Out of Memory", - // report.getAttribute(BugzillaReportElement.SHORT_DESC.getKeyString()) - // .getValue()); - // assertEquals("Platform", - // report.getAttribute(BugzillaReportElement.PRODUCT.getKeyString()).getValue()); - // assertEquals("Ant", - // report.getAttribute(BugzillaReportElement.COMPONENT.getKeyString()).getValue()); - // assertEquals("PC", - // report.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()).getValue()); - // assertEquals("other", - // report.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()).getValue()); - // assertEquals("2.0", - // report.getAttribute(BugzillaReportElement.VERSION.getKeyString()).getValue()); - // assertEquals("P2", - // report.getAttribute(BugzillaReportElement.PRIORITY.getKeyString()).getValue()); - // assertEquals("normal", - // report.getAttribute(BugzillaReportElement.BUG_SEVERITY.getKeyString()).getValue()); - // assertEquals("RESOLVED", - // report.getAttribute(BugzillaReportElement.BUG_STATUS.getKeyString()).getValue()); - // assertEquals("WONTFIX", - // report.getAttribute(BugzillaReportElement.RESOLUTION.getKeyString()).getValue()); - // assertEquals("2002-10-07 09:32", - // report.getAttribute(BugzillaReportElement.CREATION_TS.getKeyString()) - // .getValue()); - // assertEquals("2006-02-03 12:03:57", - // report.getAttribute(BugzillaReportElement.DELTA_TS.getKeyString()) - // .getValue()); - // assertEquals("core, performance, ui", - // report.getAttribute(BugzillaReportElement.KEYWORDS.getKeyString()) - // .getValue()); - // // RepositoryTaskAttribute attribute = - // // report.getAttribute(BugzillaReportElement.CC); - // // assertEquals(30, 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).getValue()); - // // assertEquals("relves@cs.ubc.ca", - // // report.getAttribute(BugzillaReportElement.ASSIGNED_TO).getValue()); - // // assertEquals(1, report.getComments().size()); - // // assertEquals("relves@cs.ubc.ca", - // // - // report.getComments().get(0).getAttribute(BugzillaReportElement.WHO).getValue()); - // // assertEquals("2006-03-02 18:13", - // // - // report.getComments().get(0).getAttribute(BugzillaReportElement.BUG_WHEN) - // // .getValue()); - // // assertEquals("search-match-test 1", - // // - // report.getComments().get(0).getAttribute(BugzillaReportElement.THETEXT) - // // .getValue()); - // // assertEquals(0, report.getAttachments().size()); - // } - - // public void testReadingReport220() throws Exception { - // String bugid = "1"; - // TaskRepository repository = new - // TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, - // IBugzillaConstants.TEST_BUGZILLA_220_URL); - // - // RepositoryTaskData report = new RepositoryTaskData(attributeFactory, - // BugzillaCorePlugin.REPOSITORY_KIND, - // repository.getUrl(), bugid); - // BugzillaServerFacade.setupExistingBugAttributes(repository.getUrl(), - // report); - // factory.populateReport(report, repository.getUrl(), null, - // repository.getUserName(), repository.getPassword(), - // null); - // - // assertNotNull(report); - // assertEquals("1", - // report.getAttribute(BugzillaReportElement.BUG_ID.getKeyString()).getValue()); - // assertEquals("search-match-test", - // report.getAttribute(BugzillaReportElement.SHORT_DESC.getKeyString()) - // .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 17:30", - // report.getAttribute(BugzillaReportElement.CREATION_TS.getKeyString()) - // .getValue()); - // assertEquals("2006-04-20 15:13:43", - // 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()) - // .getValue()); - // assertEquals("relves@cs.ubc.ca", - // report.getAttribute(BugzillaReportElement.CC.getKeyString()).getValue()); - // assertEquals(3, report.getComments().size()); - // assertEquals("relves@cs.ubc.ca", - // report.getComments().get(0).getAttribute( - // BugzillaReportElement.WHO.getKeyString()).getValue()); - // assertEquals("2006-03-02 17:30", - // report.getComments().get(0).getAttribute( - // BugzillaReportElement.BUG_WHEN.getKeyString()).getValue()); - // assertEquals("search-match-test", - // report.getComments().get(0).getAttribute( - // BugzillaReportElement.THETEXT.getKeyString()).getValue()); - // assertEquals(0, report.getAttachments().size()); - // } - - public void testReadingReport218() throws Exception { - String bugid = "1"; - setRepository(BugzillaCorePlugin.REPOSITORY_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()) - .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()) - .getValue()); - assertEquals(0, report.getAttachments().size()); - } - - public void testTimeTracking222() throws Exception { - setRepository(BugzillaCorePlugin.REPOSITORY_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()); - } - - // public void testTimeTracking2201() throws Exception { - // RepositoryTaskData report = - // init(IBugzillaConstants.TEST_BUGZILLA_2201_URL, 23); - // - // 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("2005-03-04", - // report.getAttribute(BugzillaReportElement.DEADLINE.getKeyString()).getValue()); - // } - // - // public void testTimeTracking220() throws Exception { - // RepositoryTaskData report = - // init(IBugzillaConstants.TEST_BUGZILLA_220_URL, 9); - // - // 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("2005-03-04", - // report.getAttribute(BugzillaReportElement.DEADLINE.getKeyString()).getValue()); - // } - - public void testTimeTracking218() throws Exception { - setRepository(BugzillaCorePlugin.REPOSITORY_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()); - } - - public void testMultipleDepensOn() throws Exception { - String bugid = "5"; - setRepository(BugzillaCorePlugin.REPOSITORY_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()); - } - - public void testBugReportAPI() throws Exception { - String bugid = "3"; - setRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); - RepositoryTaskData report = init(bugid); - assertNotNull(report); - assertTrue(report != null); - RepositoryTaskData bugReport = report; - assertEquals("search-match-test 2", bugReport.getSummary()); - assertEquals("search-match-test 2", bugReport.getDescription()); - assertEquals("TestProduct", bugReport.getProduct()); - assertEquals("nhapke@cs.ubc.ca", bugReport.getAssignedTo()); - } - - public void testDeltaTsTruncation() { - String ts1 = "2006-07-06 03:22:08 0900"; - String ts1_truncated = "2006-07-06 03:22:08"; - assertEquals(ts1_truncated, BugzillaClient.stripTimeZone(ts1)); - - String ts2 = "2006-07-06 03:22:08"; - String ts2_truncated = "2006-07-06 03:22:08"; - assertEquals(ts2_truncated, BugzillaClient.stripTimeZone(ts2)); - - String ts3 = "2006-07-06 03:22:08 PST"; - String ts3_truncated = "2006-07-06 03:22:08"; - assertEquals(ts3_truncated, BugzillaClient.stripTimeZone(ts3)); - } - -} diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryTaskHandleTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryTaskHandleTest.java deleted file mode 100644 index bf78c462a..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryTaskHandleTest.java +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 - 2006 Mylar 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 junit.framework.TestCase; - -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaTask; -import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants; -import org.eclipse.mylyn.tasks.ui.TaskListManager; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; - -/** - * @author Mik Kersten - */ -public class RepositoryTaskHandleTest extends TestCase { - - private TaskListManager manager = TasksUiPlugin.getTaskListManager(); - - @Override - protected void setUp() throws Exception { - super.setUp(); - manager = TasksUiPlugin.getTaskListManager(); - manager.resetTaskList(); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - manager.resetTaskList(); - } - - // Dash now allowed in task id - // public void testInvalidHandle() { - // // MockRepositoryTask task = new MockRepositoryTask() - // String url = "http://foo"; - // assertEquals(url + "-" + "abc", RepositoryTaskHandleUtil.getHandle(url, - // "abc")); - // Exception caught = null; - // try { - // RepositoryTaskHandleUtil.getHandle(url, "a-23"); - // } catch (Exception e) { - // caught = e; - // } - // assertNotNull(caught); - // } - - public void testRepositoryUrlHandles() { - - String repository = IBugzillaConstants.ECLIPSE_BUGZILLA_URL; - String id = "123"; - BugzillaTask bugTask = new BugzillaTask(repository, id, "label 124"); - assertEquals(repository, bugTask.getRepositoryUrl()); - - manager.getTaskList().moveToContainer(bugTask, - TasksUiPlugin.getTaskListManager().getTaskList().getDefaultCategory()); - manager.saveTaskList(); - manager.resetTaskList(); - manager.readExistingOrCreateNewList(); - - BugzillaTask readReport = (BugzillaTask) manager.getTaskList() - .getDefaultCategory() - .getChildren() - .iterator() - .next(); - assertEquals(readReport.getSummary(), readReport.getSummary()); - assertEquals(readReport.getRepositoryUrl(), readReport.getRepositoryUrl()); - } -} diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskEditorTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskEditorTest.java deleted file mode 100644 index 4d88eaa4e..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskEditorTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 - 2006 Mylar 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 junit.framework.TestCase; - -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttributeFactory; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector; -import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants; -import org.eclipse.mylyn.tasks.core.RepositoryTaskData; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; -import org.eclipse.mylyn.tasks.ui.TasksUiUtil; -import org.eclipse.mylyn.tasks.ui.editors.AbstractRepositoryTaskEditor; -import org.eclipse.mylyn.tasks.ui.editors.NewTaskEditorInput; -import org.eclipse.mylyn.tasks.ui.editors.TaskEditor; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.PlatformUI; - -/** - * @author Jeff Pound - */ -public class TaskEditorTest extends TestCase { - - private static final String DESCRIPTION = "summary"; - - @Override - protected void setUp() throws Exception { - super.setUp(); - } - - @Override - protected void tearDown() throws Exception { - PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false); - TasksUiPlugin.getRepositoryManager().clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); - TasksUiPlugin.getTaskListManager().resetTaskList(); - TasksUiPlugin.getTaskListManager().saveTaskList(); - // TasksUiPlugin.getDefault().getTaskListSaveManager().saveTaskList(true); - super.tearDown(); - } - - /** - * Automated task creation needs to access newly created task editors. This test tests that the access is available. - * - * @throws Exception - */ - public void testAccessNewEditor() throws Exception { - TaskRepository repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, - IBugzillaConstants.TEST_BUGZILLA_222_URL); - - RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), - BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager() - .getNewRepositoryTaskId()); - model.setNew(true); - BugzillaRepositoryConnector.setupNewBugAttributes(repository, model); - NewTaskEditorInput editorInput = new NewTaskEditorInput(repository, model); - IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - TasksUiUtil.openEditor(editorInput, TaskEditor.ID_EDITOR, page); - assertTrue(page.getActiveEditor() instanceof TaskEditor); - TaskEditor taskEditor = (TaskEditor) page.getActiveEditor(); - assertTrue(taskEditor.getActivePageInstance() instanceof AbstractRepositoryTaskEditor); - AbstractRepositoryTaskEditor editor = (AbstractRepositoryTaskEditor) taskEditor.getActivePageInstance(); - - String desc = DESCRIPTION; - String summary = "summary"; - // ensure we have access without exceptions - editor.setDescriptionText(desc); - editor.setSummaryText(summary); - // editor.doSave(new NullProgressMonitor()); - } - -} diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListNotificationManagerTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListNotificationManagerTest.java deleted file mode 100644 index 4278863b9..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListNotificationManagerTest.java +++ /dev/null @@ -1,134 +0,0 @@ -/******************************************************************************* - * 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.util.Date; - -import junit.framework.TestCase; - -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryQuery; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaTask; -import org.eclipse.mylyn.internal.tasks.core.LocalTask; -import org.eclipse.mylyn.internal.tasks.ui.ITaskListNotification; -import org.eclipse.mylyn.internal.tasks.ui.TaskListNotificationIncoming; -import org.eclipse.mylyn.internal.tasks.ui.TaskListNotificationManager; -import org.eclipse.mylyn.tasks.core.AbstractTask; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.AbstractTask.RepositoryTaskSyncState; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; - -/** - * @author Rob Elves - */ -public class TaskListNotificationManagerTest extends TestCase { - - @Override - protected void setUp() throws Exception { - super.setUp(); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void testTaskListNotificationReminder() throws InterruptedException { - - Date now = new Date(); - - AbstractTask task0 = new LocalTask("0", "t0 - test 0"); - AbstractTask task1 = new LocalTask("1", "t1 - test 1"); - AbstractTask task2 = new LocalTask("2", "t2 - test 2"); - - task0.setScheduledForDate(new Date(now.getTime() - 2000)); - task1.setScheduledForDate(new Date(now.getTime() - 2000)); - task2.setScheduledForDate(new Date(now.getTime() - 2000)); - - TasksUiPlugin.getTaskListManager().getTaskList().addTask(task0); - TasksUiPlugin.getTaskListManager().getTaskList().addTask(task1); - TasksUiPlugin.getTaskListManager().getTaskList().addTask(task2); - - TaskListNotificationManager notificationManager = TasksUiPlugin.getTaskListNotificationManager(); - notificationManager.collectNotifications(); - - task0 = TasksUiPlugin.getTaskListManager().getTaskList().getTask("local-0"); - assertNotNull(task0); - assertTrue(task0.isReminded()); - task1 = TasksUiPlugin.getTaskListManager().getTaskList().getTask("local-1"); - assertNotNull(task1); - assertTrue(task1.isReminded()); - task2 = TasksUiPlugin.getTaskListManager().getTaskList().getTask("local-2"); - assertNotNull(task2); - assertTrue(task2.isReminded()); - - } - - public void testTaskListNotificationIncoming() { - - TaskRepository repository = new TaskRepository("bugzilla", "https://bugs.eclipse.org/bugs"); - TasksUiPlugin.getRepositoryManager().addRepository(repository, - TasksUiPlugin.getDefault().getRepositoriesFilePath()); - AbstractTask task = new BugzillaTask("https://bugs.eclipse.org/bugs", "142891", "label"); - assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState()); - assertFalse(task.isNotified()); - TasksUiPlugin.getTaskListManager().getTaskList().addTask(task); - TaskListNotificationManager notificationManager = TasksUiPlugin.getTaskListNotificationManager(); - notificationManager.collectNotifications(); - assertTrue(notificationManager.getNotifications().contains(new TaskListNotificationIncoming(task))); - task = TasksUiPlugin.getTaskListManager().getTaskList().getTask("https://bugs.eclipse.org/bugs-142891"); - assertNotNull(task); - assertTrue(task.isNotified()); - } - - public void testTaskListNotificationQueryIncoming() { - BugzillaTask hit = new BugzillaTask("https://bugs.eclipse.org/bugs", "1", "summary"); - assertFalse(hit.isNotified()); - BugzillaRepositoryQuery query = new BugzillaRepositoryQuery("https://bugs.eclipse.org/bugs", "queryUrl", - "summary"); - TasksUiPlugin.getTaskListManager().getTaskList().addQuery(query); - TasksUiPlugin.getTaskListManager().getTaskList().addTask(hit, query); - - TaskListNotificationManager notificationManager = TasksUiPlugin.getTaskListNotificationManager(); - assertFalse(hit.isNotified()); - notificationManager.collectNotifications(); - for (ITaskListNotification notification : notificationManager.getNotifications()) { - notification.getLabel().equals(hit.getSummary()); - } - //assertTrue(notificationManager.getNotifications().contains(new TaskListNotificationQueryIncoming(hit))); - assertTrue(hit.isNotified()); - } - - public void testTaskListNotificationQueryIncomingRepeats() { - TasksUiPlugin.getTaskListManager().resetTaskList(); - BugzillaTask hit = new BugzillaTask("https://bugs.eclipse.org/bugs", "1", "summary"); - String hitHandle = hit.getHandleIdentifier(); - assertFalse(hit.isNotified()); - BugzillaRepositoryQuery query = new BugzillaRepositoryQuery("https://bugs.eclipse.org/bugs", "queryUrl", - "summary"); - TasksUiPlugin.getTaskListManager().getTaskList().addQuery(query); - TasksUiPlugin.getTaskListManager().getTaskList().addTask(hit, query); - TaskListNotificationManager notificationManager = TasksUiPlugin.getTaskListNotificationManager(); - notificationManager.collectNotifications(); - for (ITaskListNotification notification : notificationManager.getNotifications()) { - notification.getLabel().equals(hit.getSummary()); - } - //assertTrue(notificationManager.getNotifications().iterator().next().equals(new TaskListNotificationQueryIncoming(hit))); - assertTrue(hit.isNotified()); - - TasksUiPlugin.getTaskListManager().saveTaskList(); - TasksUiPlugin.getTaskListManager().resetTaskList(); - assertEquals(0, TasksUiPlugin.getTaskListManager().getTaskList().getQueries().size()); - assertTrue(TasksUiPlugin.getTaskListManager().readExistingOrCreateNewList()); - assertEquals(1, TasksUiPlugin.getTaskListManager().getTaskList().getQueries().size()); - BugzillaTask hitLoaded = (BugzillaTask) TasksUiPlugin.getTaskListManager().getTaskList().getTask(hitHandle); - assertNotNull(hitLoaded); - assertTrue(hitLoaded.isNotified()); - } - -} diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListStandaloneTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListStandaloneTest.java deleted file mode 100644 index e43e3d3d4..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListStandaloneTest.java +++ /dev/null @@ -1,208 +0,0 @@ -/******************************************************************************* - * 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.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; -import java.util.Set; - -import junit.framework.TestCase; - -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.ui.tasklist.BugzillaTaskListFactory; -import org.eclipse.mylyn.internal.tasks.core.LocalTask; -import org.eclipse.mylyn.tasks.core.AbstractTask; -import org.eclipse.mylyn.tasks.core.AbstractTaskListFactory; -import org.eclipse.mylyn.tasks.ui.TaskListManager; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; - -/** - * @author Mik Kersten - * @author Rob Elves - */ -public class TaskListStandaloneTest extends TestCase { - - private TaskListManager manager; - - @Override - protected void setUp() throws Exception { - super.setUp(); - TasksUiPlugin.getRepositoryManager().clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); - manager = TasksUiPlugin.getTaskListManager(); - - manager.resetTaskList(); - assertEquals("should be empty: " + manager.getTaskList().getDefaultCategory().getChildren(), 0, - manager.getTaskList().getDefaultCategory().getChildren().size()); - } - - @Override - protected void tearDown() throws Exception { - manager.resetTaskList(); - manager.saveTaskList(); - super.tearDown(); - } - - public void testDueDateExternalization() { - AbstractTask task = new LocalTask("1", "task 1"); - Date dueDate = new Date(); - task.setDueDate(dueDate); - manager.getTaskList().moveToContainer(task, manager.getTaskList().getDefaultCategory()); - assertEquals(1, manager.getTaskList().getAllTasks().size()); - - manager.saveTaskList(); - manager.resetTaskList(); - manager.readExistingOrCreateNewList(); - assertEquals(1, manager.getTaskList().getAllTasks().size()); - Set readList = manager.getTaskList().getDefaultCategory().getChildren(); - AbstractTask readTask = readList.iterator().next(); - assertTrue(readTask.getSummary().equals("task 1")); - assertTrue(readTask.getDueDate().compareTo(dueDate) == 0); - } - - public void testPastReminder() { - AbstractTask task = new LocalTask("1", "1"); - long now = new Date().getTime(); - task.setScheduledForDate(new Date(now - 1000)); - assertTrue(task.isPastReminder()); - - task.setScheduledForDate(new Date(now + 1000)); - assertFalse(task.isPastReminder()); - - task.setScheduledForDate(new Date(now - 1000)); - task.setCompleted(true); - assertTrue(task.isPastReminder()); - } - - public void testDates() { - Date start = Calendar.getInstance().getTime(); - Date creation = new Date(); - AbstractTask task = new LocalTask("1", "task 1"); - - manager.getTaskList().moveToContainer(task, manager.getTaskList().getDefaultCategory()); - assertDatesCloseEnough(task.getCreationDate(), start); - - task.setCompleted(true); - assertDatesCloseEnough(task.getCompletionDate(), start); - - task.setScheduledForDate(start); - assertDatesCloseEnough(task.getScheduledForDate(), start); - - assertEquals(2, manager.getTaskList().getRootElements().size()); - manager.saveTaskList(); - - assertNotNull(manager.getTaskList()); - // TaskList list = new TaskList(); - // manager.setTaskList(list); - // assertEquals(0, manager.getTaskList().getRootTasks().size()); - // manager.readOrCreateTaskList(); - // assertNotNull(manager.getTaskList()); - assertEquals(1, manager.getTaskList().getDefaultCategory().getChildren().size()); - - Set readList = manager.getTaskList().getDefaultCategory().getChildren(); - AbstractTask readTask = readList.iterator().next(); - assertTrue(readTask.getSummary().equals("task 1")); - - assertEquals("should be: " + creation, task.getCreationDate(), readTask.getCreationDate()); - assertEquals(task.getCompletionDate(), readTask.getCompletionDate()); - assertEquals(task.getScheduledForDate(), readTask.getScheduledForDate()); - } - - // Task retention when connector missing upon startup - public void testOrphanedTasks() { - List originalExternalizers = manager.getTaskListWriter().getExternalizers(); - List externalizers; - externalizers = new ArrayList(); - externalizers.add(new BugzillaTaskListFactory()); - // make some tasks - // save them - BugzillaTask task = new BugzillaTask("http://bugs", "1", "1"); - manager.getTaskList().addTask(task); - manager.saveTaskList(); - - // reload tasklist and check that they persist - manager.resetTaskList(); - manager.readExistingOrCreateNewList(); - assertEquals(1, manager.getTaskList().getAllTasks().size()); - - // removed/disable externalizers - externalizers.clear(); - manager.getTaskListWriter().setDelegateExternalizers(externalizers); - - // reload tasklist ensure task didn't load - manager.resetTaskList(); - manager.readExistingOrCreateNewList(); - assertEquals(0, manager.getTaskList().getAllTasks().size()); - // Save the task list (tasks with missing connectors should get - // persisted) - manager.saveTaskList(); - - // re-enable connector - externalizers.add(new BugzillaTaskListFactory()); - manager.getTaskListWriter().setDelegateExternalizers(externalizers); - - // re-load tasklist - manager.resetTaskList(); - manager.readExistingOrCreateNewList(); - - // ensure that task now gets loaded - assertEquals(1, manager.getTaskList().getAllTasks().size()); - manager.getTaskListWriter().setDelegateExternalizers(originalExternalizers); - } - - // Query retention when connector missing/fails to load - public void testOrphanedQueries() { - List originalExternalizers = manager.getTaskListWriter().getExternalizers(); - List externalizers; - externalizers = new ArrayList(); - externalizers.add(new BugzillaTaskListFactory()); - // make a query - BugzillaRepositoryQuery query = new BugzillaRepositoryQuery(IBugzillaConstants.TEST_BUGZILLA_222_URL, - "http://queryurl", "summary"); - - manager.getTaskList().addQuery(query); - manager.saveTaskList(); - - // reload tasklist and check that they persist - manager.resetTaskList(); - manager.readExistingOrCreateNewList(); - assertEquals(1, manager.getTaskList().getQueries().size()); - - // removed/disable externalizers - externalizers.clear(); - manager.getTaskListWriter().setDelegateExternalizers(externalizers); - - // reload tasklist ensure query didn't load - manager.resetTaskList(); - manager.readExistingOrCreateNewList(); - assertEquals(0, manager.getTaskList().getQueries().size()); - // Save the task list (queries with missing connectors should get - // persisted) - manager.saveTaskList(); - - // re-enable connector - externalizers.add(new BugzillaTaskListFactory()); - manager.getTaskListWriter().setDelegateExternalizers(externalizers); - - // re-load tasklist - manager.resetTaskList(); - manager.readExistingOrCreateNewList(); - - // ensure that task now gets loaded - assertEquals(1, manager.getTaskList().getQueries().size()); - manager.getTaskListWriter().setDelegateExternalizers(originalExternalizers); - } - - public void assertDatesCloseEnough(Date first, Date second) { - assertTrue(second.getTime() - first.getTime() < 100); - } -} diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskReportGeneratorTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskReportGeneratorTest.java deleted file mode 100644 index 62021b7ac..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskReportGeneratorTest.java +++ /dev/null @@ -1,186 +0,0 @@ -/******************************************************************************* - * 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.lang.reflect.InvocationTargetException; -import java.util.Date; -import java.util.HashSet; -import java.util.Set; - -import junit.framework.TestCase; - -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryQuery; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaTask; -import org.eclipse.mylyn.internal.tasks.core.TaskCategory; -import org.eclipse.mylyn.internal.tasks.ui.planner.CompletedTaskCollector; -import org.eclipse.mylyn.internal.tasks.ui.planner.TaskReportGenerator; -import org.eclipse.mylyn.tasks.core.AbstractTask; -import org.eclipse.mylyn.tasks.core.AbstractTaskContainer; -import org.eclipse.mylyn.tasks.ui.TaskListManager; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; - -/** - * @author Mik Kersten - * @author Rob Elves - */ -public class TaskReportGeneratorTest extends TestCase { - - private TaskListManager manager; - - @Override - protected void setUp() throws Exception { - super.setUp(); - manager = TasksUiPlugin.getTaskListManager(); - manager.resetTaskList(); - assertEquals(0, manager.getTaskList().getAllTasks().size()); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - manager.resetTaskList(); - TasksUiPlugin.getTaskListManager().saveTaskList(); -// TasksUiPlugin.getDefault().getTaskListSaveManager().saveTaskList(true); - assertEquals(0, manager.getTaskList().getAllTasks().size()); - } - - public void testCompletedTasksRetrieved() throws InvocationTargetException, InterruptedException { - AbstractTask task1 = manager.createNewLocalTask("task 1"); - manager.getTaskList().moveToContainer(task1, manager.getTaskList().getDefaultCategory()); - - CompletedTaskCollector collector = new CompletedTaskCollector(new Date(0)); - TaskReportGenerator generator = new TaskReportGenerator(manager.getTaskList()); - generator.addCollector(collector); - generator.run(new NullProgressMonitor()); - assertEquals(0, generator.getAllCollectedTasks().size()); - - task1.setCompleted(true); - generator.run(new NullProgressMonitor()); - assertEquals(1, generator.getAllCollectedTasks().size()); - assertEquals(task1, generator.getAllCollectedTasks().get(0)); - } - - public void testCompletedTasksDateBoundsRetrieved() throws InvocationTargetException, InterruptedException { - AbstractTask task1 = manager.createNewLocalTask("task 1"); - manager.getTaskList().moveToContainer(task1, manager.getTaskList().getDefaultCategory()); - task1.setCompleted(true); - Thread.sleep(1000); - long now = new Date().getTime(); - - CompletedTaskCollector collector = new CompletedTaskCollector(new Date(now)); - TaskReportGenerator generator = new TaskReportGenerator(manager.getTaskList()); - generator.addCollector(collector); - generator.run(new NullProgressMonitor()); - assertEquals(0, generator.getAllCollectedTasks().size()); - - generator = new TaskReportGenerator(manager.getTaskList()); - collector = new CompletedTaskCollector(new Date(now - 8000)); - generator.addCollector(collector); - generator.run(new NullProgressMonitor()); - assertEquals(1, generator.getAllCollectedTasks().size()); - assertEquals(task1, generator.getAllCollectedTasks().get(0)); - } - - public void testCompletedBugzillaTasksRetrieved() throws InvocationTargetException, InterruptedException { - BugzillaTask task1 = new BugzillaTask("repo", "1", "bugzillatask 1"); - manager.getTaskList().moveToContainer(task1, manager.getTaskList().getDefaultCategory()); - - CompletedTaskCollector collector = new CompletedTaskCollector(new Date(0)); - TaskReportGenerator generator = new TaskReportGenerator(manager.getTaskList()); - generator.addCollector(collector); - generator.run(new NullProgressMonitor()); - assertEquals(0, generator.getAllCollectedTasks().size()); - - task1.setCompleted(true); - generator.run(new NullProgressMonitor()); - assertEquals(1, generator.getAllCollectedTasks().size()); - assertEquals(task1, generator.getAllCollectedTasks().get(0)); - } - - public void testCompletedTasksInCategoryRetrieved() throws InvocationTargetException, InterruptedException { - AbstractTask task1 = manager.createNewLocalTask("task 1"); - manager.getTaskList().moveToContainer(task1, manager.getTaskList().getDefaultCategory()); - task1.setCompleted(true); - TaskCategory cat1 = new TaskCategory("TaskReportGeneratorTest Category"); - manager.getTaskList().addCategory(cat1); - - Set catagories = new HashSet(); - catagories.add(cat1); - - CompletedTaskCollector collector = new CompletedTaskCollector(new Date(0)); - TaskReportGenerator generator = new TaskReportGenerator(manager.getTaskList(), catagories); - generator.addCollector(collector); - generator.run(new NullProgressMonitor()); - assertEquals(0, generator.getAllCollectedTasks().size()); - - manager.getTaskList().moveToContainer(task1, cat1); - - generator.run(new NullProgressMonitor()); - assertEquals(1, generator.getAllCollectedTasks().size()); - assertEquals(task1, generator.getAllCollectedTasks().get(0)); - } - - public void testCompletedBugzillaTasksInCategoryRetrieved() throws InvocationTargetException, InterruptedException { - BugzillaTask task1 = new BugzillaTask("repo", "1", "task 1"); - manager.getTaskList().moveToContainer(task1, - TasksUiPlugin.getTaskListManager().getTaskList().getDefaultCategory()); - task1.setCompleted(true); - TaskCategory cat1 = new TaskCategory("TaskReportGeneratorTest Category"); - manager.getTaskList().addCategory(cat1); - - Set catagories = new HashSet(); - catagories.add(cat1); - - CompletedTaskCollector collector = new CompletedTaskCollector(new Date(0)); - TaskReportGenerator generator = new TaskReportGenerator(manager.getTaskList(), catagories); - generator.addCollector(collector); - generator.run(new NullProgressMonitor()); - assertEquals(0, generator.getAllCollectedTasks().size()); - - manager.getTaskList().moveToContainer(task1, cat1); - - generator.run(new NullProgressMonitor()); - assertEquals(1, generator.getAllCollectedTasks().size()); - assertEquals(task1, generator.getAllCollectedTasks().get(0)); - } - - public void testCompletedBugzillaTasksInQueryRetrieved() throws InvocationTargetException, InterruptedException { - BugzillaTask task1 = new BugzillaTask("repo", "1", "task 1"); - manager.getTaskList().moveToContainer(task1, - TasksUiPlugin.getTaskListManager().getTaskList().getDefaultCategory()); - task1.setCompleted(false); - - BugzillaRepositoryQuery bugQuery = new BugzillaRepositoryQuery("repositoryUrl", "queryUrl", - "TaskReportGeneratorBugzillaQueryCategory"); - - manager.getTaskList().addQuery(bugQuery); - - Set catagories = new HashSet(); - catagories.add(bugQuery); - - CompletedTaskCollector collector = new CompletedTaskCollector(new Date(0)); - TaskReportGenerator generator = new TaskReportGenerator(manager.getTaskList(), catagories); - generator.addCollector(collector); - generator.run(new NullProgressMonitor()); - assertEquals(0, generator.getAllCollectedTasks().size()); - - manager.getTaskList().addTask(task1, bugQuery); - - generator.run(new NullProgressMonitor()); - assertEquals(0, generator.getAllCollectedTasks().size()); - - task1.setCompleted(true); - - generator.run(new NullProgressMonitor()); - assertEquals(1, generator.getAllCollectedTasks().size()); - assertEquals(task1, generator.getAllCollectedTasks().get(0)); - } - -} diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaQueryTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaQueryTest.java deleted file mode 100644 index b26e79e87..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaQueryTest.java +++ /dev/null @@ -1,175 +0,0 @@ -/******************************************************************************* - * 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.headless; - -import junit.framework.TestCase; - -import org.eclipse.core.runtime.NullProgressMonitor; -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.BugzillaReportElement; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryQuery; -import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants; -import org.eclipse.mylyn.tasks.core.AbstractTask; -import org.eclipse.mylyn.tasks.core.AbstractTaskDataHandler; -import org.eclipse.mylyn.tasks.core.QueryHitCollector; -import org.eclipse.mylyn.tasks.core.RepositoryTaskData; -import org.eclipse.mylyn.tasks.core.TaskList; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.ui.TaskFactory; - -// import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; - -/** - * Example use of headless API (no ui dependencies) - * - * @author Rob Elves - * @author Nathan Hapke - */ -public class BugzillaQueryTest extends TestCase { - - private TaskRepository repository; - - private BugzillaRepositoryConnector connector; - - private AbstractTaskDataHandler handler; - - @Override - protected void setUp() throws Exception { - super.setUp(); - // - // connector = (BugzillaRepositoryConnector) - // TasksUiPlugin.getRepositoryManager().getRepositoryConnector( - // BugzillaCorePlugin.REPOSITORY_KIND); - - connector = new BugzillaRepositoryConnector(); - connector.init(new TaskList()); - handler = connector.getTaskDataHandler(); - repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); - Credentials credentials = TestUtil.readCredentials(); - repository.setAuthenticationCredentials(credentials.username, credentials.password); - } - - /** - * This is the first test so that the repository credentials are correctly set for the other tests - */ - public void testAddCredentials() { - if (!repository.hasCredentials()) { - Credentials credentials = TestUtil.readCredentials(); - repository.setAuthenticationCredentials(credentials.username, credentials.password); - - assertTrue(repository.hasCredentials()); - } - } - - public void testGetBug() throws Exception { - RepositoryTaskData taskData = handler.getTaskData(repository, "1", new NullProgressMonitor()); - assertNotNull(taskData); - assertEquals("user@mylar.eclipse.org", taskData.getAssignedTo()); - assertEquals("foo", taskData.getDescription()); - - // You can use the getAttributeValue to pull up the information on any - // part of the bug - assertEquals("P1", taskData.getAttributeValue(BugzillaReportElement.PRIORITY.getKeyString())); - } - - // TODO: Uncomment when bug#176513 completed -// public void testGetBugs() throws Exception { -// HashSet taskIds = new HashSet(); -// taskIds.add("1"); -// taskIds.add("2"); -// taskIds.add("4"); -// Map taskDataMap = handler.getTaskData(repository, taskIds); -// assertNotNull(taskDataMap); -// RepositoryTaskData taskData = taskDataMap.get("1"); -// assertEquals("user@mylar.eclipse.org", taskData.getAssignedTo()); -// assertEquals("foo", taskData.getDescription()); -// // You can use the getAttributeValue to pull up the information on any -// // part of the bug -// assertEquals("P1", taskData.getAttributeValue(BugzillaReportElement.PRIORITY.getKeyString())); -// -// taskData = taskDataMap.get("2"); -// assertEquals("nhapke@cs.ubc.ca", taskData.getAssignedTo()); -// assertEquals("search-match-test 1", taskData.getDescription()); -// -// taskData = taskDataMap.get("4"); -// assertEquals("relves@cs.ubc.ca", taskData.getReporter()); -// assertEquals("Test", taskData.getDescription()); -// } - - // README - // public void testPostBug() throws Exception { - // RepositoryTaskData taskData = handler.getTaskData(repository, "1"); - // assertNotNull(taskData); - // assertEquals("user@mylar.eclipse.org", taskData.getAssignedTo()); - // assertEquals("foo", taskData.getDescription()); - // taskData.setSummary("New Summary"); - // // post this modification back to the repository - // handler.postTaskData(repository, taskData); - // - // // You can use the getAttributeValue to pull up the information on any - // // part of the bug - // // assertEquals("P1", - // // - // taskData.getAttributeValue(BugzillaReportElement.PRIORITY.getKeyString())); - // } - - @SuppressWarnings("deprecation") - public void testQueryViaConnector() throws Exception { - String queryUrlString = repository.getUrl() - + "/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=search-match-test&product=TestProduct&long_desc_type=substring&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&deadlinefrom=&deadlineto=&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&emailassigned_to1=1&emailtype1=substring&email1=&emailassigned_to2=1&emailreporter2=1&emailcc2=1&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0="; - - // holds onto actual hit objects - TaskList taskList = new TaskList(); - QueryHitCollector collector = new QueryHitCollector(new TaskFactory(repository)); - BugzillaRepositoryConnector connector = new BugzillaRepositoryConnector(); - connector.init(taskList); - BugzillaRepositoryQuery query = new BugzillaRepositoryQuery(repository.getUrl(), queryUrlString, "summary"); - connector.performQuery(query, repository, new NullProgressMonitor(), collector); - assertEquals(2, collector.getTasks().size()); - for (AbstractTask hit : collector.getTasks()) { - assertTrue(hit.getSummary().contains("search-match-test")); - } - } -} - -// public void testValidateCredentials() throws IOException, -// BugzillaException, KeyManagementException, -// GeneralSecurityException { -// BugzillaClient.validateCredentials(null, repository.getUrl(), -// repository.getCharacterEncoding(), -// repository.getUserName(), repository.getPassword()); -// } -// -// public void testValidateCredentialsInvalidProxy() throws IOException, -// BugzillaException, KeyManagementException, -// GeneralSecurityException { -// BugzillaClient.validateCredentials(new Proxy(Proxy.Type.HTTP, new -// InetSocketAddress("localhost", 12356)), -// repository.getUrl(), repository.getCharacterEncoding(), -// repository.getUserName(), repository -// .getPassword()); -// } - -// public void testCredentialsEncoding() throws IOException, -// BugzillaException, KeyManagementException, -// GeneralSecurityException { -// String poundSignUTF8 = -// BugzillaClient.addCredentials(IBugzillaConstants.TEST_BUGZILLA_222_URL, -// "UTF-8", -// "testUser", "\u00A3"); -// assertTrue(poundSignUTF8.endsWith("password=%C2%A3")); -// String poundSignISO = -// BugzillaClient.addCredentials(IBugzillaConstants.TEST_BUGZILLA_222_URL, -// "ISO-8859-1", "testUser", "\u00A3"); -// assertFalse(poundSignISO.contains("%C2%A3")); -// assertTrue(poundSignISO.endsWith("password=%A3")); -// } diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaTaskHistoryTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaTaskHistoryTest.java deleted file mode 100644 index b4b810753..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaTaskHistoryTest.java +++ /dev/null @@ -1,161 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.headless; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; - -import org.eclipse.mylyn.bugzilla.tests.AbstractBugzillaTest; -import org.eclipse.mylyn.context.tests.support.TestUtil; -import org.eclipse.mylyn.context.tests.support.TestUtil.Credentials; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector; -import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants; -import org.eclipse.mylyn.internal.bugzilla.core.history.AssignmentEvent; -import org.eclipse.mylyn.internal.bugzilla.core.history.ResolutionEvent; -import org.eclipse.mylyn.internal.bugzilla.core.history.StatusEvent; -import org.eclipse.mylyn.internal.bugzilla.core.history.TaskHistory; -import org.eclipse.mylyn.tasks.core.TaskList; -import org.eclipse.mylyn.tasks.core.TaskRepository; - -public class BugzillaTaskHistoryTest extends AbstractBugzillaTest { - - private TaskRepository repository; - - private BugzillaRepositoryConnector connector; - - private static final String HISTORY_FILE_NAME = "storedHistory.history"; - - private static final String REPORT_ID = "1"; - - @Override - public void setUp() throws Exception { - super.setUp(); - connector = new BugzillaRepositoryConnector(); - connector.init(new TaskList()); - repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); - - Credentials credentials = TestUtil.readCredentials(); - repository.setAuthenticationCredentials(credentials.username, credentials.password); - } - - public void testGetBugHistory() throws Exception { - - BugzillaClient client = connector.getClientManager().getClient(repository); - assertNotNull(client); - TaskHistory history = client.getHistory("1"); - assertNotNull(history); - - assertEquals(1, history.getAssignmentEvents().size()); - assertEquals(2, history.getStatusEvents().size()); - assertEquals(1, history.getResolutionEvents().size()); - assertEquals(12, history.getOtherEvents().size()); - } - - public void testAssignmentEvent() throws Exception { - BugzillaClient client = connector.getClientManager().getClient(repository); - assertNotNull(client); - TaskHistory history = client.getHistory("1"); - assertNotNull(history); - - AssignmentEvent assignment = history.getAssignmentEvents().get(0); - assertEquals("nhapke@cs.ubc.ca", assignment.getName()); - assertEquals("user@mylar.eclipse.org", assignment.getAssigned()); - assertEquals("2006-08-25 17:48:02", assignment.getDate()); - assertEquals("nhapke@cs.ubc.ca", assignment.getRemoved()); - assertEquals("user@mylar.eclipse.org", assignment.getAdded()); - assertEquals("AssignedTo", assignment.getWhat()); - } - - public void testStatusEvent() throws Exception { - - BugzillaClient client = connector.getClientManager().getClient(repository); - assertNotNull(client); - TaskHistory history = client.getHistory("1"); - assertNotNull(history); - - StatusEvent statusChange = history.getStatusEvents().get(0); - assertEquals("nhapke@cs.ubc.ca", statusChange.getName()); - assertEquals("2006-08-25 19:18:05", statusChange.getDate()); - assertEquals("NEW", statusChange.getRemoved()); - assertEquals("ASSIGNED", statusChange.getAdded()); - assertEquals("Status", statusChange.getWhat()); - } - - public void testResolutionEvent() throws Exception { - BugzillaClient client = connector.getClientManager().getClient(repository); - assertNotNull(client); - TaskHistory history = client.getHistory(REPORT_ID); - assertNotNull(history); - - ResolutionEvent resolutionChange = history.getResolutionEvents().get(0); - assertEquals("janvik@cs.ubc.ca", resolutionChange.getName()); - assertEquals("2007-02-15 14:52:51", resolutionChange.getDate()); - assertEquals("", resolutionChange.getRemoved()); - assertEquals("FIXED", resolutionChange.getAdded()); - assertEquals("Resolution", resolutionChange.getWhat()); - } - - public void testStoredHistory() throws Exception { - BugzillaClient client = connector.getClientManager().getClient(repository); - assertNotNull(client); - TaskHistory history = client.getHistory(REPORT_ID); - assertNotNull(history); - storeHistory(history); - - history = getStoredHistory(); - - assertEquals(1, history.getAssignmentEvents().size()); - assertEquals(2, history.getStatusEvents().size()); - assertEquals(1, history.getResolutionEvents().size()); - assertEquals(12, history.getOtherEvents().size()); - - // Remove file - File storedHistoryFile = new File(HISTORY_FILE_NAME); - assertTrue(storedHistoryFile.delete()); - } - - private void storeHistory(TaskHistory history) { - File saveFile = new File(HISTORY_FILE_NAME); - saveFile.deleteOnExit(); - try { - ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(saveFile)); - out.writeObject(history); - out.close(); - } catch (FileNotFoundException e) { - System.err.println("Can't write to: " + saveFile); - } catch (IOException e) { - e.printStackTrace(); - } - } - - private TaskHistory getStoredHistory() { - File file = new File(HISTORY_FILE_NAME); - try { - ObjectInputStream in = new ObjectInputStream(new FileInputStream(file)); - TaskHistory history = (TaskHistory) in.readObject(); - in.close(); - return history; - } catch (FileNotFoundException e) { - System.err.println("Can't find: " + file); - } catch (IOException e) { - e.printStackTrace(); - } catch (ClassNotFoundException e) { - e.printStackTrace(); - } - - // Should never happen - return null; - } -} diff --git a/org.eclipse.mylyn.bugzilla.tests/test-attach-1181009324093.txt b/org.eclipse.mylyn.bugzilla.tests/test-attach-1181009324093.txt deleted file mode 100644 index bdf08de0f..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/test-attach-1181009324093.txt +++ /dev/null @@ -1 +0,0 @@ -test file \ No newline at end of file diff --git a/org.eclipse.mylyn.bugzilla.tests/test-attach-1182233735875.txt b/org.eclipse.mylyn.bugzilla.tests/test-attach-1182233735875.txt deleted file mode 100644 index bdf08de0f..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/test-attach-1182233735875.txt +++ /dev/null @@ -1 +0,0 @@ -test file \ No newline at end of file diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/configuration/rdfconfig218.txt b/org.eclipse.mylyn.bugzilla.tests/testdata/configuration/rdfconfig218.txt deleted file mode 100644 index bf41e9a70..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/testdata/configuration/rdfconfig218.txt +++ /dev/null @@ -1,461 +0,0 @@ - - - - - - - - 2.18.5 - relves@cs.ubc.ca - - - -
  • UNCONFIRMED
  • -
  • NEW
  • -
  • ASSIGNED
  • -
  • REOPENED
  • -
  • RESOLVED
  • -
  • VERIFIED
  • -
  • CLOSED
  • -
    -
    - - - -
  • UNCONFIRMED
  • -
  • NEW
  • -
  • ASSIGNED
  • -
  • REOPENED
  • -
    -
    - - - -
  • RESOLVED
  • -
  • VERIFIED
  • -
  • CLOSED
  • -
    -
    - - - -
  • -
  • FIXED
  • -
  • INVALID
  • -
  • WONTFIX
  • -
  • LATER
  • -
  • REMIND
  • -
  • DUPLICATE
  • -
  • WORKSFORME
  • -
  • MOVED
  • -
    -
    - - - - - - - - -
  • All
  • -
  • DEC
  • -
  • HP
  • -
  • Macintosh
  • -
  • PC
  • -
  • SGI
  • -
  • Sun
  • -
  • Other
  • -
    -
    - - - -
  • All
  • -
  • Windows 3.1
  • -
  • Windows 95
  • -
  • Windows 98
  • -
  • Windows ME
  • -
  • Windows 2000
  • -
  • Windows NT
  • -
  • Windows XP
  • -
  • Windows Server 2003
  • -
  • Mac System 7
  • -
  • Mac System 7.5
  • -
  • Mac System 7.6.1
  • -
  • Mac System 8.0
  • -
  • Mac System 8.5
  • -
  • Mac System 8.6
  • -
  • Mac System 9.x
  • -
  • Mac OS X 10.0
  • -
  • Mac OS X 10.1
  • -
  • Mac OS X 10.2
  • -
  • Mac OS X 10.3
  • -
  • Linux
  • -
  • BSD/OS
  • -
  • FreeBSD
  • -
  • NetBSD
  • -
  • OpenBSD
  • -
  • AIX
  • -
  • BeOS
  • -
  • HP-UX
  • -
  • IRIX
  • -
  • Neutrino
  • -
  • OpenVMS
  • -
  • OS/2
  • -
  • OSF/1
  • -
  • Solaris
  • -
  • SunOS
  • -
  • other
  • -
    -
    - - - -
  • P1
  • -
  • P2
  • -
  • P3
  • -
  • P4
  • -
  • P5
  • -
    -
    - - - -
  • blocker
  • -
  • critical
  • -
  • major
  • -
  • normal
  • -
  • minor
  • -
  • trivial
  • -
  • enhancement
  • -
    -
    - - - -
  • - - TestProduct - - - -
  • - - - - - -
  • - - - - - -
  • -
  • - - Test-Long-Named-Product-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - - - -
  • - - - - - -
  • - - - - - -
  • -
    -
    - - - -
  • - - TestComponent - -
  • -
    -
    - - - -
  • - - other - -
  • -
    -
    - - - - -
  • - - bug_id - Bug ID - -
  • -
  • - - short_desc - Summary - -
  • -
  • - - product - Product - -
  • -
  • - - version - Version - -
  • -
  • - - rep_platform - Hardware - -
  • -
  • - - bug_file_loc - URL - -
  • -
  • - - op_sys - OS - -
  • -
  • - - bug_status - Status - -
  • -
  • - - status_whiteboard - Whiteboard - -
  • -
  • - - keywords - Keywords - -
  • -
  • - - resolution - Resolution - -
  • -
  • - - bug_severity - Severity - -
  • -
  • - - priority - Priority - -
  • -
  • - - component - Component - -
  • -
  • - - assigned_to - Assignee - -
  • -
  • - - reporter - Reporter - -
  • -
  • - - votes - Votes - -
  • -
  • - - qa_contact - QA Contact - -
  • -
  • - - cc - CC - -
  • -
  • - - dependson - Depends on - -
  • -
  • - - blocked - Blocks - -
  • -
  • - - attachments.description - Attachment description - -
  • -
  • - - attachments.thedata - Attachment data - -
  • -
  • - - attachments.filename - Attachment filename - -
  • -
  • - - attachments.mimetype - Attachment mime type - -
  • -
  • - - attachments.ispatch - Attachment is patch - -
  • -
  • - - attachments.isobsolete - Attachment is obsolete - -
  • -
  • - - attachments.isprivate - Attachment is private - -
  • -
  • - - target_milestone - Target Milestone - -
  • -
  • - - delta_ts - Last Changed time - -
  • -
  • - - (to_days(now()) - to_days(bugs.delta_ts)) - Days since bug changed - -
  • -
  • - - longdesc - Comment - -
  • -
  • - - alias - Alias - -
  • -
  • - - everconfirmed - Ever confirmed? - -
  • -
  • - - reporter_accessible - Reporter accessible? - -
  • -
  • - - cclist_accessible - CC list accessible? - -
  • -
  • - - bug_group - Group - -
  • -
  • - - flagtypes.name - Flag - -
  • -
  • - - requestees.login_name - Flag Requestee - -
  • -
  • - - setters.login_name - Flag Setter - -
  • -
  • - - content - Content - -
  • -
  • - - owner_idle_time - Time Since Owner Touched - -
  • -
    -
    -
    - -
    \ No newline at end of file diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/contexts/.cvsignore b/org.eclipse.mylyn.bugzilla.tests/testdata/contexts/.cvsignore deleted file mode 100644 index 47269cfbd..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/testdata/contexts/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -downloadedContext.xml diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/contexts/empty.txt b/org.eclipse.mylyn.bugzilla.tests/testdata/contexts/empty.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/bug-1-full.html b/org.eclipse.mylyn.bugzilla.tests/testdata/pages/bug-1-full.html deleted file mode 100644 index 00fd1bcb7..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/bug-1-full.html +++ /dev/null @@ -1,719 +0,0 @@ - - - - - - - - - - - Bug 1 - Usability issue with external editors (1GE6IRL) - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - -
    - - - - -
    - Bugzilla Bug 1 -
    -
     Usability issue with external editors (1GE6IRL)
    - - - - -     Query page -     Enter new bug - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Bug#: - - 1 -   - Platform: - - -   - Reporter: - andre_weinand@ch.ibm.com (Andre Weinand) -
    - Product: - - -   - OS: - - -   - Add CC: - - -
    - - - Component: - - - -   - Version: - - -   - CC: - - -
    - Remove selected CCs -
    -
    - - Status: - - VERIFIED  - Priority: - - -  
    - - Resolution: - - FIXED  - Severity: - - -  
    - - Assigned To: - - James_Moody@ca.ibm.com (James Moody)  - - Target Milestone: - - - -  
    - - URL: - - - -
    - Summary: - - -
    - - Keywords: - - - -
    - - - - - -
    - - - - - - - - - - - - - - -
    AttachmentTypeModifiedStatusActions
    - Create a New Attachment (proposed patch, testcase, etc.) - - View All -
    -
    - - - - - - - - - - - - - - -
    Bug 1 depends on: - - - - Show - dependency tree - -
    Bug 1 blocks: - - -
    - - - - - - -
    - Votes: - 0    - Show - votes for this bug    - Vote - for this bug -
    - - - -
    - Additional Comments: -
    - -
    - - - - -
    - - Leave as VERIFIED FIXED -
    - - - - Reopen bug -
    - - Mark bug as CLOSED
    - - - -

    - - - View Bug Activity -   |   - Format For Printing - - - -

    -
    - - - - - - - - -
    - - Description: - - - Opened: 2001-10-10 21:34 -
    -
    - - -
    - Setup a project that contains a *.gif resource
    -	- release project to CVS
    -	- edit the *.gif resource with an external editor, e.g. PaintShop
    -	- save and close external editor
    -	- in Navigator open the icon resource and verify that your changes are there
    -	- release project
    -		-> nothing to release!
    -	- in Navigator open the icon resource and verify that your changes are still there
    -
    -	Problem: because I never "Refreshed from local", the workspace hasn't changed so "Release" didn't find anything.
    -	However opening the resource with an external editor found the modified file on disk and showed the changes.
    -
    -	The real problem occurs if "Release" actually finds something to release but you don't spot that some resources are missing.
    -	This is extremely error prone: one of my changes didn't made it into build 110 because of this!
    -
    -NOTES:
    -EG (5/23/01 3:00:33 PM)
    -	Release should do a refresh from local before doing the release.
    -	Moving to VCM
    -
    -
    -KM (05/27/01 5:10:19 PM)
    -	Comments from JM in related email:
    -
    -	Should not do this for free.  Could have a setting which made it optoinal but should nt be mandatory.  Default setting could be to have it on.
    -	Consider the SWT team who keep their workspaces on network drives.  This will be slow.  
    -
    -	Side effects will be that a build runs when the refresh is completed unless you somehow do it in a workspace runnable and don't end the
    -	runnable until after the release.  This would be less than optimal as some builders may be responsible for maintaining some invariants and deriving resources which are releasable.  If you don't run the builders before releasing, the invariants will not be maintained and you will release inconsistent state.
    -
    -	Summary:  Offer to "ensure local consistency" before releasing.
    -
    -KM (5/31/01 1:30:35 PM)
    -	See also 1GEAG1A: ITPVCM:WINNT - Internal error comparing with a document
    -	which failed with an error.  Never got log from Tod though.
    -
    - ------- Additional Comment - #1 From - James Moody - 2001-10-19 10:32 ------- - - - -
    *** Bug 183 has been marked as a duplicate of this bug. ***
    -
    - ------- Additional Comment - #2 From - James Moody - 2001-10-19 16:36 ------- - - - -
    Implemented 'auto refresh' option. Default value is off.
    -
    - ------- Additional Comment - #3 From - DJ Houghton - 2001-10-23 23:39 ------- - - - -
    PRODUCT VERSION:
    -	109
    -
    -
    -
    - ------- Additional Comment - #4 From - James Moody - 2001-10-25 10:19 ------- - - - -
    Fixed in v206
    - -
    - - - - -     Query page -     Enter new bug - -
    - - - - - - - - - - - -
    - - - - -
    - - - - This is Bugzilla: the Mozilla bug system. For more - information about what Bugzilla is and what it can do, see - bugzilla.org. - - - -
    - - - - - - - - - -
    - - - - - - - - - - - -
    - Actions: - - New | - Query | - - bug # - | - - Reports - -   - New Account | - Log In -
    -
    - -
    -
    - - - \ No newline at end of file diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/bug-not-found-eclipse.html b/org.eclipse.mylyn.bugzilla.tests/testdata/pages/bug-not-found-eclipse.html deleted file mode 100644 index 156212e5e..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/bug-not-found-eclipse.html +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - - - - - - - Error - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - -
    - - - - -
    - Error -
    -
     
    - - - - - -
    - Bug #666 does not exist. - -
    - -

    - Please press Back and try again. -

    - - - - - - - - - - - -
    - - - - -
    - - - - This is Bugzilla: the Mozilla bug system. For more - information about what Bugzilla is and what it can do, see - bugzilla.org. - - - -
    - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - -
    - Actions: - - New | - Query | - - bug # - | - - Reports - - | My Votes -   - Edit prefs - - | Log out cubranic@cs.ubc.ca -
    - Preset Queries: - - My Bugs - -
    -
    - -
    -
    - - - \ No newline at end of file diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/bug-not-found-hipikat.html b/org.eclipse.mylyn.bugzilla.tests/testdata/pages/bug-not-found-hipikat.html deleted file mode 100644 index e6261be5d..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/bug-not-found-hipikat.html +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - - - - - - - Error - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - Bugzilla Version 2.16.3 -
    -
    - - - - - - - -
    - - - - -
    - Error -
    -
     
    - - - - - -
    - Bug #666 does not exist. - -
    - -

    - Please press Back and try again. -

    - - - - - - - - - - - -
    - - - - -
    - - - - This is Bugzilla: the Mozilla bug system. For more - information about what Bugzilla is and what it can do, see - bugzilla.org. - - - -
    - - - - - - - - - -
    - - - - - - - - - - - -
    - Actions: - - New | - Query | - - bug # - | - - Reports - -   - New Account | - Log In -
    -
    - -
    -
    - - - \ No newline at end of file diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/cdt-page.html b/org.eclipse.mylyn.bugzilla.tests/testdata/pages/cdt-page.html deleted file mode 100644 index 3a1d20fdb..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/cdt-page.html +++ /dev/null @@ -1,184 +0,0 @@ - - -Enter Bug - - - - - - -
    - - - - -
    - - - - - -
    - - - -
    Enter - Bug
     This page lets you enter a new bug into - Bugzilla.
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Before reporting a bug, please read - the bug - writing guidelines, please look at the list of most frequently - reported bugs, and please search for the bug. -

    Reporter:tanya@cs.ubc.caProduct:CDT
    Version: -Component: - -
     
    Platform: - OS: -
    Severity: -
     
    Assigned - To: (Leave blank to assign to - default component owner)
    Cc:
     
    Summary:
    Description: -
    -      -

    We've made a guess at your operating system and - platform. Please check them and, if we got it wrong, email - webmaster@eclipse.org.
    - - - -
    - - - -
    This is Bugzilla: the Mozilla bug system. For more - information about what Bugzilla is and what it can do, see bugzilla.org.
    -
    - - - - - - - - - -
    Actions: New | - Query | bug # | - Reports | - My - Votes  Edit prefs | - Log out tanya@cs.ubc.ca -
    Preset Queries: My Bugs -
    diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/enter-bug220.html b/org.eclipse.mylyn.bugzilla.tests/testdata/pages/enter-bug220.html deleted file mode 100644 index e9c1deb49..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/enter-bug220.html +++ /dev/null @@ -1,441 +0,0 @@ - - - - Enter Bug: TestProduct - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    - Before reporting a bug, please read the -bug writing guidelines, please look at the list of -most frequently reported bugs, and please -search for the bug. -

    Reporter:relves@cs.ubc.caProduct:TestProduct
    - Version: - - - - - - - - Component: - - - - -
     
    - - - Platform: - - - - - - OS: - - - - -
    - - Priority: - - - - - - - Severity: - - - -
     
    Initial State:NEW
    - - Assign To: - - - - -
    Cc: -
     
    URL: - -
    Summary: - - -
    Description: - -
    -
    - Depends on: - - - -
    - Blocks: - - - -
    -
    - -      - -
    -
    - We've made a guess at your - operating system and platform. Please check them - and, if we got it wrong, email - THE MAINTAINER HAS NOT YET BEEN SET. -
    - - -
    - - - - - - diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/enter-bug2201.html b/org.eclipse.mylyn.bugzilla.tests/testdata/pages/enter-bug2201.html deleted file mode 100644 index b942b2a55..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/enter-bug2201.html +++ /dev/null @@ -1,493 +0,0 @@ - - - - Enter Bug: Mylar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - Eclipse bugs
    Bugzilla 2.20.1  
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    - Before reporting a bug, please read the -bug writing guidelines, please look at the list of -most frequently reported bugs, and please -search for the bug. -

    Reporter:relves@cs.ubc.caProduct:Mylar
    - Version: - - - - - - - Component: - - - -
     
    - - Platform: - - - - - - - OS: - - - - -
    - - Severity: - - - - -
     
    Initial State:NEW
    - - Assign To: - - - - -
    QA Contact: - - -
    Cc: -
     
    URL: - - -
    Summary: - -
    Description: - -
    -
    -
    - -      - -
    -
    - We've made a guess at your - operating system and platform. Please check them - and, if we got it wrong, email - webmaster@eclipse.org. -
    - -
    - - - - - - diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/equinox-page.html b/org.eclipse.mylyn.bugzilla.tests/testdata/pages/equinox-page.html deleted file mode 100644 index 1c8fdf57d..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/equinox-page.html +++ /dev/null @@ -1,177 +0,0 @@ - - -Enter Bug - - - - - - -
    - - - - -
    - - - - - -
    - - - -
    Enter - Bug
     This page lets you enter a new bug into - Bugzilla.
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Before reporting a bug, please read - the bug - writing guidelines, please look at the list of most frequently - reported bugs, and please search for the bug. -

    Reporter:tanya@cs.ubc.caProduct:Equinox
    Version: Component: - -
     
    Platform: - OS: -
    Severity: -
     
    Assigned - To: (Leave blank to assign to - default component owner)
    Cc:
     
    Summary:
    Description: -
    -      -

    We've made a guess at your operating system and - platform. Please check them and, if we got it wrong, email - webmaster@eclipse.org.
    - - - -
    - - - -
    This is Bugzilla: the Mozilla bug system. For more - information about what Bugzilla is and what it can do, see bugzilla.org.
    -
    - - - - - - - - - -
    Actions: New | - Query | bug # | - Reports | - My - Votes  Edit prefs | - Log out tanya@cs.ubc.ca -
    Preset Queries: My Bugs -
    diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/gmt-page.html b/org.eclipse.mylyn.bugzilla.tests/testdata/pages/gmt-page.html deleted file mode 100644 index 951b86ccd..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/gmt-page.html +++ /dev/null @@ -1,175 +0,0 @@ - - -Enter Bug - - - - - - -
    - - - - -
    - - - - - -
    - - - -
    Enter - Bug
     This page lets you enter a new bug into - Bugzilla.
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Before reporting a bug, please read - the bug - writing guidelines, please look at the list of most frequently - reported bugs, and please search for the bug. -

    Reporter:tanya@cs.ubc.caProduct:GMT
    Version: Component: -
     
    Platform: - OS: -
    Severity: -
     
    Assigned - To: (Leave blank to assign to - default component owner)
    Cc:
     
    Summary:
    Description: -
    -      -

    We've made a guess at your operating system and - platform. Please check them and, if we got it wrong, email - webmaster@eclipse.org.
    - - - -
    - - - -
    This is Bugzilla: the Mozilla bug system. For more - information about what Bugzilla is and what it can do, see bugzilla.org.
    -
    - - - - - - - - - -
    Actions: New | - Query | bug # | - Reports | - My - Votes  Edit prefs | - Log out tanya@cs.ubc.ca -
    Preset Queries: My Bugs -
    diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/hipikat-copy-bug-1-full.html b/org.eclipse.mylyn.bugzilla.tests/testdata/pages/hipikat-copy-bug-1-full.html deleted file mode 100644 index 6390fcc9a..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/hipikat-copy-bug-1-full.html +++ /dev/null @@ -1,157 +0,0 @@ - -Bug 1 - Usability issue with external editors (1GE6IRL) - - - - -
    - - - - - -
    - - -
    - Bugzilla Bug 1
    -
      -Usability issue with external editors (1GE6IRL) -
    -     Query page -     Enter new bug -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Bug#:1 Platform: Reporter:Andre_Weinand@oti.com (Andre Weinand)
    Product: OS: Add CC:
    Component: Version: Cc:
    -Remove selected CCs
    -
    Status:VERIFIED Priority: 
    Resolution:FIXED Severity: 
    Assigned To: - James_Moody@oti.com (James Moody)  
    URL: - -
    Summary: - -
    Attachments:Create a new attachment (proposed patch, testcase, etc.)
    - - - - -
    Bug 1 depends on:Show dependency tree - -
    Show dependency graph -
    Bug 1 blocks:
    - -
    -Additional Comments: -
    -

    - - Leave as VERIFIED FIXED
    Reopen bug
    - - Mark bug as CLOSED
    - - - - -

    - - View Bug Activity -   |   - Format For Printing - -

    - -
    Description:Opened: 2001-10-10 17:34
    -
    -
    - Setup a project that contains a *.gif resource
	- release project to CVS
	- edit the *.gif resource with an external editor, e.g. PaintShop
	- save and close external editor
	- in Navigator open the icon resource and verify that your changes are there
	- release project
		-> nothing to release!
	- in Navigator open the icon resource and verify that your changes are still there

	Problem: because I never "Refreshed from local", the workspace hasn't changed so "Release" didn't find anything.
	However opening the resource with an external editor found the modified file on disk and showed the changes.

	The real problem occurs if "Release" actually finds something to release but you don't spot that some resources are missing.
	This is extremely error prone: one of my changes didn't made it into build 110 because of this!

NOTES:
EG (5/23/01 3:00:33 PM)
	Release should do a refresh from local before doing the release.
	Moving to VCM


KM (05/27/01 5:10:19 PM)
	Comments from JM in related email:

	Should not do this for free.  Could have a setting which made it optoinal but should nt be mandatory.  Default setting could be to have it on.
	Consider the SWT team who keep their workspaces on network drives.  This will be slow.  

	Side effects will be that a build runs when the refresh is completed unless you somehow do it in a workspace runnable and don't end the
	runnable until after the release.  This would be less than optimal as some builders may be responsible for maintaining some invariants and deriving resources which are releasable.  If you don't run the builders before releasing, the invariants will not be maintained and you will release inconsistent state.

	Summary:  Offer to "ensure local consistency" before releasing.

KM (5/31/01 1:30:35 PM)
	See also 1GEAG1A: ITPVCM:WINNT - Internal error comparing with a document
	which failed with an error.  Never got log from Tod though.
    -

    ------- Additional Comments From James Moody 2001-10-19 06:32 -------
    -
    *** Bug 183 has been marked as a duplicate of this bug. ***
    -

    ------- Additional Comments From James Moody 2001-10-19 12:36 -------
    -
    Implemented 'auto refresh' option. Default value is off.
    -

    ------- Additional Comments From DJ Houghton 2001-10-23 19:39 -------
    -
    PRODUCT VERSION:
	109

    -

    ------- Additional Comments From James Moody 2001-10-25 06:19 -------
    -
    Fixed in v206
    - -
    -     Query page -     Enter new bug -
    -     Query page -     Enter new bug -
    - - diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/platform-page.html b/org.eclipse.mylyn.bugzilla.tests/testdata/pages/platform-page.html deleted file mode 100644 index d41b5c84d..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/platform-page.html +++ /dev/null @@ -1,299 +0,0 @@ -Enter Bug - - - - - - - - - - - - - - - - - -
    -
    - -
    -Actions: - -New | Query | - bug # | Reports  - - New account - | Log in

    -Eclipse Bugs Home -
    - - - - - - - -
    - - - - -
    - Enter Bug -
    -
     This page lets you enter a new bug into Bugzilla.
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    - - - - - - - -Before reporting a bug, please read the -bug writing guidelines, please look at the list of -most frequently reported bugs, and please -search for the bug. -

    Reporter:tanya@cs.ubc.caProduct:Platform
    - Version: - - - - - - Component: - - - -
     
    - - Platform: - - - - - - OS: - - - -
    - - Severity: - - - -
     
    - - Assigned To: - - - - (Leave blank to assign to default component owner) -
    Cc: - -
     
    - -
    Summary: - -
    Description: - -
    -
    -
    - -      - -
    -
    - We've made a guess at your operating system and platform. - Please check them and, if we got it wrong, email webmaster@eclipse.org. -
    - -
    - - - - - - - - - - - -
    - - - - -
    - - - - This is Bugzilla: the Mozilla bug system. For more - information about what Bugzilla is and what it can do, see - bugzilla.org. - - - -
    - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - -
    - Actions: - - New | - Query | - - bug # - | - - Reports - - | My Votes -   - Edit prefs - - | Log out tanya@cs.ubc.ca -
    - Preset Queries: - - My Bugs - -
    -
    - -
    -
    - - \ No newline at end of file diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/product-page-1-product-hipikat.html b/org.eclipse.mylyn.bugzilla.tests/testdata/pages/product-page-1-product-hipikat.html deleted file mode 100644 index 53805b2d2..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/product-page-1-product-hipikat.html +++ /dev/null @@ -1,256 +0,0 @@ - - -Enter Bug - - - - - - - - -
    -
    This is Bugzilla -
    -
    Bugzilla Version -2.17.6
    - - - - - -
    - - - -
    Enter - Bug
     This page lets you enter a new bug into - Bugzilla.
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Before reporting a bug, please read - the bug - writing guidelines, please look at the list of most - frequently reported bugs, and please search - for the bug.

    Reporter:tanya@cs.ubc.caProduct:TestProduct
    Version: Component: -
     
    Platform: - OS: - -
    Priority: - Severity: -
     
    Assign - To:
    Cc:
     
    URL:
    Summary:
    Description: -
    Keywords: - (optional)
    Depends on:
    Blocks:
    -      -

    We've made a guess at your operating system and - platform. Please check them and, if we got it wrong, emailTHE MAINTAINER - HAS NOT YET BEEN SET.
    - - - -
    - - - -
    -
    - - - - - - - - - -
    Actions: New - | Search - | bug # - | Reports - | My - Requests | My - Votes  Edit prefs, - products, - flags, - keywords - | Log out tanya@cs.ubc.ca -
    Saved Searches: My Bugs -
    diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-220.html b/org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-220.html deleted file mode 100644 index 6e8adde46..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-220.html +++ /dev/null @@ -1,667 +0,0 @@ - - - - Bug 7 - summary - - - - - - - - - - - - - - - - - - - - - - - - - -First - Last - Prev - Next -    - No search results available - -     Search page -     Enter new bug - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Bug#: - - 7 -
    - Product: - - -  
    - - - Component: - - - -  
    - - Status: - - NEW
    - - Resolution: - - -
    - - Assigned To: - - Robert Elves <relves@cs.ubc.ca>
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Hardware: - - -  
    - OS: - - -  
    - Version: - - -  
    - Priority: - - -  
    - Severity: - - -  
    -
    - - - - - - - - - - - - - - - - - - -
    - Reporter: - - Robert Elves <relves@cs.ubc.ca> -
    - Add CC: - -
    - CC: - - -
    - Remove selected CCs -
    -
    - -
    - - - - - - - - - - - - - - - - - -
    - - URL: - - - -
    - Summary: - - -
    -
    - - - - -
    -
    -
    - - - -
    - - - - - - - - - - - - - -
    AttachmentTypeCreatedSizeActions
    - Create a New Attachment (proposed patch, testcase, etc.) - - View All -
    -
    - - - - - - - - - - - - - - -
    Bug 7 depends on: - - - - Show - dependency tree - -
    - Show - dependency graph -
    Bug 7 blocks: - - -
    - - - - -
    - Additional Comments: -
    - - - -
    - -
    - -
    - - -
    - - - - - -
    - - - - - -
    - - - - -
    - - - -
    - - - -
    - - - -

    - - - View Bug Activity -   |   - Format For Printing -   |   - Clone This Bug - - - - - -

    - - - -
    -
    - - - - - -
    - Description:   - - Opened: 2006-02-13 17:02 -
    - - - -
    test summary
    -
    -
    -
    -
    - - ------- Comment - #1 From - Robert Elves - 2006-02-21 16:34 - - - ------- - - - - -
    out
    -
    -
    - -
    - -
    -First - Last - Prev - Next -    - No search results available - -     Search page -     Enter new bug - -
    - - - - \ No newline at end of file diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-2201.html b/org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-2201.html deleted file mode 100644 index f93d6a5c8..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-2201.html +++ /dev/null @@ -1,859 +0,0 @@ - - - - Bug 125527 - bugzilla refresh incorrect for new reports and newly opened hits - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - Eclipse bugs
    Bugzilla 2.20.1  
    - - -First - Last - Prev - Next -    - No search results available - -     Search page -     Enter new bug - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - [Technology] - Bug#: - - 125527 -
    - Product: - - -  
    - - - Component: - - - -  
    - - Status: - - RESOLVED
    - - Resolution: - - FIXED -
    - - Assigned To: - - Robert Elves <relves@cs.ubc.ca>
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Hardware: - - -  
    - OS: - - -  
    - Version: - - -  
    - Priority: - - -  
    - Severity: - - -  
    - - Target Milestone: - - - -  
    -
    - - - - - - - - - - - - - - - - - - -
    - Reporter: - - Mik Kersten <beatmik@acm.org> -
    - Add CC: - -
    - CC: - - -
    - Remove selected CCs -
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - QA Contact: - -
    - - URL: - - - -
    - Summary: - - -
    - Status Whiteboard: - - -
    - - Keywords: - - - -
    -
    - - - - -
    -
    -
    - - - -
    - - - - - - - - - - - - - -
    AttachmentTypeCreatedSizeActions
    - Create a New Attachment (proposed patch, testcase, etc.) - - View All -
    -
    - - - - - - - - - - - - - - -
    Bug 125527 depends on: - - - - Show - dependency tree - -
    Bug 125527 blocks: - - -
    - - - - - - -
    - Votes: - 0    - Show - votes for this bug    - Vote - for this bug -
    - - - -
    - Additional Comments: -
    - - - -
    - -
    - -
    - - -
    - - - - - - -
    - - -
    - - -
    - - - -

    - - - View Bug Activity -   |   - Format For Printing -   |   - Clone This Bug - - - - - -

    - - - -
    -
    - - - - - -
    - - Description:   - - Opened: 2006-01-27 13:36 -
    - - - -
    After bug report is added, description is always blank, and it's opened in
    -wrong editor (ExistingBugEditor, not MylarTaskEditor).
    -
    -After hit is opened and becomes a task, task stays italic.
    -
    -
    -
    -
    - - ------- Comment - - #1 From - Mik Kersten - 2006-01-27 21:30 - - - ------- - - - - -
    Done.
    -
    -
    - -
    - -
    -First - Last - Prev - Next -    - No search results available - -     Search page -     Enter new bug - -
    - - - - \ No newline at end of file diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-222attachment.html b/org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-222attachment.html deleted file mode 100644 index 6248ce40d..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-222attachment.html +++ /dev/null @@ -1,859 +0,0 @@ - - - - Bug 4 - Another Test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Bug List: - (4 of 4) - - First - Last - - Prev - - Next - -   Show last search results - -     Search page -     Enter new bug - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Bug#: - - 4 -
    - Product: - - -
    - - - - Component: - - - -
    - - Status: - - - NEW
    - - Resolution: - - - -
    - - Assigned To: - - - Robert Elves <relves@cs.ubc.ca>
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Hardware: - - -
    - OS: - - -
    - Version: - - -
    - - Priority: - - -
    - Severity: - - -
    - - Target Milestone: - - - - -
    -
    - - - - - - - - - - - - - - - - - - -
    - Reporter: - - - Robert Elves <relves@cs.ubc.ca> -
    - - Add CC: - -
    - - CC: - - -
    - -
    - - - - - - - - - - - - - - - - - -
    - - - URL: - - - -
    - Summary: - - -
    -
    - - - - - -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    AttachmentTypeCreatorCreatedSizeActions
    - Testing upload - text/plain - - - Robert Elves - - 2006-03-10 14:116.87 KB - Edit - -
    - Create a New Attachment (proposed patch, testcase, etc.) - - View All - -
    -
    - - - - - - - - - - - - - - - -
    Bug 4 depends on: - - - - Show - dependency tree - -
    - Show - dependency graph - -
    Bug 4 blocks: - - - -
    - - - - -
    - Additional Comments: - -
    - - - -
    - - -
    - -
    - - -
    - - - - -
    - - - - - - -
    - - - - -
    - - - - -
    - - - -
    - - - - -

    - - - View Bug Activity -   |   - Format For Printing -   |   - - XML -   |   - Clone This Bug - - - - - -

    - - - -
    - - - - - - - - - -
    - - - - - - - -
    - - Description:   - - Opened: 2006-03-09 13:09 -
    - - - -
    Testing new 2.22 version capability
    -
    -
    -
    -
    - - ------- Comment - - - #1 From - Robert Elves - 2006-03-10 14:11:48 - - - ------- - - - - -
    Created an attachment (id=1) [edit]
    -
    -Testing upload
    -
    -The comment
    -
    -
    - -
    - -
    -Bug List: - (4 of 4) - - First - Last - - Prev - - Next - -   Show last search results - -     Search page -     Enter new bug - -
    - - - - diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/ve-page.html b/org.eclipse.mylyn.bugzilla.tests/testdata/pages/ve-page.html deleted file mode 100644 index e5423da71..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/ve-page.html +++ /dev/null @@ -1,178 +0,0 @@ - - -Enter Bug - - - - - - -
    - - - - -
    - - - - - -
    - - - -
    Enter - Bug
     This page lets you enter a new bug into - Bugzilla.
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Before reporting a bug, please read - the bug - writing guidelines, please look at the list of most frequently - reported bugs, and please search for the bug. -

    Reporter:tanya@cs.ubc.caProduct:VE
    Version: Component: -
     
    Platform: - OS: -
    Severity: -
     
    Assigned - To: (Leave blank to assign to - default component owner)
    Cc:
     
    Summary:
    Description: -
    -      -

    We've made a guess at your operating system and - platform. Please check them and, if we got it wrong, email - webmaster@eclipse.org.
    - - - -
    - - - -
    This is Bugzilla: the Mozilla bug system. For more - information about what Bugzilla is and what it can do, see bugzilla.org.
    -
    - - - - - - - - - -
    Actions: New | - Query | bug # | - Reports | - My - Votes  Edit prefs | - Log out tanya@cs.ubc.ca -
    Preset Queries: My Bugs -
    diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/1.html b/org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/1.html deleted file mode 100644 index cf50a3d46..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/1.html +++ /dev/null @@ -1,377 +0,0 @@ - - -Bug 4548 - DCR: TableTree should support icon in 1st column (1G06WFT) - - - - - - -
    - - - - -
    - - - - - -
    - - - -
    Bugzilla Bug - 4548
     DCR: TableTree should support icon in 1st - column (1G06WFT)
    Bug -List: First Last (This bug is -not in your list)   Show list -     Query page -     Enter new bug -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Bug#: 4548 -  Platform:  Reporter: erich_gamma@ch.ibm.com (Erich Gamma)
    Product:  OS:  Add CC:
    Component: - -  Version: -  CC:
    Status: RESOLVED Priority: -  
    Resolution: - WONTFIX Severity: -  
    Assigned To: - veronika_irvine@ca.ibm.com (Veronika Irvine) Target - Milestone:  
    URL:
    Summary:
    Keywords: - -

    - - - - - - - - - - -
    AttachmentTypeModifiedStatusActions
    Create - a New Attachment (proposed patch, testcase, etc.) View - All

    - - - - - - - - - - -
    Bug 4548 depends on: Show - dependency tree
    Bug 4548 blocks:
    - - - - -
    Votes: 0    Show - votes for this bug    Vote - for this bug

    Additional Comments:
    -

    Leave as -RESOLVED WONTFIX
    -Reopen bug
    Mark bug as -VERIFIED
    Mark bug as -CLOSED
    -

    View Bug -Activity   |   Format For -Printing

    - - - - -
    Description: Opened: 2001-10-11 14:18
    -
    -
    EG (8/24/00 3:41:25 PM)	
    -	TableTree doesn't support showing an icon in the first column. The icon is eaten up
    -	by the +/- icon.
    -	Not being able to have an icon in the first column reduces the applicability
    -	of TableTree (we would like to use it in the Java plugin, but we can't).
    -
    -NOTES:
    -
    -VI (8/24/00 10:54:39 AM)
    -	TableTree is implemented using the Windows table widget and this only allows
    -	one image per column.  Sorry, there's nothing we can do.
    -
    -AW (24.08.00 17:31:06)
    -	Why not combining the +/- icon with the client's icon into a single icon?
    -
    -EG (8/29/00 3:35:01 PM)
    -	JFace has support for compositing icons see: 
    -		com.ibm.jface.examples.compositeimage.CompositeImageExample
    -
    -CM (3/17/01 5:29:49 PM)
    -	P1/M1 (April 1st, 2001)
    -	Need to know the priority of 1GAJ9KP: SWT:ALL - TableTree class has no selection support for the SWT.CHECK style
    -	because these two PRs may conflict.
    -
    -CM (3/28/01 5:09:33 PM)
    -	We investigated using the Windows "state image" feature in Table, but this is already being used by
    -	checkboxes if the Table is created with check style. It would also mean that we would have to provide
    -	platform-specific public API on Table to allow TableTree class to set/get state images. So we decided
    -	against this.
    -
    -	VI is going to investigate merging the [+]/[-] images with the user's image. We would try to write it
    -	in such a way that only those who actually put an image in the first column would have to pay for
    -	the added slowness. We suspect there may be issues such as background color/transparency
    -	problems, hit test problems, selection highlight problems, and cheese problems, but we will have
    -	to try it first before we know for sure.
    -
    -VI (4/4/2001 10:41:59 AM)
    -	Two major issues which prevent us from merging the [+]/[-] with the user's image and using the normal first column image:
    -	1) Images of different sizes can be added to the control, however the size of the image displayed in the associated 
    -        Windows Common Control will be constrained to the size of the first image added to the ImageList.
    -		Images for all columns are added to the same ImageList and therefore must have the exact same height and WIDTH.
    -		This makes merging the +/- and the first column image have impact on every image in the TableTree
    -	2) There is a limit to how may images I can cram in the ImageList.  Having potentially 3 per row I think will quickly exceed the limit.
    -
    -VI (4/4/2001 05:20 PM)
    -
    -	We have a PR that requests support for an image in the first column of a TableTree and I believe that you
    -	are the prime requestor.
    -
    -	I have tried to make this work and below is the best I can do.  As you can see, there is a limitation on the
    -	underlying native widget which is that all images in the TableTree must have the exact same height and width.
    -	Consequently, when I leave enough room to merge the +/- image with the image you wish to show in the first column,
    -	this causes all the other images in the TableTree to be stretched width wise.
    -
    -	<picture>
    -
    -	It is my opinion that the current TableTree can not be made to work any better than this.  If this is not
    -	adequate for your use, the only alternative is to write a custom widget that does this and does not
    -	use the native widget.  Writing a full custom widget is not trivial.  It will probably require a month or
    -	two and will probably not give all the capability that is present in native List or Tree widgets (just
    -	because there are a lot of subtle things going on there and I won't have time to get them all).  I need
    -	to know if I should commence with a custom widget.  Also, as I have other responsibilities, Mike and I will
    -	have to discuss which of them will be set aside before I can do this work.
    -
    -VI (4/27/2001 8:42:19 AM)
    -	Have received no feedback requesting a custom Tree or implementation of the solution presented above.
    -	Moving to Inactive.

    ------- Additional Comment #1 From -Veronika Irvine 2002-05-27 16:17 --------
    java.lang.NullPointerException Closing this bug report.  A new DCR should be raised from a better custom table 
    -tree.
    -
    -Bug List: First Last (This bug is -not in your list)   Show list -     Query page -     Enter new bug
    - - - -
    - - - -
    This is Bugzilla: the Mozilla bug system. For more - information about what Bugzilla is and what it can do, see bugzilla.org.
    -
    - - - - - - -
    Actions: New | - Query | bug # | - Reports -  New Account - | Log In -
    diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/2.html b/org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/2.html deleted file mode 100644 index 6bae80545..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/2.html +++ /dev/null @@ -1,406 +0,0 @@ - - -Bug 76146 - NPE using quickfix in Aspect opened with java editor - - - - - - -
    - - - - -
    - - - - - -
    - - - -
    Bugzilla Bug - 76146
     NPE using quickfix in Aspect opened with java - editor
    Bug List: First Last (This bug is -not in your list)   Show list -     Query page -     Enter new bug -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Bug#: 76146  Platform:  Reporter: hawkinsh@uk.ibm.com (Helen Hawkins)
    Product:  OS:  Add CC:
    Component: -  Version:  CC:
    Status: NEW Priority: -  
    Resolution: -  Severity: -  
    Assigned To: - mchapman@uk.ibm.com (Matt Chapman) Target - Milestone:  
    URL:
    Summary:
    Keywords: - -

    - - - - - - - - - - -
    AttachmentTypeModifiedStatusActions
    Create - a New Attachment (proposed patch, testcase, etc.) View - All

    - - - - - - - - - - -
    Bug 76146 depends on: Show - dependency tree
    Bug 76146 blocks:

    Additional -Comments:
    -

    Leave as -NEW 
    Accept bug -(change status to ASSIGNED)
    Resolve bug, changing resolution to
    Resolve bug, mark it as duplicate of bug #
    Reassign -bug to
    Reassign bug to owner of selected component -
    -

    View Bug -Activity   |   Format For -Printing

    - - - - -
    Description: Opened: 2004-10-13 04:51
    -
    -
    To recreate:
    -
    -- Check out the QuickFix project from ajdt.test project
    -java.lang.NullPointerException- Open TestAspect.java in the Java Editor (right click > open with > Java 
    -Editor)
    -- Click on the lightbulb with the error marker (the same line as File f = new 
    -File("tmp");
    -java.lang.NullPointerException- An Internal Error appear in the Error log with the following stack trace:
    -
    -
    -
    -java.lang.NullPointerException
    -at 
    -org.eclipse.jdt.internal.ui.text.correction.UnresolvedElementsSubProcessor.getT
    -ypeProposals(UnresolvedElementsSubProcessor.java:395)
    -at org.eclipse.jdt.internal.ui.text.correction.QuickFixProcessor.process
    -(QuickFixProcessor.java:270)
    -at org.eclipse.jdt.internal.ui.text.correction.QuickFixProcessor.getCorrections
    -(QuickFixProcessor.java:202)
    -at 
    -org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.collectCorr
    -ections(JavaCorrectionProcessor.java:240)
    -at 
    -org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.processAnno
    -tations(JavaCorrectionProcessor.java:208)
    -at 
    -org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.computeComp
    -letionProposals(JavaCorrectionProcessor.java:177)
    -at 
    -org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposal
    -s(ContentAssistant.java:1472)
    -at 
    -org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals
    -(CompletionProposalPopup.java:242)
    -at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$7
    -(CompletionProposalPopup.java:238)
    -at org.eclipse.jface.text.contentassist.CompletionProposalPopup$1.run
    -(CompletionProposalPopup.java:197)
    -at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
    -at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals
    -(CompletionProposalPopup.java:192)
    -at 
    -org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions
    -(ContentAssistant.java:1320)
    -at 
    -org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionAssistant.showPossibl
    -eCompletions(JavaCorrectionAssistant.java:159)
    -at 
    -org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewe
    -r.doOperation(CompilationUnitEditor.java:184)
    -at org.eclipse.jdt.internal.ui.javaeditor.JavaSelectAnnotationRulerAction.run
    -(JavaSelectAnnotationRulerAction.java:78)
    -at org.eclipse.ui.texteditor.AbstractRulerActionDelegate.run
    -(AbstractRulerActionDelegate.java:99)
    -at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:276)
    -at org.eclipse.ui.internal.PluginAction.run(PluginAction.java:238)
    -at org.eclipse.ui.texteditor.AbstractTextEditor$11.triggerAction
    -(AbstractTextEditor.java:2110)
    -at org.eclipse.ui.texteditor.AbstractTextEditor$11.mouseUp
    -(AbstractTextEditor.java:2117)
    -at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:136)
    -at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
    -at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796)
    -at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2772)
    -at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2431)
    -at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1377)
    -at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1348)
    -at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:254)
    -at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141)
    -at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:96)
    -at org.eclipse.core.internal.runtime.PlatformActivator$1.run
    -(PlatformActivator.java:335)
    -at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273)
    -at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
    -at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    -at sun.reflect.NativeMethodAccessorImpl.invoke
    -(NativeMethodAccessorImpl.java:39)
    -at sun.reflect.DelegatingMethodAccessorImpl.invoke
    -(DelegatingMethodAccessorImpl.java:25)
    -at java.lang.reflect.Method.invoke(Method.java:324)
    -at org.eclipse.core.launcher.Main.basicRun(Main.java:183)
    -at org.eclipse.core.launcher.Main.run(Main.java:644)
    -at org.eclipse.core.launcher.Main.main(Main.java:628)
    -
    -
    -Looking at the jdt code in UnresolvedElementsSubProcessor.java, at line 395, 
    -the parent field is null:
    -
    -	ASTNode parent= selectedNode.getParent();
    -	while (parent.getLength() == selectedNode.getLength()) { // line 395
    -			parent= parent.getParent(); 
    -	}
    -
    -java.lang.NullPointerException There just needs to be a null check as there is above:
    -
    -
    -	ASTNode selectedNode= problem.getCoveringNode(context.getASTRoot());
    -	if (selectedNode == null) {
    -		return;
    -	}
    -	int kind= SimilarElementsRequestor.ALL_TYPES;
    -		
    -	ASTNode parent= selectedNode.getParent();
    -	while (parent.getLength() == selectedNode.getLength()) { 	
    -		parent= parent.getParent(); 
    -	}
    -
    -should become:
    -
    -
    -	ASTNode selectedNode= problem.getCoveringNode(context.getASTRoot());
    -	if (selectedNode == null) {
    -		return;
    -	}
    -	int kind= SimilarElementsRequestor.ALL_TYPES;
    -		
    -	ASTNode parent= selectedNode.getParent();
    -	if (parent == null) {
    -		return;
    -	}
    -	while (parent.getLength() == selectedNode.getLength()) { 	
    -		parent= parent.getParent(); 
    -	}
    -
    -
    -This needs to be raised as a jdt bug, since we don't pass through any ajdt 
    -code in order to get here.
    -
    -Raising this bug against ajdt is just for tracking.
    -
    -(note this happens on 1.1.12, but also on the latest AJDT dev build).
    -
    -Bug List: First Last (This bug is -not in your list)   Show list -     Query page -     Enter new bug
    - - - -
    - - - -
    This is Bugzilla: the Mozilla bug system. For more - information about what Bugzilla is and what it can do, see bugzilla.org.
    -
    - - - - - - -
    Actions: New | - Query | bug # | - Reports -  New Account - | Log In -
    diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/40152.html b/org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/40152.html deleted file mode 100644 index fb15d0fa8..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/40152.html +++ /dev/null @@ -1,1228 +0,0 @@ - - -Bug 40152 - Junit tests fail on GTK - - - - - - -
    - - - - -
    - - - - - -
    - - - -
    Bugzilla Bug - 40152
     Junit tests fail on GTK
    Bug List: (18 of -183) First Last Prev Next -  Show list -     Query page -     Enter new bug -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Bug#: 40152  Platform:  Reporter: christophe_cornu@ca.ibm.com (Christophe Cornu)
    Product:  OS:  Add CC:
    Component: - -  Version: -  CC:
    Status: NEW Priority: -  
    Resolution: -  Severity: -  
    Assigned To: - felipe_heidrich@ca.ibm.com (Felipe Heidrich) Target - Milestone:  
    URL:
    Summary:
    Keywords: - -

    - - - - - - - - - - -
    AttachmentTypeModifiedStatusActions
    Create - a New Attachment (proposed patch, testcase, etc.) View - All

    - - - - - - - - - - -
    Bug 40152 depends on: Show - dependency tree
    Bug 40152 blocks:
    - - - - -
    Votes: 0    Show - votes for this bug    Vote - for this bug

    Additional Comments:
    -

    Leave as -NEW 
    Accept bug -(change status to ASSIGNED)
    Resolve bug, changing resolution to
    Resolve bug, mark it as duplicate of bug #
    Reassign -bug to
    Reassign bug to owner of selected component -
    -

    View Bug -Activity   |   Format For -Printing

    - - - - -
    Description: Opened: 2003-07-15 16:25
    -
    -
    latest from head (20030715) generate about 30 errors/failures.
    -
    -.........................................
    -.........................................
    -.........................E................
    -..........4
    -5
    -...............................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -...........F.....F...........F.E.E............
    -.................F....F....................
    -..........
    -(<unknown>:6548): Gdk-CRITICAL **: file gdkdraw.c: line 238 
    -(gdk_drawable_get_display): assertion `GDK_IS_DRAWABLE (drawable)' failed
    -
    -(<unknown>:6548): Gdk-CRITICAL **: file gdkdisplay.c: line 498 
    -(gdk_display_get_window_at_pointer): assertion `GDK_IS_DISPLAY (display)' 
    -failed
    -........
    -(<unknown>:6548): Gdk-CRITICAL **: file gdkdraw.c: line 238 
    -(gdk_drawable_get_display): assertion `GDK_IS_DRAWABLE (drawable)' failed
    -
    -(<unknown>:6548): Gdk-CRITICAL **: file gdkdisplay.c: line 498 
    -(gdk_display_get_window_at_pointer): assertion `GDK_IS_DISPLAY (display)' 
    -failed
    -.......................
    -.........................................
    -..............F...........................
    -.........................................
    -....................................F.....
    -.........................................
    -.........................................
    -.........................................
    -.......................................
    -(<unknown>:6548): Gtk-CRITICAL **: file gtkwidget.c: line 5139 
    -(gtk_widget_set_size_request): assertion `width >= -1' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtkwidget.c: line 5139 
    -(gtk_widget_set_size_request): assertion `width >= -1' failed
    -..
    -...................
    -(<unknown>:6548): Gtk-CRITICAL **: file gtkwidget.c: line 5139 
    -(gtk_widget_set_size_request): assertion `width >= -1' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtkwidget.c: line 5139 
    -(gtk_widget_set_size_request): assertion `width >= -1' failed
    -......................
    -.........................................
    -..................................
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreeview.c: line 9817 
    -(gtk_tree_view_get_path_at_pos): assertion `tree_view->priv->bin_window != 
    -NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreeview.c: line 9817 
    -(gtk_tree_view_get_path_at_pos): assertion `tree_view->priv->bin_window != 
    -NULL' failed
    -.......
    -...
    -(<unknown>:6548): Gtk-CRITICAL **: file gtkliststore.c: line 533 
    -(gtk_list_store_get_path): assertion `iter->stamp == GTK_LIST_STORE 
    -(tree_model)->stamp' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtkliststore.c: line 533 
    -(gtk_list_store_get_path): assertion `iter->stamp == GTK_LIST_STORE 
    -(tree_model)->stamp' failed
    -.........
    -(<unknown>:6548): Gtk-CRITICAL **: file gtkliststore.c: line 533 
    -(gtk_list_store_get_path): assertion `iter->stamp == GTK_LIST_STORE 
    -(tree_model)->stamp' failed
    -..
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreeview.c: line 9817 
    -(gtk_tree_view_get_path_at_pos): assertion `tree_view->priv->bin_window != 
    -NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreeview.c: line 9817 
    -(gtk_tree_view_get_path_at_pos): assertion `tree_view->priv->bin_window != 
    -NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreeview.c: line 9817 
    -(gtk_tree_view_get_path_at_pos): assertion `tree_view->priv->bin_window != 
    -NULL' failed
    -F...........................
    -.........................................
    -........................................F.
    -............F........F........F...F..........
    -.........................................
    -.........................................
    -.....................F.F...................
    -.........................................
    -.........................................
    -................................
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreeview.c: line 9817 
    -(gtk_tree_view_get_path_at_pos): assertion `tree_view->priv->bin_window != 
    -NULL' failed
    -F.
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreestore.c: line 569 
    -(gtk_tree_store_get_path): assertion `iter->stamp == GTK_TREE_STORE 
    -(tree_model)->stamp' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 369 
    -(gtk_tree_path_get_depth): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreeview.c: line 8800 
    -(gtk_tree_view_scroll_to_cell): assertion `path != NULL || column != NULL' 
    -failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 400 
    -(gtk_tree_path_free): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreestore.c: line 569 
    -(gtk_tree_store_get_path): assertion `iter->stamp == GTK_TREE_STORE 
    -(tree_model)->stamp' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 369 
    -(gtk_tree_path_get_depth): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreeview.c: line 8800 
    -(gtk_tree_view_scroll_to_cell): assertion `path != NULL || column != NULL' 
    -failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 400 
    -(gtk_tree_path_free): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreestore.c: line 569 
    -(gtk_tree_store_get_path): assertion `iter->stamp == GTK_TREE_STORE 
    -(tree_model)->stamp' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 369 
    -(gtk_tree_path_get_depth): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreeview.c: line 8800 
    -(gtk_tree_view_scroll_to_cell): assertion `path != NULL || column != NULL' 
    -failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 400 
    -(gtk_tree_path_free): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreestore.c: line 569 
    -(gtk_tree_store_get_path): assertion `iter->stamp == GTK_TREE_STORE 
    -(tree_model)->stamp' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 369 
    -(gtk_tree_path_get_depth): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreeview.c: line 8800 
    -(gtk_tree_view_scroll_to_cell): assertion `path != NULL || column != NULL' 
    -failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 400 
    -(gtk_tree_path_free): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreestore.c: line 569 
    -(gtk_tree_store_get_path): assertion `iter->stamp == GTK_TREE_STORE 
    -(tree_model)->stamp' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 369 
    -(gtk_tree_path_get_depth): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreeview.c: line 8800 
    -(gtk_tree_view_scroll_to_cell): assertion `path != NULL || column != NULL' 
    -failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 400 
    -(gtk_tree_path_free): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreestore.c: line 569 
    -(gtk_tree_store_get_path): assertion `iter->stamp == GTK_TREE_STORE 
    -(tree_model)->stamp' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 369 
    -(gtk_tree_path_get_depth): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreeview.c: line 8800 
    -(gtk_tree_view_scroll_to_cell): assertion `path != NULL || column != NULL' 
    -failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 400 
    -(gtk_tree_path_free): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreestore.c: line 569 
    -(gtk_tree_store_get_path): assertion `iter->stamp == GTK_TREE_STORE 
    -(tree_model)->stamp' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 369 
    -(gtk_tree_path_get_depth): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreeview.c: line 8800 
    -(gtk_tree_view_scroll_to_cell): assertion `path != NULL || column != NULL' 
    -failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 400 
    -(gtk_tree_path_free): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreestore.c: line 569 
    -(gtk_tree_store_get_path): assertion `iter->stamp == GTK_TREE_STORE 
    -(tree_model)->stamp' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 369 
    -(gtk_tree_path_get_depth): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreeview.c: line 8800 
    -(gtk_tree_view_scroll_to_cell): assertion `path != NULL || column != NULL' 
    -failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 400 
    -(gtk_tree_path_free): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreestore.c: line 569 
    -(gtk_tree_store_get_path): assertion `iter->stamp == GTK_TREE_STORE 
    -(tree_model)->stamp' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 369 
    -(gtk_tree_path_get_depth): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreeview.c: line 8800 
    -(gtk_tree_view_scroll_to_cell): assertion `path != NULL || column != NULL' 
    -failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 400 
    -(gtk_tree_path_free): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreestore.c: line 569 
    -(gtk_tree_store_get_path): assertion `iter->stamp == GTK_TREE_STORE 
    -(tree_model)->stamp' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 369 
    -(gtk_tree_path_get_depth): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreeview.c: line 8800 
    -(gtk_tree_view_scroll_to_cell): assertion `path != NULL || column != NULL' 
    -failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 400 
    -(gtk_tree_path_free): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreestore.c: line 569 
    -(gtk_tree_store_get_path): assertion `iter->stamp == GTK_TREE_STORE 
    -(tree_model)->stamp' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 369 
    -(gtk_tree_path_get_depth): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreeview.c: line 8800 
    -(gtk_tree_view_scroll_to_cell): assertion `path != NULL || column != NULL' 
    -failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 400 
    -(gtk_tree_path_free): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreestore.c: line 569 
    -(gtk_tree_store_get_path): assertion `iter->stamp == GTK_TREE_STORE 
    -(tree_model)->stamp' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 369 
    -(gtk_tree_path_get_depth): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreeview.c: line 8800 
    -(gtk_tree_view_scroll_to_cell): assertion `path != NULL || column != NULL' 
    -failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 400 
    -(gtk_tree_path_free): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreestore.c: line 569 
    -(gtk_tree_store_get_path): assertion `iter->stamp == GTK_TREE_STORE 
    -(tree_model)->stamp' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 369 
    -(gtk_tree_path_get_depth): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreeview.c: line 8800 
    -(gtk_tree_view_scroll_to_cell): assertion `path != NULL || column != NULL' 
    -failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 400 
    -(gtk_tree_path_free): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreestore.c: line 569 
    -(gtk_tree_store_get_path): assertion `iter->stamp == GTK_TREE_STORE 
    -(tree_model)->stamp' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 369 
    -(gtk_tree_path_get_depth): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreeview.c: line 8800 
    -(gtk_tree_view_scroll_to_cell): assertion `path != NULL || column != NULL' 
    -failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 400 
    -(gtk_tree_path_free): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreestore.c: line 569 
    -(gtk_tree_store_get_path): assertion `iter->stamp == GTK_TREE_STORE 
    -(tree_model)->stamp' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 369 
    -(gtk_tree_path_get_depth): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreeview.c: line 8800 
    -(gtk_tree_view_scroll_to_cell): assertion `path != NULL || column != NULL' 
    -failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 400 
    -(gtk_tree_path_free): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreestore.c: line 569 
    -(gtk_tree_store_get_path): assertion `iter->stamp == GTK_TREE_STORE 
    -(tree_model)->stamp' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 369 
    -(gtk_tree_path_get_depth): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreeview.c: line 8800 
    -(gtk_tree_view_scroll_to_cell): assertion `path != NULL || column != NULL' 
    -failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 400 
    -(gtk_tree_path_free): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreestore.c: line 569 
    -(gtk_tree_store_get_path): assertion `iter->stamp == GTK_TREE_STORE 
    -(tree_model)->stamp' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 369 
    -(gtk_tree_path_get_depth): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreeview.c: line 8800 
    -(gtk_tree_view_scroll_to_cell): assertion `path != NULL || column != NULL' 
    -failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 400 
    -(gtk_tree_path_free): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreestore.c: line 569 
    -(gtk_tree_store_get_path): assertion `iter->stamp == GTK_TREE_STORE 
    -(tree_model)->stamp' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 369 
    -(gtk_tree_path_get_depth): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreeview.c: line 8800 
    -(gtk_tree_view_scroll_to_cell): assertion `path != NULL || column != NULL' 
    -failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 400 
    -(gtk_tree_path_free): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreestore.c: line 569 
    -(gtk_tree_store_get_path): assertion `iter->stamp == GTK_TREE_STORE 
    -(tree_model)->stamp' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 369 
    -(gtk_tree_path_get_depth): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreeview.c: line 8800 
    -(gtk_tree_view_scroll_to_cell): assertion `path != NULL || column != NULL' 
    -failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 400 
    -(gtk_tree_path_free): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreestore.c: line 569 
    -(gtk_tree_store_get_path): assertion `iter->stamp == GTK_TREE_STORE 
    -(tree_model)->stamp' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 369 
    -(gtk_tree_path_get_depth): assertion `path != NULL' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreeview.c: line 8800 
    -(gtk_tree_view_scroll_to_cell): assertion `path != NULL || column != NULL' 
    -failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtktreemodel.c: line 400 
    -(gtk_tree_path_free): assertion `path != NULL' failed
    -........
    -.........................................
    -.........................................
    -...........................F..............
    -.........................................
    -.........................................
    -.............
    -(<unknown>:6548): Gtk-CRITICAL **: file gtkeditable.c: line 172 
    -(gtk_editable_delete_selection): assertion `GTK_IS_EDITABLE (editable)' failed
    -
    -(<unknown>:6548): Gtk-CRITICAL **: file gtkeditable.c: line 172 
    -(gtk_editable_delete_selection): assertion `GTK_IS_EDITABLE (editable)' failed
    -F....F.......F.......F.E.......E..
    -.........................................
    -.........................................
    -.............................
    -(<unknown>:6548): Gtk-CRITICAL **: file gtkframe.c: line 362 
    -(gtk_frame_set_label_widget): assertion `label_widget == NULL || label_widget-
    ->parent == NULL' failed
    -............
    -.........................................
    -.........................................
    -................F.........................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.......................................F.F.
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -...........F.F.............................
    -..F....F..E.E................................
    -....F.F....................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.........................................
    -.......
    -Time: 111.199
    -There were 7 errors:
    -1) test_getFontData
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_graphics_Font)
    -java.lang.NullPointerException
    -	at org.eclipse.swt.graphics.Font.dispose(Font.java:143)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_graphics_Font.test_getFontData
    -(Test_org_eclipse_swt_graphics_Font.java:239)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_graphics_Font.runTest
    -(Test_org_eclipse_swt_graphics_Font.java:308)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -2) test_setText$Ljava_lang_String
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_TableItem)
    -org.eclipse.swt.SWTError: Cannot get text
    -	at org.eclipse.swt.SWT.error(SWT.java:2391)
    -	at org.eclipse.swt.SWT.error(SWT.java:2295)
    -	at org.eclipse.swt.widgets.Widget.error(Widget.java:375)
    -	at org.eclipse.swt.widgets.TableItem.getText(TableItem.java:350)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_TableItem.test_setText
    -$Ljava_lang_String(Test_org_eclipse_swt_widgets_TableItem.java:359)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_TableItem.runTest
    -(Test_org_eclipse_swt_widgets_TableItem.java:518)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -3) test_setTextILjava_lang_String
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_TableItem)
    -org.eclipse.swt.SWTError: Cannot get text
    -	at org.eclipse.swt.SWT.error(SWT.java:2391)
    -	at org.eclipse.swt.SWT.error(SWT.java:2295)
    -	at org.eclipse.swt.widgets.Widget.error(Widget.java:375)
    -	at org.eclipse.swt.widgets.TableItem.getText(TableItem.java:350)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_TableItem.test_setText
    -ILjava_lang_String(Test_org_eclipse_swt_widgets_TableItem.java:396)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_TableItem.runTest
    -(Test_org_eclipse_swt_widgets_TableItem.java:519)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -4) test_removeII
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Combo)
    -java.lang.IllegalArgumentException: Index out of bounds
    -	at org.eclipse.swt.SWT.error(SWT.java:2351)
    -	at org.eclipse.swt.SWT.error(SWT.java:2295)
    -	at org.eclipse.swt.widgets.Widget.error(Widget.java:375)
    -	at org.eclipse.swt.widgets.Combo.remove(Combo.java:938)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Combo.test_removeII
    -(Test_org_eclipse_swt_widgets_Combo.java:397)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Combo.runTest
    -(Test_org_eclipse_swt_widgets_Combo.java:688)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -5) test_setItemILjava_lang_String
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Combo)
    -java.lang.ArrayIndexOutOfBoundsException: 0
    -	at org.eclipse.swt.widgets.Combo.setItem(Combo.java:1103)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Combo.test_setItemILja
    -va_lang_String(Test_org_eclipse_swt_widgets_Combo.java:503)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Combo.runTest
    -(Test_org_eclipse_swt_widgets_Combo.java:695)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -6) test_print
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_StyledText)
    -java.lang.NullPointerException
    -	at org.eclipse.swt.custom.StyledText$Printing.<init>
    -(StyledText.java:200)
    -	at org.eclipse.swt.custom.StyledText.print(StyledText.java:5933)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_StyledText.test_print
    -(Test_org_eclipse_swt_custom_StyledText.java:1690)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_StyledText.runTest
    -(Test_org_eclipse_swt_custom_StyledText.java:4165)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -7) test_printLorg_eclipse_swt_printing_Printer
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_StyledText)
    -java.lang.NullPointerException
    -	at org.eclipse.swt.custom.StyledText$Printing.<init>
    -(StyledText.java:200)
    -	at org.eclipse.swt.custom.StyledText.print(StyledText.java:5988)
    -	at org.eclipse.swt.custom.StyledText.print(StyledText.java:5963)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_StyledText.test_printLo
    -rg_eclipse_swt_printing_Printer
    -(Test_org_eclipse_swt_custom_StyledText.java:1710)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_StyledText.runTest
    -(Test_org_eclipse_swt_custom_StyledText.java:4166)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -There were 30 failures:
    -1) test_getBoundsI
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_TableItem)
    -junit.framework.AssertionFailedError: :a:
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_TableItem.test_getBoun
    -dsI(Test_org_eclipse_swt_widgets_TableItem.java:85)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_TableItem.runTest
    -(Test_org_eclipse_swt_widgets_TableItem.java:501)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -2) test_getImageBoundsI
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_TableItem)
    -junit.framework.AssertionFailedError: :e:
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_TableItem.test_getImag
    -eBoundsI(Test_org_eclipse_swt_widgets_TableItem.java:177)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_TableItem.runTest
    -(Test_org_eclipse_swt_widgets_TableItem.java:506)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -3) test_setImageIndentI
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_TableItem)
    -junit.framework.AssertionFailedError: expected:<1> but was:<0>
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_TableItem.test_setImag
    -eIndentI(Test_org_eclipse_swt_widgets_TableItem.java:338)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_TableItem.runTest
    -(Test_org_eclipse_swt_widgets_TableItem.java:517)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -4) test_getWidth
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_TableColumn)
    -junit.framework.AssertionFailedError: :a: width=0 should be=10
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_TableColumn.test_getWi
    -dth(Test_org_eclipse_swt_widgets_TableColumn.java:122)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_TableColumn.runTest
    -(Test_org_eclipse_swt_widgets_TableColumn.java:264)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -5) test_setAlignmentI
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_TableColumn)
    -junit.framework.AssertionFailedError: :c: Should not be allowed to set 
    -alignment of the first column
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_TableColumn.test_setAl
    -ignmentI(Test_org_eclipse_swt_widgets_TableColumn.java:177)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_TableColumn.runTest
    -(Test_org_eclipse_swt_widgets_TableColumn.java:268)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -6) test_setDefaultItemLorg_eclipse_swt_widgets_MenuItem
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Menu)
    -junit.framework.AssertionFailedError: expected:<null> but was:<MenuItem {}>
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Menu.test_setDefaultIt
    -emLorg_eclipse_swt_widgets_MenuItem(Test_org_eclipse_swt_widgets_Menu.java:272)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Menu.runTest
    -(Test_org_eclipse_swt_widgets_Menu.java:387)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -7) test_getMonitor
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Shell)
    -junit.framework.AssertionFailedError
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Control.test_getMonito
    -r(Test_org_eclipse_swt_widgets_Control.java:287)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Control.runTest
    -(Test_org_eclipse_swt_widgets_Control.java:819)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Scrollable.runTest
    -(Test_org_eclipse_swt_widgets_Scrollable.java:72)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Composite.runTest
    -(Test_org_eclipse_swt_widgets_Composite.java:159)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Canvas.runTest
    -(Test_org_eclipse_swt_widgets_Canvas.java:115)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Decorations.runTest
    -(Test_org_eclipse_swt_widgets_Decorations.java:250)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Shell.runTest
    -(Test_org_eclipse_swt_widgets_Shell.java:428)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -8) test_setTopIndexI
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_List)
    -junit.framework.AssertionFailedError: expected:<0> but was:<1>
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_List.test_setTopIndexI
    -(Test_org_eclipse_swt_widgets_List.java:2019)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_List.runTest
    -(Test_org_eclipse_swt_widgets_List.java:2144)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -9) test_getDoubleClickEnabled
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text)
    -junit.framework.AssertionFailedError: expected:<false> but was:<true>
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text.test_getDoubleCli
    -ckEnabled(Test_org_eclipse_swt_widgets_Text.java:316)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text.runTest
    -(Test_org_eclipse_swt_widgets_Text.java:953)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -10) test_getTopIndex
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text)
    -junit.framework.AssertionFailedError: expected:<1> but was:<0>
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text.test_getTopIndex
    -(Test_org_eclipse_swt_widgets_Text.java:424)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text.runTest
    -(Test_org_eclipse_swt_widgets_Text.java:966)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -11) test_setDoubleClickEnabledZ
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text)
    -junit.framework.AssertionFailedError: expected:<false> but was:<true>
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text.test_setDoubleCli
    -ckEnabledZ(Test_org_eclipse_swt_widgets_Text.java:599)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text.runTest
    -(Test_org_eclipse_swt_widgets_Text.java:974)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -12) test_setTabsI
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text)
    -junit.framework.AssertionFailedError: expected:<8> but was:<0>
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text.test_setTabsI
    -(Test_org_eclipse_swt_widgets_Text.java:759)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text.runTest
    -(Test_org_eclipse_swt_widgets_Text.java:982)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -13) test_setTopIndexI
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text)
    -junit.framework.AssertionFailedError: expected:<1> but was:<0>
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text.test_setTopIndexI
    -(Test_org_eclipse_swt_widgets_Text.java:820)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text.runTest
    -(Test_org_eclipse_swt_widgets_Text.java:985)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -14) test_setMaximumI
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_ScrollBar)
    -junit.framework.AssertionFailedError: expected:<1> but was:<10>
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_ScrollBar.check
    -(Test_org_eclipse_swt_widgets_ScrollBar.java:67)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_ScrollBar.report
    -(Test_org_eclipse_swt_widgets_ScrollBar.java:61)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_ScrollBar.test_setMaxi
    -mumI(Test_org_eclipse_swt_widgets_ScrollBar.java:757)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_ScrollBar.runTest
    -(Test_org_eclipse_swt_widgets_ScrollBar.java:892)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -15) test_setMinimumI
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_ScrollBar)
    -junit.framework.AssertionFailedError: expected:<10> but was:<9>
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_ScrollBar.check
    -(Test_org_eclipse_swt_widgets_ScrollBar.java:68)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_ScrollBar.report
    -(Test_org_eclipse_swt_widgets_ScrollBar.java:61)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_ScrollBar.test_setMini
    -mumI(Test_org_eclipse_swt_widgets_ScrollBar.java:773)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_ScrollBar.runTest
    -(Test_org_eclipse_swt_widgets_ScrollBar.java:893)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -16) test_setTopItemLorg_eclipse_swt_widgets_TreeItem
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Tree)
    -junit.framework.AssertionFailedError: expected:<TreeItem {}> but was:<null>
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Tree.test_setTopItemLo
    -rg_eclipse_swt_widgets_TreeItem(Test_org_eclipse_swt_widgets_Tree.java:424)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Tree.runTest
    -(Test_org_eclipse_swt_widgets_Tree.java:538)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -17) test_setSelectionI
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_TabFolder)
    -junit.framework.AssertionFailedError: expected:<0> but was:<1>
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_TabFolder.test_setSele
    -ctionI(Test_org_eclipse_swt_widgets_TabFolder.java:307)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_TabFolder.runTest
    -(Test_org_eclipse_swt_widgets_TabFolder.java:405)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -18) test_clearSelection
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Combo)
    -junit.framework.AssertionFailedError: :d:
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Combo.test_clearSelect
    -ion(Test_org_eclipse_swt_widgets_Combo.java:130)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Combo.runTest
    -(Test_org_eclipse_swt_widgets_Combo.java:669)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -19) test_deselectI
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Combo)
    -junit.framework.AssertionFailedError: :b:0
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Combo.test_deselectI
    -(Test_org_eclipse_swt_widgets_Combo.java:155)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Combo.runTest
    -(Test_org_eclipse_swt_widgets_Combo.java:673)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -20) test_getSelectionIndex
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Combo)
    -junit.framework.AssertionFailedError: expected:<1> but was:<0>
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Combo.test_getSelectio
    -nIndex(Test_org_eclipse_swt_widgets_Combo.java:219)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Combo.runTest
    -(Test_org_eclipse_swt_widgets_Combo.java:680)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -21) test_removeI
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Combo)
    -junit.framework.AssertionFailedError: index 0 expected:<0> but was:<-1>
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Combo.test_removeI
    -(Test_org_eclipse_swt_widgets_Combo.java:356)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Combo.runTest
    -(Test_org_eclipse_swt_widgets_Combo.java:687)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -22) test_getRowCount
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_ToolBar)
    -junit.framework.AssertionFailedError: :a:1
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_ToolBar.test_getRowCou
    -nt(Test_org_eclipse_swt_widgets_ToolBar.java:132)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_ToolBar.runTest
    -(Test_org_eclipse_swt_widgets_ToolBar.java:206)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -23) test_setMaximumI
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Slider)
    -junit.framework.AssertionFailedError: setMaximum(11): Thumb Expected: 1  
    -Actual: 10
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Slider.check
    -(Test_org_eclipse_swt_widgets_Slider.java:67)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Slider.report
    -(Test_org_eclipse_swt_widgets_Slider.java:60)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Slider.test_setMaximum
    -I(Test_org_eclipse_swt_widgets_Slider.java:743)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Slider.runTest
    -(Test_org_eclipse_swt_widgets_Slider.java:836)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -24) test_setMinimumI
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Slider)
    -junit.framework.AssertionFailedError: setMinimum(91): Thumb Expected: 9  
    -Actual: 10
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Slider.check
    -(Test_org_eclipse_swt_widgets_Slider.java:67)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Slider.report
    -(Test_org_eclipse_swt_widgets_Slider.java:60)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Slider.test_setMinimum
    -I(Test_org_eclipse_swt_widgets_Slider.java:755)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Slider.runTest
    -(Test_org_eclipse_swt_widgets_Slider.java:837)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -25) test_copy
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_StyledText)
    -junit.framework.AssertionFailedError: :a:
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_StyledText.test_copy
    -(Test_org_eclipse_swt_custom_StyledText.java:559)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_StyledText.runTest
    -(Test_org_eclipse_swt_custom_StyledText.java:4127)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -26) test_cut
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_StyledText)
    -junit.framework.AssertionFailedError: :a:
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_StyledText.test_cut
    -(Test_org_eclipse_swt_custom_StyledText.java:619)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_StyledText.runTest
    -(Test_org_eclipse_swt_custom_StyledText.java:4128)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -27) test_getTopIndex
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_StyledText)
    -junit.framework.AssertionFailedError: :d:
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_StyledText.test_getTopI
    -ndex(Test_org_eclipse_swt_custom_StyledText.java:1388)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_StyledText.runTest
    -(Test_org_eclipse_swt_custom_StyledText.java:4159)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -28) test_invokeActionI
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_StyledText)
    -junit.framework.ComparisonFailure: expected:<...
    -...> but was:<......>
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_StyledText.test_invokeA
    -ctionI(Test_org_eclipse_swt_custom_StyledText.java:1593)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_StyledText.runTest
    -(Test_org_eclipse_swt_custom_StyledText.java:4163)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -29) test_setTopIndexI
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_StyledText)
    -junit.framework.AssertionFailedError: :e:
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_StyledText.test_setTopI
    -ndexI(Test_org_eclipse_swt_custom_StyledText.java:3943)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_StyledText.runTest
    -(Test_org_eclipse_swt_custom_StyledText.java:4202)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -30) test_setTopPixelI
    -(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_StyledText)
    -junit.framework.AssertionFailedError: :f:
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_StyledText.test_setTopP
    -ixelI(Test_org_eclipse_swt_custom_StyledText.java:3972)
    -	at 
    -org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_StyledText.runTest
    -(Test_org_eclipse_swt_custom_StyledText.java:4203)
    -	at org.eclipse.swt.tests.junit.AllTests.main(AllTests.java:25)
    -
    -FAILURES!!!
    -Tests run: 4148,  Failures: 30,  Errors: 7
    -
    -
    -Calls to warnUnimpl: 958

    ------- Additional Comment #1 -From Felipe Heidrich 2003-07-28 -17:17 -------
    I was able to get rid of the GTK warnings, we still have 2 errors and 28 
    -Failures.
    -
    -
    -Bug List: (18 of 183) First Last Prev Next -  Show list -     Query page -     Enter new bug
    - - - -
    - - - -
    This is Bugzilla: the Mozilla bug system. For more - information about what Bugzilla is and what it can do, see bugzilla.org.
    -
    - - - - - - -
    Actions: New | - Query | bug # | - Reports -  New Account - | Log In -
    diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/4548.html b/org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/4548.html deleted file mode 100644 index b7047a40b..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/4548.html +++ /dev/null @@ -1,377 +0,0 @@ - - -Bug 4548 - DCR: TableTree should support icon in 1st column (1G06WFT) - - - - - - -
    - - - - -
    - - - - - -
    - - - -
    Bugzilla Bug - 4548
     DCR: TableTree should support icon in 1st - column (1G06WFT)
    Bug -List: First Last (This bug is -not in your list)   Show list -     Query page -     Enter new bug -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Bug#: 4548 -  Platform:  Reporter: erich_gamma@ch.ibm.com (Erich Gamma)
    Product:  OS:  Add CC:
    Component: - -  Version: -  CC:
    Status: RESOLVED Priority: -  
    Resolution: - WONTFIX Severity: -  
    Assigned To: - veronika_irvine@ca.ibm.com (Veronika Irvine) Target - Milestone:  
    URL:
    Summary:
    Keywords: - -

    - - - - - - - - - - -
    AttachmentTypeModifiedStatusActions
    Create - a New Attachment (proposed patch, testcase, etc.) View - All

    - - - - - - - - - - -
    Bug 4548 depends on: Show - dependency tree
    Bug 4548 blocks:
    - - - - -
    Votes: 0    Show - votes for this bug    Vote - for this bug

    Additional Comments:
    -

    Leave as -RESOLVED WONTFIX
    -Reopen bug
    Mark bug as -VERIFIED
    Mark bug as -CLOSED
    -

    View Bug -Activity   |   Format For -Printing

    - - - - -
    Description: Opened: 2001-10-11 14:18
    -
    -
    EG (8/24/00 3:41:25 PM)	
    -	TableTree doesn't support showing an icon in the first column. The icon is eaten up
    -	by the +/- icon.
    -	Not being able to have an icon in the first column reduces the applicability
    -	of TableTree (we would like to use it in the Java plugin, but we can't).
    -
    -NOTES:
    -
    -VI (8/24/00 10:54:39 AM)
    -	TableTree is implemented using the Windows table widget and this only allows
    -	one image per column.  Sorry, there's nothing we can do.
    -
    -AW (24.08.00 17:31:06)
    -	Why not combining the +/- icon with the client's icon into a single icon?
    -
    -EG (8/29/00 3:35:01 PM)
    -	JFace has support for compositing icons see: 
    -		com.ibm.jface.examples.compositeimage.CompositeImageExample
    -
    -CM (3/17/01 5:29:49 PM)
    -	P1/M1 (April 1st, 2001)
    -	Need to know the priority of 1GAJ9KP: SWT:ALL - TableTree class has no selection support for the SWT.CHECK style
    -	because these two PRs may conflict.
    -
    -CM (3/28/01 5:09:33 PM)
    -	We investigated using the Windows "state image" feature in Table, but this is already being used by
    -	checkboxes if the Table is created with check style. It would also mean that we would have to provide
    -	platform-specific public API on Table to allow TableTree class to set/get state images. So we decided
    -	against this.
    -
    -	VI is going to investigate merging the [+]/[-] images with the user's image. We would try to write it
    -	in such a way that only those who actually put an image in the first column would have to pay for
    -	the added slowness. We suspect there may be issues such as background color/transparency
    -	problems, hit test problems, selection highlight problems, and cheese problems, but we will have
    -	to try it first before we know for sure.
    -
    -VI (4/4/2001 10:41:59 AM)
    -	Two major issues which prevent us from merging the [+]/[-] with the user's image and using the normal first column image:
    -	1) Images of different sizes can be added to the control, however the size of the image displayed in the associated 
    -        Windows Common Control will be constrained to the size of the first image added to the ImageList.
    -		Images for all columns are added to the same ImageList and therefore must have the exact same height and WIDTH.
    -		This makes merging the +/- and the first column image have impact on every image in the TableTree
    -	2) There is a limit to how may images I can cram in the ImageList.  Having potentially 3 per row I think will quickly exceed the limit.
    -
    -VI (4/4/2001 05:20 PM)
    -
    -	We have a PR that requests support for an image in the first column of a TableTree and I believe that you
    -	are the prime requestor.
    -
    -	I have tried to make this work and below is the best I can do.  As you can see, there is a limitation on the
    -	underlying native widget which is that all images in the TableTree must have the exact same height and width.
    -	Consequently, when I leave enough room to merge the +/- image with the image you wish to show in the first column,
    -	this causes all the other images in the TableTree to be stretched width wise.
    -
    -	<picture>
    -
    -	It is my opinion that the current TableTree can not be made to work any better than this.  If this is not
    -	adequate for your use, the only alternative is to write a custom widget that does this and does not
    -	use the native widget.  Writing a full custom widget is not trivial.  It will probably require a month or
    -	two and will probably not give all the capability that is present in native List or Tree widgets (just
    -	because there are a lot of subtle things going on there and I won't have time to get them all).  I need
    -	to know if I should commence with a custom widget.  Also, as I have other responsibilities, Mike and I will
    -	have to discuss which of them will be set aside before I can do this work.
    -
    -VI (4/27/2001 8:42:19 AM)
    -	Have received no feedback requesting a custom Tree or implementation of the solution presented above.
    -	Moving to Inactive.

    ------- Additional Comment #1 From -Veronika Irvine 2002-05-27 16:17 --------
    Closing this bug report.  A new DCR should be raised from a better custom table 
    -tree.
    -
    -Bug List: First Last (This bug is -not in your list)   Show list -     Query page -     Enter new bug
    - - - -
    - - - -
    This is Bugzilla: the Mozilla bug system. For more - information about what Bugzilla is and what it can do, see bugzilla.org.
    -
    - - - - - - -
    Actions: New | - Query | bug # | - Reports -  New Account - | Log In -
    diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/4862.html b/org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/4862.html deleted file mode 100644 index 813a29a15..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/4862.html +++ /dev/null @@ -1,401 +0,0 @@ - - -Bug 4862 - Check for isDisposed() in dispose after sending Dispose Calback (1GLC25X) - - - - - - -
    - - - - -
    - - - - - -
    - - - -
    Bugzilla Bug - 4862
     Check for isDisposed() in dispose after - sending Dispose Calback (1GLC25X)
    Bug List: First Last (This bug is -not in your list)   Show list -     Query page -     Enter new bug -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Bug#: 4862 -  Platform:  Reporter: veronika_irvine@ca.ibm.com (Veronika Irvine)
    Product:  OS:  Add CC:
    Component: - -  Version: -  CC: -
    Remove selected CCs
    Status: NEW Priority: -  
    Resolution: -  Severity: -  
    Assigned To: - Silenio_Quarti@ca.ibm.com (Silenio Quarti) Target - Milestone:  
    URL:
    Summary:
    Keywords: - -

    - - - - - - - - - - -
    AttachmentTypeModifiedStatusActions
    Create - a New Attachment (proposed patch, testcase, etc.) View - All

    - - - - - - - - - - -
    Bug 4862 depends on: Show - dependency tree
    Bug 4862 blocks:
    - - - - -
    Votes: 0    Show - votes for this bug    Vote - for this bug

    Additional Comments:
    -

    Leave as -NEW 
    Accept bug -(change status to ASSIGNED)
    Resolve bug, changing resolution to
    Resolve bug, mark it as duplicate of bug #
    Reassign -bug to
    Reassign bug to owner of selected component -
    -

    View Bug -Activity   |   Format For -Printing

    - - - - -
    Description: Opened: 2001-10-11 14:24
    -
    -
    Run the following example, click on the button and you get the SWT Exception wdiget is disposed.
    -See Stack trace below.
    -In the dispose method of a widget, we need to check that the widget has not been disposed in the Dispose callback.
    -
    -public static void main(String args[]){
    -	Display display = new Display ();
    -	Shell shell = new Shell();
    -	shell.setLayout(new org.eclipse.swt.layout.GridLayout());
    -	shell.setBounds(100,30, 800,600);
    -	shell.open();
    - 
    -	final Composite panel = new Composite(shell, SWT.BORDER);
    -	panel.setBounds(20,430,100,100);
    - 
    -	final Button button = new Button(panel, 0);
    -	button.setText("dispose button");
    -	button.setBounds(7,7,80,70);
    -	final SelectionAdapter[] selectionListener = new SelectionAdapter[1];
    -	selectionListener[0] = new SelectionAdapter(){
    -		public void widgetSelected (org.eclipse.swt.events.SelectionEvent e){
    -			button.dispose();
    -		}
    -	};
    -	button.addSelectionListener(selectionListener[0]);
    - 
    -	final DisposeListener[] disposeListener = new DisposeListener[1];
    -	disposeListener[0] = new DisposeListener(){
    -		public void widgetDisposed(org.eclipse.swt.events.DisposeEvent e){
    -			button.removeDisposeListener(disposeListener[0]);
    -			panel.dispose();
    -		}
    -	};
    -	button.addDisposeListener(disposeListener[0]);
    - 
    -	while (!shell.isDisposed ()) {
    -		if (!display.readAndDispatch ()) display.sleep ();
    -	}
    -}
    -
    -
    -org.eclipse.swt.SWTException: Widget is disposed
    -	at org.eclipse.swt.SWT.error(SWT.java:1818)
    -	at org.eclipse.swt.SWT.error(SWT.java:1750)
    -	at org.eclipse.swt.widgets.Widget.error(Widget.java:379)
    -	at org.eclipse.swt.widgets.Control.getDisplay(Control.java:597)
    -	at org.eclipse.swt.widgets.Control.unsubclass(Control.java:2365)
    -	at org.eclipse.swt.widgets.Control.releaseWidget(Control.java:1247)
    -	at org.eclipse.swt.widgets.Button.releaseWidget(Button.java:344)
    -	at org.eclipse.swt.widgets.Widget.dispose(Widget.java:366)
    -	at veronika._Scrapbook$1.widgetSelected(_Scrapbook.java:43)
    -	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:85)
    -	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:54)
    -	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:645)
    -	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1359)
    -	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1160)
    -	at veronika._Scrapbook.main(_Scrapbook.java:58)
    -Exception in thread "main" 
    -
    -NOTES:

    ------- Additional Comment #1 From -DJ Houghton 2001-10-29 16:44 ------- -
    PRODUCT VERSION:
    -2.0 007
    -
    -

    ------- Additional Comment #2 From -Veronika Irvine 2004-09-24 10:09 --------
    In 3.1, I get a different error now on Windows:
    -
    -java.lang.NullPointerException
    -	at org.eclipse.swt.widgets.Control.deregister(Control.java:498)
    -	at org.eclipse.swt.widgets.Control.releaseWidget(Control.java:1496)
    -	at org.eclipse.swt.widgets.Button.releaseWidget(Button.java:364)
    -	at org.eclipse.swt.widgets.Widget.dispose(Widget.java:368)
    -	at veronika.Newsgroup$1.widgetSelected(Newsgroup.java:25)
    -	at org.eclipse.swt.widgets.TypedListener.handleEvent
    -(TypedListener.java:89)
    -	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
    -	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796)
    -	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2783)
    -	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2442)
    -	at veronika.Newsgroup.main(Newsgroup.java:40)
    -
    -
    -Bug List: First Last (This bug is -not in your list)   Show list -     Query page -     Enter new bug
    - - - -
    - - - -
    This is Bugzilla: the Mozilla bug system. For more - information about what Bugzilla is and what it can do, see bugzilla.org.
    -
    - - - - - - -
    Actions: New | - Query | bug # | - Reports -  New Account - | Log In -
    diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/67395.html b/org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/67395.html deleted file mode 100644 index ec9911002..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/67395.html +++ /dev/null @@ -1,390 +0,0 @@ - - -Bug 67395 - NullPointerException @ org.eclipse.jdt.internal.debug.eval.ast.engine.ASTInstructionCompiler.containsALocalType - - - - - - -
    - - - - -
    - - - - - -
    - - - -
    Bugzilla Bug - 67395
     NullPointerException @ - org.eclipse.jdt.internal.debug.eval.ast.engine.ASTInstructionCompiler.containsALocalType
    Bug -List: First Last (This bug is -not in your list)   Show list -     Query page -     Enter new bug -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Bug#: 67395  Platform:  Reporter: Leo.Kuznetsov@windriver.com (Leo Kuznetsov)
    Product:  OS:  Add CC:
    Component: -  Version:  CC: -
    Remove selected CCs
    Status: ASSIGNED Priority: -  
    Resolution: -  Severity: -  
    Assigned To: - luc_bourlier@us.ibm.com (Luc Bourlier) Target - Milestone:  
    URL:
    Summary:
    Keywords: - -

    - - - - - - - - - - -
    AttachmentTypeModifiedStatusActions
    Create - a New Attachment (proposed patch, testcase, etc.) View - All

    - - - - - - - - - - -
    Bug 67395 depends on: Show - dependency tree
    Bug 67395 blocks:
    - - - - -
    Votes: 0    Show - votes for this bug    Vote - for this bug

    Additional Comments:
    -

    Leave as -ASSIGNED 
    Resolve -bug, changing resolution to
    Resolve bug, mark it as duplicate of bug #
    Reassign -bug to
    Reassign bug to owner of selected component -
    -

    View Bug -Activity   |   Format For -Printing

    - - - - -
    Description: Opened: 2004-06-15 18:14
    -
    -
    java.lang.NullPointerException
    -at 
    -org.eclipse.jdt.internal.debug.eval.ast.engine.ASTInstructionCompiler.containsA
    -LocalType(ASTInstructionCompiler.java:331)
    -at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTInstructionCompiler.visit
    -(ASTInstructionCompiler.java:2075)
    -at org.eclipse.jdt.core.dom.MethodInvocation.accept0(MethodInvocation.java:234)
    -at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2456)
    -at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2503)
    -at org.eclipse.jdt.core.dom.ReturnStatement.accept0(ReturnStatement.java:133)
    -at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2456)
    -at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2526)
    -at org.eclipse.jdt.core.dom.Block.accept0(Block.java:133)
    -at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2456)
    -at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2503)
    -at org.eclipse.jdt.core.dom.MethodDeclaration.accept0
    -(MethodDeclaration.java:499)
    -at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2456)
    -at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2526)
    -at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:474)
    -at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2456)
    -at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2526)
    -at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:290)
    -at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2456)
    -at 
    -org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine.createExpres
    -sionFromAST(ASTEvaluationEngine.java:251)
    -at 
    -org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine.getCompiledE
    -xpression(ASTEvaluationEngine.java:156)
    -at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine.evaluate
    -(ASTEvaluationEngine.java:73)
    -at 
    -org.eclipse.jdt.internal.debug.ui.JavaWatchExpressionDelegate$EvaluationRunnabl
    -e.run(JavaWatchExpressionDelegate.java:144)
    -at org.eclipse.jdt.internal.debug.core.model.JDIThread$ThreadJob.run
    -(JDIThread.java:2510)
    -at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)

    ------- -Additional Comment #1 -From John Arthorne 2004-06-15 -18:17 -------
    Please include the Eclipse build number in the bug report. Also, it looks like
    -you are evaluating a watch expression. Please include/describe the expression,
    -and say if it is reproducible.

    ------- Additional Comment #2 -From Darin Wright 2004-06-16 13:38 --------
    Do you have the expression that caused this problem?

    ------- -Additional Comment #3 -From Darin Wright 2004-06-17 12:26 --------
    *** Bug 67664 has been marked as a duplicate of this bug. ***

    ------- -Additional Comment #4 -From Leo Kuznetsov 2004-06-17 -15:53 -------
    This was a function call:
    -
    -Sequent.getCurrent().toDebugString()
    -
    -where toDebugString() returns String

    ------- Additional Comment #5 -From Darin Wright 2004-06-23 09:24 --------
    Deferred

    ------- Additional Comment #6 -From Darin Wright 2004-08-03 14:57 --------
    *** Bug 70615 has been marked as a duplicate of this bug. ***

    ------- -Additional Comment #7 -From Darin Wright 2004-08-03 14:57 --------
    open for 3.1

    ------- Additional Comment #8 -From Darin Wright 2004-08-03 14:58 --------
    Luc, please advise if this should be fixed in 3.0.1

    ------- -Additional Comment #9 -From Darin Wright 2004-08-12 09:26 --------
    *** Bug 71851 has been marked as a duplicate of this bug. ***
    -
    -Bug List: First Last (This bug is -not in your list)   Show list -     Query page -     Enter new bug
    - - - -
    - - - -
    This is Bugzilla: the Mozilla bug system. For more - information about what Bugzilla is and what it can do, see bugzilla.org.
    -
    - - - - - - -
    Actions: New | - Query | bug # | - Reports -  New Account - | Log In -
    diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/76146.html b/org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/76146.html deleted file mode 100644 index f806fe8aa..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/76146.html +++ /dev/null @@ -1,406 +0,0 @@ - - -Bug 76146 - NPE using quickfix in Aspect opened with java editor - - - - - - -
    - - - - -
    - - - - - -
    - - - -
    Bugzilla Bug - 76146
     NPE using quickfix in Aspect opened with java - editor
    Bug List: First Last (This bug is -not in your list)   Show list -     Query page -     Enter new bug -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Bug#: 76146  Platform:  Reporter: hawkinsh@uk.ibm.com (Helen Hawkins)
    Product:  OS:  Add CC:
    Component: -  Version:  CC:
    Status: NEW Priority: -  
    Resolution: -  Severity: -  
    Assigned To: - mchapman@uk.ibm.com (Matt Chapman) Target - Milestone:  
    URL:
    Summary:
    Keywords: - -

    - - - - - - - - - - -
    AttachmentTypeModifiedStatusActions
    Create - a New Attachment (proposed patch, testcase, etc.) View - All

    - - - - - - - - - - -
    Bug 76146 depends on: Show - dependency tree
    Bug 76146 blocks:

    Additional -Comments:
    -

    Leave as -NEW 
    Accept bug -(change status to ASSIGNED)
    Resolve bug, changing resolution to
    Resolve bug, mark it as duplicate of bug #
    Reassign -bug to
    Reassign bug to owner of selected component -
    -

    View Bug -Activity   |   Format For -Printing

    - - - - -
    Description: Opened: 2004-10-13 04:51
    -
    -
    To recreate:
    -
    -- Check out the QuickFix project from ajdt.test project
    -- Open TestAspect.java in the Java Editor (right click > open with > Java 
    -Editor)
    -- Click on the lightbulb with the error marker (the same line as File f = new 
    -File("tmp");
    -- An Internal Error appear in the Error log with the following stack trace:
    -
    -
    -
    -java.lang.NullPointerException
    -at 
    -org.eclipse.jdt.internal.ui.text.correction.UnresolvedElementsSubProcessor.getT
    -ypeProposals(UnresolvedElementsSubProcessor.java:395)
    -at org.eclipse.jdt.internal.ui.text.correction.QuickFixProcessor.process
    -(QuickFixProcessor.java:270)
    -at org.eclipse.jdt.internal.ui.text.correction.QuickFixProcessor.getCorrections
    -(QuickFixProcessor.java:202)
    -at 
    -org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.collectCorr
    -ections(JavaCorrectionProcessor.java:240)
    -at 
    -org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.processAnno
    -tations(JavaCorrectionProcessor.java:208)
    -at 
    -org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.computeComp
    -letionProposals(JavaCorrectionProcessor.java:177)
    -at 
    -org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposal
    -s(ContentAssistant.java:1472)
    -at 
    -org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals
    -(CompletionProposalPopup.java:242)
    -at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$7
    -(CompletionProposalPopup.java:238)
    -at org.eclipse.jface.text.contentassist.CompletionProposalPopup$1.run
    -(CompletionProposalPopup.java:197)
    -at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
    -at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals
    -(CompletionProposalPopup.java:192)
    -at 
    -org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions
    -(ContentAssistant.java:1320)
    -at 
    -org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionAssistant.showPossibl
    -eCompletions(JavaCorrectionAssistant.java:159)
    -at 
    -org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewe
    -r.doOperation(CompilationUnitEditor.java:184)
    -at org.eclipse.jdt.internal.ui.javaeditor.JavaSelectAnnotationRulerAction.run
    -(JavaSelectAnnotationRulerAction.java:78)
    -at org.eclipse.ui.texteditor.AbstractRulerActionDelegate.run
    -(AbstractRulerActionDelegate.java:99)
    -at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:276)
    -at org.eclipse.ui.internal.PluginAction.run(PluginAction.java:238)
    -at org.eclipse.ui.texteditor.AbstractTextEditor$11.triggerAction
    -(AbstractTextEditor.java:2110)
    -at org.eclipse.ui.texteditor.AbstractTextEditor$11.mouseUp
    -(AbstractTextEditor.java:2117)
    -at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:136)
    -at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
    -at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796)
    -at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2772)
    -at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2431)
    -at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1377)
    -at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1348)
    -at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:254)
    -at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141)
    -at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:96)
    -at org.eclipse.core.internal.runtime.PlatformActivator$1.run
    -(PlatformActivator.java:335)
    -at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273)
    -at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
    -at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    -at sun.reflect.NativeMethodAccessorImpl.invoke
    -(NativeMethodAccessorImpl.java:39)
    -at sun.reflect.DelegatingMethodAccessorImpl.invoke
    -(DelegatingMethodAccessorImpl.java:25)
    -at java.lang.reflect.Method.invoke(Method.java:324)
    -at org.eclipse.core.launcher.Main.basicRun(Main.java:183)
    -at org.eclipse.core.launcher.Main.run(Main.java:644)
    -at org.eclipse.core.launcher.Main.main(Main.java:628)
    -
    -
    -Looking at the jdt code in UnresolvedElementsSubProcessor.java, at line 395, 
    -the parent field is null:
    -
    -	ASTNode parent= selectedNode.getParent();
    -	while (parent.getLength() == selectedNode.getLength()) { // line 395
    -			parent= parent.getParent(); 
    -	}
    -
    -There just needs to be a null check as there is above:
    -
    -
    -	ASTNode selectedNode= problem.getCoveringNode(context.getASTRoot());
    -	if (selectedNode == null) {
    -		return;
    -	}
    -	int kind= SimilarElementsRequestor.ALL_TYPES;
    -		
    -	ASTNode parent= selectedNode.getParent();
    -	while (parent.getLength() == selectedNode.getLength()) { 	
    -		parent= parent.getParent(); 
    -	}
    -
    -should become:
    -
    -
    -	ASTNode selectedNode= problem.getCoveringNode(context.getASTRoot());
    -	if (selectedNode == null) {
    -		return;
    -	}
    -	int kind= SimilarElementsRequestor.ALL_TYPES;
    -		
    -	ASTNode parent= selectedNode.getParent();
    -	if (parent == null) {
    -		return;
    -	}
    -	while (parent.getLength() == selectedNode.getLength()) { 	
    -		parent= parent.getParent(); 
    -	}
    -
    -
    -This needs to be raised as a jdt bug, since we don't pass through any ajdt 
    -code in order to get here.
    -
    -Raising this bug against ajdt is just for tracking.
    -
    -(note this happens on 1.1.12, but also on the latest AJDT dev build).
    -
    -Bug List: First Last (This bug is -not in your list)   Show list -     Query page -     Enter new bug
    - - - -
    - - - -
    This is Bugzilla: the Mozilla bug system. For more - information about what Bugzilla is and what it can do, see bugzilla.org.
    -
    - - - - - - -
    Actions: New | - Query | bug # | - Reports -  New Account - | Log In -
    diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/76388.html b/org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/76388.html deleted file mode 100644 index 1e2c41aa0..000000000 --- a/org.eclipse.mylyn.bugzilla.tests/testdata/reports-stacktrace/76388.html +++ /dev/null @@ -1,426 +0,0 @@ - - -Bug 76388 - Assertion failed during pull up refactoring - - - - - - -
    - - - - -
    - - - - - -
    - - - -
    Bugzilla Bug - 76388
     Assertion failed during pull up - refactoring
    Bug List: -First Last (This bug is -not in your list)   Show list -     Query page -     Enter new bug -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Bug#: 76388  Platform:  Reporter: silvio_boehler@ca.ibm.com (Silvio Böhler)
    Product:  OS:  Add CC:
    Component: - - Version:  CC:
    Status: NEW Priority: -  
    Resolution: -  Severity: -  
    Assigned To: - dirk_baeumer@ch.ibm.com (Dirk Baeumer) Target - Milestone:  
    URL:
    Summary: -
    Keywords: - -

    - - - - - - - - - - -
    AttachmentTypeModifiedStatusActions
    Create - a New Attachment (proposed patch, testcase, etc.) View - All

    - - - - - - - - - - -
    Bug 76388 depends on: Show - dependency tree
    Bug 76388 blocks:
    - - - - -
    Votes: 0    Show - votes for this bug    Vote - for this bug

    Additional Comments:
    -

    Leave as -NEW 
    Accept bug -(change status to ASSIGNED)
    Resolve bug, changing resolution to
    Resolve bug, mark it as duplicate of bug #
    Reassign -bug to
    Reassign bug to owner of selected component -
    -

    View Bug -Activity   |   Format For -Printing

    - - - - -
    Description: Opened: 2004-10-15 15:30
    -
    -
    I was doing some pull up refactorings.
    -
    -!SESSION Oct 15, 2004 15:08:42.572 ---------------------------------------------
    -eclipse.buildId=I200410130800
    -java.fullversion=J2RE 1.4.2 IBM J9 2.2 Windows XP x86-32 j9n142-20040831 (JIT
    -enabled)
    -J9VM - 20040827_2136_lHdSMR
    -JIT  - r7_level20040827_1801
    -BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
    -
    -!ENTRY org.eclipse.core.runtime 4 2 Oct 15, 2004 15:08:42.572
    -!MESSAGE Problems occurred when invoking code from plug-in:
    -"org.eclipse.core.runtime".
    -!STACK 0
    -org.eclipse.jface.text.Assert$AssertionFailedException: Assertion failed: 
    -	at org.eclipse.jface.text.Assert.isTrue(Assert.java:177)
    -	at org.eclipse.jface.text.Assert.isTrue(Assert.java:162)
    -	at org.eclipse.text.edits.TextEdit.internalSetLength(TextEdit.java:712)
    -	at org.eclipse.text.edits.MultiTextEdit.defineRegion(MultiTextEdit.java:194)
    -	at org.eclipse.text.edits.TextEditProcessor.<init>(TextEditProcessor.java:65)
    -	at org.eclipse.text.edits.TextEditProcessor.<init>(TextEditProcessor.java:56)
    -	at
    -org.eclipse.ltk.core.refactoring.TextChange.createTextEditProcessor(TextChange.java:638)
    -	at
    -org.eclipse.ltk.core.refactoring.TextChange.getPreviewDocument(TextChange.java:611)
    -	at
    -org.eclipse.ltk.core.refactoring.TextChange.getPreviewDocument(TextChange.java:538)
    -	at
    -org.eclipse.ltk.core.refactoring.TextChange.getPreviewContent(TextChange.java:553)
    -	at
    -org.eclipse.ltk.internal.ui.refactoring.TextChangePreviewViewer.setInput(TextChangePreviewViewer.java:190)
    -	at
    -org.eclipse.ltk.internal.ui.refactoring.DefaultChangeElement.feedInput(DefaultChangeElement.java:57)
    -	at
    -org.eclipse.ltk.internal.ui.refactoring.PreviewWizardPage.showPreview(PreviewWizardPage.java:370)
    -	at
    -org.eclipse.ltk.internal.ui.refactoring.PreviewWizardPage.access$2(PreviewWizardPage.java:355)
    -	at
    -org.eclipse.ltk.internal.ui.refactoring.PreviewWizardPage$2.selectionChanged(PreviewWizardPage.java:346)
    -	at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:163)
    -	at
    -org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:616)
    -	at org.eclipse.core.runtime.Platform.run(Platform.java:747)
    -	at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:161)
    -	at
    -org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:1613)
    -	at
    -org.eclipse.jface.viewers.StructuredViewer.setSelection(StructuredViewer.java:1304)
    -	at org.eclipse.jface.viewers.Viewer.setSelection(Viewer.java:380)
    -	at
    -org.eclipse.ltk.internal.ui.refactoring.PreviewWizardPage.setVisible(PreviewWizardPage.java:283)
    -	at org.eclipse.jface.wizard.WizardDialog.updateForPage(WizardDialog.java:1024)
    -	at org.eclipse.jface.wizard.WizardDialog.access$2(WizardDialog.java:1007)
    -	at org.eclipse.jface.wizard.WizardDialog$4.run(WizardDialog.java:997)
    -	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
    -	at org.eclipse.jface.wizard.WizardDialog.showPage(WizardDialog.java:995)
    -	at org.eclipse.jface.wizard.WizardDialog.nextPressed(WizardDialog.java:747)
    -	at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:338)
    -	at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:543)
    -	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89)
    -	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
    -	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:800)
    -	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2784)
    -	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2443)
    -	at org.eclipse.jface.window.Window.runEventLoop(Window.java:706)
    -	at org.eclipse.jface.window.Window.open(Window.java:684)
    -	at
    -org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation$1.run(RefactoringWizardOpenOperation.java:125)
    -	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
    -	at
    -org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:138)
    -	at
    -org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate(RefactoringStarter.java:40)
    -	at org.eclipse.jdt.ui.actions.PullUpAction.startRefactoring(PullUpAction.java:209)
    -	at org.eclipse.jdt.ui.actions.PullUpAction.run(PullUpAction.java:151)
    -	at
    -org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:216)
    -	at
    -org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:188)
    -	at org.eclipse.jface.action.Action.runWithEvent(Action.java:988)
    -	at
    -org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:946)
    -	at
    -org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:896)
    -	at
    -org.eclipse.jface.action.ActionContributionItem$7.handleEvent(ActionContributionItem.java:810)
    -	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
    -	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:800)
    -	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2784)
    -	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2443)
    -	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1443)
    -	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1414)
    -	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:271)
    -	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:144)
    -	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:102)
    -	at
    -org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:335)
    -	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273)
    -	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
    -	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    -	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
    -	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
    -	at
    -sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
    -	at java.lang.reflect.Method.invoke(Method.java:391)
    -	at org.eclipse.core.launcher.Main.basicRun(Main.java:185)
    -	at org.eclipse.core.launcher.Main.run(Main.java:704)
    -	at org.eclipse.core.launcher.Main.main(Main.java:688)

    ------- -Additional Comment #1 -From Dirk Baeumer 2004-10-19 06:06 --------
    Silvio, any steps to reproduce or any additional entries in the log that 
    -contain exceptions from text edits ?

    ------- Additional Comment #2 -From Silvio Böhler 2004-10-19 -08:57 -------
    No further entries and no reproducable steps unfortunately, sorry.
    -
    -Bug List: First Last (This bug is -not in your list)   Show list -     Query page -     Enter new bug
    - - - -
    - - - -
    This is Bugzilla: the Mozilla bug system. For more - information about what Bugzilla is and what it can do, see bugzilla.org.
    -
    - - - - - - -
    Actions: New | - Query | bug # | - Reports -  New Account - | Log In -
    diff --git a/org.eclipse.mylyn.tasks.tests/.classpath b/org.eclipse.mylyn.tasks.tests/.classpath deleted file mode 100644 index c9c6503f7..000000000 --- a/org.eclipse.mylyn.tasks.tests/.classpath +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/org.eclipse.mylyn.tasks.tests/.cvsignore b/org.eclipse.mylyn.tasks.tests/.cvsignore deleted file mode 100644 index ba077a403..000000000 --- a/org.eclipse.mylyn.tasks.tests/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/org.eclipse.mylyn.tasks.tests/.project b/org.eclipse.mylyn.tasks.tests/.project deleted file mode 100644 index 63df12cbd..000000000 --- a/org.eclipse.mylyn.tasks.tests/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.mylyn.tasks.tests - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 888de1277..000000000 --- a/org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,316 +0,0 @@ -#Sun Jun 24 11:52:58 EDT 2007 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=error -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nullReference=error -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore -org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.5 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=80 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=1 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=false -org.eclipse.jdt.core.formatter.comment.format_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=false -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=120 -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=120 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=true -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true \ No newline at end of file diff --git a/org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 276c2e6d8..000000000 --- a/org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,6 +0,0 @@ -#Mon Feb 05 18:45:19 PST 2007 -eclipse.preferences.version=1 -formatter_profile=_Mylar based on Eclipse [built-in] -formatter_settings_version=11 -internal.default.compliance=default -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.ltk.core.refactoring.prefs b/org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.ltk.core.refactoring.prefs deleted file mode 100644 index 7ab03bdac..000000000 --- a/org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.ltk.core.refactoring.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Fri Jun 02 15:30:09 PDT 2006 -eclipse.preferences.version=1 -org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=true diff --git a/org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.mylar.tasklist.prefs b/org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.mylar.tasklist.prefs deleted file mode 100644 index a6cf96a98..000000000 --- a/org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.mylar.tasklist.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Fri Oct 20 16:54:30 PDT 2006 -eclipse.preferences.version=1 -project.repository.kind=bugzilla -project.repository.url=https\://bugs.eclipse.org/bugs diff --git a/org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.mylyn.tasklist.prefs b/org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.mylyn.tasklist.prefs deleted file mode 100644 index 0a2cc0b30..000000000 --- a/org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.mylyn.tasklist.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Mon Jun 18 17:14:59 PDT 2007 -eclipse.preferences.version=1 -project.repository.kind=bugzilla -project.repository.url=https\://bugs.eclipse.org/bugs diff --git a/org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.mylyn.tasks.ui.prefs b/org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.mylyn.tasks.ui.prefs deleted file mode 100644 index d8c6d26af..000000000 --- a/org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.mylyn.tasks.ui.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Mon Jun 25 03:02:37 GMT 2007 -eclipse.preferences.version=1 -project.repository.kind=bugzilla -project.repository.url=https\://bugs.eclipse.org/bugs diff --git a/org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.pde.prefs b/org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.pde.prefs deleted file mode 100644 index 769b229ff..000000000 --- a/org.eclipse.mylyn.tasks.tests/.settings/org.eclipse.pde.prefs +++ /dev/null @@ -1,12 +0,0 @@ -#Thu Nov 03 15:45:55 PST 2005 -compilers.p.deprecated=2 -compilers.p.no-required-att=0 -compilers.p.not-externalized-att=2 -compilers.p.unknown-attribute=0 -compilers.p.unknown-class=0 -compilers.p.unknown-element=0 -compilers.p.unknown-resource=0 -compilers.p.unresolved-ex-points=0 -compilers.p.unresolved-import=0 -compilers.use-project=true -eclipse.preferences.version=1 diff --git a/org.eclipse.mylyn.tasks.tests/META-INF/MANIFEST.MF b/org.eclipse.mylyn.tasks.tests/META-INF/MANIFEST.MF deleted file mode 100644 index be02f134e..000000000 --- a/org.eclipse.mylyn.tasks.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,29 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Mylyn Tasks Tests -Bundle-SymbolicName: org.eclipse.mylyn.tasks.tests;singleton:=true -Bundle-Version: 0.0.0 -Bundle-Activator: org.eclipse.mylyn.tasks.tests.TasksTestsPlugin -Bundle-Vendor: Eclipse.org -Require-Bundle: org.eclipse.core.runtime, - org.junit, - org.eclipse.mylyn.context.core, - org.eclipse.mylyn.context.tests, - org.eclipse.jdt.core, - org.eclipse.core.resources, - org.eclipse.ui, - org.eclipse.mylyn.tasks.ui, - org.eclipse.mylyn.context.ui, - org.eclipse.mylyn.tasks.core, - org.eclipse.mylyn.monitor.ui, - org.eclipse.ui.forms, - org.eclipse.mylyn.resources.tests, - org.eclipse.mylyn.web.tasks, - org.eclipse.mylyn.monitor.core, - org.eclipse.mylyn, - org.eclipse.mylyn.web.core -Eclipse-AutoStart: true -Bundle-ClassPath: mylar-tasklist-tests.jar -Export-Package: org.eclipse.mylyn.tasks.tests, - org.eclipse.mylyn.tasks.tests.connector -Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/org.eclipse.mylyn.tasks.tests/about.html b/org.eclipse.mylyn.tasks.tests/about.html deleted file mode 100644 index 0dd939c09..000000000 --- a/org.eclipse.mylyn.tasks.tests/about.html +++ /dev/null @@ -1,27 +0,0 @@ - - - -About - - - -

    About This Content

    - -

    June 7, 2007

    -

    License

    - -

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

    - -

    If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

    - - - \ No newline at end of file diff --git a/org.eclipse.mylyn.tasks.tests/build.properties b/org.eclipse.mylyn.tasks.tests/build.properties deleted file mode 100644 index 7901e44bb..000000000 --- a/org.eclipse.mylyn.tasks.tests/build.properties +++ /dev/null @@ -1,18 +0,0 @@ -############################################################################### -# Copyright (c) 2004, 2006 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 -############################################################################### -bin.includes = META-INF/,\ - mylar-tasklist-tests.jar,\ - about.html,\ - plugin.xml -jars.compile.order = mylar-tasklist-tests.jar -source.mylar-tasklist-tests.jar = src/ -output.mylar-tasklist-tests.jar = bin/ -src.includes = about.html,\ - src/,\ - META-INF/ -jre.compilation.profile = J2SE-1.5 diff --git a/org.eclipse.mylyn.tasks.tests/plugin.xml b/org.eclipse.mylyn.tasks.tests/plugin.xml deleted file mode 100644 index 4f876c12f..000000000 --- a/org.eclipse.mylyn.tasks.tests/plugin.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java deleted file mode 100644 index 7f7876866..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * 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.tasks.tests; - -import junit.framework.Test; -import junit.framework.TestSuite; - -/** - * @author Mik Kersten - */ -public class AllTasksTests { - - public static Test suite() { - TestSuite suite = new TestSuite("Test for org.eclipse.mylyn.tasks.tests"); - - // $JUnit-BEGIN$ - suite.addTestSuite(TaskRepositoryTest.class); - suite.addTestSuite(TaskRepositorySorterTest.class); - suite.addTestSuite(TaskDataManagerTest.class); - suite.addTestSuite(CopyDetailsActionTest.class); - suite.addTestSuite(TaskListTest.class); - suite.addTestSuite(ProjectRepositoryAssociationTest.class); - suite.addTestSuite(TaskList06DataMigrationTest.class); - suite.addTestSuite(TaskPlanningEditorTest.class); - suite.addTestSuite(TaskListManagerTest.class); - suite.addTestSuite(RepositoryTaskSynchronizationTest.class); - suite.addTestSuite(TaskRepositoryManagerTest.class); - suite.addTestSuite(TaskRepositoriesExternalizerTest.class); - suite.addTestSuite(TaskListContentProviderTest.class); - suite.addTestSuite(TaskListBackupManagerTest.class); - suite.addTestSuite(TableSorterTest.class); - suite.addTestSuite(TaskKeyComparatorTest.class); - suite.addTestSuite(TaskTest.class); - suite.addTestSuite(TaskListUiTest.class); - suite.addTestSuite(TaskListDnDTest.class); - suite.addTestSuite(TaskDataExportTest.class); - // XXX: Put back - //suite.addTestSuite(TaskDataImportTest.class); - suite.addTestSuite(TaskActivityTest.class); - suite.addTestSuite(AttachmentJobTest.class); - suite.addTestSuite(RepositorySettingsPageTest.class); - suite.addTestSuite(TaskHistoryTest.class); - suite.addTestSuite(UrlConnectionUtilTest.class); - suite.addTestSuite(CommentQuoterTest.class); - suite.addTestSuite(OfflineStorageTest.class); - suite.addTestSuite(OfflineCachingStorageTest.class); - // $JUnit-END$ - - // suite.addTestSuite(BackgroundSaveTest.class); - // suite.addTestSuite(RetrieveTitleFromUrlTest.class); - return suite; - } -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AttachmentJobTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AttachmentJobTest.java deleted file mode 100644 index 060136b48..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AttachmentJobTest.java +++ /dev/null @@ -1,115 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 - 2006 Mylar 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.tasks.tests; - -import java.io.File; -import java.io.RandomAccessFile; - -import junit.framework.TestCase; - -import org.eclipse.core.runtime.Status; -import org.eclipse.mylyn.internal.tasks.ui.actions.CopyAttachmentToClipboardJob; -import org.eclipse.mylyn.internal.tasks.ui.actions.DownloadAttachmentJob; -import org.eclipse.mylyn.monitor.core.StatusHandler; -import org.eclipse.mylyn.tasks.core.RepositoryAttachment; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.TaskRepositoryManager; -import org.eclipse.mylyn.tasks.tests.connector.MockAttachmentHandler; -import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryConnector; -import org.eclipse.mylyn.tasks.tests.connector.MockStatusHandler; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; -import org.eclipse.swt.dnd.Clipboard; -import org.eclipse.swt.dnd.TextTransfer; -import org.eclipse.ui.PlatformUI; - -/** - * Test task attachment jobs. - * - * @author Steffen Pingel - */ -public class AttachmentJobTest extends TestCase { - - private TaskRepositoryManager manager; - - private MockRepositoryConnector connector; - - private MockAttachmentHandler attachmentHandler; - - private MockStatusHandler statusHandler; - - private TaskRepository repository; - - private RepositoryAttachment attachment; - - @Override - protected void setUp() throws Exception { - super.setUp(); - - manager = TasksUiPlugin.getRepositoryManager(); - - repository = new TaskRepository(MockRepositoryConnector.REPOSITORY_KIND, MockRepositoryConnector.REPOSITORY_URL); - manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath()); - - attachmentHandler = new MockAttachmentHandler(); - - connector = new MockRepositoryConnector(); - connector.setAttachmentHandler(attachmentHandler); - manager.addRepositoryConnector(connector); - - statusHandler = new MockStatusHandler(); - StatusHandler.addStatusHandler(statusHandler); - - attachment = new RepositoryAttachment(null); - attachment.setRepositoryKind(repository.getConnectorKind()); - attachment.setRepositoryUrl(repository.getUrl()); - } - - @Override - protected void tearDown() throws Exception { - if (statusHandler != null) { - StatusHandler.removeStatusHandler(statusHandler); - } - } - - public void testCopyToClipboardAction() throws Exception { - String expected = "attachment content"; - attachmentHandler.setAttachmentData(expected.getBytes()); - - CopyAttachmentToClipboardJob job = new CopyAttachmentToClipboardJob(attachment); - job.schedule(); - job.join(); - - Clipboard clipboard = new Clipboard(PlatformUI.getWorkbench().getDisplay()); - assertEquals(expected, clipboard.getContents(TextTransfer.getInstance())); - } - - public void testDownloadAttachmentJob() throws Exception { - File file = File.createTempFile("mylyn", null); - file.deleteOnExit(); - - String expected = "attachment\ncontent"; - attachmentHandler.setAttachmentData(expected.getBytes()); - - DownloadAttachmentJob job = new DownloadAttachmentJob(attachment, file); - job.schedule(); - job.join(); - - assertEquals(Status.OK_STATUS, job.getResult()); - statusHandler.assertNoStatus(); - - RandomAccessFile raf = new RandomAccessFile(file, "r"); - byte[] data = new byte[expected.getBytes().length]; - try { - raf.readFully(data); - } finally { - raf.close(); - } - assertEquals(expected, new String(data)); - } -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/BackgroundSaveTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/BackgroundSaveTest.java deleted file mode 100644 index 9fa82db1d..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/BackgroundSaveTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * 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.tasks.tests; - -import java.io.File; -import java.io.IOException; -import java.util.Locale; - -import junit.framework.TestCase; - -import org.eclipse.mylyn.internal.tasks.ui.util.BackgroundSaveTimer; -import org.eclipse.mylyn.internal.tasks.ui.util.TaskListSaveManager; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; - -/** - * Tests the mechanism for saving the task data periodically. If this test fails unexpectedly, try adjusting the timing. - * - * @author Wesley Coelho - * @author Mik Kersten (rewrite) - */ -public class BackgroundSaveTest extends TestCase { - - private BackgroundSaveTimer saveTimer; - - private TaskListSaveManager saveManager; - - @Override - protected void setUp() throws Exception { - super.setUp(); - TasksUiPlugin.getTaskListManager().saveTaskList(); - saveManager = new TaskListSaveManager(); -// saveManager = TasksUiPlugin.getDefault().getTaskListSaveManager(); - - saveTimer = new BackgroundSaveTimer(saveManager); - saveTimer.setSaveIntervalMillis(50); - saveTimer.start(); -// saveManager.setForceBackgroundSave(true); - } - - @Override - protected void tearDown() throws Exception { - saveTimer.stop(); - super.tearDown(); -// saveManager.setForceBackgroundSave(false); - } - - public void testBackgroundSave() throws InterruptedException, IOException { - if (System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("linux")) { - System.out.println("> BackgroundSaveTest.testBackgroundSave() not run on Linux due to IO concurrency"); - } else { - File file = TasksUiPlugin.getTaskListManager().getTaskListFile(); - long previouslyModified = file.lastModified(); -// TasksUiPlugin.getTaskListManager().saveTaskList(); - saveManager.saveTaskList(true, false); - assertTrue(file.lastModified() > previouslyModified); - } - } -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CommentQuoterTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CommentQuoterTest.java deleted file mode 100644 index 49c7af971..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CommentQuoterTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 - 2006 Mylar 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.tasks.tests; - -import junit.framework.TestCase; - -import org.eclipse.mylyn.internal.tasks.core.CommentQuoter; - -/** - * Test many quoting scenarios - * - * @author Willian Mitsuda - */ -public class CommentQuoterTest extends TestCase { - - public void testNoWrapping() { - CommentQuoter quoter = new CommentQuoter(10); - String quotedText = quoter.quote("bababa"); - assertEquals("> bababa\n", quotedText); - } - - public void testSimpleWrapping() { - CommentQuoter quoter = new CommentQuoter(10); - String quotedText = quoter.quote("bababa bobobo"); - assertEquals("> bababa\n> bobobo\n", quotedText); - } - - public void testNoWayToWrap() { - CommentQuoter quoter = new CommentQuoter(10); - String quotedText = quoter.quote("babababababa"); - assertEquals("> babababababa\n", quotedText); - } - - public void testExactWrap() { - CommentQuoter quoter = new CommentQuoter(10); - String quotedText = quoter.quote("bababababa"); - assertEquals("> bababababa\n", quotedText); - } - - public void testMultiLineNoWrapping() { - CommentQuoter quoter = new CommentQuoter(10); - String quotedText = quoter.quote("bababa\nbobobo"); - assertEquals("> bababa\n> bobobo\n", quotedText); - } - - public void testMultiLineWithWrapping() { - CommentQuoter quoter = new CommentQuoter(10); - String quotedText = quoter.quote("bababa bebebe\nbibibibibibi bibi\nbobobo bububu"); - assertEquals("> bababa\n> bebebe\n> bibibibibibi\n> bibi\n> bobobo\n> bububu\n", quotedText); - } - - public void testExcessiveSpacingWrapping() { - CommentQuoter quoter = new CommentQuoter(10); - String quotedText = quoter.quote("bababa bobobo"); - assertEquals("> bababa\n> bobobo\n", quotedText); - } - - public void testBlankLineQuoting() { - CommentQuoter quoter = new CommentQuoter(10); - String quotedText = quoter.quote("bababa\n\nbobobo"); - assertEquals("> bababa\n> \n> bobobo\n", quotedText); - } - -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java deleted file mode 100644 index e3a27fb16..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 - 2006 Mylar 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.tasks.tests; - -import junit.framework.TestCase; - -import org.eclipse.mylyn.internal.tasks.ui.actions.CopyTaskDetailsAction; -import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryTask; - -/** - * @author Mik Kersten - */ -public class CopyDetailsActionTest extends TestCase { - - public void testIdLabelIncluded() { - MockRepositoryTask task = new MockRepositoryTask("123"); - String text = CopyTaskDetailsAction.getTextForTask(task); - assertTrue(text.startsWith(task.getTaskKey())); - } - -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/OfflineCachingStorageTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/OfflineCachingStorageTest.java deleted file mode 100644 index dc1abbc6b..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/OfflineCachingStorageTest.java +++ /dev/null @@ -1,151 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 - 2006 Mylar 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.tasks.tests; - -import java.io.File; -import java.util.HashSet; -import java.util.Set; - -import junit.framework.TestCase; - -import org.eclipse.mylyn.internal.tasks.core.TaskDataState; -import org.eclipse.mylyn.internal.tasks.ui.OfflineCachingStorage; -import org.eclipse.mylyn.internal.tasks.ui.OfflineFileStorage; -import org.eclipse.mylyn.tasks.core.RepositoryTaskAttribute; -import org.eclipse.mylyn.tasks.core.RepositoryTaskData; -import org.eclipse.mylyn.tasks.tests.connector.MockAttributeFactory; -import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryConnector; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; - -/** - * @author Rob Elves - */ -public class OfflineCachingStorageTest extends TestCase { - - private static final String MOCK_ID = "1"; - - private File dataDir; - - private OfflineCachingStorage storage; - - @Override - protected void setUp() throws Exception { - //dataDir = new File("c:/offline"); - dataDir = new File(TasksUiPlugin.getDefault().getDataDirectory() + '/' + "offline"); - storage = new OfflineCachingStorage(new OfflineFileStorage(dataDir)); - storage.start(); - super.setUp(); - } - - @Override - protected void tearDown() throws Exception { - storage.stop(); - storage.clear(); - } - - public void testPutAndGet() throws Exception { - - TaskDataState state = new TaskDataState(MockRepositoryConnector.REPOSITORY_URL, MOCK_ID); - - RepositoryTaskData newData = new RepositoryTaskData(new MockAttributeFactory(), - MockRepositoryConnector.REPOSITORY_KIND, MockRepositoryConnector.REPOSITORY_URL, MOCK_ID); - - newData.setAttributeValue("attributeKey1", "attValue!"); - newData.setDescription("description"); - newData.setNew(true); - newData.setNewComment("new comment"); - newData.setSummary("summary"); - newData.setTaskKey("task key"); - - RepositoryTaskData oldData = new RepositoryTaskData(new MockAttributeFactory(), - MockRepositoryConnector.REPOSITORY_KIND, MockRepositoryConnector.REPOSITORY_URL, MOCK_ID); - - Set edits = new HashSet(); - - state.setNewTaskData(newData); - state.setOldTaskData(oldData); - state.setEdits(edits); - - storage.put(state); - - TaskDataState retrieved = storage.get(MockRepositoryConnector.REPOSITORY_URL, MOCK_ID); - assertNotNull(retrieved); - RepositoryTaskData newTaskData = retrieved.getNewTaskData(); - assertNotNull(newTaskData); - assertEquals(MockRepositoryConnector.REPOSITORY_KIND, newTaskData.getRepositoryKind()); - assertEquals("description", newTaskData.getDescription()); - assertEquals("new comment", newTaskData.getNewComment()); - assertEquals("task key", newTaskData.getTaskKey()); - } - - public void testRemove() throws Exception { - assertNull(storage.get(MockRepositoryConnector.REPOSITORY_URL, MOCK_ID)); - - TaskDataState state = new TaskDataState(MockRepositoryConnector.REPOSITORY_URL, MOCK_ID); - - RepositoryTaskData newData = new RepositoryTaskData(new MockAttributeFactory(), - MockRepositoryConnector.REPOSITORY_KIND, MockRepositoryConnector.REPOSITORY_URL, MOCK_ID); - - newData.setAttributeValue("attributeKey1", "attValue!"); - newData.setDescription("description"); - newData.setNew(true); - newData.setNewComment("new comment"); - newData.setSummary("summary"); - newData.setTaskKey("task key"); - - RepositoryTaskData oldData = new RepositoryTaskData(new MockAttributeFactory(), - MockRepositoryConnector.REPOSITORY_KIND, MockRepositoryConnector.REPOSITORY_URL, MOCK_ID); - - Set edits = new HashSet(); - - state.setNewTaskData(newData); - state.setOldTaskData(oldData); - state.setEdits(edits); - - storage.put(state); - assertEquals(1, storage.getReadQueue().size()); - assertEquals("1", storage.getReadQueue().iterator().next().getId()); - assertNotNull(storage.get(MockRepositoryConnector.REPOSITORY_URL, MOCK_ID)); - storage.remove(MockRepositoryConnector.REPOSITORY_URL, MOCK_ID); - assertEquals(0, storage.getReadQueue().size()); - assertNull(storage.get(MockRepositoryConnector.REPOSITORY_URL, MOCK_ID)); - - } - - public void testLRUQueue() { - assertNull(storage.get(MockRepositoryConnector.REPOSITORY_URL, MOCK_ID)); - assertEquals(0, storage.getReadQueue().size()); - TaskDataState state1 = new TaskDataState(MockRepositoryConnector.REPOSITORY_URL, MOCK_ID); - TaskDataState state2 = new TaskDataState(MockRepositoryConnector.REPOSITORY_URL, "2"); - TaskDataState state3 = new TaskDataState(MockRepositoryConnector.REPOSITORY_URL, "3"); - - storage.put(state1); - storage.put(state2); - storage.put(state3); - - assertEquals(3, storage.getReadQueue().size()); - - // should return least recently used - assertEquals("1", storage.getReadQueue().iterator().next().getId()); - - assertNotNull(storage.get(MockRepositoryConnector.REPOSITORY_URL, "3")); - assertNotNull(storage.get(MockRepositoryConnector.REPOSITORY_URL, "2")); - assertNotNull(storage.get(MockRepositoryConnector.REPOSITORY_URL, MOCK_ID)); - - assertEquals(3, storage.getReadQueue().size()); - - // should return least recently used - assertEquals("3", storage.getReadQueue().iterator().next().getId()); - storage.put(state1); - storage.put(state3); - // should return least recently used - assertEquals("2", storage.getReadQueue().iterator().next().getId()); - assertEquals(3, storage.getReadQueue().size()); - } -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/OfflineStorageTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/OfflineStorageTest.java deleted file mode 100644 index 6edb19944..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/OfflineStorageTest.java +++ /dev/null @@ -1,309 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 - 2006 Mylar 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.tasks.tests; - -import java.io.File; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import junit.framework.TestCase; - -import org.eclipse.mylyn.internal.tasks.core.TaskDataState; -import org.eclipse.mylyn.internal.tasks.ui.OfflineFileStorage; -import org.eclipse.mylyn.tasks.core.RepositoryAttachment; -import org.eclipse.mylyn.tasks.core.RepositoryOperation; -import org.eclipse.mylyn.tasks.core.RepositoryTaskAttribute; -import org.eclipse.mylyn.tasks.core.RepositoryTaskData; -import org.eclipse.mylyn.tasks.core.TaskComment; -import org.eclipse.mylyn.tasks.tests.connector.MockAttributeFactory; -import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryConnector; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; -import org.eclipse.ui.XMLMemento; - -/** - * @author Rob Elves - */ -public class OfflineStorageTest extends TestCase { - - File dataDir; - - OfflineFileStorage storage; - - protected void setUp() throws Exception { - //dataDir = new File("c:/offline"); - dataDir = new File(TasksUiPlugin.getDefault().getDataDirectory() + "/offline"); - storage = new OfflineFileStorage(dataDir); - storage.start(); - super.setUp(); - } - - protected void tearDown() throws Exception { - storage.stop(); - removeTestFiles(dataDir); - } - - private void removeTestFiles(File folder) { - if (folder.isDirectory()) { - for (File file : folder.listFiles()) { - removeTestFiles(file); - } - } - folder.delete(); - } - - public void testPutAndGet() throws Exception { - - TaskDataState state = new TaskDataState(MockRepositoryConnector.REPOSITORY_URL, "1"); - - RepositoryTaskData newData = new RepositoryTaskData(new MockAttributeFactory(), - MockRepositoryConnector.REPOSITORY_KIND, MockRepositoryConnector.REPOSITORY_URL, "1", "kind"); - - newData.setAttributeValue("attributeKey1", "attValue!"); - newData.setDescription("description"); - newData.setNew(true); - newData.setNewComment("new comment"); - newData.setSummary("summary"); - newData.setTaskKey("task key"); - - RepositoryTaskData oldData = new RepositoryTaskData(new MockAttributeFactory(), - MockRepositoryConnector.REPOSITORY_KIND, MockRepositoryConnector.REPOSITORY_URL, "1", "kind"); - - Set edits = new HashSet(); - - state.setNewTaskData(newData); - state.setOldTaskData(oldData); - state.setEdits(edits); - - storage.put(state); - - TaskDataState retrieved = storage.get(MockRepositoryConnector.REPOSITORY_URL, "1"); - assertNotNull(retrieved); - RepositoryTaskData newTaskData = retrieved.getNewTaskData(); - assertNotNull(newTaskData); - assertEquals(MockRepositoryConnector.REPOSITORY_KIND, newTaskData.getRepositoryKind()); - assertEquals("description", newTaskData.getDescription()); - assertEquals("new comment", newTaskData.getNewComment()); - assertEquals("task key", newTaskData.getTaskKey()); - assertEquals("kind", newTaskData.getTaskKind()); - } - - public void testRemove() throws Exception { - assertNull(storage.get(MockRepositoryConnector.REPOSITORY_URL, "1")); - - TaskDataState state = new TaskDataState(MockRepositoryConnector.REPOSITORY_URL, "1"); - - RepositoryTaskData newData = new RepositoryTaskData(new MockAttributeFactory(), - MockRepositoryConnector.REPOSITORY_KIND, MockRepositoryConnector.REPOSITORY_URL, "1"); - - newData.setAttributeValue("attributeKey1", "attValue!"); - newData.setDescription("description"); - newData.setNew(true); - newData.setNewComment("new comment"); - newData.setSummary("summary"); - newData.setTaskKey("task key"); - - RepositoryTaskData oldData = new RepositoryTaskData(new MockAttributeFactory(), - MockRepositoryConnector.REPOSITORY_KIND, MockRepositoryConnector.REPOSITORY_URL, "1"); - - Set edits = new HashSet(); - - state.setNewTaskData(newData); - state.setOldTaskData(oldData); - state.setEdits(edits); - - storage.put(state); - assertNotNull(storage.get(MockRepositoryConnector.REPOSITORY_URL, "1")); - storage.remove(MockRepositoryConnector.REPOSITORY_URL, "1"); - assertNull(storage.get(MockRepositoryConnector.REPOSITORY_URL, "1")); - - } - - public void testAttributes() throws Exception { - List attributes = new ArrayList(); - RepositoryTaskAttribute attribute = new RepositoryTaskAttribute("testId", "testName", true); - attribute.setReadOnly(true); - attribute.addOption("Option Name 1", "Option Value 1"); - attribute.addOption("Option Name 2", "Option Value 2"); - attribute.addValue("Value 1"); - attribute.addValue("Value 2"); - attribute.addValue("Value 3"); - attribute.putMetaDataValue("MetaKey1", "MetaValue1"); - attribute.putMetaDataValue("MetaKey2", "MetaValue2"); - attribute.putMetaDataValue("MetaKey3", "MetaValue3"); - attribute.putMetaDataValue("MetaKey4", "MetaValue4"); - - attributes.add(attribute); - - XMLMemento memento = XMLMemento.createWriteRoot("Attributes"); - storage.addAttributes(memento, attributes); - List readAttributes = storage.readAttributes(memento); - assertNotNull(readAttributes); - assertEquals(1, readAttributes.size()); - RepositoryTaskAttribute attr = readAttributes.get(0); - - assertEquals("testId", attr.getId()); - assertEquals("testName", attr.getName()); - assertEquals(true, attr.isHidden()); - assertEquals(true, attr.isReadOnly()); - - assertNotNull(attr.getOptions()); - assertEquals(2, attr.getOptions().size()); - - assertEquals("Option Name 1", attr.getOptions().get(0)); - assertEquals("Option Name 2", attr.getOptions().get(1)); - assertEquals("Option Value 1", attr.getOptionParameter(attr.getOptions().get(0))); - assertEquals("Option Value 2", attr.getOptionParameter(attr.getOptions().get(1))); - - assertEquals("Value 1", attr.getValues().get(0)); - assertEquals("Value 2", attr.getValues().get(1)); - assertEquals("Value 3", attr.getValues().get(2)); - - assertEquals("MetaValue1", attribute.getMetaDataValue("MetaKey1")); - assertEquals("MetaValue2", attribute.getMetaDataValue("MetaKey2")); - assertEquals("MetaValue3", attribute.getMetaDataValue("MetaKey3")); - assertEquals("MetaValue4", attribute.getMetaDataValue("MetaKey4")); - } - - public void testOperations() throws Exception { - RepositoryOperation op = new RepositoryOperation("knob1", "operationName1"); - op.setChecked(true); - op.setInputName("InputName"); - op.setInputValue("InputValue"); - op.setUpOptions("TheOptionName"); - op.addOption("optionName1", "optionValue1"); - op.addOption("optionName2", "optionValue2"); - op.setOptionSelection("optionSelection1"); - - RepositoryOperation op2 = new RepositoryOperation("knob2", "operationName2"); - op2.setChecked(true); - op2.setInputName("InputName2"); - op2.setInputValue("InputValue2"); - op2.setUpOptions("TheOptionName2"); - op2.addOption("optionName1", "optionValue1"); - op2.addOption("optionName2", "optionValue2"); - op2.setOptionSelection("optionSelection2"); - XMLMemento memento = XMLMemento.createWriteRoot("Operations"); - - List operations = new ArrayList(); - operations.add(op); - operations.add(op2); - storage.addOperations(memento, operations); - List readOperations = storage.readOperations(memento); - RepositoryOperation op1 = readOperations.get(0); - assertEquals("knob1", op1.getKnobName()); - assertEquals("operationName1", op1.getOperationName()); - assertEquals("InputName", op1.getInputName()); - assertEquals("InputValue", op1.getInputValue()); - - assertEquals("TheOptionName", op1.getOptionName()); - assertEquals(2, op1.getOptionNames().size()); - assertEquals("optionValue1", op1.getOptionValue(op1.getOptionNames().get(0))); - assertEquals("optionValue2", op1.getOptionValue(op1.getOptionNames().get(1))); - assertEquals("optionSelection1", op1.getOptionSelection()); - - RepositoryOperation op2ver2 = readOperations.get(1); - assertEquals("knob2", op2ver2.getKnobName()); - assertEquals("operationName2", op2ver2.getOperationName()); - assertEquals("InputName2", op2ver2.getInputName()); - assertEquals("InputValue2", op2ver2.getInputValue()); - - assertEquals("TheOptionName2", op2ver2.getOptionName()); - assertEquals(2, op2ver2.getOptionNames().size()); - assertEquals("optionValue1", op2ver2.getOptionValue(op1.getOptionNames().get(0))); - assertEquals("optionValue2", op2ver2.getOptionValue(op1.getOptionNames().get(1))); - assertEquals("optionSelection2", op2ver2.getOptionSelection()); - } - - public void testComments() throws Exception { - TaskComment comment1 = new TaskComment(new MockAttributeFactory(), 1); - comment1.setAttachmentId("attachmentId1"); - comment1.setHasAttachment(true); - comment1.addAttribute("attr1", new RepositoryTaskAttribute("attr1", "attr1Name", false)); - - TaskComment comment2 = new TaskComment(new MockAttributeFactory(), 2); - comment2.setAttachmentId("attachmentId2"); - comment2.setHasAttachment(false); - comment2.addAttribute("attr2", new RepositoryTaskAttribute("attr2", "attr2Name", false)); - comment2.addAttribute("attr3", new RepositoryTaskAttribute("attr3", "attr3Name", true)); - - XMLMemento memento = XMLMemento.createWriteRoot("Comments"); - List comments = new ArrayList(); - comments.add(comment1); - comments.add(comment2); - storage.addComments(memento, comments); - List returnedComments = storage.readComments(memento); - assertEquals(2, returnedComments.size()); - - assertEquals("attachmentId1", returnedComments.get(0).getAttachmentId()); - assertEquals(true, returnedComments.get(0).hasAttachment()); - assertEquals(1, returnedComments.get(0).getAttributes().size()); - assertEquals("attr1", returnedComments.get(0).getAttributes().get(0).getId()); - assertEquals("attr1Name", returnedComments.get(0).getAttributes().get(0).getName()); - - assertEquals("attachmentId2", returnedComments.get(1).getAttachmentId()); - assertEquals(false, returnedComments.get(1).hasAttachment()); - assertEquals(2, returnedComments.get(1).getAttributes().size()); - assertEquals("attr2", returnedComments.get(1).getAttributes().get(0).getId()); - assertEquals("attr2Name", returnedComments.get(1).getAttributes().get(0).getName()); - assertEquals("attr3Name", returnedComments.get(1).getAttributes().get(1).getName()); - } - - public void testAttachments() throws Exception { - - List attachments = new ArrayList(); - RepositoryAttachment attachment1 = new RepositoryAttachment(new MockAttributeFactory()); - attachment1.setCreator("thecreator"); - attachment1.setObsolete(false); - attachment1.setPatch(true); - attachment1.setRepositoryKind("bugzilla"); - attachment1.setRepositoryUrl("repUrl"); - attachment1.setTaskId("taskid1"); - attachment1.addAttribute("attr1", new RepositoryTaskAttribute("attr1", "attr1Name", true)); - attachment1.addAttribute("attr2", new RepositoryTaskAttribute("attr2", "attr2Name", true)); - - RepositoryAttachment attachment2 = new RepositoryAttachment(new MockAttributeFactory()); - attachment2.setCreator("thecreator2"); - attachment2.setObsolete(true); - attachment2.setPatch(false); - attachment2.setRepositoryKind("bugzilla2"); - attachment2.setRepositoryUrl("repUrl2"); - attachment2.setTaskId("taskid2"); - attachment2.addAttribute("attr3", new RepositoryTaskAttribute("attr3", "attr3Name", true)); - attachment2.addAttribute("attr4", new RepositoryTaskAttribute("attr4", "attr4Name", true)); - - attachments.add(attachment1); - attachments.add(attachment2); - XMLMemento memento = XMLMemento.createWriteRoot("Attachments"); - storage.addAttachments(memento, attachments); - List readAttachments = storage.readAttachments(memento); - - assertEquals(2, readAttachments.size()); - RepositoryAttachment readAttachment = readAttachments.get(0); - assertEquals(attachment1.getTaskId(), readAttachment.getTaskId()); - assertEquals(attachment1.getCreator(), readAttachment.getCreator()); - assertEquals(attachment1.isObsolete(), readAttachment.isObsolete()); - assertEquals(attachment1.isPatch(), readAttachment.isPatch()); - assertEquals(attachment1.getRepositoryKind(), readAttachment.getRepositoryKind()); - assertEquals(attachment1.getRepositoryUrl(), readAttachment.getRepositoryUrl()); - assertEquals(attachment1.getAttributeValue("attr1"), readAttachment.getAttributeValue("attr1")); - assertEquals(attachment1.getAttributeValue("attr2"), readAttachment.getAttributeValue("attr2")); - - readAttachment = readAttachments.get(1); - assertEquals(attachment2.getTaskId(), readAttachment.getTaskId()); - assertEquals(attachment2.getCreator(), readAttachment.getCreator()); - assertEquals(attachment2.isObsolete(), readAttachment.isObsolete()); - assertEquals(attachment2.isPatch(), readAttachment.isPatch()); - assertEquals(attachment2.getRepositoryKind(), readAttachment.getRepositoryKind()); - assertEquals(attachment2.getRepositoryUrl(), readAttachment.getRepositoryUrl()); - assertEquals(attachment2.getAttributeValue("attr3"), readAttachment.getAttributeValue("attr3")); - assertEquals(attachment2.getAttributeValue("attr4"), readAttachment.getAttributeValue("attr4")); - } -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ProjectRepositoryAssociationTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ProjectRepositoryAssociationTest.java deleted file mode 100644 index b3c4f4b63..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ProjectRepositoryAssociationTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 - 2006 Mylar 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.tasks.tests; - -import junit.framework.TestCase; - -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.mylyn.resources.tests.ResourceTestUtil; -import org.eclipse.mylyn.resources.tests.TestProject; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; - -/** - * @author Rob Elves - */ -public class ProjectRepositoryAssociationTest extends TestCase { - - private static final String REPOSITORY_URL = "http://mylar.eclipse.org/bugs222"; - - private static final String REPOSITORY_KIND = "bugzilla"; - - private TestProject projectWrapper; - - @Override - protected void setUp() throws Exception { - super.setUp(); - projectWrapper = new TestProject(this.getClass().getName()); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - ResourceTestUtil.deleteProject(projectWrapper.getProject()); - TasksUiPlugin.getRepositoryManager().clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); - } - - public void testRepositoryForProject() throws CoreException { - assertNull(TasksUiPlugin.getDefault().getRepositoryForResource(projectWrapper.getProject(), true)); - TaskRepository repository = new TaskRepository(REPOSITORY_KIND, REPOSITORY_URL); - TasksUiPlugin.getRepositoryManager().addRepository(repository, - TasksUiPlugin.getDefault().getRepositoriesFilePath()); - TasksUiPlugin.getDefault().setRepositoryForResource(projectWrapper.getProject(), repository); - TaskRepository returnedRepository = TasksUiPlugin.getDefault().getRepositoryForResource( - projectWrapper.getProject(), true); - assertNotNull(returnedRepository); - assertEquals(REPOSITORY_KIND, returnedRepository.getConnectorKind()); - assertEquals(REPOSITORY_URL, returnedRepository.getUrl()); - } - - public void testRepositoryForFolder() throws CoreException { - IFolder folder = projectWrapper.createFolder("testFolder"); - assertTrue(folder.exists()); - assertNull(TasksUiPlugin.getDefault().getRepositoryForResource(folder, true)); - TaskRepository repository = new TaskRepository(REPOSITORY_KIND, REPOSITORY_URL); - TasksUiPlugin.getRepositoryManager().addRepository(repository, - TasksUiPlugin.getDefault().getRepositoriesFilePath()); - TasksUiPlugin.getDefault().setRepositoryForResource(folder, repository); - TaskRepository returnedRepository = TasksUiPlugin.getDefault().getRepositoryForResource(folder, true); - assertNotNull(returnedRepository); - assertEquals(REPOSITORY_KIND, returnedRepository.getConnectorKind()); - assertEquals(REPOSITORY_URL, returnedRepository.getUrl()); - } -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RepositorySettingsPageTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RepositorySettingsPageTest.java deleted file mode 100644 index cb59400f7..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RepositorySettingsPageTest.java +++ /dev/null @@ -1,178 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 - 2006 Mylar 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.tasks.tests; - -import junit.framework.TestCase; - -import org.eclipse.jface.preference.StringFieldEditor; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.tests.connector.MockTaskConnectorUi; -import org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; -import org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PlatformUI; - -/** - * @author Steffen Pingel - */ -public class RepositorySettingsPageTest extends TestCase { - - public void testNeedsEncoding() { - TaskRepository repository = new TaskRepository("kind", "http://localhost/"); - repository.setCharacterEncoding("UTF-8"); - - MockRepositorySettingsPage page = new MockRepositorySettingsPage(new MockTaskConnectorUi()); - page.setNeedsEncoding(true); - - Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); - page.createControl(shell); - page.setVisible(true); - - TaskRepository repository2 = page.createTaskRepository(); - assertEquals("UTF-8", repository2.getCharacterEncoding()); - } - - public void testNeedsEncodingFalse() { - MockRepositorySettingsPage page = new MockRepositorySettingsPage(new MockTaskConnectorUi()); - page.setNeedsEncoding(false); - - Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); - page.createControl(shell); - page.setVisible(true); - - page.createTaskRepository(); - } - - public void testNeedsAnonyoumousLoginFalse() { - MockRepositorySettingsPage page = new MockRepositorySettingsPage(new MockTaskConnectorUi()); - page.setNeedsAnonymousLogin(false); - - Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); - page.createControl(shell); - page.setVisible(true); - - assertNull(page.getAnonymousButton()); - } - - public void testNeedsAnonyoumousLoginNoRepository() { - MockRepositorySettingsPage page = new MockRepositorySettingsPage(new MockTaskConnectorUi()); - page.setNeedsAnonymousLogin(true); - - Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); - page.createControl(shell); - page.setVisible(true); - - assertNotNull(page.getAnonymousButton()); - - assertTrue(page.getAnonymousButton().getSelection()); - assertFalse(page.getUserNameEditor().getTextControl(page.getParent()).isEnabled()); - assertFalse(page.getPasswordEditor().getTextControl(page.getParent()).isEnabled()); - assertEquals("", page.getUserName()); - assertEquals("", page.getPassword()); - page.getAnonymousButton().setSelection(false); - } - - public void testNeedsAnonyoumousLogin() { - TaskRepository repository = new TaskRepository("kind", "http://localhost/"); - - TasksUiPlugin.getDefault().addRepositoryConnectorUi(new MockTaskConnectorUi()); - - MockRepositorySettingsPage page = new MockRepositorySettingsPage(new MockTaskConnectorUi()); - page.setNeedsAnonymousLogin(true); - page.setRepository(repository); - - Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); - page.createControl(shell); - page.setVisible(true); - - assertNotNull(page.getAnonymousButton()); - - assertTrue(page.getAnonymousButton().getSelection()); - assertFalse(page.getUserNameEditor().getTextControl(page.getParent()).isEnabled()); - assertFalse(page.getPasswordEditor().getTextControl(page.getParent()).isEnabled()); - assertEquals("", page.getUserName()); - assertEquals("", page.getPassword()); - - page.getAnonymousButton().setSelection(false); - page.getAnonymousButton().notifyListeners(SWT.Selection, new Event()); - assertTrue(page.getUserNameEditor().getTextControl(page.getParent()).isEnabled()); - assertTrue(page.getPasswordEditor().getTextControl(page.getParent()).isEnabled()); - page.getUserNameEditor().setStringValue("user"); - page.getPasswordEditor().setStringValue("password"); - assertEquals("user", page.getUserName()); - assertEquals("password", page.getPassword()); - - page.getAnonymousButton().setSelection(true); - page.getAnonymousButton().notifyListeners(SWT.Selection, new Event()); - assertFalse(page.getUserNameEditor().getTextControl(page.getParent()).isEnabled()); - assertFalse(page.getPasswordEditor().getTextControl(page.getParent()).isEnabled()); - assertEquals("", page.getUserName()); - assertEquals("", page.getPassword()); - - page.getAnonymousButton().setSelection(false); - page.getAnonymousButton().notifyListeners(SWT.Selection, new Event()); - assertTrue(page.getUserNameEditor().getTextControl(page.getParent()).isEnabled()); - assertTrue(page.getPasswordEditor().getTextControl(page.getParent()).isEnabled()); - assertEquals("user", page.getUserNameEditor().getStringValue()); - assertEquals("password", page.getPasswordEditor().getStringValue()); - assertEquals("user", page.getUserName()); - assertEquals("password", page.getPassword()); - } - - private class MockRepositorySettingsPage extends AbstractRepositorySettingsPage { - - public MockRepositorySettingsPage(AbstractRepositoryConnectorUi repositoryUi) { - super("title", "summary", repositoryUi); - } - - @Override - protected void createAdditionalControls(Composite parent) { - // ignore - } - - @Override - protected boolean isValidUrl(String name) { - // ignore - return false; - } - - @Override - protected void validateSettings() { - // ignore - } - - Button getAnonymousButton() { - return anonymousButton; - } - - StringFieldEditor getUserNameEditor() { - return repositoryUserNameEditor; - } - - StringFieldEditor getPasswordEditor() { - return repositoryPasswordEditor; - } - - Composite getParent() { - return compositeContainer; - } - - @Override - protected Validator getValidator(TaskRepository repository) { - // ignore - return null; - } - } - -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RepositoryTaskSynchronizationTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RepositoryTaskSynchronizationTest.java deleted file mode 100644 index b91f9262a..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RepositoryTaskSynchronizationTest.java +++ /dev/null @@ -1,454 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 - 2006 Mylar 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.tasks.tests; - -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; - -import junit.framework.TestCase; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.mylyn.tasks.core.AbstractAttributeFactory; -import org.eclipse.mylyn.tasks.core.AbstractTask; -import org.eclipse.mylyn.tasks.core.AbstractTaskDataHandler; -import org.eclipse.mylyn.tasks.core.RepositoryTaskAttribute; -import org.eclipse.mylyn.tasks.core.RepositoryTaskData; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.AbstractTask.RepositoryTaskSyncState; -import org.eclipse.mylyn.tasks.tests.connector.MockAttributeFactory; -import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryConnector; -import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryTask; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; - -/** - * @author Rob Elves - */ -public class RepositoryTaskSynchronizationTest extends TestCase { - - private static final String DATE_STAMP_3 = "2006-06-21 15:29:42"; - - private static final String DATE_STAMP_2 = "2006-06-21 15:29:41"; - - private static final String DATE_STAMP_1 = "2006-06-21 15:29:40"; - - private static final String MOCCK_ID = "1"; - - //private static final String URL1 = "http://www.eclipse.org/mylar"; - - private TestRepositoryConnector connector = new TestRepositoryConnector(); - - private TestOfflineTaskHandler handler = new TestOfflineTaskHandler(); - - private RepositoryTaskData newData; - - @Override - protected void setUp() throws Exception { - super.setUp(); - TasksUiPlugin.getSynchronizationManager().setForceSyncExec(true); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void testHasIncoming() { - AbstractTask task = new MockRepositoryTask(MOCCK_ID); - RepositoryTaskData taskData = new RepositoryTaskData(new MockAttributeFactory(), connector.getConnectorKind(), - MockRepositoryConnector.REPOSITORY_URL, MOCCK_ID); - task.setLastReadTimeStamp("never"); - - assertTrue(TasksUiPlugin.getSynchronizationManager().checkHasIncoming(task, taskData)); - taskData.setAttributeValue(RepositoryTaskAttribute.DATE_MODIFIED, "2006-06-21 15:29:39"); - assertTrue(TasksUiPlugin.getSynchronizationManager().checkHasIncoming(task, taskData)); - taskData.setAttributeValue(RepositoryTaskAttribute.DATE_MODIFIED, DATE_STAMP_1); - assertTrue(TasksUiPlugin.getSynchronizationManager().checkHasIncoming(task, taskData)); - task.setLastReadTimeStamp("2006-06-21 15:29:39"); - assertTrue(TasksUiPlugin.getSynchronizationManager().checkHasIncoming(task, taskData)); - task.setLastReadTimeStamp(DATE_STAMP_1); - assertFalse(TasksUiPlugin.getSynchronizationManager().checkHasIncoming(task, taskData)); - } - - public void testIncomingToIncoming() { - /* - * - Synchronize task with incoming changes - Make another change using - * browser - Open report in tasklist (editor opens with old 'new' data - * and background sync occurs) - Incoming status set again on task due - * to 2nd occurrence of new incoming data - */ - - // Test unforced - AbstractTask task = primeTaskAndRepository(RepositoryTaskSyncState.INCOMING, RepositoryTaskSyncState.INCOMING); - RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), - task.getTaskId()); - assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp()); - assertEquals(RepositoryTaskSyncState.INCOMING, task.getSynchronizationState()); - assertEquals(DATE_STAMP_2, newData.getLastModified()); - TasksUiPlugin.getSynchronizationManager().saveIncoming(task, newData, false); - assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp()); - assertEquals(RepositoryTaskSyncState.INCOMING, task.getSynchronizationState()); - // TasksUiPlugin.getSynchronizationManager().setTaskRead(task, true); - // assertEquals(DATE_STAMP_2, task.getLastSyncDateStamp()); - // and again... - - RepositoryTaskData taskData3 = new RepositoryTaskData(new MockAttributeFactory(), connector.getConnectorKind(), - MockRepositoryConnector.REPOSITORY_URL, "1"); - taskData3.setAttributeValue(RepositoryTaskAttribute.DATE_MODIFIED, DATE_STAMP_3); - TasksUiPlugin.getSynchronizationManager().saveIncoming(task, taskData3, false); - // last modified stamp not updated until user synchronizes (newdata == - // olddata) - assertEquals(RepositoryTaskSyncState.INCOMING, task.getSynchronizationState()); - assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp()); - taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId()); - assertEquals(DATE_STAMP_3, taskData.getLastModified()); - - // Should keep INCOMING state state since new data has same date samp - // and sych is not forced. - TasksUiPlugin.getSynchronizationManager().saveIncoming(task, taskData3, false); - assertEquals(RepositoryTaskSyncState.INCOMING, task.getSynchronizationState()); - assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp()); - taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId()); - assertEquals(DATE_STAMP_3, taskData.getLastModified()); - } - - // Invalid state change. Test that this can't happen. - public void testIncomingToSynchronized() { - // When not forced, tasks with incoming state should remain in incoming - // state if - // if new data has same date stamp as old data. - AbstractTask task = primeTaskAndRepository(RepositoryTaskSyncState.INCOMING, - RepositoryTaskSyncState.SYNCHRONIZED); - assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp()); - TasksUiPlugin.getSynchronizationManager().saveIncoming(task, newData, false); - assertEquals(RepositoryTaskSyncState.INCOMING, task.getSynchronizationState()); - assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp()); - - task = primeTaskAndRepository(RepositoryTaskSyncState.INCOMING, RepositoryTaskSyncState.SYNCHRONIZED); - assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp()); - TasksUiPlugin.getSynchronizationManager().saveIncoming(task, newData, true); - assertEquals(RepositoryTaskSyncState.INCOMING, task.getSynchronizationState()); - // assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, - // task.getSyncState()); - assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp()); - - // Test forced with remote incoming - // Update: bug#163850 - synchronize gets new data but doesn't mark - // synchronized - task = primeTaskAndRepository(RepositoryTaskSyncState.INCOMING, RepositoryTaskSyncState.INCOMING); - assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp()); - TasksUiPlugin.getSynchronizationManager().saveIncoming(task, newData, true); - assertEquals(RepositoryTaskSyncState.INCOMING, task.getSynchronizationState()); - - } - - // public void testIncomingToSynchronizedWithVoidSyncTime() { - // // IF the last sync time (modified timestamp on task) is null, this can - // result - // // in the editor refresh/repoen going into an infinite loops since the - // task never - // // gets to a synchronized state if the last mod time isn't set. It is now - // being set - // // if found to be null. - // AbstractTask task = - // primeTaskAndRepository(RepositoryTaskSyncState.INCOMING, - // RepositoryTaskSyncState.SYNCHRONIZED); - // assertEquals(DATE_STAMP_1, task.getLastSyncDateStamp()); - // task.setLastSyncDateStamp(null); - // TasksUiPlugin.getSynchronizationManager().updateOfflineState(task, - // newData, false); - // assertEquals(RepositoryTaskSyncState.INCOMING, task.getSyncState()); - // assertEquals(DATE_STAMP_1, task.getLastSyncDateStamp()); - // - // TasksUiPlugin.getSynchronizationManager().updateOfflineState(task, - // newData, false); - // assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSyncState()); - // assertEquals(DATE_STAMP_1, task.getLastSyncDateStamp()); - // } - - /* - * public void testIncomingToConflict() { // invalid } - */ - - /* - * public void testIncomingToOutgoing() { // invalid } - */ - - public void testSynchronizedToIncoming() { - AbstractTask task = primeTaskAndRepository(RepositoryTaskSyncState.SYNCHRONIZED, - RepositoryTaskSyncState.INCOMING); - assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp()); - TasksUiPlugin.getSynchronizationManager().saveIncoming(task, newData, false); - assertEquals(RepositoryTaskSyncState.INCOMING, task.getSynchronizationState()); - RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), - task.getTaskId()); - assertEquals(DATE_STAMP_2, taskData.getLastModified()); - // assertEquals(DATE_STAMP_2, task.getLastModifiedDateStamp()); - } - - public void testSynchronizedToSynchronized() { - AbstractTask task = primeTaskAndRepository(RepositoryTaskSyncState.SYNCHRONIZED, - RepositoryTaskSyncState.SYNCHRONIZED); - assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp()); - TasksUiPlugin.getSynchronizationManager().saveIncoming(task, newData, false); - assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState()); - assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp()); - } - - /* - * public void testSynchronizedToConflict() { // invalid } - */ - - public void testSynchronizedToOutgoing() { - AbstractTask task = primeTaskAndRepository(RepositoryTaskSyncState.SYNCHRONIZED, - RepositoryTaskSyncState.SYNCHRONIZED); - assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp()); - - RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getEditableCopy(task.getRepositoryUrl(), - task.getTaskId()); - - taskData.setNewComment("new comment"); - - HashSet changed = new HashSet(); - changed.add(taskData.getAttribute(RepositoryTaskAttribute.COMMENT_NEW)); - TasksUiPlugin.getSynchronizationManager().saveOutgoing(task, changed); - assertEquals(RepositoryTaskSyncState.OUTGOING, task.getSynchronizationState()); - assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp()); - } - - public void testConflictToConflict() { - AbstractTask task = primeTaskAndRepository(RepositoryTaskSyncState.CONFLICT, RepositoryTaskSyncState.INCOMING); - assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp()); - TasksUiPlugin.getSynchronizationManager().saveIncoming(task, newData, true); - assertEquals(RepositoryTaskSyncState.CONFLICT, task.getSynchronizationState()); - RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), - task.getTaskId()); - - assertEquals(DATE_STAMP_2, taskData.getLastModified()); - TasksUiPlugin.getSynchronizationManager().saveIncoming(task, newData, true); - assertEquals(RepositoryTaskSyncState.CONFLICT, task.getSynchronizationState()); - taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId()); - assertEquals(DATE_STAMP_2, taskData.getLastModified()); - } - - /* - * public void testConflictToSynchonized() { // invalid, requires markRead } - */ - - /* - * public void testConflictToConflict() { // ui involved } - */ - - /* - * public void testConflictToOutgoing() { // invalid? } - */ - - // TODO: Test merging new incoming with outgoing - // TODO: Test discard outgoing - public void testOutgoingToConflict() { - // Forced - AbstractTask task = primeTaskAndRepository(RepositoryTaskSyncState.OUTGOING, RepositoryTaskSyncState.INCOMING); - RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), - task.getTaskId()); - - assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp()); - assertEquals(RepositoryTaskSyncState.OUTGOING, task.getSynchronizationState()); - TasksUiPlugin.getSynchronizationManager().saveIncoming(task, newData, true); - assertEquals(RepositoryTaskSyncState.CONFLICT, task.getSynchronizationState()); - taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId()); - - assertEquals(DATE_STAMP_2, taskData.getLastModified()); - // assertEquals(DATE_STAMP_2, task.getLastModifiedDateStamp()); - } - - // Illegal state change, test it doesn't occur - public void testOutgoingToSynchronized() { - - AbstractTask task = primeTaskAndRepository(RepositoryTaskSyncState.OUTGOING, - RepositoryTaskSyncState.SYNCHRONIZED); - assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp()); - - TasksUiPlugin.getSynchronizationManager().saveIncoming(task, newData, true); - assertEquals(RepositoryTaskSyncState.OUTGOING, task.getSynchronizationState()); - assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp()); - } - - public void testOutgoingToOutgoing() { - AbstractTask task = primeTaskAndRepository(RepositoryTaskSyncState.OUTGOING, - RepositoryTaskSyncState.SYNCHRONIZED); - assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp()); - TasksUiPlugin.getSynchronizationManager().saveIncoming(task, newData, false); - assertEquals(RepositoryTaskSyncState.OUTGOING, task.getSynchronizationState()); - assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp()); - } - - public void testMarkRead() { - AbstractTask task = primeTaskAndRepository(RepositoryTaskSyncState.INCOMING, - RepositoryTaskSyncState.SYNCHRONIZED); - task.setLastReadTimeStamp(null); - assertEquals(RepositoryTaskSyncState.INCOMING, task.getSynchronizationState()); - TasksUiPlugin.getSynchronizationManager().setTaskRead(task, true); - assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp()); - assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState()); - } - - public void testMarkUnread() { - AbstractTask task = primeTaskAndRepository(RepositoryTaskSyncState.SYNCHRONIZED, - RepositoryTaskSyncState.SYNCHRONIZED); - task.setLastReadTimeStamp(null); - assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState()); - TasksUiPlugin.getSynchronizationManager().setTaskRead(task, false); - assertEquals(RepositoryTaskSyncState.INCOMING, task.getSynchronizationState()); - } - - public void testClearOutgoing() { - AbstractTask task = primeTaskAndRepository(RepositoryTaskSyncState.SYNCHRONIZED, - RepositoryTaskSyncState.SYNCHRONIZED); - RepositoryTaskData taskData1 = new RepositoryTaskData(new MockAttributeFactory(), - MockRepositoryConnector.REPOSITORY_KIND, MockRepositoryConnector.REPOSITORY_URL, "1"); - TasksUiPlugin.getTaskDataManager().setNewTaskData(taskData1); - taskData1 = TasksUiPlugin.getTaskDataManager().getEditableCopy(task.getRepositoryUrl(), task.getTaskId()); - - taskData1.setNewComment("Testing"); - Set edits = new HashSet(); - edits.add(taskData1.getAttribute(RepositoryTaskAttribute.COMMENT_NEW)); - TasksUiPlugin.getTaskDataManager().saveEdits(task.getRepositoryUrl(), task.getTaskId(), edits); - - RepositoryTaskData editedData = TasksUiPlugin.getTaskDataManager().getEditableCopy(task.getRepositoryUrl(), - task.getTaskId()); - assertEquals("Testing", editedData.getNewComment()); - - TasksUiPlugin.getSynchronizationManager().discardOutgoing(task); - - assertTrue(task.getSynchronizationState().equals(RepositoryTaskSyncState.SYNCHRONIZED)); - RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getEditableCopy(task.getRepositoryUrl(), - task.getTaskId()); - assertEquals("", taskData.getNewComment()); - - } - - private class TestOfflineTaskHandler extends AbstractTaskDataHandler { - - @Override - public AbstractAttributeFactory getAttributeFactory(String repositoryUrl, String repositoryKind, String taskKind) { - // ignore - return null; - } - - public Set getChangedSinceLastSync(TaskRepository repository, Set tasks) - throws CoreException { - return null; - } - - @Override - public RepositoryTaskData getTaskData(TaskRepository repository, String taskId, IProgressMonitor monitor) - throws CoreException { - return null; - } - - @Override - public String postTaskData(TaskRepository repository, RepositoryTaskData taskData, IProgressMonitor monitor) - throws CoreException { - // ignore - return null; - } - - @Override - public boolean initializeTaskData(TaskRepository repository, RepositoryTaskData data, IProgressMonitor monitor) - throws CoreException { - // ignore - return false; - } - - @Override - public AbstractAttributeFactory getAttributeFactory(RepositoryTaskData taskData) { - // ignore - return null; - } - - @Override - public Set getSubTaskIds(RepositoryTaskData taskData) { - return Collections.emptySet(); - } - - // private final String DATE_FORMAT_2 = "yyyy-MM-dd HH:mm:ss"; - // - // private final SimpleDateFormat format = new - // SimpleDateFormat(DATE_FORMAT_2); - // - // - // public Date getDateForAttributeType(String attributeKey, String - // dateString) { - // - // try { - // return format.parse(dateString); - // } catch (ParseException e) { - // return null; - // } - // } - - } - - private class TestRepositoryConnector extends MockRepositoryConnector { - - @Override - public AbstractTaskDataHandler getTaskDataHandler() { - return handler; - } - - // @Override - // protected void removeOfflineTaskData(RepositoryTaskData bug) { - // // ignore - // } - // - // @Override - // public void saveOffline(RepositoryTaskData taskData) { - // // ignore - // } - - // @Override - // protected RepositoryTaskData - // loadOfflineTaskData(AbstractTask repositoryTask) { - // return repositoryTask.getTaskData(); - // } - - } - - private AbstractTask primeTaskAndRepository(RepositoryTaskSyncState localState, RepositoryTaskSyncState remoteState) { - RepositoryTaskData taskData = null; - AbstractTask task = new MockRepositoryTask(MOCCK_ID); - - taskData = new RepositoryTaskData(new MockAttributeFactory(), connector.getConnectorKind(), - MockRepositoryConnector.REPOSITORY_URL, MOCCK_ID); - taskData.setAttributeValue(RepositoryTaskAttribute.DATE_MODIFIED, DATE_STAMP_1); - task.setLastReadTimeStamp(DATE_STAMP_1); - task.setSynchronizationState(localState); - TasksUiPlugin.getTaskDataManager().setNewTaskData(taskData); - newData = new RepositoryTaskData(new MockAttributeFactory(), connector.getConnectorKind(), - MockRepositoryConnector.REPOSITORY_URL, MOCCK_ID); - - switch (remoteState) { - case CONFLICT: - case INCOMING: - newData.setAttributeValue(RepositoryTaskAttribute.DATE_MODIFIED, DATE_STAMP_2); - break; - case SYNCHRONIZED: - newData.setAttributeValue(RepositoryTaskAttribute.DATE_MODIFIED, DATE_STAMP_1); - break; - default: - fail("Remote repository can only be INCOMING or SYNCHRONIZED wrt the local task."); - - } - - return task; - - } - -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RetrieveTitleFromUrlTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RetrieveTitleFromUrlTest.java deleted file mode 100644 index 52da2b7cb..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RetrieveTitleFromUrlTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * 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.tasks.tests; - -import java.lang.reflect.InvocationTargetException; - -import junit.framework.TestCase; - -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.mylyn.internal.tasks.ui.RetrieveTitleFromUrlJob; - -/** - * @author Mik Kersten - */ -public class RetrieveTitleFromUrlTest extends TestCase { - - // XXX broken due to hang that causes the scheduled job to never complete - public void testRetrieve() throws InterruptedException, InvocationTargetException { - final String url = "http://eclipse.org/mylar/index.php"; - final String knownTitle = "Mylar Technology Project"; - - RetrieveTitleFromUrlJob job = new RetrieveTitleFromUrlJob(url) { - - @Override - public void setTitle(String title) { - assertEquals(knownTitle, title); - } - }; - job.run(new NullProgressMonitor()); - - assertTrue(job.isTitleRetrieved()); - assertEquals(knownTitle, job.getPageTitle()); - } -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TableSorterTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TableSorterTest.java deleted file mode 100644 index ffe743c70..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TableSorterTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * 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.tasks.tests; - -import junit.framework.TestCase; - -import org.eclipse.mylyn.internal.tasks.core.LocalTask; -import org.eclipse.mylyn.internal.tasks.core.TaskCategory; -import org.eclipse.mylyn.internal.tasks.ui.views.TaskListTableSorter; -import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView; -import org.eclipse.mylyn.tasks.core.AbstractTask; - -/** - * @author Mik Kersten - */ -public class TableSorterTest extends TestCase { - - public void testRootTaskSorting() { - TaskListTableSorter sorter = new TaskListTableSorter(TaskListView.getFromActivePerspective(), - TaskListTableSorter.SortByIndex.SUMMARY); - - AbstractTask task = new LocalTask("1", ""); - TaskCategory category = new TaskCategory("cat"); - - assertEquals(-1, sorter.compare(null, task, category)); - assertEquals(1, sorter.compare(null, category, task)); - } -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskActivityTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskActivityTest.java deleted file mode 100644 index 981756ba8..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskActivityTest.java +++ /dev/null @@ -1,773 +0,0 @@ -/******************************************************************************* - * 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.tasks.tests; - -import java.util.Calendar; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.List; - -import junit.framework.TestCase; - -import org.eclipse.mylyn.context.core.ContextCorePlugin; -import org.eclipse.mylyn.internal.context.core.DegreeOfInterest; -import org.eclipse.mylyn.internal.context.core.InteractionContext; -import org.eclipse.mylyn.internal.context.core.InteractionContextManager; -import org.eclipse.mylyn.internal.context.core.ScalingFactors; -import org.eclipse.mylyn.internal.tasks.core.ScheduledTaskDelegate; -import org.eclipse.mylyn.internal.tasks.core.ScheduledTaskContainer; -import org.eclipse.mylyn.internal.tasks.core.LocalTask; -import org.eclipse.mylyn.monitor.core.InteractionEvent; -import org.eclipse.mylyn.tasks.core.AbstractTask; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; - -/** - * @author Rob Elves - */ -public class TaskActivityTest extends TestCase { - - private long currentStartMili = 1200; - - private long currentEndMili = 1900; - - protected void setUp() throws Exception { - super.setUp(); - } - - protected void tearDown() throws Exception { - // MylarTaskListPlugin.getTaskListManager().readExistingOrCreateNewList(); - TasksUiPlugin.getTaskListManager().resetTaskList(); - TasksUiPlugin.getTaskListManager().saveTaskList(); - super.tearDown(); - } - - // TODO: Test scheduling into day bins - public void testDaysOfWeek() { - List days = TasksUiPlugin.getTaskListManager().getActivityWeekDays(); - assertNotNull(days); - assertEquals(7, days.size()); - } - - public void testDateRangeContainer() { - - Calendar startDate = GregorianCalendar.getInstance(); - startDate.setTimeInMillis(1000); - Calendar endDate = GregorianCalendar.getInstance(); - endDate.setTimeInMillis(2000); - - ScheduledTaskContainer testContainer = new ScheduledTaskContainer(startDate, endDate, - "test date range container"); - assertTrue(testContainer.includes(startDate)); - assertTrue(testContainer.includes(endDate)); - Calendar midTime = GregorianCalendar.getInstance(); - midTime.setTimeInMillis(1500); - assertTrue(testContainer.includes(midTime)); - - AbstractTask task1 = new LocalTask("task 1", "Task 1"); - AbstractTask task2 = new LocalTask("task 2", "Task 2"); - - Calendar currentTaskStart = GregorianCalendar.getInstance(); - currentTaskStart.setTimeInMillis(currentStartMili); - Calendar currentTaskEnd = GregorianCalendar.getInstance(); - currentTaskEnd.setTimeInMillis(currentEndMili); - testContainer.addTask(new ScheduledTaskDelegate(testContainer, task1, currentTaskStart, currentTaskEnd, 10)); - // assertEquals(currentEndMili - currentStartMili, - // testContainer.getTotalElapsed()); - assertEquals(10, testContainer.getTotalElapsed()); - testContainer.addTask(new ScheduledTaskDelegate(testContainer, task2, currentTaskStart, currentTaskEnd, 10)); - assertEquals(20, testContainer.getTotalElapsed()); - // assertEquals(2 * (currentEndMili - currentStartMili), - // testContainer.getTotalElapsed()); - assertEquals(2, testContainer.getDateRangeDelegates().size()); - testContainer.addTask(new ScheduledTaskDelegate(testContainer, task2, currentTaskStart, currentTaskEnd, 10)); - - assertEquals(30, testContainer.getTotalElapsed()); - // assertEquals(3 * (currentEndMili - currentStartMili), - // testContainer.getTotalElapsed()); - // assertEquals(2 * (currentEndMili - currentStartMili), - // testContainer.getElapsed(new DateRangeActivityDelegate( - // testContainer, task2, currentTaskStart, currentTaskEnd))); - assertEquals(20, testContainer.getElapsed(new ScheduledTaskDelegate(testContainer, task2, currentTaskStart, - currentTaskEnd))); - assertEquals(2, testContainer.getDateRangeDelegates().size()); - } - - // public void testNegativeInactivity() { - // Calendar startDate = GregorianCalendar.getInstance(); - // startDate.setTimeInMillis(1000); - // Calendar endDate = GregorianCalendar.getInstance(); - // endDate.setTimeInMillis(2000); - // ITask task1 = new Task("task 1", "Task 1", true); - // DateRangeContainer testContainer = new DateRangeContainer(startDate, - // endDate, "test date range container", taskList); - // testContainer.addTask(new DateRangeActivityDelegate(testContainer, task1, - // startDate, endDate, 3000)); - // assertEquals(0, testContainer.getTotalElapsed()); - // } - - public void testTaskListManagerActivity() { - - AbstractTask task1 = new LocalTask("task 1", "Task 1"); - AbstractTask task2 = new LocalTask("task 2", "Task 2"); - TasksUiPlugin.getTaskListManager().getTaskList().addTask(task1); - TasksUiPlugin.getTaskListManager().getTaskList().addTask(task2); - - // test this week - ScheduledTaskContainer thisWeekActivity = TasksUiPlugin.getTaskListManager().getActivityThisWeek(); - assertNotNull(thisWeekActivity); - assertEquals(0, thisWeekActivity.getChildren().size()); - assertEquals(0, thisWeekActivity.getTotalElapsed()); - Calendar thisWeekCalendarStart = GregorianCalendar.getInstance(); - thisWeekCalendarStart.setTime(thisWeekActivity.getStart().getTime()); - Calendar thisWeekCalendarStop = GregorianCalendar.getInstance(); - thisWeekCalendarStop.setTime(thisWeekActivity.getStart().getTime()); - thisWeekCalendarStop.add(Calendar.MILLISECOND, 2); - assertTrue(thisWeekActivity.includes(thisWeekCalendarStart)); - - InteractionEvent event1 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", - task1.getHandleIdentifier(), "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, thisWeekCalendarStart.getTime(), - thisWeekCalendarStart.getTime()); - InteractionEvent event2 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", - task1.getHandleIdentifier(), "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, thisWeekCalendarStop.getTime(), - thisWeekCalendarStop.getTime()); - - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event1); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event2); - assertEquals(1, thisWeekActivity.getChildren().size()); - assertEquals(0, thisWeekActivity.getTotalElapsed()); - // assertEquals(thisWeekCalendarStop.getTime().getTime() - - // thisWeekCalendarStart.getTime().getTime(), - // thisWeekActivity.getTotalElapsed()); - - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event1); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event2); - assertEquals(1, thisWeekActivity.getChildren().size()); - // assertEquals(2 * (thisWeekCalendarStop.getTime().getTime() - - // thisWeekCalendarStart.getTime().getTime()), - // thisWeekActivity.getTotalElapsed()); - // assertEquals(2 * (thisWeekCalendarStop.getTime().getTime() - - // thisWeekCalendarStart.getTime().getTime()), - // thisWeekActivity.getElapsed(new - // DateRangeActivityDelegate(thisWeekActivity, task1, null, null))); - - // multiple tasks in category - event1 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", task2.getHandleIdentifier(), - "originId", "navigatedRelation", InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, - thisWeekCalendarStart.getTime(), thisWeekCalendarStart.getTime()); - event2 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", task2.getHandleIdentifier(), - "originId", "navigatedRelation", InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, - thisWeekCalendarStop.getTime(), thisWeekCalendarStop.getTime()); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event1); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event2); - assertEquals(2, thisWeekActivity.getChildren().size()); - - // test Past - ScheduledTaskContainer pastActivity = TasksUiPlugin.getTaskListManager().getActivityPast(); - assertNotNull(pastActivity); - assertEquals(0, pastActivity.getChildren().size()); - - InteractionEvent event3 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", - task2.getHandleIdentifier(), "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, pastActivity.getStart().getTime(), - pastActivity.getStart().getTime()); - InteractionEvent event4 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", - task2.getHandleIdentifier(), "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, pastActivity.getEnd().getTime(), - pastActivity.getEnd().getTime()); - - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event3); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event4); - assertEquals(1, pastActivity.getChildren().size()); - - // test Future - ScheduledTaskContainer futureActivity = TasksUiPlugin.getTaskListManager().getActivityFuture(); - assertNotNull(futureActivity); - assertEquals(0, futureActivity.getChildren().size()); - - InteractionEvent event5 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", - task2.getHandleIdentifier(), "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, futureActivity.getStart().getTime(), - futureActivity.getStart().getTime()); - InteractionEvent event6 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", - task2.getHandleIdentifier(), "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, futureActivity.getEnd().getTime(), - futureActivity.getEnd().getTime()); - - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event5); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event6); - // No longer adding activity to future bins (days of week, next week, or - // future) - assertEquals(0, futureActivity.getChildren().size()); - - // test Next week activity - ScheduledTaskContainer activityNextWeek = TasksUiPlugin.getTaskListManager().getActivityNextWeek(); - assertNotNull(activityNextWeek); - assertEquals(0, activityNextWeek.getChildren().size()); - - InteractionEvent event7 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", - task2.getHandleIdentifier(), "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, activityNextWeek.getStart().getTime(), - activityNextWeek.getStart().getTime()); - InteractionEvent event8 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", - task2.getHandleIdentifier(), "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, activityNextWeek.getEnd().getTime(), - activityNextWeek.getEnd().getTime()); - - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event7); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event8); - // No longer adding activity to future bins (days of week, next week, or - // future) - assertEquals(0, activityNextWeek.getChildren().size()); - - // test Previous week activity - ScheduledTaskContainer activityPreviousWeek = TasksUiPlugin.getTaskListManager().getActivityPrevious(); - assertNotNull(activityPreviousWeek); - assertEquals(0, activityPreviousWeek.getChildren().size()); - - InteractionEvent event9 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", - task2.getHandleIdentifier(), "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, activityPreviousWeek.getStart().getTime(), - activityPreviousWeek.getStart().getTime()); - InteractionEvent event10 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", - task2.getHandleIdentifier(), "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, activityPreviousWeek.getEnd().getTime(), - activityPreviousWeek.getEnd().getTime()); - - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event9); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event10); - assertEquals(1, activityPreviousWeek.getChildren().size()); - } - - /** - * Some 'attention' events when all tasks are inactive - * - * @author Yuri Baburov (burchik@gmail.com) - */ - public void testTaskListManagerActivity2() { - AbstractTask task1 = new LocalTask("task 1", "Task 1"); - TasksUiPlugin.getTaskListManager().getTaskList().addTask(task1); - ScheduledTaskContainer thisWeekActivity = TasksUiPlugin.getTaskListManager().getActivityThisWeek(); - assertNotNull(thisWeekActivity); - assertEquals(0, thisWeekActivity.getChildren().size()); - assertEquals(0, thisWeekActivity.getTotalElapsed()); - thisWeekActivity.getStart().setTimeInMillis(1149490800000L); // Start - // of - // the - // week - // Jun 5 - // 2006 - // - Jun - // 11 - // 2006, - // NOVST - thisWeekActivity.getEnd().setTimeInMillis(1150095600000L); // End of - // the week - - Date time1 = new Date(1149911820812L); // Sat Jun 10 10:57:00 NOVST - // 2006 - task 1 - activated - Date time2 = new Date(1149911820812L); // Sat Jun 10 10:57:00 NOVST - // 2006 - task 1 - deactivated - Date time3 = new Date(1149911840812L); // Sat Jun 10 10:57:20 NOVST - // 2006 - attention - - // deactivated - Date time4 = new Date(1149911941765L); // Sat Jun 10 10:59:01 NOVST - // 2006 - attention - activated - Date time5 = new Date(1149911948953L); // Sat Jun 10 10:59:08 NOVST - // 2006 - task 1 - activated - Date time6 = new Date(1149911988781L); // Sat Jun 10 10:59:48 NOVST - // 2006 - task 1 - deactivated - - String task1handle = task1.getHandleIdentifier(); - InteractionEvent event1 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", task1handle, - "originId", "navigatedRelation", InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, time1, time1); - InteractionEvent event2 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", task1handle, - "originId", "navigatedRelation", InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, time2, time2); - InteractionEvent event3 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", "attention", - "originId", "navigatedRelation", InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, time3, time3); - InteractionEvent event4 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", "attention", - "originId", "navigatedRelation", InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, time4, time4); - InteractionEvent event5 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", task1handle, - "originId", "navigatedRelation", InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, time5, time5); - InteractionEvent event6 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", task1handle, - "originId", "navigatedRelation", InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, time6, time6); - - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event1); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event2); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event3); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event4); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event5); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event6); - assertEquals(1, thisWeekActivity.getChildren().size()); - long expectedTotalTime = 0;// time6.getTime() - time5.getTime() + - // time2.getTime() - time1.getTime(); - assertEquals(expectedTotalTime, thisWeekActivity.getTotalElapsed()); - assertEquals(expectedTotalTime, TasksUiPlugin.getTaskListManager().getElapsedTime(task1)); - assertEquals(expectedTotalTime, thisWeekActivity.getElapsed(new ScheduledTaskDelegate(thisWeekActivity, task1, - null, null))); - } - - /** - * Task with some inner 'attention' events - * - * @author Yuri Baburov (burchik@gmail.com) - */ - public void testTaskListManagerActivity3() { - AbstractTask task1 = new LocalTask("task 1", "Task 1"); - TasksUiPlugin.getTaskListManager().getTaskList().addTask(task1); - ScheduledTaskContainer thisWeekActivity = TasksUiPlugin.getTaskListManager().getActivityThisWeek(); - assertNotNull(thisWeekActivity); - assertEquals(0, thisWeekActivity.getChildren().size()); - assertEquals(0, thisWeekActivity.getTotalElapsed()); - thisWeekActivity.getStart().setTimeInMillis(1149490800000L); // Start - // of - // the - // week - // Jun 5 - // 2006 - // - Jun - // 11 - // 2006, - // NOVST - thisWeekActivity.getEnd().setTimeInMillis(1150095600000L); // End of - // the week - - Date time1 = new Date(1150007053171L); // Sun Jun 11 13:24:13 NOVST - // 2006 - task 1 - activated - Date time2 = new Date(1150007263468L); // Sun Jun 11 13:27:43 NOVST - // 2006 - attention - - // deactivated - Date time3 = new Date(1150021535953L); // Sun Jun 11 17:25:35 NOVST - // 2006 - attention - activated - Date time4 = new Date(1150021658500L); // Sun Jun 11 17:27:38 NOVST - // 2006 - attention - - // deactivated - Date time5 = new Date(1150031089250L); // Sun Jun 11 20:04:49 NOVST - // 2006 - attention - activated - Date time6 = new Date(1150031111578L); // Sun Jun 11 20:05:11 NOVST - // 2006 - attention - - // deactivated - Date time7 = new Date(1150031111578L); // Sun Jun 11 20:05:11 NOVST - // 2006 - task 1 - deactivated - - String task1handle = task1.getHandleIdentifier(); - InteractionEvent event1 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", task1handle, - "originId", "navigatedRelation", InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, time1, time1); - - InteractionEvent event2 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", "attention", - "originId", "navigatedRelation", InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, time1, time2); - InteractionEvent event3 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", "attention", - "originId", "navigatedRelation", InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, time3, time4); - // InteractionEvent event4 = new - // InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", - // "attention", - // "originId", "navigatedRelation", - // MylarContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, time4, time4); - InteractionEvent event5 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", "attention", - "originId", "navigatedRelation", InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, time5, time6); - // InteractionEvent event6 = new - // InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", - // "attention", - // "originId", "navigatedRelation", - // MylarContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, time6, time6); - InteractionEvent event7 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", task1handle, - "originId", "navigatedRelation", InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, time7, time7); - - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event1); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event2); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event3); - // TasksUiPlugin.getTaskListManager().parseInteractionEvent(event4); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event5); - // TasksUiPlugin.getTaskListManager().parseInteractionEvent(event6); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event7); - assertEquals(1, thisWeekActivity.getChildren().size()); - long expectedTotalTime = time6.getTime() - time5.getTime() + time4.getTime() - time3.getTime() - + time2.getTime() - time1.getTime(); - assertEquals(expectedTotalTime, thisWeekActivity.getTotalElapsed()); - assertEquals(expectedTotalTime, thisWeekActivity.getElapsed(new ScheduledTaskDelegate(thisWeekActivity, task1, - null, null))); - } - - public void testTaskListManagerInactivity() { - - AbstractTask task1 = new LocalTask("task 1", "Task 1"); - TasksUiPlugin.getTaskListManager().getTaskList().addTask(task1); - - ScheduledTaskContainer activityThisWeek = TasksUiPlugin.getTaskListManager().getActivityThisWeek(); - assertNotNull(activityThisWeek); - assertEquals(0, activityThisWeek.getChildren().size()); - - InteractionEvent event1 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", - task1.getHandleIdentifier(), "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, activityThisWeek.getStart().getTime(), - activityThisWeek.getStart().getTime()); - InteractionEvent event2 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", - task1.getHandleIdentifier(), "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, activityThisWeek.getEnd().getTime(), - activityThisWeek.getEnd().getTime()); - - Calendar activityStart = GregorianCalendar.getInstance(); - Calendar activityEnd = GregorianCalendar.getInstance(); - activityEnd.add(Calendar.HOUR_OF_DAY, 1); - - // InteractionEvent inactivityEvent1 = new - // InteractionEvent(InteractionEvent.Kind.COMMAND, "structureKind", - // MylarContextManager.ACTIVITY_HANDLE_ATTENTION, "originId", - // "navigatedRelation", - // MylarContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, - // inactivityStart.getTime(), inactivityStart.getTime()); - // InteractionEvent inactivityEvent2 = new - // InteractionEvent(InteractionEvent.Kind.COMMAND, "structureKind", - // MylarContextManager.ACTIVITY_HANDLE_ATTENTION, "originId", - // "navigatedRelation", - // MylarContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, - // inactivityEnd.getTime(), inactivityEnd.getTime()); - - InteractionEvent activityEvent = new InteractionEvent(InteractionEvent.Kind.COMMAND, - InteractionContextManager.ACTIVITY_STRUCTURE_KIND, InteractionContextManager.ACTIVITY_HANDLE_ATTENTION, - InteractionContextManager.ACTIVITY_ORIGIN_ID, null, InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, - 1f, activityStart.getTime(), activityEnd.getTime()); - - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event1); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(activityEvent); - // TasksUiPlugin.getTaskListManager().parseInteractionEvent(inactivityEvent1); - // TasksUiPlugin.getTaskListManager().parseInteractionEvent(inactivityEvent2); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event2); - assertEquals(1, activityThisWeek.getChildren().size()); - - // long expectedTotalTime = - // (activityThisWeek.getEnd().getTime().getTime() - - // activityThisWeek.getStart().getTime() - // .getTime()) - // - (inactivityEnd.getTime().getTime() - - // inactivityStart.getTime().getTime()); - // - - long expectedTotalTime = (activityEnd.getTime().getTime() - activityStart.getTime().getTime()); - - assertEquals(expectedTotalTime, activityThisWeek.getTotalElapsed()); - assertEquals(expectedTotalTime, activityThisWeek.getElapsed(new ScheduledTaskDelegate(activityThisWeek, task1, - null, null))); - - } - - public void testInterleavedActivation() { - - AbstractTask task1 = new LocalTask("task 1", "Task 1"); - TasksUiPlugin.getTaskListManager().getTaskList().addTask(task1); - - ScheduledTaskContainer activityThisWeek = TasksUiPlugin.getTaskListManager().getActivityThisWeek(); - assertNotNull(activityThisWeek); - assertEquals(0, activityThisWeek.getChildren().size()); - - Calendar taskActivationStart = GregorianCalendar.getInstance(); - taskActivationStart.add(Calendar.MILLISECOND, 15); - Calendar taskActivationStop = GregorianCalendar.getInstance(); - taskActivationStop.add(Calendar.MILLISECOND, 25); - - Calendar inactivityStart1 = GregorianCalendar.getInstance(); - inactivityStart1.add(Calendar.MILLISECOND, 5); - Calendar inactivityStop1 = GregorianCalendar.getInstance(); - inactivityStop1.add(Calendar.MILLISECOND, 10); - - Calendar inactivityStart2 = GregorianCalendar.getInstance(); - inactivityStart2.add(Calendar.MILLISECOND, 18); - Calendar inactivityStop2 = GregorianCalendar.getInstance(); - inactivityStop2.add(Calendar.MILLISECOND, 25); - - InteractionEvent event1 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", - task1.getHandleIdentifier(), "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, taskActivationStart.getTime(), - taskActivationStart.getTime()); - InteractionEvent event2 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", - task1.getHandleIdentifier(), "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, taskActivationStop.getTime(), - taskActivationStop.getTime()); - - InteractionEvent inactivityEvent1 = new InteractionEvent(InteractionEvent.Kind.COMMAND, "structureKind", - InteractionContextManager.ACTIVITY_HANDLE_ATTENTION, "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, inactivityStart1.getTime(), - inactivityStop1.getTime()); - InteractionEvent inactivityEvent2 = new InteractionEvent(InteractionEvent.Kind.COMMAND, "structureKind", - InteractionContextManager.ACTIVITY_HANDLE_ATTENTION, "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, inactivityStart2.getTime(), - inactivityStop2.getTime()); - - TasksUiPlugin.getTaskListManager().parseInteractionEvent(inactivityEvent1); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event1); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event2); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(inactivityEvent2); - assertEquals(1, activityThisWeek.getChildren().size()); - - // long expectedTotalTime = taskActivationStop.getTimeInMillis() - - // taskActivationStart.getTimeInMillis(); - long expectedTotalTime = 0; - assertEquals(expectedTotalTime, activityThisWeek.getTotalElapsed()); - assertEquals(expectedTotalTime, activityThisWeek.getElapsed(new ScheduledTaskDelegate(activityThisWeek, task1, - null, null))); - } - - public void testInterleavedActivation2() { - - AbstractTask task1 = new LocalTask("task 1", "Task 1"); - TasksUiPlugin.getTaskListManager().getTaskList().addTask(task1); - - ScheduledTaskContainer activityThisWeek = TasksUiPlugin.getTaskListManager().getActivityThisWeek(); - assertNotNull(activityThisWeek); - assertEquals(0, activityThisWeek.getChildren().size()); - - Calendar taskActivationStart = GregorianCalendar.getInstance(); - taskActivationStart.add(Calendar.MILLISECOND, 10); - Calendar taskActivationStop = GregorianCalendar.getInstance(); - taskActivationStop.add(Calendar.MILLISECOND, 25); - - Calendar inactivityStart = GregorianCalendar.getInstance(); - inactivityStart.add(Calendar.MILLISECOND, 15); - Calendar inactivityStop = GregorianCalendar.getInstance(); - inactivityStop.add(Calendar.MILLISECOND, 20); - - InteractionEvent event1 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", - task1.getHandleIdentifier(), "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, taskActivationStart.getTime(), - taskActivationStart.getTime()); - InteractionEvent event2 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", - task1.getHandleIdentifier(), "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, taskActivationStop.getTime(), - taskActivationStop.getTime()); - - InteractionEvent inactivityEvent1 = new InteractionEvent(InteractionEvent.Kind.COMMAND, "structureKind", - InteractionContextManager.ACTIVITY_HANDLE_ATTENTION, "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, inactivityStart.getTime(), - inactivityStop.getTime()); - - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event1); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(inactivityEvent1); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event1); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(inactivityEvent1); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event2); - - assertEquals(1, activityThisWeek.getChildren().size()); - - long expectedTotalTime = 2 * (inactivityStart.getTimeInMillis() - taskActivationStart.getTimeInMillis()); - assertEquals(expectedTotalTime, activityThisWeek.getTotalElapsed()); - assertEquals(expectedTotalTime, activityThisWeek.getElapsed(new ScheduledTaskDelegate(activityThisWeek, task1, - null, null))); - } - - public void testResetAndRollOver() { - - ScheduledTaskContainer pastWeeks = TasksUiPlugin.getTaskListManager().getActivityPast(); - ScheduledTaskContainer previousWeek = TasksUiPlugin.getTaskListManager().getActivityPrevious(); - ScheduledTaskContainer thisWeek = TasksUiPlugin.getTaskListManager().getActivityThisWeek(); - ScheduledTaskContainer nextWeek = TasksUiPlugin.getTaskListManager().getActivityNextWeek(); - ScheduledTaskContainer futureWeeks = TasksUiPlugin.getTaskListManager().getActivityFuture(); - - assertTrue(thisWeek.isPresent()); - assertTrue(nextWeek.isFuture()); - - long pastStartTime = pastWeeks.getEnd().getTimeInMillis(); - long previousStartTime = previousWeek.getStart().getTimeInMillis(); - long thisWeekStartTime = thisWeek.getStart().getTimeInMillis(); - long nextStartTime = nextWeek.getStart().getTimeInMillis(); - long futureStartTime = futureWeeks.getStart().getTimeInMillis(); - - Calendar pastWeeksTaskStart = Calendar.getInstance(); - pastWeeksTaskStart.setTimeInMillis(pastStartTime - 10); - assertTrue(pastWeeks.includes(pastWeeksTaskStart)); - - Calendar previousWeekTaskStart = Calendar.getInstance(); - previousWeekTaskStart.setTimeInMillis(previousStartTime + 10); - assertTrue(previousWeek.includes(previousWeekTaskStart)); - - Calendar thisWeekTaskStart = Calendar.getInstance(); - thisWeekTaskStart.setTimeInMillis(thisWeekStartTime + 10); - assertTrue(thisWeek.includes(thisWeekTaskStart)); - - Calendar thisWeekTaskStop = Calendar.getInstance(); - thisWeekTaskStop.setTimeInMillis(thisWeek.getEnd().getTimeInMillis() - 10); - assertTrue(thisWeek.includes(thisWeekTaskStop)); - - Calendar nextWeekTaskStart = Calendar.getInstance(); - nextWeekTaskStart.setTimeInMillis(nextStartTime + 10); - assertTrue(nextWeek.includes(nextWeekTaskStart)); - - Calendar futureWeekTaskStart = Calendar.getInstance(); - futureWeekTaskStart.setTimeInMillis(futureStartTime + 10); - assertTrue(futureWeeks.includes(futureWeekTaskStart)); - - AbstractTask task1 = new LocalTask("task 1", "Task 1"); - TasksUiPlugin.getTaskListManager().getTaskList().addTask(task1); - InteractionEvent event1 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", - task1.getHandleIdentifier(), "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, thisWeekTaskStart.getTime(), - thisWeekTaskStart.getTime()); - InteractionEvent event2 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", - task1.getHandleIdentifier(), "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, thisWeekTaskStop.getTime(), - thisWeekTaskStop.getTime()); - - InteractionEvent activityEvent1 = new InteractionEvent(InteractionEvent.Kind.COMMAND, "structureKind", - InteractionContextManager.ACTIVITY_HANDLE_ATTENTION, "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, thisWeekTaskStart.getTime(), - thisWeekTaskStop.getTime()); - - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event1); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event2); - assertEquals(1, thisWeek.getChildren().size()); - // assertEquals(thisWeekTaskStop.getTime().getTime() - - // thisWeekTaskStart.getTime().getTime(), thisWeek - // .getTotalElapsed()); - - // ROLL OVER - - TasksUiPlugin.getTaskListManager().startTime = new Date(nextWeek.getStart().getTimeInMillis() + 10); - TasksUiPlugin.getTaskListManager().resetAndRollOver(); - - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event1); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(activityEvent1); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event2); - - ScheduledTaskContainer newPastWeeks = TasksUiPlugin.getTaskListManager().getActivityPast(); - ScheduledTaskContainer newPreviousWeek = TasksUiPlugin.getTaskListManager().getActivityPrevious(); - ScheduledTaskContainer newThisWeek = TasksUiPlugin.getTaskListManager().getActivityThisWeek(); - ScheduledTaskContainer newNextWeek = TasksUiPlugin.getTaskListManager().getActivityNextWeek(); - // DateRangeContainer newFutureWeeks = - // MylarTaskListPlugin.getTaskListManager().getActivityFuture(); - - assertTrue(newPastWeeks.includes(previousWeekTaskStart)); - assertTrue(newPreviousWeek.includes(thisWeekTaskStart)); - assertTrue(newThisWeek.includes(nextWeekTaskStart)); - assertTrue(newNextWeek.includes(futureWeekTaskStart)); - - assertFalse(newThisWeek.includes(thisWeekTaskStart)); - assertFalse(newThisWeek.isPresent()); - assertTrue(newThisWeek.isFuture()); - - assertEquals(1, newPreviousWeek.getChildren().size()); - assertEquals(thisWeekTaskStop.getTime().getTime() - thisWeekTaskStart.getTime().getTime(), - newPreviousWeek.getTotalElapsed()); - } - - public void testAfterReloading() { - AbstractTask task1 = new LocalTask("task 1", "Task 1"); - TasksUiPlugin.getTaskListManager().getTaskList().addTask(task1); - - Calendar startTime = Calendar.getInstance(); - Calendar endTime = Calendar.getInstance(); - endTime.add(Calendar.SECOND, 20); - - InteractionEvent event1 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", - task1.getHandleIdentifier(), "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, startTime.getTime(), startTime.getTime()); - InteractionEvent event2 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", - task1.getHandleIdentifier(), "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, startTime.getTime(), startTime.getTime()); - - InteractionEvent activityEvent1 = new InteractionEvent(InteractionEvent.Kind.COMMAND, - InteractionContextManager.ACTIVITY_STRUCTURE_KIND, InteractionContextManager.ACTIVITY_HANDLE_ATTENTION, - InteractionContextManager.ACTIVITY_ORIGIN_ID, null, InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, - 1f, startTime.getTime(), endTime.getTime()); - - ContextCorePlugin.getContextManager().getActivityMetaContext().parseEvent(event1); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event1); - ContextCorePlugin.getContextManager().getActivityMetaContext().parseEvent(activityEvent1); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(activityEvent1); - ContextCorePlugin.getContextManager().getActivityMetaContext().parseEvent(event2); - TasksUiPlugin.getTaskListManager().parseInteractionEvent(event2); - assertEquals(20000, TasksUiPlugin.getTaskListManager().getElapsedTime(task1)); - - ContextCorePlugin.getContextManager().saveActivityContext(); - ContextCorePlugin.getContextManager().loadActivityMetaContext(); - TasksUiPlugin.getTaskListManager().resetAndRollOver(); - - assertEquals(20000, TasksUiPlugin.getTaskListManager().getElapsedTime(task1)); - - } - - public void testCollapsedTiming() { - Calendar startTime1 = Calendar.getInstance(); - Calendar endTime1 = Calendar.getInstance(); - endTime1.add(Calendar.SECOND, 20); - - Calendar startTime2 = Calendar.getInstance(); - startTime2.setTimeInMillis(endTime1.getTimeInMillis()); - Calendar endTime2 = Calendar.getInstance(); - endTime2.setTimeInMillis(startTime2.getTimeInMillis() + 20 * 1000); - - InteractionContext mockContext = new InteractionContext("doitest", new ScalingFactors()); - DegreeOfInterest doi = new DegreeOfInterest(mockContext, InteractionContextManager.getScalingFactors()); - InteractionEvent activityEvent1 = new InteractionEvent(InteractionEvent.Kind.COMMAND, - InteractionContextManager.ACTIVITY_STRUCTURE_KIND, InteractionContextManager.ACTIVITY_HANDLE_ATTENTION, - InteractionContextManager.ACTIVITY_ORIGIN_ID, null, InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, - 1f, startTime1.getTime(), endTime1.getTime()); - - InteractionEvent activityEvent2 = new InteractionEvent(InteractionEvent.Kind.COMMAND, - InteractionContextManager.ACTIVITY_STRUCTURE_KIND, InteractionContextManager.ACTIVITY_HANDLE_ATTENTION, - InteractionContextManager.ACTIVITY_ORIGIN_ID, null, InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, - 1f, startTime2.getTime(), endTime2.getTime()); - - doi.addEvent(activityEvent1); - doi.addEvent(activityEvent2); - assertEquals(2, doi.getCollapsedEvents().size()); - InteractionEvent collapsed = doi.getCollapsedEvents().get(1); - assertEquals(40 * 1000, collapsed.getEndDate().getTime() - collapsed.getDate().getTime()); - } - - public void testCollapsedExternalization() { - - Calendar startTime1 = Calendar.getInstance(); - Calendar endTime1 = Calendar.getInstance(); - endTime1.add(Calendar.SECOND, 20); - - Calendar startTime2 = Calendar.getInstance(); - startTime2.add(Calendar.DAY_OF_MONTH, 1); - Calendar endTime2 = Calendar.getInstance(); - endTime2.add(Calendar.DAY_OF_MONTH, 1); - endTime2.add(Calendar.SECOND, 20); - - AbstractTask task1 = new LocalTask("task 1", "Task 1"); - TasksUiPlugin.getTaskListManager().getTaskList().addTask(task1); - InteractionContext metaContext = ContextCorePlugin.getContextManager().getActivityMetaContext(); - metaContext.reset(); - assertEquals(0, metaContext.getInteractionHistory().size()); - - TasksUiPlugin.getTaskListManager().activateTask(task1); - - InteractionEvent activityEvent1 = new InteractionEvent(InteractionEvent.Kind.COMMAND, - InteractionContextManager.ACTIVITY_STRUCTURE_KIND, InteractionContextManager.ACTIVITY_HANDLE_ATTENTION, - InteractionContextManager.ACTIVITY_ORIGIN_ID, null, InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, - endTime1.getTime().getTime() - startTime1.getTime().getTime(), startTime1.getTime(), endTime1.getTime()); - - InteractionEvent activityEvent2 = new InteractionEvent(InteractionEvent.Kind.COMMAND, - InteractionContextManager.ACTIVITY_STRUCTURE_KIND, InteractionContextManager.ACTIVITY_HANDLE_ATTENTION, - InteractionContextManager.ACTIVITY_ORIGIN_ID, null, InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, - endTime2.getTime().getTime() - startTime2.getTime().getTime(), startTime2.getTime(), endTime2.getTime()); - - metaContext.parseEvent(activityEvent1); - metaContext.parseEvent(activityEvent2); - TasksUiPlugin.getTaskListManager().deactivateAllTasks(); - assertEquals(4, ContextCorePlugin.getContextManager().getActivityMetaContext().getInteractionHistory().size()); - TasksUiPlugin.getTaskListManager().saveTaskList(); - ContextCorePlugin.getContextManager().saveActivityContext(); - ContextCorePlugin.getContextManager().getActivityMetaContext().reset(); - assertEquals(0, ContextCorePlugin.getContextManager().getActivityMetaContext().getInteractionHistory().size()); - ContextCorePlugin.getContextManager().loadActivityMetaContext(); - - // Only three remain as the two attention events have compressed into one - assertEquals(3, ContextCorePlugin.getContextManager().getActivityMetaContext().getInteractionHistory().size()); - assertEquals(0, TasksUiPlugin.getTaskListManager().getElapsedTime(task1)); - - TasksUiPlugin.getTaskListManager().resetAndRollOver(); - assertEquals((endTime1.getTimeInMillis() - startTime1.getTimeInMillis()) - + (endTime2.getTimeInMillis() - startTime2.getTimeInMillis()), TasksUiPlugin.getTaskListManager() - .getElapsedTime(task1)); - } - -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataExportTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataExportTest.java deleted file mode 100644 index 9c862ea5c..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataExportTest.java +++ /dev/null @@ -1,160 +0,0 @@ -/******************************************************************************* - * 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.tasks.tests; - -import java.io.File; -import java.io.FileInputStream; -import java.util.ArrayList; -import java.util.zip.ZipEntry; -import java.util.zip.ZipInputStream; - -import org.eclipse.mylyn.context.core.ContextCorePlugin; -import org.eclipse.mylyn.context.tests.AbstractContextTest; -import org.eclipse.mylyn.internal.context.core.InteractionContext; -import org.eclipse.mylyn.internal.tasks.ui.wizards.TaskDataExportWizard; -import org.eclipse.mylyn.internal.tasks.ui.wizards.TaskDataExportWizardPage; -import org.eclipse.mylyn.monitor.core.InteractionEvent; -import org.eclipse.mylyn.tasks.core.AbstractTask; -import org.eclipse.mylyn.tasks.ui.TaskListManager; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; -import org.eclipse.swt.widgets.Shell; - -/** - * Test case for the Task Export Wizard - * - * @author Wesley Coelho - * @author Mik Kersten (fixes) - */ -public class TaskDataExportTest extends AbstractContextTest { - - private TaskDataExportWizard wizard = null; - - private TaskDataExportWizardPage wizardPage = null; - - private File destinationDir = null; - - private AbstractTask task1 = null; - - private TaskListManager manager = TasksUiPlugin.getTaskListManager(); - - private InteractionContext mockContext; - - @Override - protected void setUp() throws Exception { - super.setUp(); - - removeFiles(new File(TasksUiPlugin.getDefault().getDataDirectory())); - ContextCorePlugin.getDefault().getContextStore().init(); - - // Create the export wizard - wizard = new TaskDataExportWizard(); - wizard.addPages(); - wizard.createPageControls(new Shell()); - wizardPage = (TaskDataExportWizardPage) wizard.getPage(TaskDataExportWizardPage.PAGE_NAME); - assertNotNull(wizardPage); - - // Create test export destination directory - destinationDir = new File(TasksUiPlugin.getDefault().getDataDirectory() + File.separator + "TestDir"); - if (destinationDir.exists()) { - removeFiles(destinationDir); - } else { - destinationDir.mkdir(); - } - assertTrue(destinationDir.exists()); - - // Create a task and context with an interaction event to be saved - task1 = manager.createNewLocalTask("Export Test Task"); - manager.getTaskList().moveToContainer(task1, manager.getTaskList().getDefaultCategory()); - mockContext = ContextCorePlugin.getContextManager().loadContext(task1.getHandleIdentifier()); - InteractionEvent event = new InteractionEvent(InteractionEvent.Kind.EDIT, "structureKind", "handle", "originId"); - mockContext.parseEvent(event); - ContextCorePlugin.getContextManager().activateContext(mockContext); - - // Save the context file and check that it exists - assertTrue(ContextCorePlugin.getDefault().getContextStore().getContextDirectory().exists()); - ContextCorePlugin.getContextManager().saveContext(mockContext.getHandleIdentifier()); - File taskFile = ContextCorePlugin.getContextManager().getFileForContext(task1.getHandleIdentifier()); - assertTrue(ContextCorePlugin.getContextManager().hasContext(task1.getHandleIdentifier())); - assertTrue(taskFile.exists()); - } - - @Override - protected void tearDown() throws Exception { - removeFiles(destinationDir); - destinationDir.delete(); - assertFalse(destinationDir.exists()); - ContextCorePlugin.getContextManager().deactivateContext(mockContext.getHandleIdentifier()); - super.tearDown(); - } - - /** - * Tests the wizard when it has been asked to export all task data to a zip file - */ - public void testExportAllToZip() throws Exception { - - // Set parameters in the wizard to simulate a user setting them and - // clicking "Finish" - wizardPage.setParameters(true, true, true, true, true, destinationDir.getPath()); - wizard.performFinish(); - - // Check that the task list file was exported - File destZipFile = new File(destinationDir + File.separator + TaskDataExportWizard.getZipFileName()); - assertTrue(destZipFile.exists()); - ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(destZipFile)); - ArrayList entries = new ArrayList(); - - ZipEntry entry = zipInputStream.getNextEntry(); - while (entry != null) { - entries.add(entry.getName()); - entry = zipInputStream.getNextEntry(); - } - zipInputStream.close(); - assertEquals(3, entries.size()); - assertTrue(entries.contains("tasklist.xml.zip")); - assertTrue(entries.contains("contexts/local-1.xml.zip")); - } - - // /** Tests the wizard when it has been asked to export all task data */ - // public void testExportAll() { - // - // // Set parameters in the wizard to simulate a user setting them and - // // clicking "Finish" - // wizardPage.setParameters(true, true, true, true, false, - // destinationDir.getPath()); - // wizard.performFinish(); - // - // // Check that the task list file was exported - // File destTaskListFile = new File(destinationDir + File.separator + - // TasksUiPlugin.OLD_TASK_LIST_FILE); - // assertTrue(destTaskListFile.exists()); - // - // // Check that the activity history file was exported - // File destActivationHistoryFile = new File(destinationDir + File.separator - // + MylarContextManager.CONTEXT_HISTORY_FILE_NAME + - // MylarContextManager.CONTEXT_FILE_EXTENSION_OLD); - // assertTrue(destActivationHistoryFile.exists()); - // - // // Check that the task context file created in setUp() was exported - // File destTaskContextFile = - // ContextCorePlugin.getContextManager().getFileForContext(task1.getHandleIdentifier()); - // // File destTaskContextFile = new File(destinationDir + File.separator + - // // task1.getContextPath() + MylarContextManager.CONTEXT_FILE_EXTENSION); - // assertTrue(destTaskContextFile.exists()); - // } - - private void removeFiles(File root) { - if (root.isDirectory()) { - for (File file : root.listFiles()) { - if (file.isDirectory()) { - removeFiles(file); - } - file.delete(); - } - } - } -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataImportTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataImportTest.java deleted file mode 100644 index 652564b27..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataImportTest.java +++ /dev/null @@ -1,127 +0,0 @@ -/******************************************************************************* - * 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.tasks.tests; - -import java.io.File; - -import org.eclipse.mylyn.context.core.ContextCorePlugin; -import org.eclipse.mylyn.context.tests.AbstractContextTest; -import org.eclipse.mylyn.internal.tasks.ui.wizards.TaskDataImportWizard; -import org.eclipse.mylyn.internal.tasks.ui.wizards.TaskDataImportWizardPage; -import org.eclipse.mylyn.tasks.ui.TaskListManager; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; -import org.eclipse.swt.widgets.Shell; - -/** - * Test case for the Task Import Wizard - * - * @author Rob Elves - */ -public class TaskDataImportTest extends AbstractContextTest { - - private TaskDataImportWizard wizard = null; - - private TaskDataImportWizardPage wizardPage = null; - - // private String sourceDir = "testdata/taskdataimporttest"; - - // private File sourceDirFile = null; - - private String sourceZipPath = "testdata/taskdataimporttest/mylardata-2007-01-19.zip"; - - private File sourceZipFile = null; - - private TaskListManager manager = TasksUiPlugin.getTaskListManager(); - - @Override - protected void setUp() throws Exception { - super.setUp(); - - // Create the import wizard - wizard = new TaskDataImportWizard(); - wizard.addPages(); - wizard.createPageControls(new Shell()); - wizardPage = (TaskDataImportWizardPage) wizard.getPage(TaskDataImportWizardPage.PAGE_NAME); - assertNotNull(wizardPage); - - manager.resetTaskList(); - assertEquals(2, manager.getTaskList().getRootElements().size()); - - sourceZipFile = TaskTestUtil.getLocalFile(sourceZipPath); - assertTrue(sourceZipFile.exists()); - - // make correct number of categories exist prior to import tests - assertEquals(1, manager.getTaskList().getTaskContainers().size()); - ContextCorePlugin.getContextManager().getActivityMetaContext().reset(); - } - - @Override - protected void tearDown() throws Exception { - ContextCorePlugin.getContextManager().resetActivityHistory(); - TasksUiPlugin.getRepositoryManager().clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); - TasksUiPlugin.getTaskListManager().resetTaskList(); - super.tearDown(); - } - - /** - * Tests the wizard when it has been asked to import all task data from a zip file - */ - // XXX: Put Back -// public void testImportRepositoriesZip() { -// TaskList taskList = TasksUiPlugin.getTaskListManager().getTaskList(); -// InteractionContext historyContext = ContextCorePlugin.getContextManager().getActivityMetaContext(); -// assertNotNull(taskList); -// assertNotNull(historyContext); -// assertTrue(taskList.getAllTasks().size() == 0); -// assertTrue(historyContext.getInteractionHistory().size() == 0); -// -// wizardPage.setParameters(true, true, true, true, true, "", sourceZipFile.getPath()); -// wizard.performFinish(); -// -// Collection tasks = taskList.getAllTasks(); -// assertEquals(2, tasks.size()); -// for (AbstractTask task : tasks) { -// assertTrue(ContextCorePlugin.getContextManager().hasContext(task.getHandleIdentifier())); -// } -// historyContext = ContextCorePlugin.getContextManager().getActivityMetaContext(); -// assertNotNull(historyContext); -// assertTrue(historyContext.getInteractionHistory().size() > 0); -// assertTrue(TasksUiPlugin.getRepositoryManager().getAllRepositories().size() > 2); -// } - - // XXX: Put Back -// public void testImportOverwritesAllTasks() { -// TaskList taskList = TasksUiPlugin.getTaskListManager().getTaskList(); -// InteractionContext historyContext = ContextCorePlugin.getContextManager().getActivityMetaContext(); -// assertNotNull(taskList); -// assertNotNull(historyContext); -// assertTrue(taskList.getAllTasks().size() == 0); -// assertTrue(historyContext.getInteractionHistory().size() == 0); -// //assertEquals(2, TasksUiPlugin.getRepositoryManager().getAllRepositories().size()); -// -// AbstractTask task1 = new LocalTask("999", "label"); -// taskList.addTask(task1); -// Collection tasks = taskList.getAllTasks(); -// assertEquals(1, tasks.size()); -// -// wizardPage.setParameters(true, true, true, true, true, "", sourceZipFile.getPath()); -// wizard.performFinish(); -// -// tasks = taskList.getAllTasks(); -// assertEquals(2, tasks.size()); -// assertTrue(!taskList.getAllTasks().contains(task1)); -// for (AbstractTask task : tasks) { -// assertTrue(ContextCorePlugin.getContextManager().hasContext(task.getHandleIdentifier())); -// } -// historyContext = ContextCorePlugin.getContextManager().getActivityMetaContext(); -// assertNotNull(historyContext); -// assertTrue(historyContext.getInteractionHistory().size() > 0); -// assertTrue(TasksUiPlugin.getRepositoryManager().getAllRepositories().size() > 2); -// } - -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataManagerTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataManagerTest.java deleted file mode 100644 index 4e419c170..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataManagerTest.java +++ /dev/null @@ -1,257 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 - 2006 Mylar 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.tasks.tests; - -import java.io.IOException; -import java.util.HashSet; -import java.util.Set; - -import junit.framework.TestCase; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.mylyn.internal.tasks.core.TaskDataManager; -import org.eclipse.mylyn.tasks.core.RepositoryTaskAttribute; -import org.eclipse.mylyn.tasks.core.RepositoryTaskData; -import org.eclipse.mylyn.tasks.tests.connector.MockAttributeFactory; -import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryConnector; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; - -/** - * @author Rob Elves - */ -public class TaskDataManagerTest extends TestCase { - - TaskDataManager offlineTaskDataManager; - - @Override - protected void setUp() throws Exception { - super.setUp(); - offlineTaskDataManager = TasksUiPlugin.getTaskDataManager(); - offlineTaskDataManager.clear(); - offlineTaskDataManager.saveNow(); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - if (offlineTaskDataManager != null) { - offlineTaskDataManager.clear(); - offlineTaskDataManager.saveNow(); - } - } - - public void testAdd() throws CoreException { - RepositoryTaskData taskData = new RepositoryTaskData(new MockAttributeFactory(), - MockRepositoryConnector.REPOSITORY_KIND, MockRepositoryConnector.REPOSITORY_URL, "1"); - offlineTaskDataManager.setNewTaskData(taskData); - assertNotNull(offlineTaskDataManager.getNewTaskData(MockRepositoryConnector.REPOSITORY_URL, "1")); - } - - public void testSave() throws CoreException, IOException, ClassNotFoundException { - RepositoryTaskData taskData = new RepositoryTaskData(new MockAttributeFactory(), - MockRepositoryConnector.REPOSITORY_KIND, MockRepositoryConnector.REPOSITORY_URL, "1"); - - RepositoryTaskAttribute attrib1 = new RepositoryTaskAttribute("key", "name", false); - attrib1.putMetaDataValue("key1", "value1"); - attrib1.putMetaDataValue("key2", "value2"); - taskData.addAttribute("key", attrib1); - - assertNotNull(taskData.getAttribute("key")); - - offlineTaskDataManager.setNewTaskData(taskData); - - taskData = new RepositoryTaskData(new MockAttributeFactory(), MockRepositoryConnector.REPOSITORY_KIND, - MockRepositoryConnector.REPOSITORY_URL, "2"); - - RepositoryTaskAttribute attrib2 = new RepositoryTaskAttribute("key", "name", false); - attrib2.putMetaDataValue("key3", "value3"); - attrib2.putMetaDataValue("key4", "value4"); - taskData.addAttribute("key", attrib2); - - assertNotNull(taskData.getAttribute("key")); - - offlineTaskDataManager.setNewTaskData(taskData); - - RepositoryTaskData loaded = offlineTaskDataManager.getNewTaskData(MockRepositoryConnector.REPOSITORY_URL, "1"); - assertNotNull(loaded); - RepositoryTaskAttribute atr = loaded.getAttribute("key"); - assertNotNull(atr); - assertEquals("value1", atr.getMetaDataValue("key1")); - assertEquals("value2", atr.getMetaDataValue("key2")); - - loaded = offlineTaskDataManager.getNewTaskData(MockRepositoryConnector.REPOSITORY_URL, "2"); - assertNotNull(loaded); - atr = loaded.getAttribute("key"); - assertNotNull(atr); - - assertEquals("value3", atr.getMetaDataValue("key3")); - assertEquals("value4", atr.getMetaDataValue("key4")); - - offlineTaskDataManager.saveNow(); - offlineTaskDataManager.remove(MockRepositoryConnector.REPOSITORY_URL, "1"); - offlineTaskDataManager.remove(MockRepositoryConnector.REPOSITORY_URL, "2"); - - assertNull(offlineTaskDataManager.getNewTaskData(MockRepositoryConnector.REPOSITORY_URL, "1")); - assertNull(offlineTaskDataManager.getNewTaskData(MockRepositoryConnector.REPOSITORY_URL, "2")); - - } - - public void testGetNextOfflineBugId() throws IOException, ClassNotFoundException { - assertEquals("1", offlineTaskDataManager.getNewRepositoryTaskId()); - assertEquals("2", offlineTaskDataManager.getNewRepositoryTaskId()); - offlineTaskDataManager.saveNow(); - offlineTaskDataManager.clear(); // currently resets new task id - assertEquals("1", offlineTaskDataManager.getNewRepositoryTaskId()); - } - -// public void testGetTaskData() throws CoreException, IOException, ClassNotFoundException { -// RepositoryTaskData taskData = new RepositoryTaskData(new MockAttributeFactory(), -// MockRepositoryConnector.REPOSITORY_KIND, MockRepositoryConnector.REPOSITORY_URL, "1"); -// taskData.setNewComment("version 1"); -// offlineTaskDataManager.setNewTaskData(RepositoryTaskHandleUtil.getHandle(MockRepositoryConnector.REPOSITORY_URL, "1"), -// taskData); -// offlineTaskDataManager.setOldTaskData(RepositoryTaskHandleUtil.getHandle(MockRepositoryConnector.REPOSITORY_URL, "1"), -// taskData); -// assertNotNull(offlineTaskDataManager.getNewTaskData(RepositoryTaskHandleUtil.getHandle( -// MockRepositoryConnector.REPOSITORY_URL, "1"))); -// taskData = new RepositoryTaskData(new MockAttributeFactory(), MockRepositoryConnector.REPOSITORY_KIND, -// MockRepositoryConnector.REPOSITORY_URL, "1"); -// taskData.setNewComment("version 2"); -// offlineTaskDataManager.setNewTaskData(RepositoryTaskHandleUtil.getHandle(MockRepositoryConnector.REPOSITORY_URL, "1"), -// taskData); -// -// offlineTaskDataManager.saveNow(); -// offlineTaskDataManager.clear(); -// offlineTaskDataManager.readOfflineData(); -// assertEquals("version 2", offlineTaskDataManager.getNewTaskData( -// RepositoryTaskHandleUtil.getHandle(MockRepositoryConnector.REPOSITORY_URL, "1")).getNewComment()); -// assertEquals("version 1", offlineTaskDataManager.getOldTaskData(MockRepositoryConnector.REPOSITORY_URL, "1").getNewComment()); -// } - - public void testUniqueCopy() throws Exception { - RepositoryTaskData taskData = new RepositoryTaskData(new MockAttributeFactory(), - MockRepositoryConnector.REPOSITORY_KIND, MockRepositoryConnector.REPOSITORY_URL, "1"); - offlineTaskDataManager.setNewTaskData(taskData); - RepositoryTaskData taskData2 = offlineTaskDataManager.getEditableCopy(MockRepositoryConnector.REPOSITORY_URL, - "1"); - assertNotNull(taskData2); - taskData2.setNewComment("test"); - taskData = null; - taskData = offlineTaskDataManager.getNewTaskData(MockRepositoryConnector.REPOSITORY_URL, "1"); - assertFalse(taskData.getNewComment().equals("test")); -// taskData = null; -// taskData = offlineTaskDataManager.getOldTaskData(RepositoryTaskHandleUtil.getHandle( -// MockRepositoryConnector.REPOSITORY_URL, "1")); -// assertFalse(taskData.getNewComment().equals("test")); - } - - public void testRemoveRepositoryTaskData() throws CoreException, IOException, ClassNotFoundException { - RepositoryTaskData taskData = new RepositoryTaskData(new MockAttributeFactory(), - MockRepositoryConnector.REPOSITORY_KIND, MockRepositoryConnector.REPOSITORY_URL, "1"); - offlineTaskDataManager.setNewTaskData(taskData); - taskData = new RepositoryTaskData(new MockAttributeFactory(), MockRepositoryConnector.REPOSITORY_KIND, - MockRepositoryConnector.REPOSITORY_URL, "2"); - offlineTaskDataManager.setNewTaskData(taskData); - offlineTaskDataManager.saveNow(); - assertNotNull(offlineTaskDataManager.getNewTaskData(MockRepositoryConnector.REPOSITORY_URL, "1")); - assertNotNull(offlineTaskDataManager.getNewTaskData(MockRepositoryConnector.REPOSITORY_URL, "2")); - offlineTaskDataManager.remove(MockRepositoryConnector.REPOSITORY_URL, "2"); - assertNotNull(offlineTaskDataManager.getNewTaskData(MockRepositoryConnector.REPOSITORY_URL, "1")); - assertNull(offlineTaskDataManager.getNewTaskData(MockRepositoryConnector.REPOSITORY_URL, "2")); - offlineTaskDataManager.saveNow(); - offlineTaskDataManager.clear(); - assertNull(offlineTaskDataManager.getNewTaskData(MockRepositoryConnector.REPOSITORY_URL, "1")); - assertNull(offlineTaskDataManager.getNewTaskData(MockRepositoryConnector.REPOSITORY_URL, "2")); - } - - public void testEditing() { - RepositoryTaskData taskData = new RepositoryTaskData(new MockAttributeFactory(), - MockRepositoryConnector.REPOSITORY_KIND, MockRepositoryConnector.REPOSITORY_URL, "1"); - offlineTaskDataManager.setNewTaskData(taskData); - - assertNotNull(offlineTaskDataManager.getNewTaskData(MockRepositoryConnector.REPOSITORY_URL, "1")); -// assertNotNull(offlineTaskDataManager.getOldTaskData(RepositoryTaskHandleUtil.getHandle( -// MockRepositoryConnector.REPOSITORY_URL, "1"))); - - RepositoryTaskData editData = offlineTaskDataManager.getEditableCopy(MockRepositoryConnector.REPOSITORY_URL, - "1"); - assertNotNull(editData); - editData.setAttributeFactory(new MockAttributeFactory()); - editData.setAttributeValue(RepositoryTaskAttribute.COMMENT_NEW, "new comment"); - // for (RepositoryTaskAttribute attribute: editData.getAttributes()) { - // assertTrue(taskData.getAttribute(attribute.getID()).equals(attribute)); - // } - - Set attSave = new HashSet(); - attSave.add(editData.getAttribute(RepositoryTaskAttribute.COMMENT_NEW)); - offlineTaskDataManager.saveEdits(MockRepositoryConnector.REPOSITORY_URL, "1", attSave); - - editData = null; - editData = offlineTaskDataManager.getEditableCopy(MockRepositoryConnector.REPOSITORY_URL, "1"); - assertNotNull(editData); - assertEquals("new comment", editData.getAttributeValue(RepositoryTaskAttribute.COMMENT_NEW)); - - } - - // /** DND - // * As is will write 81481326 bytes. - // * - // * @throws Exception - // */ - // public void testLargeDataSet() throws Exception { - // RepositoryTaskData taskData; - // for (int x = 1; x < 500; x++) { - // taskData = new RepositoryTaskData(new MockAttributeFactory(), - // MockRepositoryConnector.REPOSITORY_KIND, - // MockRepositoryConnector.REPOSITORY_URL, "" + x); - // - // for (int y = 1; y < 60; y++) { - // RepositoryTaskAttribute attribute = new RepositoryTaskAttribute("" + y, - // "" + y, false); - // for (int z = 1; z < 10; z++) { - // attribute.addOption("" + z, "" + z); - // attribute.addValue("" + z); - // } - // taskData.addAttribute("" + y, attribute); - // } - // - // for (int y = 1; y < 5; y++) { - // RepositoryOperation op = new RepositoryOperation("" + y, "" + y); - // taskData.addOperation(op); - // } - // - // try { - // for (int y = 1; y < 1000; y++) { - // TaskComment comment = new TaskComment(new MockAttributeFactory(), y); - // comment.setAttributeValue(RepositoryTaskAttribute.COMMENT_TEXT, "Testing - // \u05D0"); - // taskData.addComment(comment); - // } - // } catch (StackOverflowError e) { - // e.printStackTrace(); - // } - // - // // for(int y = 1; y < 1000; y++) { - // // RepositoryAttachment attachment = new - // // RepositoryAttachment(repository, new MockAttributeFactory()); - // // taskData.addAttachment(attachment); - // // } - // - // offlineTaskDataManager.put(taskData); - // offlineTaskDataManager.put(taskData); - // } - // offlineTaskDataManager.save(); - // File file = - // TasksUiPlugin.getDefault().getOfflineReportsFilePath().toFile(); - // offlineTaskDataManager.clear(); - // offlineTaskDataManager.readOfflineData(); - // assertNotNull(offlineTaskDataManager.getOldTaskData(AbstractTask.getHandle( - // MockRepositoryConnector.REPOSITORY_URL, 400))); - // } -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskHistoryTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskHistoryTest.java deleted file mode 100644 index d5884a1c1..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskHistoryTest.java +++ /dev/null @@ -1,242 +0,0 @@ -/******************************************************************************* - * 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.tasks.tests; - -import java.util.List; - -import junit.framework.TestCase; - -import org.eclipse.mylyn.context.core.ContextCorePlugin; -import org.eclipse.mylyn.internal.tasks.ui.actions.ActivateTaskHistoryDropDownAction; -import org.eclipse.mylyn.internal.tasks.ui.actions.TaskActivateAction; -import org.eclipse.mylyn.internal.tasks.ui.actions.TaskDeactivateAction; -import org.eclipse.mylyn.internal.tasks.ui.actions.TaskNavigateDropDownAction.TaskNavigateAction; -import org.eclipse.mylyn.internal.tasks.ui.views.TaskActivationHistory; -import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView; -import org.eclipse.mylyn.tasks.core.AbstractTask; -import org.eclipse.mylyn.tasks.ui.TaskListManager; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; - -/** - * @author Wes Coelho - * @author Rob Elves - */ -public class TaskHistoryTest extends TestCase { - - protected TaskListManager manager = TasksUiPlugin.getTaskListManager(); - - protected TaskActivationHistory history; - - protected TaskListView taskView = null; - - protected AbstractTask task1 = null; - - protected AbstractTask task2 = null; - - protected AbstractTask task3 = null; - - protected AbstractTask task4 = null; - - protected AbstractTask task5 = null; - - @Override - protected void setUp() throws Exception { - super.setUp(); - - taskView = TaskListView.openInActivePerspective(); - - resetHistory(); - - task1 = manager.createNewLocalTask("task 1"); - manager.getTaskList().moveToContainer(task1, manager.getTaskList().getDefaultCategory()); - - task2 = manager.createNewLocalTask("task 2"); - manager.getTaskList().moveToContainer(task2, manager.getTaskList().getDefaultCategory()); - - task3 = manager.createNewLocalTask("task 3"); - manager.getTaskList().moveToContainer(task3, manager.getTaskList().getDefaultCategory()); - - task4 = manager.createNewLocalTask("task 4"); - manager.getTaskList().moveToContainer(task4, manager.getTaskList().getDefaultCategory()); - - task5 = manager.createNewLocalTask("task 5"); - manager.getTaskList().moveToContainer(task5, manager.getTaskList().getDefaultCategory()); - - history = manager.getTaskActivationHistory(); - } - - private void resetHistory() { - manager.getTaskActivationHistory().clear(); - ContextCorePlugin.getContextManager().resetActivityHistory(); - } - - /** - * Tests the next task and previous task navigation. - */ - public void testBasicHistoryNavigation() { - (new TaskActivateAction()).run(task1); - history.addTask(task1); - (new TaskActivateAction()).run(task2); - history.addTask(task2); - (new TaskActivateAction()).run(task3); - history.addTask(task3); - - assertTrue(task3.isActive()); - assertFalse(task2.isActive()); - - taskView.getPreviousTaskAction().run(); - assertTrue(task2.isActive()); - - taskView.getPreviousTaskAction().run(); - assertTrue(task1.isActive()); - - taskView.getPreviousTaskAction().run(); - assertTrue(task1.isActive()); - - // taskView.getPreviousTaskAction().run(); - // assertTrue(task1.isActive()); - // - // taskView.getPreviousTaskAction().run(); - // assertTrue(task1.isActive()); - - // taskView.getNextTaskAction().run(); - // assertTrue(task2.isActive()); - // - // taskView.getNextTaskAction().run(); - // assertTrue(task3.isActive()); - // - // taskView.getNextTaskAction().run(); - // assertTrue(task3.isActive()); - // - // taskView.getPreviousTaskAction().run(); - // assertTrue(task2.isActive()); - // - // taskView.getNextTaskAction().run(); - // assertTrue(task3.isActive()); - // - // (new TaskActivateAction()).run(task4); - // history.addTask(task4); // Simulate clicking on it rather - // // than navigating next or previous - // assertTrue(task4.isActive()); - // - // taskView.getNextTaskAction().run(); - // assertTrue(task4.isActive()); - // - // taskView.getPreviousTaskAction().run(); - // assertTrue(task3.isActive()); - // - // taskView.getNextTaskAction().run(); - // assertTrue(task4.isActive()); - - } - - /** - * Tests navigation to previous/next tasks that are chosen from a list rather than being sequentially navigated - */ - public void testArbitraryHistoryNavigation() { - - resetHistory(); - - // Simulate activating the tasks by clicking rather than - // navigating previous/next - (new TaskActivateAction()).run(task1); - history.addTask(task1); - (new TaskActivateAction()).run(task2); - history.addTask(task2); - (new TaskActivateAction()).run(task3); - history.addTask(task3); - (new TaskActivateAction()).run(task4); - history.addTask(task4); - - assertTrue(task4.isActive()); - //TaskActivationHistory taskHistory = taskView.getTaskActivationHistory(); - List prevHistoryList = history.getPreviousTasks(); - - // Check that the previous history list looks right - assertTrue(prevHistoryList.size() >= 3); - assertTrue(prevHistoryList.get(prevHistoryList.size() - 2) == task3); - assertTrue(prevHistoryList.get(prevHistoryList.size() - 3) == task2); - assertTrue(prevHistoryList.get(prevHistoryList.size() - 4) == task1); - - // Get a task from the list and activate it - ActivateTaskHistoryDropDownAction prevAction = new ActivateTaskHistoryDropDownAction(history, false); - TaskNavigateAction navigateAction = prevAction.new TaskNavigateAction(task2); - navigateAction.run(); - assertTrue(task2.isActive()); - - // Now check that the next and prev lists look right - prevHistoryList = history.getPreviousTasks(); - assertTrue(prevHistoryList.get(prevHistoryList.size() - 1) == task2); - assertTrue(prevHistoryList.get(prevHistoryList.size() - 2) == task4); - assertTrue(prevHistoryList.get(prevHistoryList.size() - 3) == task3); - assertTrue(prevHistoryList.get(prevHistoryList.size() - 4) == task1); - - // Activation of task outside of history navigation tool - history.addTask(task3); - prevHistoryList = history.getPreviousTasks(); - assertTrue(prevHistoryList.get(prevHistoryList.size() - 1) == task3); - assertTrue(prevHistoryList.get(prevHistoryList.size() - 2) == task2); - assertTrue(prevHistoryList.get(prevHistoryList.size() - 3) == task4); - assertTrue(prevHistoryList.get(prevHistoryList.size() - 4) == task1); - - // Pick a task from drop down history - navigateAction = prevAction.new TaskNavigateAction(task4); - navigateAction.run(); - assertTrue(task4.isActive()); - assertTrue(prevHistoryList.get(prevHistoryList.size() - 1) == task4); - assertTrue(prevHistoryList.get(prevHistoryList.size() - 2) == task3); - assertTrue(prevHistoryList.get(prevHistoryList.size() - 3) == task2); - assertTrue(prevHistoryList.get(prevHistoryList.size() - 4) == task1); - - // Hit previous task button - taskView.getPreviousTaskAction().run(); - assertTrue(task3.isActive()); - assertTrue(prevHistoryList.get(prevHistoryList.size() - 1) == task4); - assertTrue(prevHistoryList.get(prevHistoryList.size() - 2) == task3); - assertTrue(prevHistoryList.get(prevHistoryList.size() - 3) == task2); - assertTrue(prevHistoryList.get(prevHistoryList.size() - 4) == task1); - - (new TaskDeactivateAction()).run(task3); - - // List nextHistoryList = taskHistory.getNextTasks(); - // assertTrue(nextHistoryList.get(0) == task3); - // assertTrue(nextHistoryList.get(1) == task4); - // - // // Navigate to a next item - // NextTaskDropDownAction nextAction = new - // NextTaskDropDownAction(taskView, taskHistory); - // navigateAction = nextAction.new TaskNavigateAction(task4); - // navigateAction.run(); - // taskHistory.navigatedToTask(task4); - // - // assertTrue(task4.isActive()); - // - // // Check that the prev and next lists look right - // nextHistoryList = taskHistory.getNextTasks(); - // prevHistoryList = taskHistory.getPreviousTasks(); - // assertTrue(nextHistoryList.size() == 0); - // assertTrue(prevHistoryList.get(prevHistoryList.size() - 1) == task3); - // assertTrue(prevHistoryList.get(prevHistoryList.size() - 2) == task2); - // assertTrue(prevHistoryList.get(prevHistoryList.size() - 3) == task1); - // - // // Check that a deactivated task appears first on the history list - // (new TaskActivateAction()).run(task5); - // (new TaskDeactivateAction()).run(task5); - // taskView.addTaskToHistory(task5); - // prevHistoryList = taskHistory.getPreviousTasks(); - // assertTrue(prevHistoryList.get(prevHistoryList.size() - 1) == task5); - - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - } - -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskKeyComparatorTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskKeyComparatorTest.java deleted file mode 100644 index ee7be632d..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskKeyComparatorTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * 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.tasks.tests; - -import java.util.Arrays; - -import junit.framework.TestCase; - -import org.eclipse.mylyn.internal.tasks.ui.views.TaskKeyComparator; - -/** - * @author Eugene Kuleshov https://bugs.eclipse.org/bugs/show_bug.cgi?taskId=129511 - * @author Mik Kersten - */ -public class TaskKeyComparatorTest extends TestCase { - - public void testPatterns() { - comparisonCheck("", new String[] { null, null, "" }); - comparisonCheck(" ", new String[] { null, null, " " }); - comparisonCheck("aa", new String[] { null, null, "aa" }); - comparisonCheck("11", new String[] { "", "11", "" }); - comparisonCheck("11 aa", new String[] { "", "11", " aa" }); - comparisonCheck(" 11 aa", new String[] { null, null, " 11 aa" }); - comparisonCheck("aa11 bb", new String[] { "aa", "11", " bb" }); - comparisonCheck("aa-11 bb", new String[] { "aa-", "11", " bb" }); - comparisonCheck("aa 11 bb", new String[] { null, null, "aa 11 bb" }); - comparisonCheck("aa bb 11 cc", new String[] { null, null, "aa bb 11 cc" }); - - comparisonCheck("aa", "aa", 0); - comparisonCheck("aa", "bb", -1); - comparisonCheck("bb", "aa", 1); - - comparisonCheck("aa11", "aa11", 0); - comparisonCheck("aa11", "aa12", -1); - comparisonCheck("aa12", "aa11", 1); - - comparisonCheck("aa1", "aa11", -1); - comparisonCheck("aa1", "aa2", -1); - comparisonCheck("aa1", "aa21", -1); - - comparisonCheck("aa1 aaa", "aa1 aaa", 0); - comparisonCheck("aa1 aaa", "aa1 bbb", -1); - comparisonCheck("aa1 bbb", "aa11 aaa", -1); - } - - private void comparisonCheck(String s, String[] exptecation) { - String[] res = new TaskKeyComparator().split(s); - assertTrue("Invalid " + Arrays.asList(res) + " " + Arrays.asList(exptecation), Arrays.equals(res, exptecation)); - } - - public void comparisonCheck(String s1, String s2, int n) { - assertEquals(n, new TaskKeyComparator().compare(s1, s2)); - } - -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskList06DataMigrationTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskList06DataMigrationTest.java deleted file mode 100644 index 4f62d4f7a..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskList06DataMigrationTest.java +++ /dev/null @@ -1,323 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 - 2006 Mylar 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.tasks.tests; - -import java.io.File; -import java.lang.reflect.InvocationTargetException; -import java.net.URLEncoder; -import java.util.ArrayList; - -import junit.framework.TestCase; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.jface.operation.IRunnableWithProgress; -import org.eclipse.mylyn.internal.context.core.InteractionContextManager; -import org.eclipse.mylyn.internal.monitor.core.util.ZipFileUtil; -import org.eclipse.mylyn.internal.tasks.ui.ITasksUiConstants; -import org.eclipse.mylyn.internal.tasks.ui.WorkspaceAwareContextStore; -import org.eclipse.mylyn.monitor.core.StatusHandler; -import org.eclipse.mylyn.tasks.core.TaskRepositoryManager; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; - -/** - * Tests unused code that was live up to Mylar 1.0.1, {@link TasksUiPlugin} - * - * @author Rob Elves - */ -public class TaskList06DataMigrationTest extends TestCase { - - private String sourceDir = "testdata/tasklistdatamigrationtest"; - - private File sourceDirFile; - - private TaskListDataMigration migrator; - - @Override - protected void setUp() throws Exception { - super.setUp(); - sourceDirFile = TaskTestUtil.getLocalFile(sourceDir); - assertNotNull(sourceDirFile); - deleteAllFiles(sourceDirFile); - migrator = new TaskListDataMigration(sourceDirFile); - assertTrue(sourceDirFile.exists()); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - deleteAllFiles(sourceDirFile); - } - - public void testOldTasklistMigration() throws Exception { - File oldTasklistFile = new File(sourceDirFile, "tasklist.xml"); - oldTasklistFile.createNewFile(); - assertTrue(new File(sourceDirFile, "tasklist.xml").exists()); - assertTrue(!new File(sourceDirFile, "tasklist.xml.zip").exists()); - assertTrue(migrator.migrateTaskList(new NullProgressMonitor())); - assertFalse(new File(sourceDirFile, "tasklist.xml").exists()); - assertFalse(!new File(sourceDirFile, "tasklist.xml.zip").exists()); - } - - public void testOldRepositoriesMigration() throws Exception { - File oldRepositoriesFile = new File(sourceDirFile, "repositories.xml"); - oldRepositoriesFile.createNewFile(); - assertTrue(new File(sourceDirFile, "repositories.xml").exists()); - assertTrue(!new File(sourceDirFile, "repositories.xml.zip").exists()); - assertTrue(migrator.migrateRepositoriesData(new NullProgressMonitor())); - assertFalse(new File(sourceDirFile, "repositories.xml").exists()); - assertTrue(new File(sourceDirFile, "repositories.xml.zip").exists()); - } - - public void testOldContextMigration() throws Exception { - String contextFileName1 = URLEncoder.encode("http://oldcontext1.xml", - InteractionContextManager.CONTEXT_FILENAME_ENCODING); - String contextFileName2 = URLEncoder.encode("http://oldcontext2.xml", - InteractionContextManager.CONTEXT_FILENAME_ENCODING); - String contextFileName3 = "task-1.xml"; - File oldContextFile1 = new File(sourceDirFile, contextFileName1); - oldContextFile1.createNewFile(); - File oldContextFile2 = new File(sourceDirFile, contextFileName2); - oldContextFile2.createNewFile(); - File oldContextFile3 = new File(sourceDirFile, contextFileName3); - oldContextFile3.createNewFile(); - File contextFolder = new File(sourceDirFile, WorkspaceAwareContextStore.CONTEXTS_DIRECTORY); - assertTrue(!contextFolder.exists()); - assertTrue(migrator.migrateTaskContextData(new NullProgressMonitor())); - assertFalse(oldContextFile1.exists()); - assertFalse(oldContextFile2.exists()); - assertFalse(oldContextFile3.exists()); - assertTrue(contextFolder.exists()); - assertTrue(new File(contextFolder, contextFileName1 + ".zip").exists()); - assertTrue(new File(contextFolder, contextFileName2 + ".zip").exists()); - assertTrue(new File(contextFolder, contextFileName3 + ".zip").exists()); - } - - public void testOldActivityMigration() throws Exception { - File oldActivityFile = new File(sourceDirFile, InteractionContextManager.OLD_CONTEXT_HISTORY_FILE_NAME - + InteractionContextManager.CONTEXT_FILE_EXTENSION_OLD); - oldActivityFile.createNewFile(); - File contextFolder = new File(sourceDirFile, WorkspaceAwareContextStore.CONTEXTS_DIRECTORY); - assertTrue(!contextFolder.exists()); - assertTrue(migrator.migrateActivityData(new NullProgressMonitor())); - assertFalse(oldActivityFile.exists()); - assertTrue(contextFolder.exists()); - assertTrue(new File(contextFolder, InteractionContextManager.CONTEXT_HISTORY_FILE_NAME - + InteractionContextManager.CONTEXT_FILE_EXTENSION).exists()); - } - - private void deleteAllFiles(File folder) { - for (File file : folder.listFiles()) { - if (file.isDirectory()) { - if (!file.getName().equals("CVS")) { - deleteAllFiles(file); - file.delete(); - } - } else if (!file.getName().equals("empty.txt")) { - file.delete(); - } - } - } -} - -class TaskListDataMigration implements IRunnableWithProgress { - - private File dataDirectory = null; - - public TaskListDataMigration(File sourceFolder) { - this.dataDirectory = sourceFolder; - } - - public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { - try { - monitor.beginTask("Task Data Migration", IProgressMonitor.UNKNOWN); - doMigration(monitor); - } finally { - - } - } - - public void doMigration(IProgressMonitor monitor) { - try { - if (dataDirectory == null || !dataDirectory.exists()) - return; - monitor.beginTask("Mylar Data Migration", 4); - migrateTaskList(new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN)); - monitor.worked(1); - migrateRepositoriesData(new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN)); - monitor.worked(1); - migrateTaskContextData(new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN)); - monitor.worked(1); - migrateActivityData(new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN)); - monitor.worked(1); - } finally { - monitor.done(); - } - } - - public boolean migrateTaskList(IProgressMonitor monitor) { - File oldTasklistFile = new File(dataDirectory, ITasksUiConstants.OLD_TASK_LIST_FILE); - File newTasklistFile = new File(dataDirectory, ITasksUiConstants.DEFAULT_TASK_LIST_FILE); - if (!oldTasklistFile.exists()) - return false; - if (newTasklistFile.exists()) { - if (!newTasklistFile.delete()) { - StatusHandler.fail(null, "Could not overwrite tasklist", false); - return false; - } - } - ArrayList filesToZip = new ArrayList(); - filesToZip.add(oldTasklistFile); - try { - monitor.beginTask("Migrate Tasklist Data", 1); - ZipFileUtil.createZipFile(newTasklistFile, filesToZip, new SubProgressMonitor(monitor, 1)); - if (!oldTasklistFile.delete()) { - StatusHandler.fail(null, "Could not remove old tasklist.", false); - return false; - } - monitor.worked(1); - } catch (Exception e) { - StatusHandler.fail(e, "Error occurred while migrating old tasklist: " + e.getMessage(), true); - return false; - } finally { - monitor.done(); - } - return true; - } - - public boolean migrateRepositoriesData(IProgressMonitor monitor) { - File oldRepositoriesFile = new File(dataDirectory, TaskRepositoryManager.OLD_REPOSITORIES_FILE); - File newRepositoriesFile = new File(dataDirectory, TaskRepositoryManager.DEFAULT_REPOSITORIES_FILE); - if (!oldRepositoriesFile.exists()) - return false; - if (newRepositoriesFile.exists()) { - if (!newRepositoriesFile.delete()) { - StatusHandler.fail(null, - "Could not overwrite repositories file. Check read/write permission on data directory.", false); - return false; - } - } - ArrayList filesToZip = new ArrayList(); - filesToZip.add(oldRepositoriesFile); - try { - monitor.beginTask("Migrate Repository Data", 1); - ZipFileUtil.createZipFile(newRepositoriesFile, filesToZip, new SubProgressMonitor(monitor, 1)); - if (!oldRepositoriesFile.delete()) { - StatusHandler.fail(null, - "Could not remove old repositories file. Check read/write permission on data directory.", false); - return false; - } - monitor.worked(1); - } catch (Exception e) { - StatusHandler.fail(e, "Error occurred while migrating old repositories data: " + e.getMessage(), true); - return false; - } finally { - monitor.done(); - } - return true; - } - - public boolean migrateTaskContextData(IProgressMonitor monitor) { - ArrayList contextFiles = new ArrayList(); - for (File file : dataDirectory.listFiles()) { - if (file.getName().startsWith("http") || file.getName().startsWith("local") - || file.getName().startsWith("task")) { - if (!file.getName().endsWith(".zip")) { - contextFiles.add(file); - } - } - } - - try { - monitor.beginTask("Task Context Migration", contextFiles.size()); - - File contextsFolder = new File(dataDirectory, WorkspaceAwareContextStore.CONTEXTS_DIRECTORY); - if (!contextsFolder.exists()) { - if (!contextsFolder.mkdir()) { - StatusHandler.fail(null, - "Could not create contexts folder. Check read/write permission on data directory.", false); - return false; - } - } - for (File file : contextFiles) { - ArrayList filesToZip = new ArrayList(); - filesToZip.add(file); - File newContextFile = new File(contextsFolder, file.getName() + ".zip"); - if (newContextFile.exists()) { - if (!newContextFile.delete()) { - StatusHandler.fail(null, - "Could not overwrite context file. Check read/write permission on data directory.", - false); - return false; - } - } - ZipFileUtil.createZipFile(newContextFile, filesToZip, new SubProgressMonitor(monitor, 1)); - if (!file.delete()) { - StatusHandler.fail(null, - "Could not remove old context file. Check read/write permission on data directory.", false); - return false; - } - monitor.worked(1); - } - } catch (Exception e) { - StatusHandler.fail(e, "Error occurred while migrating old repositories data: " + e.getMessage(), true); - return false; - } finally { - monitor.done(); - } - return true; - } - - public boolean migrateActivityData(IProgressMonitor monitor) { - File oldActivityFile = new File(dataDirectory, InteractionContextManager.OLD_CONTEXT_HISTORY_FILE_NAME - + InteractionContextManager.CONTEXT_FILE_EXTENSION_OLD); - if (!oldActivityFile.exists()) - return false; - - File contextsFolder = new File(dataDirectory, WorkspaceAwareContextStore.CONTEXTS_DIRECTORY); - if (!contextsFolder.exists()) { - if (!contextsFolder.mkdir()) { - StatusHandler.fail(null, - "Could not create contexts folder. Check read/write permission on data directory.", false); - return false; - } - } - - File newActivityFile = new File(contextsFolder, InteractionContextManager.CONTEXT_HISTORY_FILE_NAME - + InteractionContextManager.CONTEXT_FILE_EXTENSION); - - if (newActivityFile.exists()) { - if (!newActivityFile.delete()) { - StatusHandler.fail(null, - "Could not overwrite activity file. Check read/write permission on data directory.", false); - return false; - } - } - ArrayList filesToZip = new ArrayList(); - filesToZip.add(oldActivityFile); - try { - monitor.beginTask("Migrate Activity Data", 1); - ZipFileUtil.createZipFile(newActivityFile, filesToZip, new SubProgressMonitor(monitor, 1)); - if (!oldActivityFile.delete()) { - StatusHandler.fail(null, - "Could not remove old activity file. Check read/write permission on data directory.", false); - return false; - } - monitor.worked(1); - } catch (Exception e) { - StatusHandler.fail(e, "Error occurred while migrating old activity data: " + e.getMessage(), true); - return false; - } finally { - monitor.done(); - } - return true; - } - -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListBackupManagerTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListBackupManagerTest.java deleted file mode 100644 index 1a793f486..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListBackupManagerTest.java +++ /dev/null @@ -1,97 +0,0 @@ -/******************************************************************************* - * 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.tasks.tests; - -import java.io.File; -import java.io.IOException; -import java.lang.reflect.InvocationTargetException; - -import junit.framework.TestCase; - -import org.eclipse.mylyn.internal.tasks.core.LocalTask; -import org.eclipse.mylyn.internal.tasks.ui.TaskListBackupManager; -import org.eclipse.mylyn.internal.tasks.ui.TasksUiPreferenceConstants; -import org.eclipse.mylyn.tasks.core.AbstractTask; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; - -/** - * @author Rob Elves - */ -public class TaskListBackupManagerTest extends TestCase { - - private AbstractTask task1; - - @Override - protected void setUp() throws Exception { - super.setUp(); - task1 = new LocalTask("handle", "label"); - TasksUiPlugin.getTaskListManager().getTaskList().addTask(task1); - TasksUiPlugin.getTaskListManager().activateTask(task1); - TasksUiPlugin.getTaskListManager().deactivateTask(task1); - TasksUiPlugin.getTaskListManager().saveTaskList(); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - // MylarTaskListPlugin.getMylarCorePrefs().setValue(TaskListPreferenceConstants.BACKUP_AUTOMATICALLY, - // false); - } - - public void testAutoBackupDisabled() throws InterruptedException { - TaskListBackupManager backupManager = TasksUiPlugin.getDefault().getBackupManager(); - // MylarTaskListPlugin.getMylarCorePrefs().setValue(TaskListPreferenceConstants.BACKUP_AUTOMATICALLY, - // false); - TasksUiPlugin.getDefault().getPreferenceStore().setValue(TasksUiPreferenceConstants.BACKUP_SCHEDULE, 1); - TasksUiPlugin.getDefault().getPreferenceStore().setValue(TasksUiPreferenceConstants.BACKUP_LAST, 0f); - assertEquals(0, TasksUiPlugin.getDefault().getPreferenceStore().getLong(TasksUiPreferenceConstants.BACKUP_LAST)); - backupManager.start(5); - Thread.sleep(3000); - assertEquals(0, TasksUiPlugin.getDefault().getPreferenceStore().getLong(TasksUiPreferenceConstants.BACKUP_LAST)); - } - - public void testAutoBackupEnabled() throws InterruptedException, InvocationTargetException, IOException { - TaskListBackupManager backupManager = TasksUiPlugin.getDefault().getBackupManager(); - String backupFolder = TasksUiPlugin.getDefault().getBackupFolderPath(); - // String backupFolder = - // MylarTaskListPlugin.getMylarCorePrefs().getDefaultString( - // TaskListPreferenceConstants.BACKUP_FOLDER); - File backupFileFolder = new File(backupFolder); - deleteBackupFolder(backupFileFolder); - // MylarTaskListPlugin.getMylarCorePrefs().setValue(TaskListPreferenceConstants.BACKUP_FOLDER, - // backupFolder); - TasksUiPlugin.getDefault().getPreferenceStore().setValue(TasksUiPreferenceConstants.BACKUP_SCHEDULE, 1); - TasksUiPlugin.getDefault().getPreferenceStore().setValue(TasksUiPreferenceConstants.BACKUP_LAST, 0f); - // MylarTaskListPlugin.getMylarCorePrefs().setValue(TaskListPreferenceConstants.BACKUP_AUTOMATICALLY, - // true); - backupManager.backupNow(true); - assertFalse(TasksUiPlugin.getDefault().getPreferenceStore().getLong(TasksUiPreferenceConstants.BACKUP_LAST) == 0); - assertTrue(backupFileFolder.exists()); - assertTrue(backupFileFolder.isDirectory()); - assertTrue(backupFileFolder.listFiles().length == 1); - - // Test removal of old backups - TasksUiPlugin.getDefault().getPreferenceStore().setValue(TasksUiPreferenceConstants.BACKUP_MAXFILES, 0); - backupManager.removeOldBackups(backupFileFolder); - assertEquals(0, backupFileFolder.listFiles().length); - - // TODO: Test that OLDEST backups are deleted first. - - } - - private void deleteBackupFolder(File backupFileFolder) { - if (backupFileFolder.exists()) { - for (File file : backupFileFolder.listFiles()) { - file.delete(); - } - backupFileFolder.delete(); - } - } - -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListContentProviderTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListContentProviderTest.java deleted file mode 100644 index 6cb4b7e6b..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListContentProviderTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 - 2006 Mylar 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.tasks.tests; - -import junit.framework.TestCase; - -import org.eclipse.mylyn.internal.tasks.core.LocalTask; -import org.eclipse.mylyn.internal.tasks.ui.TasksUiPreferenceConstants; -import org.eclipse.mylyn.internal.tasks.ui.views.TaskListContentProvider; -import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView; -import org.eclipse.mylyn.tasks.core.AbstractTask; -import org.eclipse.mylyn.tasks.core.TaskList; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; - -/** - * @author Felix Schwarz - */ -public class TaskListContentProviderTest extends TestCase { - - private TaskListContentProvider provider; - - private TaskListView view; - - private TaskList taskList; - - @Override - protected void setUp() throws Exception { - super.setUp(); - TaskListView.openInActivePerspective(); - view = TaskListView.getFromActivePerspective(); - provider = (TaskListContentProvider) view.getViewer().getContentProvider(); - TasksUiPlugin.getDefault().getPreferenceStore().setValue(TasksUiPreferenceConstants.FILTER_SUBTASKS, false); - view.clearFilters(true); - view.addFilter(view.getCompleteFilter()); - taskList = TasksUiPlugin.getTaskListManager().getTaskList(); - } - - @Override - protected void tearDown() throws Exception { - view.clearFilters(true); - super.tearDown(); - } - - public void testHasChildren() { - - AbstractTask parent = new LocalTask("parent", "parent label"); - AbstractTask completedChild = new LocalTask("completed child", "completed child label"); - completedChild.setCompleted(true); - taskList.addTask(completedChild, parent); - assertFalse(provider.hasChildren(parent)); - - AbstractTask incompleteChild = new LocalTask("incomplete child", "incomplete child label"); - incompleteChild.setCompleted(false); - taskList.addTask(incompleteChild, parent); - assertTrue(provider.hasChildren(parent)); - } -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListDnDTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListDnDTest.java deleted file mode 100644 index 7c422a8f9..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListDnDTest.java +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* - * 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.tasks.tests; - -import java.util.Set; - -import junit.framework.TestCase; - -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.mylyn.internal.tasks.ui.views.TaskListDropAdapter; -import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView; -import org.eclipse.mylyn.tasks.core.AbstractTask; -import org.eclipse.mylyn.tasks.ui.TaskListManager; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; - -/** - * @author Rob Elves - * @author Mik Kersten - */ -public class TaskListDnDTest extends TestCase { - - private TaskListDropAdapter dropAdapter; - - private TaskListManager manager; - - @Override - protected void setUp() throws Exception { - manager = TasksUiPlugin.getTaskListManager(); - manager.resetTaskList(); - - TreeViewer viewer = TaskListView.getFromActivePerspective().getViewer(); - assertNotNull(viewer); - dropAdapter = new TaskListDropAdapter(viewer); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - manager.resetTaskList(); - manager.saveTaskList(); - assertNull(manager.getTaskList().getActiveTask()); - } - - public void testisUrl() { - String url = "http://eclipse.org"; - String title = "Title"; - String urlData = url + "\n" + title; - assertFalse(dropAdapter.isUrl(title)); - assertTrue(dropAdapter.isUrl(url)); - assertTrue(dropAdapter.isUrl(urlData)); - } - - public void testUrlDrop() { - assertEquals(0, manager.getTaskList().getDefaultCategory().getChildren().size()); - String url = "http://eclipse.org/mylar"; - String title = "Mylar Technology Project"; - String urlData = url + "\n" + title; - - dropAdapter.performDrop(urlData); - Set tasks = manager.getTaskList().getDefaultCategory().getChildren(); - assertNotNull(tasks); - assertEquals(1, tasks.size()); - assertEquals(url, tasks.iterator().next().getUrl()); - - // TODO: Failing due to asynchronous retrieval of title from url - // assertEquals(title, tasks.get(0).getDescription(false)); - } -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java deleted file mode 100644 index 23f2f494a..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java +++ /dev/null @@ -1,918 +0,0 @@ -/******************************************************************************* - * 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.tasks.tests; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Collection; -import java.util.Date; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import junit.framework.TestCase; - -import org.eclipse.mylyn.context.core.ContextCorePlugin; -import org.eclipse.mylyn.internal.tasks.core.LocalTask; -import org.eclipse.mylyn.internal.tasks.core.RepositoryTaskHandleUtil; -import org.eclipse.mylyn.internal.tasks.core.TaskCategory; -import org.eclipse.mylyn.internal.tasks.core.UnfiledCategory; -import org.eclipse.mylyn.internal.tasks.ui.ScheduledTaskListSynchJob; -import org.eclipse.mylyn.internal.tasks.ui.TaskListSynchronizationScheduler; -import org.eclipse.mylyn.internal.tasks.ui.TasksUiPreferenceConstants; -import org.eclipse.mylyn.internal.tasks.ui.actions.MarkTaskReadAction; -import org.eclipse.mylyn.internal.tasks.ui.actions.MarkTaskUnreadAction; -import org.eclipse.mylyn.tasks.core.AbstractRepositoryQuery; -import org.eclipse.mylyn.tasks.core.AbstractTask; -import org.eclipse.mylyn.tasks.core.AbstractTaskCategory; -import org.eclipse.mylyn.tasks.core.AbstractTaskContainer; -import org.eclipse.mylyn.tasks.core.RepositoryTaskData; -import org.eclipse.mylyn.tasks.core.TaskList; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.AbstractTask.RepositoryTaskSyncState; -import org.eclipse.mylyn.tasks.tests.connector.MockAttributeFactory; -import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryConnector; -import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryQuery; -import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryTask; -import org.eclipse.mylyn.tasks.ui.TaskListManager; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; - -/** - * @author Mik Kersten - */ -public class TaskListManagerTest extends TestCase { - - private TaskListManager manager; - - private TaskRepository repository; - - @Override - protected void setUp() throws Exception { - super.setUp(); - manager = TasksUiPlugin.getTaskListManager(); - manager.resetTaskList(); - manager.readExistingOrCreateNewList(); - - repository = new TaskRepository(MockRepositoryConnector.REPOSITORY_KIND, MockRepositoryConnector.REPOSITORY_URL); - TasksUiPlugin.getRepositoryManager().addRepository(repository, - TasksUiPlugin.getDefault().getRepositoriesFilePath()); - - assertEquals(0, manager.getTaskList().getAllTasks().size()); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - manager.resetTaskList(); - TasksUiPlugin.getTaskListManager().saveTaskList(); - TasksUiPlugin.getRepositoryManager().removeRepository(repository, - TasksUiPlugin.getDefault().getRepositoriesFilePath()); - assertEquals(0, manager.getTaskList().getAllTasks().size()); - } - - public void testUniqueTaskID() { - LocalTask task1 = manager.createNewLocalTask("label"); - manager.getTaskList().addTask(task1); - LocalTask task2 = manager.createNewLocalTask("label"); - manager.getTaskList().addTask(task2); - assertEquals(2, manager.getTaskList().getLastLocalTaskId()); - manager.getTaskList().deleteTask(task2); - LocalTask task3 = manager.createNewLocalTask("label"); - manager.getTaskList().addTask(task3); - assertTrue(task3.getHandleIdentifier() + " should end with 3", task3.getHandleIdentifier().endsWith("3")); - assertEquals(3, manager.getTaskList().getLastLocalTaskId()); - - assertEquals(2, manager.getTaskList().getAllTasks().size()); - manager.saveTaskList(); - manager.resetTaskList(); - assertEquals(0, manager.getTaskList().getAllTasks().size()); - assertEquals(0, manager.getTaskList().getLastLocalTaskId()); - manager.readExistingOrCreateNewList(); - assertEquals(2, manager.getTaskList().getAllTasks().size()); - assertEquals(3, manager.getTaskList().getLastLocalTaskId()); - AbstractTask task4 = manager.createNewLocalTask("label"); - assertTrue(task4.getHandleIdentifier() + " should end with 4", task4.getHandleIdentifier().endsWith("4")); - } - - public void testSingleTaskDeletion() { - MockRepositoryTask task = new MockRepositoryTask("1"); - manager.getTaskList().moveToContainer(task, manager.getTaskList().getDefaultCategory()); - assertEquals(1, manager.getTaskList().getAllTasks().size()); - manager.getTaskList().deleteTask(task); - assertEquals(0, manager.getTaskList().getAllTasks().size()); - manager.getTaskList().moveToContainer(task, manager.getTaskList().getDefaultCategory()); - assertEquals(1, manager.getTaskList().getAllTasks().size()); - - manager.saveTaskList(); - - manager.resetTaskList(); - manager.readExistingOrCreateNewList(); - assertEquals(1, manager.getTaskList().getAllTasks().size()); - - manager.getTaskList().deleteTask(task); - assertEquals(0, manager.getTaskList().getAllTasks().size()); - manager.saveTaskList(); - assertEquals(0, manager.getTaskList().getAllTasks().size()); - - manager.resetTaskList(); - manager.readExistingOrCreateNewList(); - assertEquals(0, manager.getTaskList().getAllTasks().size()); - } - - public void testMigrateTaskContextFiles() throws IOException { - File fileA = ContextCorePlugin.getContextManager().getFileForContext("http://a-1"); - fileA.createNewFile(); - fileA.deleteOnExit(); - assertTrue(fileA.exists()); - manager.refactorRepositoryUrl("http://a", "http://b"); - File fileB = ContextCorePlugin.getContextManager().getFileForContext("http://b-1"); - assertTrue(fileB.exists()); - assertFalse(fileA.exists()); - } - - public void testMigrateQueryUrlHandles() { - AbstractRepositoryQuery query = new MockRepositoryQuery("mquery"); - query.setRepositoryUrl("http://foo.bar"); - query.setUrl("http://foo.bar/b"); - manager.getTaskList().addQuery(query); - assertTrue(manager.getTaskList().getRepositoryQueries("http://foo.bar").size() > 0); - manager.refactorRepositoryUrl("http://foo.bar", "http://bar.baz"); - assertTrue(manager.getTaskList().getRepositoryQueries("http://foo.bar").size() == 0); - assertTrue(manager.getTaskList().getRepositoryQueries("http://bar.baz").size() > 0); - AbstractRepositoryQuery changedQuery = manager.getTaskList() - .getRepositoryQueries("http://bar.baz") - .iterator() - .next(); - assertEquals("http://bar.baz/b", changedQuery.getUrl()); - } - - public void testMigrateQueryHandles() { - AbstractRepositoryQuery query = new MockRepositoryQuery("mquery"); - query.setRepositoryUrl("http://a"); - manager.getTaskList().addQuery(query); - manager.refactorRepositoryUrl("http://a", "http://b"); - assertFalse(manager.getTaskList().getRepositoryQueries("http://b").isEmpty()); - assertTrue(manager.getTaskList().getRepositoryQueries("http://a").isEmpty()); - } - -// public void testMigrateQueryHits() { -// AbstractRepositoryQuery query = new MockRepositoryQuery("mquery", -// manager.getTaskList()); -// query.setRepositoryUrl("http://a"); -// manager.getTaskList().addQuery(query); -// AbstractQueryHit hit = new MockQueryHit(manager.getTaskList(), "http://a", -// "", "123"); -// query.addHit(hit); -// manager.refactorRepositoryUrl("http://a", "http://b"); -// assertNotNull(manager.getTaskList().getQueryHit("http://b-123")); -// assertEquals("http://b-123", hit.getHandleIdentifier()); -// } - - public void testMigrateTaskHandles() { - AbstractTask task = new MockRepositoryTask("http://a", "123"); - AbstractTask task2 = new MockRepositoryTask("http://other", "other"); - manager.getTaskList().addTask(task); - manager.getTaskList().addTask(task2); - - RepositoryTaskData taskData = new RepositoryTaskData(new MockAttributeFactory(), task.getConnectorKind(), - task.getRepositoryUrl(), task.getTaskId(), task.getTaskKind()); - TasksUiPlugin.getTaskDataManager().setNewTaskData(taskData); - assertNotNull(TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId())); - - RepositoryTaskData taskData2 = new RepositoryTaskData(new MockAttributeFactory(), task2.getConnectorKind(), - task2.getRepositoryUrl(), task2.getTaskId(), task2.getTaskKind()); - taskData2.setNewComment("TEST"); - TasksUiPlugin.getTaskDataManager().setNewTaskData(taskData2); - assertNotNull(TasksUiPlugin.getTaskDataManager().getNewTaskData(task2.getRepositoryUrl(), task2.getTaskId())); - assertEquals("TEST", TasksUiPlugin.getTaskDataManager().getNewTaskData(task2.getRepositoryUrl(), - task2.getTaskId()).getNewComment()); - - manager.refactorRepositoryUrl("http://a", "http://b"); - assertNull(manager.getTaskList().getTask("http://a-123")); - assertNotNull(manager.getTaskList().getTask("http://b-123")); - assertNotNull(TasksUiPlugin.getTaskDataManager().getNewTaskData("http://b", "123")); - RepositoryTaskData otherData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task2.getRepositoryUrl(), - task2.getTaskId()); - assertNotNull(otherData); - assertEquals("TEST", otherData.getNewComment()); - } - - public void testMigrateTaskHandlesWithExplicitSet() { - AbstractTask task = new MockRepositoryTask("http://a", "123"); - task.setUrl("http://a/task/123"); - manager.getTaskList().addTask(task); - manager.refactorRepositoryUrl("http://a", "http://b"); - assertNull(manager.getTaskList().getTask("http://a-123")); - assertNotNull(manager.getTaskList().getTask("http://b-123")); - assertEquals("http://b/task/123", task.getUrl()); - } - - public void testIsActiveToday() { - AbstractTask task = new LocalTask("1", "task-1"); - assertFalse(manager.isScheduledForToday(task)); - - task.setScheduledForDate(new Date()); - assertTrue(manager.isScheduledForToday(task)); - - task.setReminded(true); - assertTrue(manager.isScheduledForToday(task)); - task.setReminded(true); - - Calendar inAnHour = Calendar.getInstance(); - inAnHour.set(Calendar.HOUR_OF_DAY, inAnHour.get(Calendar.HOUR_OF_DAY) + 1); - inAnHour.getTime(); - task.setScheduledForDate(inAnHour.getTime()); - Calendar tomorrow = Calendar.getInstance(); - manager.snapToNextDay(tomorrow); - assertEquals(-1, inAnHour.compareTo(tomorrow)); - - assertTrue(manager.isScheduledForToday(task)); - } - - public void testScheduledForToday() { - AbstractTask task = new LocalTask("1", "task-1"); - Calendar cal = Calendar.getInstance(); - cal.add(Calendar.MINUTE, 2); - task.setScheduledForDate(cal.getTime()); - assertTrue(manager.isScheduledForToday(task)); - manager.setSecheduledIn(cal, 1); - task.setScheduledForDate(cal.getTime()); - assertFalse(manager.isScheduledForToday(task)); - cal = Calendar.getInstance(); - manager.setScheduledEndOfDay(cal); - task.setScheduledForDate(cal.getTime()); - assertTrue(manager.isScheduledForToday(task)); - } - - public void testSchedulePastEndOfMonth() { - Calendar calendar = Calendar.getInstance(); - calendar.set(Calendar.MONTH, Calendar.SEPTEMBER); - calendar.set(Calendar.DAY_OF_MONTH, 30); - manager.setSecheduledIn(calendar, 1); - assertEquals("Should be October", Calendar.OCTOBER, calendar.get(Calendar.MONTH)); - } - - public void testIsCompletedToday() { - AbstractTask task = new LocalTask("1", "task 1"); - task.setCompleted(true); - task.setCompletionDate(new Date()); - assertTrue(manager.isCompletedToday(task)); - - MockRepositoryTask mockTask = new MockRepositoryTask("1"); - mockTask.setOwner("unknown"); - manager.getTaskList().addTask(mockTask); - mockTask.setCompleted(true); - mockTask.setCompletionDate(new Date()); - assertFalse("completed: " + mockTask.getCompletionDate(), manager.isCompletedToday(mockTask)); - - mockTask = new MockRepositoryTask("2"); - manager.getTaskList().addTask(mockTask); - mockTask.setCompleted(true); - mockTask.setCompletionDate(new Date()); - repository.setAuthenticationCredentials("testUser", "testPassword"); - mockTask.setOwner("testUser"); - assertTrue(manager.isCompletedToday(mockTask)); - - } - - public void testMoveCategories() { - assertEquals(0, manager.getTaskList().getDefaultCategory().getChildren().size()); - AbstractTask task1 = new LocalTask("t1", "t1"); - - TaskCategory cat1 = new TaskCategory("cat1"); - manager.getTaskList().addCategory(cat1); - TaskCategory cat2 = new TaskCategory("cat2"); - manager.getTaskList().addCategory(cat2); - - manager.getTaskList().moveToContainer(task1, cat1); - assertEquals(1, manager.getTaskList().getContainerForHandle("cat1").getChildren().size()); - assertEquals(0, manager.getTaskList().getContainerForHandle("cat2").getChildren().size()); - - manager.getTaskList().moveToContainer(task1, cat2); - assertEquals(0, manager.getTaskList().getContainerForHandle("cat1").getChildren().size()); - assertEquals(1, manager.getTaskList().getContainerForHandle("cat2").getChildren().size()); - } - - public void testMoveToRoot() { - assertEquals(0, manager.getTaskList().getDefaultCategory().getChildren().size()); - AbstractTask task1 = new LocalTask("t1", "t1"); - manager.getTaskList().moveToContainer(task1, manager.getTaskList().getDefaultCategory()); - assertEquals(1, manager.getTaskList().getDefaultCategory().getChildren().size()); - assertEquals(UnfiledCategory.HANDLE, task1.getParentContainers().iterator().next().getHandleIdentifier()); - - TaskCategory cat1 = new TaskCategory("c1"); - manager.getTaskList().addCategory(cat1); - - manager.getTaskList().moveToContainer(task1, cat1); - assertEquals(0, manager.getTaskList().getDefaultCategory().getChildren().size()); - assertEquals(cat1, task1.getParentContainers().iterator().next()); - - manager.getTaskList().moveToContainer(task1, manager.getTaskList().getDefaultCategory()); - assertEquals(1, manager.getTaskList().getDefaultCategory().getChildren().size()); - assertEquals(0, cat1.getChildren().size()); - assertEquals(UnfiledCategory.HANDLE, task1.getParentContainers().iterator().next().getHandleIdentifier()); - } - - public void testEmpty() { - manager.resetTaskList(); - assertTrue(manager.getTaskList().isEmpty()); - manager.getTaskList().internalAddRootTask(new LocalTask("", "")); - assertFalse(manager.getTaskList().isEmpty()); - } - - public void testCategoryPersistance() { - MockRepositoryTask task = new MockRepositoryTask("1"); - TaskCategory category = new TaskCategory("cat"); - manager.getTaskList().addCategory(category); - manager.getTaskList().moveToContainer(task, category); - assertNotNull(manager.getTaskList()); - assertEquals(3, manager.getTaskList().getCategories().size()); - - manager.saveTaskList(); - manager.resetTaskList(); - manager.readExistingOrCreateNewList(); - assertEquals("" + manager.getTaskList().getCategories(), 3, manager.getTaskList().getCategories().size()); - assertEquals(1, manager.getTaskList().getAllTasks().size()); - } - - public void testDeleteCategory() { - assertNotNull(manager.getTaskList()); - assertEquals(2, manager.getTaskList().getCategories().size()); - TaskCategory category = new TaskCategory("cat"); - manager.getTaskList().addCategory(category); - assertEquals(3, manager.getTaskList().getCategories().size()); - manager.getTaskList().deleteCategory(category); - assertEquals(2, manager.getTaskList().getCategories().size()); - } - - public void testDeleteCategoryMovesTasksToRoot() { - AbstractTask task = new MockRepositoryTask("delete"); - TaskCategory category = new TaskCategory("cat"); - manager.getTaskList().addTask(task, category); - manager.getTaskList().addCategory(category); - assertEquals(0, manager.getTaskList().getDefaultCategory().getChildren().size()); - manager.getTaskList().deleteCategory(category); - assertEquals(1, manager.getTaskList().getDefaultCategory().getChildren().size()); - } - - public void testRenameCategory() { - - assertNotNull(manager.getTaskList()); - - TaskCategory category = new TaskCategory("cat"); - manager.getTaskList().addCategory(category); - assertEquals(3, manager.getTaskList().getCategories().size()); - String newDesc = "newDescription"; - manager.getTaskList().renameContainer(category, newDesc); - AbstractTaskCategory container = manager.getTaskList().getContainerForHandle(newDesc); - assertNotNull(container); - assertEquals(newDesc, container.getSummary()); - manager.getTaskList().deleteCategory(container); - assertEquals(2, manager.getTaskList().getCategories().size()); - } - - public void testDeleteCategoryAfterRename() { - String newDesc = "newDescription"; - assertNotNull(manager.getTaskList()); - assertEquals(2, manager.getTaskList().getCategories().size()); - TaskCategory category = new TaskCategory("cat"); - manager.getTaskList().addCategory(category); - assertEquals(3, manager.getTaskList().getCategories().size()); - manager.getTaskList().renameContainer(category, newDesc); - manager.getTaskList().deleteCategory(category); - assertEquals(2, manager.getTaskList().getCategories().size()); - } - - public void testCreateSameCategoryName() { - assertNotNull(manager.getTaskList()); - assertEquals(2, manager.getTaskList().getCategories().size()); - TaskCategory category = new TaskCategory("cat"); - manager.getTaskList().addCategory(category); - assertEquals(3, manager.getTaskList().getCategories().size()); - TaskCategory category2 = new TaskCategory("cat"); - manager.getTaskList().addCategory(category2); - assertEquals(3, manager.getTaskList().getCategories().size()); - AbstractTaskContainer container = manager.getTaskList().getContainerForHandle("cat"); - assertEquals(container, category); - } - - public void testDeleteRootTask() { - AbstractTask task = new LocalTask("1", "label"); - manager.getTaskList().addTask(task); - manager.getTaskList().internalAddRootTask(task); - manager.getTaskList().deleteTask(task); - assertEquals(0, manager.getTaskList().getAllTasks().size()); - assertEquals(0, manager.getTaskList().getDefaultCategory().getChildren().size()); - assertEquals(0, manager.getTaskList().getArchiveContainer().getChildren().size()); - } - - public void testDeleteFromCategory() { - assertEquals(0, manager.getTaskList().getAllTasks().size()); - assertEquals(0, manager.getTaskList().getDefaultCategory().getChildren().size()); - assertEquals(0, manager.getTaskList().getArchiveContainer().getChildren().size()); - assertEquals(2, manager.getTaskList().getCategories().size()); - - AbstractTask task = new LocalTask("1", "label"); - TaskCategory category = new TaskCategory("handleAndDescription"); - manager.getTaskList().addTask(task); - assertEquals(1, manager.getTaskList().getArchiveContainer().getChildren().size()); - - manager.getTaskList().addCategory(category); - manager.getTaskList().moveToContainer(task, category); - assertEquals(3, manager.getTaskList().getCategories().size()); - assertEquals(1, category.getChildren().size()); - assertEquals(0, manager.getTaskList().getArchiveContainer().getChildren().size()); - assertEquals(1, manager.getTaskList().getAllTasks().size()); - assertEquals(0, manager.getTaskList().getDefaultCategory().getChildren().size()); - - manager.getTaskList().deleteTask(task); - assertEquals(0, manager.getTaskList().getAllTasks().size()); - assertEquals(0, manager.getTaskList().getDefaultCategory().getChildren().size()); - assertEquals(0, manager.getTaskList().getArchiveContainer().getChildren().size()); - assertEquals(0, category.getChildren().size()); - } - - public void testDeleteRepositoryTask() { - String repositoryUrl = "http://somewhere.com"; - repository = new TaskRepository(MockRepositoryConnector.REPOSITORY_KIND, repositoryUrl); - TasksUiPlugin.getRepositoryManager().addRepository(repository, - TasksUiPlugin.getDefault().getRepositoriesFilePath()); - MockRepositoryTask task = new MockRepositoryTask(repositoryUrl, "1"); - TaskList taskList = TasksUiPlugin.getTaskListManager().getTaskList(); - taskList.moveToContainer(task, manager.getTaskList().getDefaultCategory()); - MockRepositoryQuery query = new MockRepositoryQuery("query"); - taskList.addQuery(query); - taskList.addTask(task, query); - assertEquals(1, taskList.getAllTasks().size()); - assertEquals(1, taskList.getDefaultCategory().getChildren().size()); - taskList.deleteTask(task); - assertEquals(0, taskList.getAllTasks().size()); - assertEquals(0, taskList.getDefaultCategory().getChildren().size()); - } - - public void testCreate() { - MockRepositoryTask repositoryTask = new MockRepositoryTask("1"); - manager.getTaskList().addTask(repositoryTask, manager.getTaskList().getDefaultCategory()); - assertEquals(1, manager.getTaskList().getDefaultCategory().getChildren().size()); - manager.saveTaskList(); - - manager.resetTaskList(); - manager.readExistingOrCreateNewList(); - assertEquals(1, manager.getTaskList().getAllTasks().size()); - } - - public void testCreateAndMove() { - MockRepositoryTask repositoryTask = new MockRepositoryTask("1"); - repositoryTask.setTaskKind("kind"); - manager.getTaskList().addTask(repositoryTask, manager.getTaskList().getDefaultCategory()); - assertEquals(0, manager.getTaskList().getArchiveContainer().getChildren().size()); - assertEquals(1, manager.getTaskList().getDefaultCategory().getChildren().size()); - manager.saveTaskList(); - - manager.resetTaskList(); - manager.readExistingOrCreateNewList(); - assertEquals(1, manager.getTaskList().getDefaultCategory().getChildren().size()); - assertEquals(0, manager.getTaskList().getArchiveContainer().getChildren().size()); - } - - public void testArchiveRepositoryTaskExternalization() { - MockRepositoryTask repositoryTask = new MockRepositoryTask("1"); - repositoryTask.setTaskKind("kind"); - manager.getTaskList().addTask(repositoryTask); - assertEquals(1, manager.getTaskList().getArchiveContainer().getChildren().size()); - assertEquals(0, manager.getTaskList().getDefaultCategory().getChildren().size()); - manager.saveTaskList(); - - manager.resetTaskList(); - manager.readExistingOrCreateNewList(); - assertEquals(1, manager.getTaskList().getArchiveContainer().getChildren().size()); - assertEquals(0, manager.getTaskList().getDefaultCategory().getChildren().size()); - } - - public void testRepositoryTasksAndCategoriesMultiRead() { - TaskCategory cat1 = new TaskCategory("Category 1"); - manager.getTaskList().addCategory(cat1); - - MockRepositoryTask reportInCat1 = new MockRepositoryTask("123"); - manager.getTaskList().moveToContainer(reportInCat1, cat1); - assertEquals(cat1, reportInCat1.getParentContainers().iterator().next()); - - manager.saveTaskList(); - assertNotNull(manager.getTaskList()); - manager.resetTaskList(); - manager.readExistingOrCreateNewList(); - - // read once - Set readCats = manager.getTaskList().getTaskContainers(); - assertTrue(manager.getTaskList().getCategories().contains(cat1)); - Iterator iterator = readCats.iterator(); - - boolean found = false; - while (iterator.hasNext()) { - AbstractTaskContainer readCat1 = iterator.next(); - if (cat1.equals(readCat1)) { - found = true; - assertEquals(1, readCat1.getChildren().size()); - } - } - if (!found) - fail(" Category not found afer tasklist read"); - - manager.saveTaskList(); - assertNotNull(manager.getTaskList()); - manager.resetTaskList(); - manager.readExistingOrCreateNewList(); - - // read again - readCats = manager.getTaskList().getTaskContainers(); - assertTrue(manager.getTaskList().getCategories().contains(cat1)); - - iterator = readCats.iterator(); - found = false; - while (iterator.hasNext()) { - AbstractTaskContainer readCat1 = iterator.next(); - if (cat1.equals(readCat1)) { - found = true; - assertEquals(1, readCat1.getChildren().size()); - } - } - if (!found) - fail(" Category not found afer tasklist read"); - } - - public void testSubTaskExternalization() { - Set rootTasks = new HashSet(); - AbstractTask task1 = new LocalTask("1", "task1"); - manager.getTaskList().moveToContainer(task1, manager.getTaskList().getDefaultCategory()); - rootTasks.add(task1); - - AbstractTask sub2 = new LocalTask("2", "sub 2"); - manager.getTaskList().addTask(sub2, task1); - assertEquals(1, task1.getChildren().size()); - - manager.saveTaskList(); - assertNotNull(manager.getTaskList()); - manager.resetTaskList(); - manager.readExistingOrCreateNewList(); - - assertNotNull(manager.getTaskList()); - assertTrue(rootTasks.containsAll(manager.getTaskList().getDefaultCategory().getChildren())); - - Set readList = manager.getTaskList().getDefaultCategory().getChildren(); - for (AbstractTask task : readList) { - if (task.equals(task1)) { - assertEquals(task1.getSummary(), task.getSummary()); - assertEquals(1, task.getChildren().size()); - } - } - } - - public void testCreationAndExternalization() { - Set rootTasks = new HashSet(); - AbstractTask task1 = manager.createNewLocalTask("task 1"); - manager.getTaskList().moveToContainer(task1, manager.getTaskList().getDefaultCategory()); - rootTasks.add(task1); - - AbstractTask sub1 = manager.createNewLocalTask("sub 1"); - manager.getTaskList().addTask(sub1, task1); - - manager.getTaskList().moveToContainer(sub1, manager.getTaskList().getArchiveContainer()); - - AbstractTask task2 = manager.createNewLocalTask("task 2"); - manager.getTaskList().moveToContainer(task2, manager.getTaskList().getDefaultCategory()); - rootTasks.add(task2); - - Set categories = new HashSet(); - Set cat1Contents = new HashSet(); - TaskCategory cat1 = new TaskCategory("Category 1"); - manager.getTaskList().addCategory(cat1); - categories.add(cat1); - AbstractTask task3 = manager.createNewLocalTask("task 3"); - manager.getTaskList().moveToContainer(task3, cat1); - cat1Contents.add(task3); - assertEquals(cat1, task3.getParentContainers().iterator().next()); - AbstractTask sub2 = manager.createNewLocalTask("sub 2"); - manager.getTaskList().addTask(sub2, task3); - manager.getTaskList().moveToContainer(sub2, manager.getTaskList().getArchiveContainer()); - - AbstractTask task4 = manager.createNewLocalTask("task 4"); - manager.getTaskList().moveToContainer(task4, cat1); - cat1Contents.add(task4); - - MockRepositoryTask reportInCat1 = new MockRepositoryTask("123"); - manager.getTaskList().moveToContainer(reportInCat1, cat1); - assertEquals(cat1, reportInCat1.getParentContainers().iterator().next()); - cat1Contents.add(reportInCat1); - - MockRepositoryTask reportInRoot = new MockRepositoryTask("124"); - manager.getTaskList().moveToContainer(reportInRoot, manager.getTaskList().getDefaultCategory()); - rootTasks.add(reportInRoot); - - assertEquals(3, manager.getTaskList().getRootElements().size()); - - manager.saveTaskList(); - assertNotNull(manager.getTaskList()); - manager.resetTaskList(); - // manager.getTaskList().clear(); - // TaskList list = new TaskList(); - // manager.setTaskList(list); - manager.readExistingOrCreateNewList(); - - assertNotNull(manager.getTaskList()); - assertTrue(rootTasks.containsAll(manager.getTaskList().getDefaultCategory().getChildren())); - - Set readList = manager.getTaskList().getDefaultCategory().getChildren(); - for (AbstractTask task : readList) { - if (task.equals(task1)) { - assertEquals(task1.getSummary(), task.getSummary()); - assertEquals(1, task.getChildren().size()); - } - if (task.equals(reportInRoot)) { - assertEquals(reportInRoot.getSummary(), task.getSummary()); - } - } - - Set readCats = manager.getTaskList().getTaskContainers(); - assertTrue(manager.getTaskList().getCategories().contains(cat1)); - Iterator iterator = readCats.iterator(); - boolean found = false; - while (iterator.hasNext()) { - AbstractTaskContainer readCat1 = iterator.next(); - if (cat1.equals(readCat1)) { - found = true; - assertEquals(cat1Contents, readCat1.getChildren()); - } - } - if (!found) - fail(" Category not found afer tasklist read"); - } - - public void testExternalizationOfHandlesWithDash() { - Set rootTasks = new HashSet(); - -// String handle = AbstractTask.getHandle("http://url/repo-location", -// 1); - AbstractTask task1 = manager.createNewLocalTask("task 1"); - manager.getTaskList().moveToContainer(task1, manager.getTaskList().getDefaultCategory()); - rootTasks.add(task1); - - manager.saveTaskList(); - assertNotNull(manager.getTaskList()); - manager.resetTaskList(); - assertTrue(manager.readExistingOrCreateNewList()); - - assertNotNull(manager.getTaskList()); - assertEquals(rootTasks, manager.getTaskList().getDefaultCategory().getChildren()); - } - - public void testScheduledRefreshJob() throws InterruptedException { - int counter = 3; - ScheduledTaskListSynchJob.resetCount(); - TasksUiPlugin.getDefault().getPreferenceStore().setValue( - TasksUiPreferenceConstants.REPOSITORY_SYNCH_SCHEDULE_ENABLED, true); - TasksUiPlugin.getDefault().getPreferenceStore().setValue( - TasksUiPreferenceConstants.REPOSITORY_SYNCH_SCHEDULE_MILISECONDS, 1000L); - assertEquals(0, ScheduledTaskListSynchJob.getCount()); - TaskListSynchronizationScheduler manager = new TaskListSynchronizationScheduler(false); - manager.startSynchJob(); - Thread.sleep(3000); - assertTrue(ScheduledTaskListSynchJob.getCount() + " smaller than " + counter, - ScheduledTaskListSynchJob.getCount() >= counter); - manager.cancelAll(); - TasksUiPlugin.getDefault().getPreferenceStore().setValue( - TasksUiPreferenceConstants.REPOSITORY_SYNCH_SCHEDULE_ENABLED, false); - } - - public void testgetQueriesAndHitsForHandle() { - TaskList taskList = manager.getTaskList(); - - MockRepositoryTask hit1 = new MockRepositoryTask("1"); - MockRepositoryTask hit2 = new MockRepositoryTask("2"); - MockRepositoryTask hit3 = new MockRepositoryTask("3"); - - MockRepositoryTask hit1twin = new MockRepositoryTask("1"); - MockRepositoryTask hit2twin = new MockRepositoryTask("2"); - MockRepositoryTask hit3twin = new MockRepositoryTask("3"); - - MockRepositoryQuery query1 = new MockRepositoryQuery("query1"); - MockRepositoryQuery query2 = new MockRepositoryQuery("query2"); - - taskList.addQuery(query1); - taskList.addQuery(query2); - taskList.addTask(hit1, query1); - taskList.addTask(hit2, query1); - taskList.addTask(hit3, query1); - - assertEquals(3, query1.getChildren().size()); - - taskList.addTask(hit1twin, query2); - taskList.addTask(hit2twin, query2); - taskList.addTask(hit3twin, query2); - - assertEquals(3, query2.getChildren().size()); - - Set queriesReturned = taskList.getQueriesForHandle(RepositoryTaskHandleUtil.getHandle( - MockRepositoryConnector.REPOSITORY_URL, "1")); - assertNotNull(queriesReturned); - assertEquals(2, queriesReturned.size()); - assertTrue(queriesReturned.contains(query1)); - assertTrue(queriesReturned.contains(query2)); - - Set handles = new HashSet(); - handles.add(RepositoryTaskHandleUtil.getHandle(MockRepositoryConnector.REPOSITORY_URL, "2")); - Collection hitsReturned = taskList.getTasks(handles); - assertNotNull(hitsReturned); - assertEquals(1, hitsReturned.size()); - assertTrue(hitsReturned.contains(hit2)); - assertTrue(hitsReturned.contains(hit2twin)); - - } - -// public void testQueryHitHasParent() { -// TaskList taskList = manager.getTaskList(); -// -// MockQueryHit hit1 = new MockQueryHit(taskList, -// MockRepositoryConnector.REPOSITORY_URL, "description1", "1"); -// assertNull(hit1.getParent()); -// MockRepositoryQuery query1 = new MockRepositoryQuery("query1", -// manager.getTaskList()); -// query1.addHit(hit1); -// assertEquals(query1, hit1.getParent()); -// -// } - - public void testUpdateQueryHits() { - TaskList taskList = manager.getTaskList(); - - MockRepositoryTask hit1 = new MockRepositoryTask("1"); - MockRepositoryTask hit2 = new MockRepositoryTask("2"); - MockRepositoryTask hit3 = new MockRepositoryTask("3"); - - MockRepositoryTask hit1twin = new MockRepositoryTask("1"); - MockRepositoryTask hit2twin = new MockRepositoryTask("2"); - MockRepositoryTask hit3twin = new MockRepositoryTask("3"); - - MockRepositoryQuery query1 = new MockRepositoryQuery("query1"); - taskList.addQuery(query1); - - taskList.addTask(hit1, query1); - taskList.addTask(hit2, query1); - taskList.addTask(hit3, query1); - - taskList.addTask(hit1twin, query1); - taskList.addTask(hit2twin, query1); - taskList.addTask(hit3twin, query1); - - assertEquals(3, query1.getChildren().size()); - query1.clear(); - assertEquals(0, query1.getChildren().size()); - taskList.addTask(hit1, query1); - taskList.addTask(hit2, query1); - assertEquals(2, query1.getChildren().size()); - hit1.setNotified(true); - - taskList.addTask(hit1twin, query1); - taskList.addTask(hit2twin, query1); - taskList.addTask(hit3twin, query1); - assertEquals(3, query1.getChildren().size()); - assertTrue(query1.getChildren().contains(hit1twin)); - assertTrue(query1.getChildren().contains(hit2twin)); - assertTrue(query1.getChildren().contains(hit3twin)); - for (AbstractTask hit : query1.getChildren()) { - if (hit.equals(hit1twin)) { - assertTrue(hit.isNotified()); - } else { - assertFalse(hit.isNotified()); - } - } - } - - public void testgetRepositoryTasks() { - - String repositoryUrl = "https://bugs.eclipse.org/bugs"; - - String bugNumber = "106939"; - - MockRepositoryTask task1 = new MockRepositoryTask(repositoryUrl, bugNumber); - manager.getTaskList().addTask(task1); - - MockRepositoryTask task2 = new MockRepositoryTask("https://unresolved", bugNumber); - manager.getTaskList().addTask(task2); - - TaskList taskList = manager.getTaskList(); - assertEquals(2, taskList.getAllTasks().size()); - Set tasksReturned = taskList.getRepositoryTasks(repositoryUrl); - assertNotNull(tasksReturned); - assertEquals(1, tasksReturned.size()); - assertTrue(tasksReturned.contains(task1)); - } - - public void testAllTasksDeactivation() { - AbstractTask task1 = new LocalTask("task1", "description1"); - AbstractTask task2 = new LocalTask("task2", "description2"); - TaskList taskList = manager.getTaskList(); - taskList.addTask(task1); - taskList.addTask(task2); - assertNull(taskList.getActiveTask()); - - manager.activateTask(task2); - assertEquals(task2, taskList.getActiveTask()); - - manager.deactivateAllTasks(); - assertNull(taskList.getActiveTask()); - } - - public void testMarkTaskRead() { - String repositoryUrl = "http://mylar.eclipse.org/bugs222"; - MockRepositoryTask task1 = new MockRepositoryTask(repositoryUrl, "1"); - MockRepositoryTask task2 = new MockRepositoryTask(repositoryUrl, "2"); - task1.setSynchronizationState(RepositoryTaskSyncState.INCOMING); - task2.setSynchronizationState(RepositoryTaskSyncState.INCOMING); - List elements = new ArrayList(); - elements.add(task1); - elements.add(task2); - MarkTaskReadAction readAction = new MarkTaskReadAction(elements); - readAction.run(); - assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task1.getSynchronizationState()); - assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task2.getSynchronizationState()); - - manager.getTaskList().reset(); - MockRepositoryTask hit1 = new MockRepositoryTask("1"); - MockRepositoryTask hit2 = new MockRepositoryTask("2"); - MockRepositoryQuery query = new MockRepositoryQuery("summary"); - manager.getTaskList().addQuery(query); - manager.getTaskList().addTask(hit1, query); - manager.getTaskList().addTask(hit2, query); - - elements.clear(); - elements.add(query); - readAction = new MarkTaskReadAction(elements); - readAction.run(); - assertEquals(2, query.getChildren().size()); - for (AbstractTaskContainer element : query.getChildren()) { - if (element instanceof MockRepositoryTask) { - MockRepositoryTask mockTask = (MockRepositoryTask) element; - assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, mockTask.getSynchronizationState()); - } - } - - } - - public void testMarkUnRead() { - String repositoryUrl = "http://mylar.eclipse.org/bugs222"; - MockRepositoryTask task1 = new MockRepositoryTask(repositoryUrl, "1"); - MockRepositoryTask task2 = new MockRepositoryTask(repositoryUrl, "2"); - assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task1.getSynchronizationState()); - assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task2.getSynchronizationState()); - List elements = new ArrayList(); - elements.add(task1); - elements.add(task2); - MarkTaskUnreadAction unreadAction = new MarkTaskUnreadAction(elements); - unreadAction.run(); - assertEquals(RepositoryTaskSyncState.INCOMING, task1.getSynchronizationState()); - assertEquals(RepositoryTaskSyncState.INCOMING, task2.getSynchronizationState()); - - manager.getTaskList().reset(); - MockRepositoryTask hit1 = new MockRepositoryTask("1"); - MockRepositoryTask hit2 = new MockRepositoryTask("2"); - MockRepositoryQuery query = new MockRepositoryQuery("summary"); - manager.getTaskList().addQuery(query); - manager.getTaskList().addTask(hit1, query); - manager.getTaskList().addTask(hit2, query); - - elements.clear(); - elements.add(query); - MarkTaskReadAction readAction = new MarkTaskReadAction(elements); - readAction.run(); - assertEquals(2, query.getChildren().size()); - for (AbstractTaskContainer element : query.getChildren()) { - if (element instanceof MockRepositoryTask) { - MockRepositoryTask mockTask = (MockRepositoryTask) element; - assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, mockTask.getSynchronizationState()); - } else { - fail(); - } - } - - unreadAction = new MarkTaskUnreadAction(elements); - unreadAction.run(); - assertEquals(2, query.getChildren().size()); - for (AbstractTaskContainer element : query.getChildren()) { - if (element instanceof MockRepositoryTask) { - MockRepositoryTask mockTask = (MockRepositoryTask) element; - assertEquals(RepositoryTaskSyncState.INCOMING, mockTask.getSynchronizationState()); - } else { - fail(); - } - } - } -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListTest.java deleted file mode 100644 index c483b3726..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListTest.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 - 2006 Mylar 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.tasks.tests; - -import junit.framework.TestCase; - -import org.eclipse.mylyn.internal.tasks.core.TaskCategory; -import org.eclipse.mylyn.tasks.core.TaskList; - -/** - * @author Mik Kersten - */ -public class TaskListTest extends TestCase { - - public void testGetUserCategories() { - TaskList taskList = new TaskList(); - taskList.addCategory(new TaskCategory("a")); - assertEquals(2, taskList.getUserCategories().size()); - } - -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListUiTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListUiTest.java deleted file mode 100644 index 318216905..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListUiTest.java +++ /dev/null @@ -1,393 +0,0 @@ -/******************************************************************************* - * 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.tasks.tests; - -import java.util.ArrayList; -import java.util.List; -import java.util.Set; -import java.util.Vector; - -import junit.framework.TestCase; - -import org.eclipse.jface.action.IContributionItem; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.mylyn.internal.tasks.core.TaskCategory; -import org.eclipse.mylyn.internal.tasks.ui.MoveToCategoryMenuContributor; -import org.eclipse.mylyn.internal.tasks.ui.TaskPriorityFilter; -import org.eclipse.mylyn.internal.tasks.ui.actions.MarkTaskCompleteAction; -import org.eclipse.mylyn.internal.tasks.ui.actions.NewCategoryAction; -import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView; -import org.eclipse.mylyn.internal.web.tasks.WebTask; -import org.eclipse.mylyn.tasks.core.AbstractTask; -import org.eclipse.mylyn.tasks.core.AbstractTaskContainer; -import org.eclipse.mylyn.tasks.core.ITaskListChangeListener; -import org.eclipse.mylyn.tasks.core.AbstractTask.PriorityLevel; -import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryQuery; -import org.eclipse.mylyn.tasks.ui.TaskListManager; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; -import org.eclipse.mylyn.tasks.ui.TasksUiUtil; -import org.eclipse.swt.widgets.TreeItem; -import org.eclipse.ui.PartInitException; - -/** - * Tests TaskListView's filtering mechanism. - * - * @author Ken Sueda - * - */ -public class TaskListUiTest extends TestCase { - - private TaskListManager manager = null; - - private TaskCategory cat1 = null; - - private AbstractTask cat1task1 = null; - - private AbstractTask cat1task2 = null; - - private AbstractTask cat1task3 = null; - - private AbstractTask cat1task4 = null; - - private AbstractTask cat1task5 = null; - - private AbstractTask cat1task1sub1 = null; - - private TaskCategory cat2 = null; - - private AbstractTask cat2task1 = null; - - private AbstractTask cat2task2 = null; - - private AbstractTask cat2task3 = null; - - private AbstractTask cat2task4 = null; - - private AbstractTask cat2task5 = null; - - private AbstractTask cat2task1sub1 = null; - - private final static int CHECK_COMPLETE_FILTER = 1; - - private final static int CHECK_INCOMPLETE_FILTER = 2; - - private final static int CHECK_PRIORITY_FILTER = 3; - - @Override - public void setUp() throws PartInitException { - try { - TaskListView.openInActivePerspective(); - manager = TasksUiPlugin.getTaskListManager(); - cat1 = new TaskCategory("First Category"); - - cat1task1 = manager.createNewLocalTask("task 1"); - cat1task1.setPriority(PriorityLevel.P1.toString()); - cat1task1.setCompleted(true); - manager.getTaskList().moveToContainer(cat1task1, cat1); - - cat1task1sub1 = manager.createNewLocalTask("sub task 1"); - cat1task1sub1.setPriority(PriorityLevel.P1.toString()); - cat1task1sub1.setCompleted(true); - manager.getTaskList().addTask(cat1task1sub1, cat1task1); - - cat1task2 = manager.createNewLocalTask("task 2"); - cat1task2.setPriority(PriorityLevel.P2.toString()); - cat1task2.addParentContainer(cat1); - manager.getTaskList().moveToContainer(cat1task2, cat1); - - cat1task3 = manager.createNewLocalTask("task 3"); - cat1task3.setPriority(PriorityLevel.P3.toString()); - cat1task3.setCompleted(true); - cat1task3.addParentContainer(cat1); - manager.getTaskList().moveToContainer(cat1task3, cat1); - - cat1task4 = manager.createNewLocalTask("task 4"); - cat1task4.setPriority(PriorityLevel.P4.toString()); - cat1task4.addParentContainer(cat1); - manager.getTaskList().moveToContainer(cat1task4, cat1); - - cat1task5 = manager.createNewLocalTask("task 5"); - cat1task5.setPriority(PriorityLevel.P5.toString()); - cat1task5.setCompleted(true); - cat1task5.addParentContainer(cat1); - manager.getTaskList().moveToContainer(cat1task5, cat1); - - manager.getTaskList().addCategory(cat1); - assertEquals(cat1.getChildren().size(), 5); - - cat2 = new TaskCategory("Second Category"); - - cat2task1 = manager.createNewLocalTask("task 1"); - cat2task1.setPriority(PriorityLevel.P1.toString()); - cat2task1.addParentContainer(cat2); - manager.getTaskList().moveToContainer(cat2task1, cat2); - - cat2task1sub1 = manager.createNewLocalTask("sub task 1"); - cat2task1sub1.setPriority(PriorityLevel.P1.toString()); - manager.getTaskList().addTask(cat2task1sub1, cat2task1); - - cat2task2 = manager.createNewLocalTask("task 2"); - cat2task2.setPriority(PriorityLevel.P2.toString()); - cat2task2.setCompleted(true); - cat2task2.addParentContainer(cat2); - manager.getTaskList().moveToContainer(cat2task2, cat2); - - cat2task3 = manager.createNewLocalTask("task 3"); - cat2task3.setPriority(PriorityLevel.P3.toString()); - cat2task3.addParentContainer(cat2); - manager.getTaskList().moveToContainer(cat2task3, cat2); - - cat2task4 = manager.createNewLocalTask("task 4"); - cat2task4.setPriority(PriorityLevel.P4.toString()); - cat2task4.setCompleted(true); - cat2task4.addParentContainer(cat2); - manager.getTaskList().moveToContainer(cat2task4, cat2); - - cat2task5 = manager.createNewLocalTask("task 5"); - cat2task5.setPriority(PriorityLevel.P5.toString()); - cat2task5.addParentContainer(cat2); - manager.getTaskList().moveToContainer(cat2task5, cat2); - - manager.getTaskList().addCategory(cat2); - manager.saveTaskList(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public void tearDown() { - // clear everything - } - - public void testMarkWebTaskCompleted() { - TaskListView view = TaskListView.getFromActivePerspective(); - assertNotNull(view); - WebTask webTask = new WebTask("1", "1", "", "", "web"); - TasksUiPlugin.getTaskListManager().getTaskList().addTask(webTask, - TasksUiPlugin.getTaskListManager().getTaskList().getDefaultCategory()); - view.getViewer().refresh(); - // Arrays.asList(view.getViewer().getVisibleExpandedElements()); - assertFalse(webTask.isCompleted()); - ArrayList tasks = new ArrayList(); - tasks.add(webTask); - new MarkTaskCompleteAction(tasks).run(); - assertTrue(webTask.isCompleted()); - } - - public void testUiFilter() { - try { - assertNotNull(TaskListView.getFromActivePerspective()); - TreeViewer viewer = TaskListView.getFromActivePerspective().getViewer(); - TaskListView.getFromActivePerspective().addFilter( - TaskListView.getFromActivePerspective().getCompleteFilter()); - viewer.refresh(); - viewer.expandAll(); - TreeItem[] items = viewer.getTree().getItems(); - assertTrue(checkFilter(CHECK_COMPLETE_FILTER, items)); - TaskListView.getFromActivePerspective().removeFilter( - TaskListView.getFromActivePerspective().getCompleteFilter()); - - TaskPriorityFilter filter = TaskListView.getFromActivePerspective().getPriorityFilter(); - filter.displayPrioritiesAbove("P2"); - TaskListView.getFromActivePerspective().addFilter(filter); - viewer.refresh(); - viewer.expandAll(); - items = viewer.getTree().getItems(); - - // check priority tasks - assertTrue(checkFilter(CHECK_PRIORITY_FILTER, items)); - } catch (Exception e) { - e.printStackTrace(); - } - } - - /** - * Tests that TaskEditors remove all listeners when closed - */ - public void testListenersRemoved() { - - int numListenersBefore = 0; - int numListenersDuring = 0; - int numListenersAfter = 0; - - TaskListManager manager = TasksUiPlugin.getTaskListManager(); - Set listeners = manager.getTaskList().getChangeListeners(); - numListenersBefore = listeners.size(); - - // open a task in editor - // cat1task1.setForceSyncOpen(true); - TasksUiUtil.openEditor(cat1task1, false, true); - // cat1task1.openTaskInEditor(false); - // cat1task2.setForceSyncOpen(true); - // cat1task2.openTaskInEditor(false); - TasksUiUtil.openEditor(cat1task2, false, true); - - listeners = manager.getTaskList().getChangeListeners(); - numListenersDuring = listeners.size(); - - assertEquals(numListenersDuring, numListenersBefore + 2); - - TasksUiPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false); - - listeners = manager.getTaskList().getChangeListeners(); - numListenersAfter = listeners.size(); - assertEquals(numListenersBefore, numListenersAfter); - - } - - /** - * Tests whether an additional NewCategory action is added to the category - */ - public void testGetSubMenuManagerContainsAllCategoriesPlusNewCategory() { - // setup - MoveToCategoryMenuContributor moveToMenuContrib = new MoveToCategoryMenuContributor(); - List selectedElements = new Vector(); - selectedElements.add(cat1task1); - int numCategoriesMinusArchiveContainer = manager.getTaskList().getCategories().size() - 1; - int numSeparators = 1; - // adding a separator and the New Category... action - int expectedNrOfSubMenuEntries = numCategoriesMinusArchiveContainer + numSeparators + 1; - NewCategoryAction newCatActon = new NewCategoryAction(); - - // execute sytem under test - MenuManager menuManager = moveToMenuContrib.getSubMenuManager(selectedElements); - IContributionItem[] items = menuManager.getItems(); - IContributionItem item = items[menuManager.getItems().length - 1]; - - // +1 for separator - assertEquals(expectedNrOfSubMenuEntries, menuManager.getItems().length); - - if (item instanceof NewCategoryAction) { - NewCategoryAction action = (NewCategoryAction) item; - assertEquals(newCatActon.getText(), action.getText()); - } - - // teardown - } - - /** - * Tests visibility of SubMenuManager - */ - public void testVisibilityOfSubMenuManager() { - //setup - MoveToCategoryMenuContributor moveToMenuContrib = new MoveToCategoryMenuContributor(); - MenuManager menuManager = null; - List selectedElements = new Vector(); - selectedElements.add(cat1task1); - - List emptySelection = new Vector(); - - List categorySelection = new Vector(); - categorySelection.add(cat1); - - List querySelection = new Vector(); - querySelection.add(new MockRepositoryQuery("query", null)); - - //execute system under test & assert - menuManager = moveToMenuContrib.getSubMenuManager(selectedElements); - assertTrue(menuManager.isVisible()); - - menuManager = null; - menuManager = moveToMenuContrib.getSubMenuManager(emptySelection); - assertFalse(menuManager.isVisible()); - - menuManager = null; - menuManager = moveToMenuContrib.getSubMenuManager(categorySelection); - assertFalse(menuManager.isVisible()); - - menuManager = null; - menuManager = moveToMenuContrib.getSubMenuManager(querySelection); - assertFalse(menuManager.isVisible()); - - //teardown - } - - /** - * Tests that the category name is shown in the Move To Category submenu, even when they have an @ in their name - */ - public void testCategoryNameIsShownInMoveToCategoryAction() { - String catNameWithAtBefore = "@CatName"; - String catNameWithAtExpected = "@CatName@"; - String catNameWithAtActual = ""; - - String catNameNoAtBefore = "CatName"; - String catNameNoAtExpected = "CatName"; - String catNameNoAtActual = ""; - - MoveToCategoryMenuContributor menuContrib = new MoveToCategoryMenuContributor(); - - catNameWithAtActual = menuContrib.handleAcceleratorKeys(catNameWithAtBefore); - catNameNoAtActual = menuContrib.handleAcceleratorKeys(catNameNoAtBefore); - - assertEquals(catNameWithAtExpected, catNameWithAtActual); - assertEquals(catNameNoAtExpected, catNameNoAtActual); - } - - public boolean checkFilter(int type, TreeItem[] items) { - switch (type) { - case CHECK_COMPLETE_FILTER: - return checkCompleteIncompleteFilter(items, false); - case CHECK_INCOMPLETE_FILTER: - return checkCompleteIncompleteFilter(items, true); - case CHECK_PRIORITY_FILTER: - return checkPriorityFilter(items); - default: - return false; - } - } - - public boolean checkCompleteIncompleteFilter(TreeItem[] items, boolean checkComplete) { - assertEquals(3, items.length); - int count = 0; - for (int i = 0; i < items.length; i++) { - if (items[i].getData() instanceof TaskCategory) { - TreeItem[] sub = items[i].getItems(); - for (int j = 0; j < sub.length; j++) { - assertTrue(sub[j].getData() instanceof AbstractTask); - AbstractTask task = (AbstractTask) sub[j].getData(); - if (checkComplete) { - assertTrue(task.isCompleted()); - } else { - assertFalse(task.isCompleted()); - } - count++; - } - } - } - assertTrue(count == 5); - return true; - } - - public boolean checkPriorityFilter(TreeItem[] items) { - assertTrue(items.length == 3); - int p2Count = 0; - int p1Count = 0; - for (int i = 0; i < items.length; i++) { - if (items[i].getData() instanceof TaskCategory) { - TreeItem[] sub = items[i].getItems(); - for (int j = 0; j < sub.length; j++) { - assertTrue(sub[j].getData() instanceof AbstractTask); - AbstractTask task = (AbstractTask) sub[j].getData(); - assertTrue(task.getPriority().equals("P2") || task.getPriority().equals("P1")); - if (task.getPriority().equals("P2")) { - p2Count++; - } else { - p1Count++; - } - } - } - } - assertEquals(2, p1Count); - assertEquals(2, p2Count); - return true; - } - -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskPlanningEditorTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskPlanningEditorTest.java deleted file mode 100644 index afd677720..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskPlanningEditorTest.java +++ /dev/null @@ -1,113 +0,0 @@ -/******************************************************************************* - * 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.tasks.tests; - -import junit.framework.TestCase; - -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.mylyn.internal.tasks.core.LocalTask; -import org.eclipse.mylyn.internal.tasks.ui.editors.TaskPlanningEditor; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; -import org.eclipse.mylyn.tasks.ui.TasksUiUtil; -import org.eclipse.mylyn.tasks.ui.editors.TaskEditor; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.PlatformUI; - -/** - * @author Rob Elves - */ -public class TaskPlanningEditorTest extends TestCase { - - private static final String MOCK_LABEL = "label"; - - private static final String DESCRIPTION = "summary"; - - private static final String NEW_DESCRIPTION = "new summary"; - - @Override - protected void setUp() throws Exception { - super.setUp(); - } - - @Override - protected void tearDown() throws Exception { - PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false); - TasksUiPlugin.getRepositoryManager().clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); - TasksUiPlugin.getTaskListManager().resetTaskList(); - TasksUiPlugin.getTaskListManager().saveTaskList(); - super.tearDown(); - } - - public void testDirtyOnEdit() { - LocalTask task = new LocalTask("1", MOCK_LABEL); - task.setSummary(DESCRIPTION); - TasksUiPlugin.getTaskListManager().getTaskList().addTask(task); - TasksUiUtil.openEditor(task, false, true); - IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - assertTrue(page.getActiveEditor() instanceof TaskEditor); - TaskEditor taskEditor = (TaskEditor) page.getActiveEditor(); - assertTrue(taskEditor.getActivePageInstance() instanceof TaskPlanningEditor); - TaskPlanningEditor editor = (TaskPlanningEditor) taskEditor.getActivePageInstance(); - assertFalse(editor.isDirty()); - editor.setNotes("notes"); - assertTrue(editor.isDirty()); - editor.doSave(new NullProgressMonitor()); - assertFalse(editor.isDirty()); - editor.setDescription(NEW_DESCRIPTION); - assertTrue(editor.isDirty()); - editor.doSave(new NullProgressMonitor()); - assertEquals(NEW_DESCRIPTION, task.getSummary()); - assertFalse(editor.isDirty()); - } - - public void testNotDirtyOnRename() { - LocalTask task = new LocalTask("1", MOCK_LABEL); - task.setSummary(DESCRIPTION); - TasksUiPlugin.getTaskListManager().getTaskList().addTask(task); - TasksUiUtil.openEditor(task, false, true); - IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - assertTrue(page.getActiveEditor() instanceof TaskEditor); - TaskEditor taskEditor = (TaskEditor) page.getActiveEditor(); - assertTrue(taskEditor.getActivePageInstance() instanceof TaskPlanningEditor); - TaskPlanningEditor editor = (TaskPlanningEditor) taskEditor.getActivePageInstance(); - assertFalse(editor.isDirty()); - assertEquals(DESCRIPTION, editor.getDescription()); - TasksUiPlugin.getTaskListManager().getTaskList().renameTask(task, NEW_DESCRIPTION); - assertEquals(NEW_DESCRIPTION, task.getSummary()); - editor.updateTaskData(task); - //assertEquals(NEW_DESCRIPTION, editor.getFormTitle()); - assertEquals(NEW_DESCRIPTION, editor.getDescription()); - assertFalse(editor.isDirty()); - } - - /** - * Test that if editor is dirty and external rename happens editor remains dirty - */ - public void testRenameInDirtyState() { - LocalTask task = new LocalTask("1", MOCK_LABEL); - task.setSummary(DESCRIPTION); - TasksUiPlugin.getTaskListManager().getTaskList().addTask(task); - TasksUiUtil.openEditor(task, false, true); - IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - assertTrue(page.getActiveEditor() instanceof TaskEditor); - TaskEditor taskEditor = (TaskEditor) page.getActiveEditor(); - assertTrue(taskEditor.getActivePageInstance() instanceof TaskPlanningEditor); - TaskPlanningEditor editor = (TaskPlanningEditor) taskEditor.getActivePageInstance(); - assertFalse(editor.isDirty()); - editor.setDescription(NEW_DESCRIPTION); - assertTrue(editor.isDirty()); - TasksUiPlugin.getTaskListManager().getTaskList().renameTask(task, NEW_DESCRIPTION + "2"); - assertEquals(NEW_DESCRIPTION + "2", task.getSummary()); - editor.updateTaskData(task); - //assertEquals(NEW_DESCRIPTION+"2", editor.getFormTitle()); - assertEquals(NEW_DESCRIPTION + "2", editor.getDescription()); - assertTrue(editor.isDirty()); - } - -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoriesExternalizerTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoriesExternalizerTest.java deleted file mode 100644 index ae67024f0..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoriesExternalizerTest.java +++ /dev/null @@ -1,108 +0,0 @@ -/******************************************************************************* - * 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.tasks.tests; - -import java.io.File; -import java.util.HashSet; -import java.util.Set; - -import junit.framework.TestCase; - -import org.eclipse.mylyn.internal.tasks.core.TaskRepositoriesExternalizer; -import org.eclipse.mylyn.tasks.core.TaskRepository; - -/** - * @author Rob Elves - * @author Erik Ramfelt (bug 168782) - */ -public class TaskRepositoriesExternalizerTest extends TestCase { - - private Set taskRepositories = new HashSet(); - - private static final String REP_TYPE = "bugzilla"; - - private static final String REPURL1 = "http://somewhere1"; - - private static final String REPURL2 = "http://somewhere2"; - - private static final String TIMEZONE = "test time zone"; - - private static final String VERSION = "test version"; - - private static final String ENCODING = "test encoding"; - - private static final String TIMESTAMP = "test time stamp"; - - private static final String SUFFIX = "2"; - - private TaskRepository repository1; - - private TaskRepository repository2; - - @Override - protected void setUp() throws Exception { - repository1 = new TaskRepository(REP_TYPE, REPURL1); - repository2 = new TaskRepository("bugzilla", REPURL2); - - repository1.setTimeZoneId(TIMEZONE); - repository1.setVersion(VERSION); - repository1.setCharacterEncoding(ENCODING); - repository1.setSynchronizationTimeStamp(TIMESTAMP); - taskRepositories.add(repository1); - - repository2.setTimeZoneId(TIMEZONE + SUFFIX); - repository2.setVersion(VERSION + SUFFIX); - repository2.setCharacterEncoding(ENCODING + SUFFIX); - repository2.setSynchronizationTimeStamp(TIMESTAMP + SUFFIX); - taskRepositories.add(repository2); - } - - public void testExternalization() { - TaskRepositoriesExternalizer externalizer = new TaskRepositoriesExternalizer(); - String path = "repositories.xml"; - File file = new File(path); - file.deleteOnExit(); - externalizer.writeRepositoriesToXML(taskRepositories, file); - taskRepositories.clear(); - assertEquals(0, taskRepositories.size()); - taskRepositories = externalizer.readRepositoriesFromXML(file); - assertEquals(2, taskRepositories.size()); - taskRepositories.contains(repository1); - taskRepositories.contains(repository2); - for (TaskRepository repository : taskRepositories) { - if (repository.getUrl().equals(REPURL1)) { - assertEquals(TIMEZONE, repository.getTimeZoneId()); - assertEquals(VERSION, repository.getVersion()); - assertEquals(ENCODING, repository.getCharacterEncoding()); - assertEquals(TIMESTAMP, repository.getSynchronizationTimeStamp()); - } else if (repository.getUrl().equals(REPURL2)) { - assertEquals(TIMEZONE + SUFFIX, repository.getTimeZoneId()); - assertEquals(VERSION + SUFFIX, repository.getVersion()); - assertEquals(ENCODING + SUFFIX, repository.getCharacterEncoding()); - assertEquals(TIMESTAMP + SUFFIX, repository.getSynchronizationTimeStamp()); - } - } - - } - - public void testExternalizationEmptyRepository() { - TaskRepositoriesExternalizer externalizer = new TaskRepositoriesExternalizer(); - String path = "repositories.xml"; - File file = new File(path); - file.deleteOnExit(); - externalizer.writeRepositoriesToXML(taskRepositories, file); - taskRepositories = externalizer.readRepositoriesFromXML(file); - assertEquals(2, taskRepositories.size()); - taskRepositories.clear(); - externalizer.writeRepositoriesToXML(taskRepositories, file); - taskRepositories = externalizer.readRepositoriesFromXML(file); - assertEquals(0, taskRepositories.size()); - } - -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java deleted file mode 100644 index e1172b91a..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java +++ /dev/null @@ -1,223 +0,0 @@ -/******************************************************************************* - * 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.tasks.tests; - -import java.net.MalformedURLException; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import junit.framework.TestCase; - -import org.eclipse.mylyn.internal.tasks.core.RepositoryTaskHandleUtil; -import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; -import org.eclipse.mylyn.tasks.core.AbstractTask; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.TaskRepositoryManager; -import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryConnector; -import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryQuery; -import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryTask; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; - -/** - * @author Mik Kersten - * @author Rob Elves - */ -public class TaskRepositoryManagerTest extends TestCase { - - private static final String DEFAULT_KIND = MockRepositoryConnector.REPOSITORY_KIND; - - private static final String DEFAULT_URL = "http://eclipse.org"; - - private static final String ANOTHER_URL = "http://codehaus.org"; - - private TaskRepositoryManager manager; - - @Override - protected void setUp() throws Exception { - super.setUp(); - manager = TasksUiPlugin.getRepositoryManager(); - assertNotNull(manager); - manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - if (manager != null) { - manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); - } - } - - public void testQueryDeletion() { - MockRepositoryTask task = new MockRepositoryTask("1"); - task.setLastReadTimeStamp("now"); - MockRepositoryQuery query = new MockRepositoryQuery("Test"); - TasksUiPlugin.getTaskListManager().getTaskList().addQuery(query); - TasksUiPlugin.getTaskListManager().getTaskList().addTask(task, query); - - assertNotNull(TasksUiPlugin.getTaskListManager().getTaskList().getTask(task.getHandleIdentifier())); - TasksUiPlugin.getTaskListManager().getTaskList().deleteQuery(query); - AbstractTask task2 = TasksUiPlugin.getTaskListManager().getTaskList().getTask(task.getHandleIdentifier()); - assertNotNull(task2); - assertEquals(1, task2.getParentContainers().size()); - - } - - public void testHandles() { - String url = "http://foo.bar"; - String id = "123"; - String handle = RepositoryTaskHandleUtil.getHandle(url, id); - assertEquals(url, RepositoryTaskHandleUtil.getRepositoryUrl(handle)); - assertEquals(id, RepositoryTaskHandleUtil.getTaskId(handle)); -// assertEquals(123, AbstractTask.getTaskIdAsInt(handle)); - } - - public void testMultipleNotAdded() throws MalformedURLException { - TaskRepository repository = new TaskRepository(DEFAULT_KIND, DEFAULT_URL); - manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath()); - TaskRepository repository2 = new TaskRepository(DEFAULT_KIND, DEFAULT_URL); - manager.addRepository(repository2, TasksUiPlugin.getDefault().getRepositoriesFilePath()); - assertEquals(1, manager.getAllRepositories().size()); - } - - public void testGet() throws MalformedURLException { - assertEquals("", TasksUiPlugin.getDefault().getPreferenceStore().getString( - TaskRepositoryManager.PREF_REPOSITORIES)); - - TaskRepository repository = new TaskRepository(DEFAULT_KIND, DEFAULT_URL); - manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath()); - assertEquals(repository, manager.getRepository(DEFAULT_KIND, DEFAULT_URL)); - assertNull(manager.getRepository(DEFAULT_KIND, "foo")); - assertNull(manager.getRepository("foo", DEFAULT_URL)); - } - - public void testConnectorAddition() { - AbstractRepositoryConnector connector = new MockRepositoryConnector(); - manager.addRepositoryConnector(connector); - assertNotNull(manager.getRepositoryConnector(connector.getConnectorKind())); - } - - public void testRepositoryPersistance() throws MalformedURLException { - // assertEquals("", - // MylarTaskListPlugin.getMylarCorePrefs().getString(TaskRepositoryManager.PREF_REPOSITORIES)); - - TaskRepository repository1 = new TaskRepository("bugzilla", "http://bugzilla"); - TaskRepository repository2 = new TaskRepository("jira", "http://jira"); - manager.addRepository(repository1, TasksUiPlugin.getDefault().getRepositoriesFilePath()); - manager.addRepository(repository2, TasksUiPlugin.getDefault().getRepositoriesFilePath()); - - // assertNotNull(MylarTaskListPlugin.getMylarCorePrefs().getString(TaskRepositoryManager.PREF_REPOSITORIES)); - - List repositoryList = new ArrayList(); - repositoryList.add(repository2); - repositoryList.add(repository1); - manager.readRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); - - // NOTE: different conditions for running with and without the JIRA - // Connector - if (manager.getRepositoryConnectors().size() > 1) { - assertTrue(manager.getAllRepositories().contains(repository1)); - assertTrue(manager.getAllRepositories().contains(repository2)); - // assertEquals(repositoryList, manager.getAllRepositories()); - } else { - // TODO there is something wrong with this - assertEquals("all: " + manager.getAllRepositories(), 1, manager.getAllRepositories().size()); - } - } - - public void testRepositoryAttributePersistance() throws MalformedURLException { - assertEquals("", TasksUiPlugin.getDefault().getPreferenceStore().getString( - TaskRepositoryManager.PREF_REPOSITORIES)); - - String version = "123"; - String encoding = "UTF-16"; - String fakeTimeZone = "nowhere"; - Date now = new Date(); - String dateString = now.toString(); - - TaskRepository repository1 = new TaskRepository("bugzilla", "http://bugzilla"); - repository1.setVersion(version); - repository1.setCharacterEncoding(encoding); - repository1.setTimeZoneId(fakeTimeZone); - repository1.setSynchronizationTimeStamp(dateString); - repository1.setAnonymous(true); - manager.addRepository(repository1, TasksUiPlugin.getDefault().getRepositoriesFilePath()); - - manager.readRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); - TaskRepository temp = manager.getRepository(repository1.getConnectorKind(), repository1.getUrl()); - assertNotNull(temp); - assertEquals(version, temp.getVersion()); - assertTrue(temp.isAnonymous()); - assertEquals(encoding, temp.getCharacterEncoding()); - assertEquals(fakeTimeZone, temp.getTimeZoneId()); - assertEquals(dateString, temp.getSynchronizationTimeStamp()); - - } - - public void testRepositoryPersistanceAfterDelete() throws MalformedURLException { - - TaskRepository repository = new TaskRepository(DEFAULT_KIND, DEFAULT_URL); - manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath()); - assertNotNull(manager.getRepository(repository.getConnectorKind(), repository.getUrl())); - - TaskRepository repository2 = new TaskRepository(DEFAULT_KIND, ANOTHER_URL); - manager.addRepository(repository2, TasksUiPlugin.getDefault().getRepositoriesFilePath()); - assertNotNull(manager.getRepository(repository2.getConnectorKind(), repository2.getUrl())); - - manager.removeRepository(repository2, TasksUiPlugin.getDefault().getRepositoriesFilePath()); - - assertNull(manager.getRepository(repository2.getConnectorKind(), repository2.getUrl())); - } - - public void testRepositoryWithUnnownUrlHandler() { - TaskRepository repository = new TaskRepository("eclipse.technology.mylar", - "nntp://news.eclipse.org/eclipse.technology.mylar"); - - repository.setAuthenticationCredentials("testUser", "testPassword"); - - assertEquals("testUser", repository.getUserName()); - assertEquals("testPassword", repository.getPassword()); - } - - public void testRepositoryWithCustomAttributes() throws Exception { - - // Note: if a connector doesn't exist the associated repositories are not loaded (orphaned) - // causing this test to fail. - AbstractRepositoryConnector connector = new MockRepositoryConnector(); - manager.addRepositoryConnector(connector); - - TaskRepository repository = new TaskRepository(MockRepositoryConnector.REPOSITORY_KIND, - "http://jroller.com/page/eu"); - repository.setProperty("owner", "euxx"); - manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath()); - - manager.readRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); - - TaskRepository temp = manager.getRepository(repository.getConnectorKind(), repository.getUrl()); - assertNotNull(temp); - assertEquals("euxx", temp.getProperty("owner")); - } - - public void testRepositoryPersistanceSameUrl() throws MalformedURLException { - TaskRepository repository1 = new TaskRepository("bugzilla", "http://repository"); - TaskRepository repository2 = new TaskRepository("jira", "http://repository"); - manager.addRepository(repository1, TasksUiPlugin.getDefault().getRepositoriesFilePath()); - manager.addRepository(repository2, TasksUiPlugin.getDefault().getRepositoriesFilePath()); - assertEquals(2, manager.getAllRepositories().size()); - - List repositoryList = new ArrayList(); - repositoryList.add(repository2); - repositoryList.add(repository1); - manager.readRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); - - assertEquals("got: " + manager.getAllRepositories(), 2, manager.getAllRepositories().size()); - } - -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositorySorterTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositorySorterTest.java deleted file mode 100644 index 12857c5cb..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositorySorterTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 - 2006 Mylar 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.tasks.tests; - -import org.eclipse.mylyn.internal.tasks.core.IRepositoryConstants; -import org.eclipse.mylyn.internal.tasks.ui.views.TaskRepositoriesSorter; -import org.eclipse.mylyn.tasks.core.TaskRepository; - -import junit.framework.TestCase; - -/** - * @author Mik Kersten - */ -public class TaskRepositorySorterTest extends TestCase { - - @Override - protected void setUp() throws Exception { - super.setUp(); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void testCategorySorting() { - TaskRepositoriesSorter sorter = new TaskRepositoriesSorter(); - TaskRepository t1 = new TaskRepository("t1", "http://a"); - TaskRepository t2 = new TaskRepository("t2", "http://a"); - TaskRepository t3 = new TaskRepository("t3", "http://a"); - assertTrue(sorter.compare(null, t1, t2) < 0); - assertTrue(sorter.compare(null, t3, t1) > 0); - } - - public void testUrlSorting() { - TaskRepositoriesSorter sorter = new TaskRepositoriesSorter(); - TaskRepository t1 = new TaskRepository("t", "http://a"); - TaskRepository t2 = new TaskRepository("t", "http://b"); - TaskRepository t3 = new TaskRepository("t", "http://c"); - assertTrue(sorter.compare(null, t1, t2) < 0); - assertTrue(sorter.compare(null, t3, t1) > 0); - } - - public void testLabelSorting() { - TaskRepositoriesSorter sorter = new TaskRepositoriesSorter(); - TaskRepository t1 = new TaskRepository("kind", "http://a"); - t1.setProperty(IRepositoryConstants.PROPERTY_LABEL, "a"); - TaskRepository t2 = new TaskRepository("kind", "http://a"); - t2.setProperty(IRepositoryConstants.PROPERTY_LABEL, "b"); - TaskRepository t3 = new TaskRepository("kind", "http://a"); - t3.setProperty(IRepositoryConstants.PROPERTY_LABEL, "c"); - - assertTrue(sorter.compare(null, t1, t2) < 0); - assertTrue(sorter.compare(null, t3, t1) > 0); - } - - public void testLabelVsNoLabel() { - TaskRepositoriesSorter sorter = new TaskRepositoriesSorter(); - TaskRepository t1 = new TaskRepository("kind", "http://a"); - t1.setProperty(IRepositoryConstants.PROPERTY_LABEL, "a"); - TaskRepository t2 = new TaskRepository("kind", "http://a"); - - assertTrue(sorter.compare(null, t1, t2) < 0); - } - -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryTest.java deleted file mode 100644 index a2becad24..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryTest.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 - 2006 Mylar 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.tasks.tests; - -import org.eclipse.mylyn.internal.tasks.core.IRepositoryConstants; -import org.eclipse.mylyn.tasks.core.TaskRepository; - -import junit.framework.TestCase; - -/** - * @author Mik Kersten - */ -public class TaskRepositoryTest extends TestCase { - - public void testLabel() { - TaskRepository repository = new TaskRepository("kind", "http://foo.bar"); - assertTrue(repository.getRepositoryLabel().equals(repository.getUrl())); - - repository.setProperty(IRepositoryConstants.PROPERTY_LABEL, "label"); - assertTrue(repository.getRepositoryLabel().equals("label")); - } - -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskTest.java deleted file mode 100644 index 53fcbae84..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * 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.tasks.tests; - -import junit.framework.TestCase; - -import org.eclipse.mylyn.internal.tasks.core.LocalTask; -import org.eclipse.mylyn.tasks.core.AbstractTask; -import org.eclipse.mylyn.tasks.core.AbstractTask.PriorityLevel; - -/** - * @author Mik Kersten - */ -public class TaskTest extends TestCase { - - @Override - protected void setUp() throws Exception { - super.setUp(); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void testUrl() { - AbstractTask task = new LocalTask("handle", "label"); - task.setUrl("http://eclipse.org/mylar/doc.php"); - assertTrue(task.hasValidUrl()); - - task.setUrl("http://"); - assertFalse(task.hasValidUrl()); - - task.setUrl("https://"); - assertFalse(task.hasValidUrl()); - - task.setUrl(""); - assertFalse(task.hasValidUrl()); - - task.setUrl(null); - assertFalse(task.hasValidUrl()); - } - - public void testPriorityNeverNull() { - AbstractTask task = new LocalTask("handle", "label"); - assertNotNull(task.getPriority()); - - PriorityLevel def = PriorityLevel.getDefault(); - assertNotNull(def); - assertEquals(def, AbstractTask.PriorityLevel.fromDescription("garbage")); - assertEquals(def, AbstractTask.PriorityLevel.fromString("garbage")); - } -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskTestUtil.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskTestUtil.java deleted file mode 100644 index 434b6a25d..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskTestUtil.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * 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.tasks.tests; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URL; - -import org.eclipse.core.runtime.FileLocator; - -/** - * @author Mik Kersten - */ -public class TaskTestUtil { - - public static File getLocalFile(String path) { - try { - URL installURL = TasksTestsPlugin.getDefault().getBundle().getEntry(path); - URL localURL = FileLocator.toFileURL(installURL); - return new File(localURL.getFile()); - } catch (IOException e) { - return null; - } - } - - /** - * Adaptred from Java Developers' almanac - */ - public static void copy(File source, File dest) throws IOException { - InputStream in = new FileInputStream(source); - OutputStream out = new FileOutputStream(dest); - byte[] buf = new byte[1024]; - int len; - while ((len = in.read(buf)) > 0) { - out.write(buf, 0, len); - } - in.close(); - out.close(); - } - -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TasksTestsPlugin.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TasksTestsPlugin.java deleted file mode 100644 index 5d8612086..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TasksTestsPlugin.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * 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.tasks.tests; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * The main plugin class to be used in the desktop. - */ -public class TasksTestsPlugin extends Plugin { - // The shared instance. - private static TasksTestsPlugin plugin; - - /** - * The constructor. - */ - public TasksTestsPlugin() { - super(); - plugin = this; - } - - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - } - - @Override - public void stop(BundleContext context) throws Exception { - super.stop(context); - plugin = null; - } - - /** - * Returns the shared instance. - */ - public static TasksTestsPlugin getDefault() { - return plugin; - } - -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/UrlConnectionUtilTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/UrlConnectionUtilTest.java deleted file mode 100644 index 513a15f9f..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/UrlConnectionUtilTest.java +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 - 2006 Mylar 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.tasks.tests; - -import java.net.InetSocketAddress; -import java.net.Proxy.Type; - -import junit.framework.TestCase; - -import org.apache.commons.httpclient.NTCredentials; -import org.apache.commons.httpclient.UsernamePasswordCredentials; -import org.eclipse.mylyn.web.core.AuthenticatedProxy; -import org.eclipse.mylyn.web.core.WebClientUtil; - -public class UrlConnectionUtilTest extends TestCase { - - public void testUrlParsers() { - String url = "https://example.com:444/folder/file.txt"; - assertEquals(444, WebClientUtil.getPort(url)); - assertEquals("example.com", WebClientUtil.getDomain(url)); - assertEquals("/folder/file.txt", WebClientUtil.getRequestPath(url)); - - url = "http://example.com/"; - assertEquals(80, WebClientUtil.getPort(url)); - assertEquals("example.com", WebClientUtil.getDomain(url)); - assertEquals("/", WebClientUtil.getRequestPath(url)); - - url = "https://example.com:321"; - assertEquals(321, WebClientUtil.getPort(url)); - assertEquals("example.com", WebClientUtil.getDomain(url)); - assertEquals("", WebClientUtil.getRequestPath(url)); - - url = "example.com:321"; - assertEquals(321, WebClientUtil.getPort(url)); - assertEquals("example.com", WebClientUtil.getDomain(url)); - assertEquals("", WebClientUtil.getRequestPath(url)); - - url = "https://example.com:444/folder/file.txt?search=https://example.com:812/folder/file.txt"; - assertEquals(444, WebClientUtil.getPort(url)); - assertEquals("example.com", WebClientUtil.getDomain(url)); - assertEquals("/folder/file.txt?search=https://example.com:812/folder/file.txt", - WebClientUtil.getRequestPath(url)); - - url = "https://example.com/folder/file.txt?search=https://example.com:812/folder/file.txt"; - assertEquals(443, WebClientUtil.getPort(url)); - assertEquals("example.com", WebClientUtil.getDomain(url)); - assertEquals("/folder/file.txt?search=https://example.com:812/folder/file.txt", - WebClientUtil.getRequestPath(url)); - - } - - public void testCredentials() { - AuthenticatedProxy proxy = new AuthenticatedProxy(Type.HTTP, new InetSocketAddress(4567), "user", "password"); - UsernamePasswordCredentials credentials = (UsernamePasswordCredentials) WebClientUtil.getCredentials(proxy, - new InetSocketAddress(1234)); - assertEquals("user", credentials.getUserName()); - assertEquals("password", credentials.getPassword()); - - proxy = new AuthenticatedProxy(Type.HTTP, new InetSocketAddress(4567), "domain\\user", "password"); - NTCredentials ntCredentials = (NTCredentials) WebClientUtil.getCredentials(proxy, new InetSocketAddress( - "mylar.eclipse.org", 1234)); - assertEquals("user", ntCredentials.getUserName()); - assertEquals("password", ntCredentials.getPassword()); - assertEquals("domain", ntCredentials.getDomain()); - assertEquals("mylar.eclipse.org", ntCredentials.getHost()); - } - -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockAttachmentHandler.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockAttachmentHandler.java deleted file mode 100644 index ee0ee1176..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockAttachmentHandler.java +++ /dev/null @@ -1,81 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 - 2006 Mylar 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.tasks.tests.connector; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.mylyn.tasks.core.AbstractAttachmentHandler; -import org.eclipse.mylyn.tasks.core.AbstractTask; -import org.eclipse.mylyn.tasks.core.ITaskAttachment; -import org.eclipse.mylyn.tasks.core.RepositoryAttachment; -import org.eclipse.mylyn.tasks.core.TaskRepository; - -/** - * @author Steffen Pingel - */ -public class MockAttachmentHandler extends AbstractAttachmentHandler { - - private byte[] data; - - @Override - public boolean canDeprecate(TaskRepository repository, RepositoryAttachment attachment) { - // ignore - return false; - } - - @Override - public boolean canDownloadAttachment(TaskRepository repository, AbstractTask task) { - // ignore - return true; - } - - @Override - public boolean canUploadAttachment(TaskRepository repository, AbstractTask task) { - // ignore - return true; - } - - @Override - public void downloadAttachment(TaskRepository repository, RepositoryAttachment attachment, OutputStream target, - IProgressMonitor monitor) throws CoreException { - try { - target.write(data); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - @Override - public InputStream getAttachmentAsStream(TaskRepository repository, RepositoryAttachment attachment, - IProgressMonitor monitor) throws CoreException { - // ignore - return new ByteArrayInputStream(data); - } - - @Override - public void updateAttachment(TaskRepository repository, RepositoryAttachment attachment) throws CoreException { - // ignore - } - - @Override - public void uploadAttachment(TaskRepository repository, AbstractTask task, ITaskAttachment attachment, - String comment, IProgressMonitor monitor) throws CoreException { - // ignore - } - - public void setAttachmentData(byte[] data) { - this.data = data; - } - -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockAttributeFactory.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockAttributeFactory.java deleted file mode 100644 index 2063e7103..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockAttributeFactory.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 - 2006 Mylar 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.tasks.tests.connector; - -import java.util.Date; - -import org.eclipse.mylyn.tasks.core.AbstractAttributeFactory; - -/** - * @author Rob Elves - */ -public class MockAttributeFactory extends AbstractAttributeFactory { - - private static final long serialVersionUID = 7713746838934802731L; - - @Override - public boolean isHidden(String key) { - // ignore - return false; - } - - @Override - public String getName(String key) { - // ignore - return key; - } - - @Override - public boolean isReadOnly(String key) { - // ignore - return false; - } - - @Override - public String mapCommonAttributeKey(String key) { - return key; - } - - @Override - public Date getDateForAttributeType(String attributeKey, String dateString) { - // ignore - return null; - } - -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryConnector.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryConnector.java deleted file mode 100644 index 36368b1fa..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryConnector.java +++ /dev/null @@ -1,170 +0,0 @@ -/******************************************************************************* - * 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.tasks.tests.connector; - -import java.util.Collections; -import java.util.Set; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.mylyn.tasks.core.AbstractAttachmentHandler; -import org.eclipse.mylyn.tasks.core.AbstractAttributeFactory; -import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; -import org.eclipse.mylyn.tasks.core.AbstractRepositoryQuery; -import org.eclipse.mylyn.tasks.core.AbstractTask; -import org.eclipse.mylyn.tasks.core.AbstractTaskDataHandler; -import org.eclipse.mylyn.tasks.core.ITaskCollector; -import org.eclipse.mylyn.tasks.core.RepositoryTaskData; -import org.eclipse.mylyn.tasks.core.TaskRepository; - -/** - * @author Mik Kersten - * @author Rob Elves - */ -public class MockRepositoryConnector extends AbstractRepositoryConnector { - - public static final String REPOSITORY_KIND = "mock"; - - public static final String REPOSITORY_URL = "http://mockrepository.test"; - - private AbstractAttachmentHandler attachmentHandler; - - @Override - public boolean canCreateNewTask(TaskRepository repository) { - // ignore - return false; - } - - @Override - public boolean canCreateTaskFromKey(TaskRepository repository) { - // ignore - return false; - } - - @Override - public AbstractAttachmentHandler getAttachmentHandler() { - return attachmentHandler; - } - - @Override - public String getLabel() { - return "Mock Repository (for unit tests)"; - } - - @Override - public AbstractTaskDataHandler getTaskDataHandler() { - // ignore - return new AbstractTaskDataHandler() { - - @Override - public AbstractAttributeFactory getAttributeFactory(String repositoryUrl, String repositoryKind, - String taskKind) { - // we don't care about the repository information right now - return new MockAttributeFactory(); - } - - @Override - public RepositoryTaskData getTaskData(TaskRepository repository, String taskId, IProgressMonitor monitor) - throws CoreException { - // ignore - return null; - } - - @Override - public String postTaskData(TaskRepository repository, RepositoryTaskData taskData, IProgressMonitor monitor) - throws CoreException { - // ignore - return null; - } - - @Override - public boolean initializeTaskData(TaskRepository repository, RepositoryTaskData data, - IProgressMonitor monitor) throws CoreException { - // ignore - return false; - } - - @Override - public AbstractAttributeFactory getAttributeFactory(RepositoryTaskData taskData) { - // ignore - return new MockAttributeFactory(); - } - - @Override - public Set getSubTaskIds(RepositoryTaskData taskData) { - return Collections.emptySet(); - } - - }; - } - - @Override - public String getConnectorKind() { - return REPOSITORY_KIND; - } - - @Override - public String getRepositoryUrlFromTaskUrl(String url) { - // ignore - return null; - } - - @Override - public String getTaskIdFromTaskUrl(String url) { - // ignore - return null; - } - - @Override - public String getTaskUrl(String repositoryUrl, String taskId) { - return null; - } - - @Override - public void updateAttributes(TaskRepository repository, IProgressMonitor monitor) throws CoreException { - // ignore - } - - @Override - public void updateTaskFromRepository(TaskRepository repository, AbstractTask repositoryTask, - IProgressMonitor monitor) { - // ignore - } - - @Override - public boolean markStaleTasks(TaskRepository repository, Set tasks, IProgressMonitor monitor) { - // ignore - return false; - } - - @Override - public AbstractTask createTask(String repositoryUrl, String id, String summary) { - // ignore - return null; - } - - @Override - public void updateTaskFromTaskData(TaskRepository repository, AbstractTask repositoryTask, - RepositoryTaskData taskData) { - // ignore - - } - - @Override - public IStatus performQuery(AbstractRepositoryQuery query, TaskRepository repository, IProgressMonitor monitor, - ITaskCollector resultCollector) { - // ignore - return null; - } - - public void setAttachmentHandler(AbstractAttachmentHandler attachmentHandler) { - this.attachmentHandler = attachmentHandler; - } -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryQuery.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryQuery.java deleted file mode 100644 index 61a60b85e..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryQuery.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * 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.tasks.tests.connector; - -import org.eclipse.mylyn.tasks.core.AbstractRepositoryQuery; - -/** - * @author Mik Kersten - */ -public class MockRepositoryQuery extends AbstractRepositoryQuery { - - public String MOCK_URL = "http://mock.repository"; - - public MockRepositoryQuery(String description) { - super(description); - super.setUrl(MOCK_URL); - } - - public MockRepositoryQuery(String description, String url) { - super(description); - super.setUrl(url); - } - - @Override - public String getRepositoryKind() { - return "mock"; - } - -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryTask.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryTask.java deleted file mode 100644 index 2709982ed..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryTask.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * 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.tasks.tests.connector; - -import org.eclipse.mylyn.tasks.core.AbstractTask; - -/** - * @author Mik Kersten - */ -public class MockRepositoryTask extends AbstractTask { - - private String ownerId; - - public MockRepositoryTask(String taskId) { - super(MockRepositoryConnector.REPOSITORY_URL, taskId, taskId); - } - - public MockRepositoryTask(String repositoryUrl, String taskId) { - super(repositoryUrl, taskId, taskId); - } - - public MockRepositoryTask(String repositoryUrl, String taskId, String summary) { - super(repositoryUrl, taskId, summary); - } - - @Override - public String getConnectorKind() { - return "mock"; - } - - @Override - public void setOwner(String ownerId) { - this.ownerId = ownerId; - } - - @Override - public String getOwner() { - if (ownerId == null) { - return super.getOwner(); - } else { - return ownerId; - } - } - - @Override - public String toString() { - return "Mock Task: " + super.getHandleIdentifier(); - } - - @Override - public boolean isLocal() { - // ignore - return false; - } - -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockStatusHandler.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockStatusHandler.java deleted file mode 100644 index d284d3107..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockStatusHandler.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 - 2006 Mylar 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.tasks.tests.connector; - -import junit.framework.TestCase; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.mylyn.internal.monitor.core.util.IStatusHandler; - -public class MockStatusHandler implements IStatusHandler { - - private IStatus status; - - public void displayStatus(String title, IStatus status) { - this.status = status; - } - - public void fail(IStatus status, boolean informUser) { - this.status = status; - } - - public void assertNoStatus() { - TestCase.assertNull("Unexpected error reported through MylarStatusHandler", status); - } - -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockTaskConnectorUi.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockTaskConnectorUi.java deleted file mode 100644 index 1c6710931..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockTaskConnectorUi.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 - 2006 Mylar 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.tasks.tests.connector; - -import org.eclipse.jface.wizard.IWizard; -import org.eclipse.mylyn.tasks.core.AbstractRepositoryQuery; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi; -import org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage; - -/** - * @author Mik Kersten - */ -public class MockTaskConnectorUi extends AbstractRepositoryConnectorUi { - - @Override - public IWizard getNewTaskWizard(TaskRepository taskRepository) { - // ignore - return null; - } - - @Override - public String getConnectorKind() { - return "mock"; - } - - @Override - public AbstractRepositorySettingsPage getSettingsPage() { - // ignore - return null; - } - - @Override - public boolean hasSearchPage() { - return false; - } - - @Override - public IWizard getQueryWizard(TaskRepository repository, AbstractRepositoryQuery query) { - // ignore - return null; - } -} diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockTaskListFactory.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockTaskListFactory.java deleted file mode 100644 index 5654f1cb4..000000000 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockTaskListFactory.java +++ /dev/null @@ -1,80 +0,0 @@ -/******************************************************************************* - * 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.tasks.tests.connector; - -import org.eclipse.mylyn.tasks.core.AbstractTask; -import org.eclipse.mylyn.tasks.core.AbstractTaskListFactory; -import org.w3c.dom.Element; - -/** - * @author Mik Kersten - */ -public class MockTaskListFactory extends AbstractTaskListFactory { - - @Override - public boolean canCreate(AbstractTask task) { - return task instanceof MockRepositoryTask; - } - - @Override - public AbstractTask createTask(String repositoryUrl, String taskId, String summary, Element element) { - MockRepositoryTask task = new MockRepositoryTask(repositoryUrl, taskId, summary); - return task; - } - - @Override - public String getTaskElementName() { - return "Mock" + AbstractTaskListFactory.KEY_TASK; - } - -// private static final String KEY_MOCK = "Mock"; -// -// @Override -// public boolean canCreateElementFor(AbstractRepositoryQuery query) { -// return query instanceof MockRepositoryQuery; -// } -// -// @Override -// public boolean canCreateElementFor(AbstractTask task) { -// return task instanceof MockRepositoryTask; -// } - -// @Override -// public boolean canCreateElementFor(AbstractQueryHit queryHit) { -// return queryHit instanceof AbstractQueryHit; -// } - -// @Override -// public boolean canReadCategory(Node node) { -// return false; -// } -// -// @Override -// public boolean canReadQuery(Node node) { -// return false; -// } -// -// @Override -// public boolean canReadQueryHit(Node node) { -// return false; -// } - -// @Override -// public String getTaskTagName() { -// return KEY_MOCK; -// } -// -// @Override -// public AbstractTask createTask(String repositoryUrl, String taskId, String summary, Element element, TaskList taskList, AbstractTaskContainer category, AbstractTask parent) -// throws TaskExternalizationException { -// MockRepositoryTask task = new MockRepositoryTask(repositoryUrl, taskId, summary); -// return task; -// } - -} diff --git a/org.eclipse.mylyn.tasks.tests/testdata/legacy/tasklist_0_4_8.xml b/org.eclipse.mylyn.tasks.tests/testdata/legacy/tasklist_0_4_8.xml deleted file mode 100644 index ca6d3bb41..000000000 --- a/org.eclipse.mylyn.tasks.tests/testdata/legacy/tasklist_0_4_8.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/context-history.xml b/org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/context-history.xml deleted file mode 100644 index dd16c2676..000000000 --- a/org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/context-history.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/local-69.xml b/org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/local-69.xml deleted file mode 100644 index eb65a146b..000000000 --- a/org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/local-69.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/local-70.xml b/org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/local-70.xml deleted file mode 100644 index 00be69490..000000000 --- a/org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/local-70.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/mylardata-2006-02-16.zip b/org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/mylardata-2006-02-16.zip deleted file mode 100644 index 326674958..000000000 Binary files a/org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/mylardata-2006-02-16.zip and /dev/null differ diff --git a/org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/mylardata-2007-01-19.zip b/org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/mylardata-2007-01-19.zip deleted file mode 100644 index 83a6ff796..000000000 Binary files a/org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/mylardata-2007-01-19.zip and /dev/null differ diff --git a/org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/repositories.xml b/org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/repositories.xml deleted file mode 100644 index bb0067736..000000000 --- a/org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/repositories.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/tasklist.xml b/org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/tasklist.xml deleted file mode 100644 index c5848ef42..000000000 --- a/org.eclipse.mylyn.tasks.tests/testdata/taskdataimporttest/tasklist.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/org.eclipse.mylyn.tasks.tests/testdata/tasklistdatamigrationtest/empty.txt b/org.eclipse.mylyn.tasks.tests/testdata/tasklistdatamigrationtest/empty.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/org.eclipse.mylyn.trac.tests/.classpath b/org.eclipse.mylyn.trac.tests/.classpath deleted file mode 100644 index 304e86186..000000000 --- a/org.eclipse.mylyn.trac.tests/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.eclipse.mylyn.trac.tests/.cvsignore b/org.eclipse.mylyn.trac.tests/.cvsignore deleted file mode 100644 index b0b9ecf46..000000000 --- a/org.eclipse.mylyn.trac.tests/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -bin -credentials.properties -credentials.properties diff --git a/org.eclipse.mylyn.trac.tests/.project b/org.eclipse.mylyn.trac.tests/.project deleted file mode 100644 index 4241ae65f..000000000 --- a/org.eclipse.mylyn.trac.tests/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.mylyn.trac.tests - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 888de1277..000000000 --- a/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,316 +0,0 @@ -#Sun Jun 24 11:52:58 EDT 2007 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=error -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nullReference=error -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore -org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.5 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=80 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=1 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=false -org.eclipse.jdt.core.formatter.comment.format_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=false -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=120 -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=120 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=true -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true \ No newline at end of file diff --git a/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 276c2e6d8..000000000 --- a/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,6 +0,0 @@ -#Mon Feb 05 18:45:19 PST 2007 -eclipse.preferences.version=1 -formatter_profile=_Mylar based on Eclipse [built-in] -formatter_settings_version=11 -internal.default.compliance=default -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.ltk.core.refactoring.prefs b/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.ltk.core.refactoring.prefs deleted file mode 100644 index 7ab03bdac..000000000 --- a/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.ltk.core.refactoring.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Fri Jun 02 15:30:09 PDT 2006 -eclipse.preferences.version=1 -org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=true diff --git a/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.mylar.tasklist.prefs b/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.mylar.tasklist.prefs deleted file mode 100644 index a6cf96a98..000000000 --- a/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.mylar.tasklist.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Fri Oct 20 16:54:30 PDT 2006 -eclipse.preferences.version=1 -project.repository.kind=bugzilla -project.repository.url=https\://bugs.eclipse.org/bugs diff --git a/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.mylyn.tasklist.prefs b/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.mylyn.tasklist.prefs deleted file mode 100644 index 0a2cc0b30..000000000 --- a/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.mylyn.tasklist.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Mon Jun 18 17:14:59 PDT 2007 -eclipse.preferences.version=1 -project.repository.kind=bugzilla -project.repository.url=https\://bugs.eclipse.org/bugs diff --git a/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.mylyn.tasks.ui.prefs b/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.mylyn.tasks.ui.prefs deleted file mode 100644 index d8c6d26af..000000000 --- a/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.mylyn.tasks.ui.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Mon Jun 25 03:02:37 GMT 2007 -eclipse.preferences.version=1 -project.repository.kind=bugzilla -project.repository.url=https\://bugs.eclipse.org/bugs diff --git a/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.pde.prefs b/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.pde.prefs deleted file mode 100644 index 769b229ff..000000000 --- a/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.pde.prefs +++ /dev/null @@ -1,12 +0,0 @@ -#Thu Nov 03 15:45:55 PST 2005 -compilers.p.deprecated=2 -compilers.p.no-required-att=0 -compilers.p.not-externalized-att=2 -compilers.p.unknown-attribute=0 -compilers.p.unknown-class=0 -compilers.p.unknown-element=0 -compilers.p.unknown-resource=0 -compilers.p.unresolved-ex-points=0 -compilers.p.unresolved-import=0 -compilers.use-project=true -eclipse.preferences.version=1 diff --git a/org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF b/org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF deleted file mode 100644 index 353e0d7f6..000000000 --- a/org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,23 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Mylar Trac Connector Tests -Bundle-SymbolicName: org.eclipse.mylyn.trac.tests -Bundle-Version: 0.0.0 -Require-Bundle: org.junit, - org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.mylyn.context.core, - org.eclipse.mylyn.tasks.ui, - org.eclipse.mylyn.tasks.core, - org.eclipse.mylyn.context.tests, - org.eclipse.mylyn.trac.ui, - org.eclipse.mylyn.trac.core, - org.eclipse.search, - org.eclipse.mylyn, - org.eclipse.ui.workbench.texteditor, - org.eclipse.jface.text, - org.eclipse.mylyn.web.core -Export-Package: org.eclipse.mylyn.trac.tests -Bundle-Activator: org.eclipse.mylyn.trac.tests.TracTestPlugin -Eclipse-LazyStart: true -Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/org.eclipse.mylyn.trac.tests/about.html b/org.eclipse.mylyn.trac.tests/about.html deleted file mode 100644 index 0dd939c09..000000000 --- a/org.eclipse.mylyn.trac.tests/about.html +++ /dev/null @@ -1,27 +0,0 @@ - - - -About - - - -

    About This Content

    - -

    June 7, 2007

    -

    License

    - -

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

    - -

    If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

    - - - \ No newline at end of file diff --git a/org.eclipse.mylyn.trac.tests/build.properties b/org.eclipse.mylyn.trac.tests/build.properties deleted file mode 100644 index 81b51c58c..000000000 --- a/org.eclipse.mylyn.trac.tests/build.properties +++ /dev/null @@ -1,11 +0,0 @@ -############################################################################### -# Copyright (c) 2005, 2006 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 -############################################################################### -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - . diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkUtilTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkUtilTest.java deleted file mode 100644 index 5b2a26ae4..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkUtilTest.java +++ /dev/null @@ -1,204 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 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.trac.ui; - -import junit.framework.TestCase; - -import org.eclipse.jface.text.Region; -import org.eclipse.jface.text.hyperlink.IHyperlink; -import org.eclipse.mylyn.internal.trac.core.TracCorePlugin; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.ui.TaskHyperlink; -import org.eclipse.mylyn.tasks.ui.WebHyperlink; - -public class TracHyperlinkUtilTest extends TestCase { - - private TaskRepository repository; - - @Override - protected void setUp() throws Exception { - super.setUp(); - - repository = new TaskRepository(TracCorePlugin.REPOSITORY_KIND, "http://localhost"); - } - - public void testFindHyperlinksComment() { - IHyperlink[] links = TracHyperlinkUtil.findHyperlinks(repository, "comment:ticket:12:34", 0, 0); - assertNotNull(links); - assertEquals(1, links.length); - assertEquals(new Region(0, 20), links[0].getHyperlinkRegion()); - assertEquals("12", ((TaskHyperlink) links[0]).getTaskId()); - } - - public void testFindHyperlinksTicket() { - IHyperlink[] links = TracHyperlinkUtil.findHyperlinks(repository, "#11", 0, 0); - assertNotNull(links); - assertEquals(1, links.length); - assertEquals(new Region(0, 3), links[0].getHyperlinkRegion()); - assertEquals("11", ((TaskHyperlink) links[0]).getTaskId()); - - links = TracHyperlinkUtil.findHyperlinks(repository, "#11, #234", 6, 0); - assertNotNull(links); - assertEquals(1, links.length); - assertEquals("234", ((TaskHyperlink) links[0]).getTaskId()); - - links = TracHyperlinkUtil.findHyperlinks(repository, " ticket:123 ", 2, 0); - assertNotNull(links); - assertEquals(1, links.length); - assertEquals(new Region(2, 10), links[0].getHyperlinkRegion()); - assertEquals("123", ((TaskHyperlink) links[0]).getTaskId()); - } - - public void testFindHyperlinksReport() { - IHyperlink[] links = TracHyperlinkUtil.findHyperlinks(repository, "report:123", 0, 0); - assertEquals(1, links.length); - assertEquals(new Region(0, 10), links[0].getHyperlinkRegion()); - assertEquals("http://localhost/report/123", ((WebHyperlink) links[0]).getURLString()); - - links = TracHyperlinkUtil.findHyperlinks(repository, "{123}", 0, 0); - assertEquals(1, links.length); - assertEquals(new Region(0, 5), links[0].getHyperlinkRegion()); - assertEquals("http://localhost/report/123", ((WebHyperlink) links[0]).getURLString()); - } - - public void testFindHyperlinksChangeset() { - IHyperlink[] links = TracHyperlinkUtil.findHyperlinks(repository, "r123", 0, 0); - assertEquals(1, links.length); - assertEquals(new Region(0, 4), links[0].getHyperlinkRegion()); - assertEquals("http://localhost/changeset/123", ((WebHyperlink) links[0]).getURLString()); - - links = TracHyperlinkUtil.findHyperlinks(repository, "[123]", 0, 0); - assertEquals(1, links.length); - assertEquals(new Region(0, 5), links[0].getHyperlinkRegion()); - assertEquals("http://localhost/changeset/123", ((WebHyperlink) links[0]).getURLString()); - - links = TracHyperlinkUtil.findHyperlinks(repository, "changeset:123", 0, 0); - assertEquals(1, links.length); - assertEquals(new Region(0, 13), links[0].getHyperlinkRegion()); - assertEquals("http://localhost/changeset/123", ((WebHyperlink) links[0]).getURLString()); - - links = TracHyperlinkUtil.findHyperlinks(repository, "[123/trunk]", 0, 0); - assertEquals(1, links.length); - assertEquals(new Region(0, 11), links[0].getHyperlinkRegion()); - assertEquals("http://localhost/changeset/123/trunk", ((WebHyperlink) links[0]).getURLString()); - - links = TracHyperlinkUtil.findHyperlinks(repository, "changeset:123/trunk", 0, 0); - assertEquals(1, links.length); - assertEquals(new Region(0, 19), links[0].getHyperlinkRegion()); - assertEquals("http://localhost/changeset/123/trunk", ((WebHyperlink) links[0]).getURLString()); - } - - public void testFindHyperlinksRevisionLog() { - IHyperlink[] links = TracHyperlinkUtil.findHyperlinks(repository, "r123:456", 0, 0); - assertEquals(2, links.length); - assertEquals("http://localhost/log/?rev=123&stop_rev=456", ((WebHyperlink) links[0]).getURLString()); - assertEquals(new Region(0, 8), links[0].getHyperlinkRegion()); - - links = TracHyperlinkUtil.findHyperlinks(repository, "[123:456]", 0, 0); - assertEquals(1, links.length); - assertEquals("http://localhost/log/?rev=123&stop_rev=456", ((WebHyperlink) links[0]).getURLString()); - assertEquals(new Region(0, 9), links[0].getHyperlinkRegion()); - - links = TracHyperlinkUtil.findHyperlinks(repository, "log:@123:456", 0, 0); - assertEquals(1, links.length); - assertEquals("http://localhost/log/?rev=123&stop_rev=456", ((WebHyperlink) links[0]).getURLString()); - assertEquals(new Region(0, 12), links[0].getHyperlinkRegion()); - - links = TracHyperlinkUtil.findHyperlinks(repository, "log:trunk@123:456", 0, 0); - assertEquals(1, links.length); - assertEquals("http://localhost/log/trunk?rev=123&stop_rev=456", ((WebHyperlink) links[0]).getURLString()); - assertEquals(new Region(0, 17), links[0].getHyperlinkRegion()); - } - - public void testFindHyperlinksDiff() { - IHyperlink[] links = TracHyperlinkUtil.findHyperlinks(repository, "diff:@123:456", 0, 0); - assertNotNull(links); - assertEquals(1, links.length); - assertEquals("http://localhost/changeset/?new=456&old=123", ((WebHyperlink) links[0]).getURLString()); - - links = TracHyperlinkUtil.findHyperlinks(repository, "diff:trunk/trac@3538//sandbox/vc-refactoring/trac@3539", - 0, 0); - assertNotNull(links); - assertEquals(1, links.length); - assertEquals( - "http://localhost/changeset/?new_path=sandbox%2Fvc-refactoring%2Ftrac&old_path=trunk%2Ftrac&new=3539&old=3538", - ((WebHyperlink) links[0]).getURLString()); - - links = TracHyperlinkUtil.findHyperlinks(repository, - "diff:tags/trac-0.9.2/wiki-default//tags/trac-0.9.3/wiki-default", 0, 0); - assertNotNull(links); - assertEquals(1, links.length); - assertEquals( - "http://localhost/changeset/?new_path=tags%2Ftrac-0.9.3%2Fwiki-default&old_path=tags%2Ftrac-0.9.2%2Fwiki-default", - ((WebHyperlink) links[0]).getURLString()); - } - - public void testFindHyperlinksWiki() { - IHyperlink[] links = TracHyperlinkUtil.findHyperlinks(repository, "[wiki:page]", 1, 0); - assertNotNull(links); - assertEquals(1, links.length); - assertEquals("http://localhost/wiki/page", ((WebHyperlink) links[0]).getURLString()); - - links = TracHyperlinkUtil.findHyperlinks(repository, "wiki:page", 0, 0); - assertNotNull(links); - assertEquals(1, links.length); - assertEquals("http://localhost/wiki/page", ((WebHyperlink) links[0]).getURLString()); - - links = TracHyperlinkUtil.findHyperlinks(repository, "Page", 0, 0); - assertNull(links); - - links = TracHyperlinkUtil.findHyperlinks(repository, "ab Page dc", 0, 0); - assertNull(links); - - links = TracHyperlinkUtil.findHyperlinks(repository, "paGe", 0, 0); - assertNull(links); - - links = TracHyperlinkUtil.findHyperlinks(repository, "WikiPage", 0, 0); - assertNotNull(links); - assertEquals(1, links.length); - assertEquals("http://localhost/wiki/WikiPage", ((WebHyperlink) links[0]).getURLString()); - assertEquals(new Region(0, 8), links[0].getHyperlinkRegion()); - - } - - public void testFindHyperlinksMilestone() { - IHyperlink[] links = TracHyperlinkUtil.findHyperlinks(repository, "milestone:1.0", 1, 0); - assertNotNull(links); - assertEquals(1, links.length); - assertEquals("http://localhost/milestone/1.0", ((WebHyperlink) links[0]).getURLString()); - } - - public void testFindHyperlinksAttachment() { - IHyperlink[] links = TracHyperlinkUtil.findHyperlinks(repository, "attachment:ticket:123:foo.bar", 1, 0); - assertNotNull(links); - assertEquals("123", ((TaskHyperlink) links[0]).getTaskId()); - } - - public void testFindHyperlinksFiles() { - IHyperlink[] links = TracHyperlinkUtil.findHyperlinks(repository, "source:trunk/foo", 1, 0); - assertNotNull(links); - assertEquals(1, links.length); - assertEquals("http://localhost/browser/trunk/foo", ((WebHyperlink) links[0]).getURLString()); - - links = TracHyperlinkUtil.findHyperlinks(repository, "source:trunk/foo@123", 1, 0); - assertNotNull(links); - assertEquals(1, links.length); - assertEquals("http://localhost/browser/trunk/foo?rev=123", ((WebHyperlink) links[0]).getURLString()); - - links = TracHyperlinkUtil.findHyperlinks(repository, "source:trunk/foo@123#L456", 1, 0); - assertNotNull(links); - assertEquals(1, links.length); - assertEquals("http://localhost/browser/trunk/foo?rev=123#L456", ((WebHyperlink) links[0]).getURLString()); - - links = TracHyperlinkUtil.findHyperlinks(repository, "source:/tags/foo_bar-1.1", 1, 0); - assertNotNull(links); - assertEquals(1, links.length); - assertEquals("http://localhost/browser/tags/foo_bar-1.1", ((WebHyperlink) links[0]).getURLString()); - } - -} diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientRepositoryTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientRepositoryTest.java deleted file mode 100644 index 9c9a5012a..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientRepositoryTest.java +++ /dev/null @@ -1,113 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mylar project committers - initial API and implementation - *******************************************************************************/ - -package org.eclipse.mylyn.trac.tests; - -import java.net.InetSocketAddress; -import java.net.Proxy; -import java.net.Proxy.Type; - -import org.eclipse.mylyn.context.tests.support.TestUtil; -import org.eclipse.mylyn.context.tests.support.TestUtil.Credentials; -import org.eclipse.mylyn.context.tests.support.TestUtil.PrivilegeLevel; -import org.eclipse.mylyn.internal.trac.core.ITracClient; -import org.eclipse.mylyn.internal.trac.core.TracException; -import org.eclipse.mylyn.internal.trac.core.TracLoginException; -import org.eclipse.mylyn.internal.trac.core.ITracClient.Version; - -/** - * Test cases for classes that implement {@link ITracClient}. - * - * @author Steffen Pingel - */ -public class AbstractTracClientRepositoryTest extends AbstractTracClientTest { - - public AbstractTracClientRepositoryTest(Version version) { - super(version); - } - - public void testValidate010() throws Exception { - validate(TracTestConstants.TEST_TRAC_010_URL); - } - - public void testValidate010DigestAuth() throws Exception { - validate(TracTestConstants.TEST_TRAC_010_DIGEST_AUTH_URL); - } - - public void testValidate011() throws Exception { - validate(TracTestConstants.TEST_TRAC_011_URL); - } - - public void testValidate010FormAuth() throws Exception { - validate(TracTestConstants.TEST_TRAC_010_FORM_AUTH_URL); - } - - protected void validate(String url) throws Exception { - Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER); - - // standard connect - connect(url); - repository.validate(); - - // invalid url - connect("http://non.existant/repository"); - try { - repository.validate(); - fail("Expected TracException"); - } catch (TracException e) { - } - - // invalid password - connect(url, credentials.username, "wrongpassword"); - try { - repository.validate(); - fail("Expected TracLoginException"); - } catch (TracLoginException e) { - } - - // invalid username - connect(url, "wrongusername", credentials.password); - try { - repository.validate(); - fail("Expected TracLoginException"); - } catch (TracLoginException e) { - } - } - - public void testProxy() throws Exception { - connect(TracTestConstants.TEST_TRAC_010_URL, "", "", new Proxy(Type.HTTP, new InetSocketAddress( - "invalidhostname", 8080))); - try { - repository.validate(); - fail("Expected IOException"); - } catch (TracException e) { - } - - connect(TracTestConstants.TEST_TRAC_010_URL, "", "", null); - repository.setProxy(new Proxy(Type.HTTP, new InetSocketAddress("invalidhostname", 8080))); - try { - repository.validate(); - fail("Expected IOException"); - } catch (TracException e) { - } - - connect(TracTestConstants.TEST_TRAC_010_URL); - repository.validate(); - repository.setProxy(new Proxy(Type.HTTP, new InetSocketAddress("invalidhostname", 8080))); - try { - repository.validate(); - fail("Expected IOException"); - } catch (TracException e) { - } - - } - -} diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientSearchTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientSearchTest.java deleted file mode 100644 index 8df5d4fdb..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientSearchTest.java +++ /dev/null @@ -1,233 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mylar project committers - initial API and implementation - *******************************************************************************/ - -package org.eclipse.mylyn.trac.tests; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import org.eclipse.mylyn.internal.trac.core.ITracClient; -import org.eclipse.mylyn.internal.trac.core.TracException; -import org.eclipse.mylyn.internal.trac.core.ITracClient.Version; -import org.eclipse.mylyn.internal.trac.core.model.TracSearch; -import org.eclipse.mylyn.internal.trac.core.model.TracTicket; -import org.eclipse.mylyn.internal.trac.core.model.TracTicket.Key; -import org.eclipse.mylyn.trac.tests.support.TestFixture; -import org.eclipse.mylyn.trac.tests.support.XmlRpcServer.TestData; -import org.eclipse.mylyn.trac.tests.support.XmlRpcServer.Ticket; - -/** - * Test cases that validate search results for classes that implement {@link ITracClient}. - * - * @author Steffen Pingel - */ -public abstract class AbstractTracClientSearchTest extends AbstractTracClientTest { - - protected List tickets; - - private TestData data; - - public AbstractTracClientSearchTest(Version version) { - super(version); - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - - data = TestFixture.init010(); - tickets = data.tickets; - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - - // TestFixture.cleanupRepository1(); - } - - protected void assertTicketEquals(Ticket ticket, TracTicket tracTicket) throws Exception { - assertTrue(tracTicket.isValid()); - - Map expectedValues = ticket.getValues(); - Map values = tracTicket.getValues(); - for (String key : values.keySet()) { - assertEquals("Values for key '" + key + "' did not match", expectedValues.get(key), values.get(key)); - } - } - - public void testGetTicket010() throws Exception { - connect010(); - getTickets(); - } - - public void testGetTicket011() throws Exception { - if (version == Version.TRAC_0_9) { - // XXX need to fix bug 175211 - return; - } - - connect011(); - getTickets(); - } - - private void getTickets() throws Exception { - TracTicket ticket = repository.getTicket(tickets.get(0).getId()); - assertTicketEquals(tickets.get(0), ticket); - - ticket = repository.getTicket(tickets.get(1).getId()); - assertTicketEquals(tickets.get(1), ticket); - } - - public void testGetTicketInvalidId010() throws Exception { - connect010(); - getTicketInvalidId(); - } - - public void testGetTicketInvalidId011() throws Exception { - connect011(); - getTicketInvalidId(); - } - - private void getTicketInvalidId() throws Exception { - try { - repository.getTicket(Integer.MAX_VALUE); - fail("Expected TracException"); - } catch (TracException e) { - } - } - - public void testGetTicketUmlaute010() throws Exception { - connect010(); - getTicketUmlaute(); - } - - public void testGetTicketUmlaute011() throws Exception { - if (version == Version.TRAC_0_9) { - // XXX need to fix bug 175211 - return; - } - - connect011(); - getTicketUmlaute(); - } - - private void getTicketUmlaute() throws Exception { - TracTicket ticket = repository.getTicket(data.htmlEntitiesTicketId); - assertEquals("test html entities: \u00E4\u00F6\u00FC", ticket.getValue(Key.SUMMARY)); - if (version == Version.XML_RPC) { - assertEquals("\u00C4\u00D6\u00DC\n\nmulti\nline\n\n'''bold'''\n", ticket.getValue(Key.DESCRIPTION)); - } else { - assertEquals(null, ticket.getValue(Key.DESCRIPTION)); - } - } - - public void testSearchAll010() throws Exception { - connect010(); - searchAll(); - } - - public void testSearchAll011() throws Exception { - connect011(); - searchAll(); - } - - private void searchAll() throws Exception { - TracSearch search = new TracSearch(); - List result = new ArrayList(); - repository.search(search, result); - assertEquals(tickets.size(), result.size()); - } - - public void testSearchEmpty010() throws Exception { - connect010(); - searchEmpty(); - } - - public void testSearchEmpty011() throws Exception { - connect011(); - searchEmpty(); - } - - private void searchEmpty() throws Exception { - TracSearch search = new TracSearch(); - search.addFilter("milestone", "does not exist"); - List result = new ArrayList(); - repository.search(search, result); - assertEquals(0, result.size()); - } - - public void testSearchMilestone1010() throws Exception { - connect010(); - searchMilestone1(); - } - - public void testSearchMilestone1011() throws Exception { - connect011(); - searchMilestone1(); - } - - private void searchMilestone1() throws Exception { - TracSearch search = new TracSearch(); - search.addFilter("milestone", "milestone1"); - List result = new ArrayList(); - repository.search(search, result); - assertEquals(1, result.size()); - assertTicketEquals(tickets.get(0), result.get(0)); - } - - public void testSearchMilestone2010() throws Exception { - connect010(); - searchMilestone2(); - } - - public void testSearchMilestone2011() throws Exception { - connect011(); - searchMilestone2(); - } - - private void searchMilestone2() throws Exception { - TracSearch search = new TracSearch(); - search.addFilter("milestone", "milestone1"); - search.addFilter("milestone", "milestone2"); - search.setOrderBy("id"); - List result = new ArrayList(); - repository.search(search, result); - assertEquals(3, result.size()); - assertTicketEquals(tickets.get(0), result.get(0)); - assertTicketEquals(tickets.get(1), result.get(1)); - assertTicketEquals(tickets.get(2), result.get(2)); - } - - public void testSearchExactMatch010() throws Exception { - connect010(); - searchExactMatch(); - } - - public void testSearchExactMatch011() throws Exception { - connect011(); - searchExactMatch(); - } - - private void searchExactMatch() throws Exception { - TracSearch search = new TracSearch(); - search.addFilter("milestone", "milestone1"); - search.addFilter("summary", "summary1"); - List result = new ArrayList(); - repository.search(search, result); - assertEquals(1, result.size()); - assertTicketEquals(tickets.get(0), result.get(0)); - assertEquals("milestone1", result.get(0).getValue(Key.MILESTONE)); - assertEquals("summary1", result.get(0).getValue(Key.SUMMARY)); - } - -} diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientTest.java deleted file mode 100644 index ce3d01db2..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientTest.java +++ /dev/null @@ -1,100 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mylar project committers - initial API and implementation - *******************************************************************************/ - -package org.eclipse.mylyn.trac.tests; - -import java.net.Proxy; - -import junit.framework.TestCase; - -import org.eclipse.mylyn.context.tests.support.TestUtil; -import org.eclipse.mylyn.context.tests.support.TestUtil.Credentials; -import org.eclipse.mylyn.context.tests.support.TestUtil.PrivilegeLevel; -import org.eclipse.mylyn.internal.trac.core.ITracClient; -import org.eclipse.mylyn.internal.trac.core.TracClientFactory; -import org.eclipse.mylyn.internal.trac.core.ITracClient.Version; - -/** - * Provides a base implementation for test cases that access trac repositories. - * - * @author Steffen Pingel - */ -public abstract class AbstractTracClientTest extends TestCase { - - public String repositoryUrl; - - public ITracClient repository; - - public String username; - - public String password; - - public Version version; - - private PrivilegeLevel level; - - public AbstractTracClientTest(Version version, PrivilegeLevel level) { - this.version = version; - this.level = level; - } - - public AbstractTracClientTest(Version version) { - this(version, PrivilegeLevel.USER); - } - - public AbstractTracClientTest() { - this(null, PrivilegeLevel.USER); - } - - public ITracClient connect096() throws Exception { - return connect(TracTestConstants.TEST_TRAC_096_URL); - } - - public ITracClient connect010() throws Exception { - return connect(TracTestConstants.TEST_TRAC_010_URL); - } - - public ITracClient connect010DigestAuth() throws Exception { - return connect(TracTestConstants.TEST_TRAC_010_DIGEST_AUTH_URL); - } - - public ITracClient connect011() throws Exception { - return connect(TracTestConstants.TEST_TRAC_011_URL); - } - - public ITracClient connect(String url) throws Exception { - return connect(url, Proxy.NO_PROXY); - } - - public ITracClient connect(String url, Proxy proxy) throws Exception { - Credentials credentials = TestUtil.readCredentials(level); - return connect(url, credentials.username, credentials.password, proxy); - } - - public ITracClient connect(String url, String username, String password) throws Exception { - return connect(url, username, password, Proxy.NO_PROXY); - } - - public ITracClient connect(String url, String username, String password, Proxy proxy) throws Exception { - return connect(url, username, password, proxy, version); - } - - public ITracClient connect(String url, String username, String password, Proxy proxy, Version version) - throws Exception { - this.repositoryUrl = url; - this.username = username; - this.password = password; - this.repository = TracClientFactory.createClient(url, version, username, password, proxy); - - return this.repository; - } - -} diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracTests.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracTests.java deleted file mode 100644 index a741e8d5c..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracTests.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mylar project committers - initial API and implementation - *******************************************************************************/ - -package org.eclipse.mylyn.trac.tests; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.eclipse.mylyn.internal.trac.ui.TracHyperlinkUtilTest; - -/** - * @author Mik Kersten - * @author Steffen Pingel - */ -public class AllTracTests { - - public static Test suite() { -// UrlConnectionUtil.initCommonsLoggingSettings(); - - TestSuite suite = new TestSuite("Test for org.eclipse.mylyn.trac.tests"); - // $JUnit-BEGIN$ - // suite.addTestSuite(TracXmlRpcTest.class); - suite.addTestSuite(TracSearchTest.class); - suite.addTestSuite(TracTicketTest.class); - suite.addTestSuite(TracXmlRpcClientTest.class); - suite.addTestSuite(TracXmlRpcClientSearchTest.class); - suite.addTestSuite(TracWebClientTest.class); - suite.addTestSuite(TracWebClientSearchTest.class); - suite.addTestSuite(TracClientFactoryTest.class); - suite.addTestSuite(TracRepositoryConnectorTest.class); - suite.addTestSuite(TracQueryTest.class); - suite.addTestSuite(TracRepositoryQueryTest.class); - suite.addTestSuite(TracClientManagerTest.class); - suite.addTestSuite(TracAttachmentHandlerTest.class); - suite.addTestSuite(RepositorySearchQueryTest.class); - suite.addTestSuite(TracTaskDataHandlerTest.class); - suite.addTestSuite(TracTaskTest.class); - suite.addTestSuite(TracRepositorySettingsPageTest.class); - suite.addTestSuite(TracClientProxyTest.class); - suite.addTestSuite(TracHyperlinkUtilTest.class); - // $JUnit-END$ - return suite; - } - -} \ No newline at end of file diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/RepositorySearchQueryTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/RepositorySearchQueryTest.java deleted file mode 100644 index 89606aa9e..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/RepositorySearchQueryTest.java +++ /dev/null @@ -1,90 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mylar project committers - initial API and implementation - *******************************************************************************/ - -package org.eclipse.mylyn.trac.tests; - -import junit.framework.TestCase; - -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.mylyn.context.tests.support.TestUtil; -import org.eclipse.mylyn.context.tests.support.TestUtil.Credentials; -import org.eclipse.mylyn.context.tests.support.TestUtil.PrivilegeLevel; -import org.eclipse.mylyn.internal.trac.core.ITracClient; -import org.eclipse.mylyn.internal.trac.core.TracCorePlugin; -import org.eclipse.mylyn.internal.trac.core.TracRepositoryQuery; -import org.eclipse.mylyn.internal.trac.core.ITracClient.Version; -import org.eclipse.mylyn.internal.trac.core.model.TracSearch; -import org.eclipse.mylyn.tasks.core.AbstractTask; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.TaskRepositoryManager; -import org.eclipse.mylyn.tasks.ui.TaskFactory; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; -import org.eclipse.mylyn.tasks.ui.search.SearchHitCollector; -import org.eclipse.mylyn.trac.tests.support.TestFixture; -import org.eclipse.mylyn.trac.tests.support.XmlRpcServer.TestData; - -/** - * @author Steffen Pingel - */ -public class RepositorySearchQueryTest extends TestCase { - - private TestData data; - - private TaskRepositoryManager manager; - -// private TracRepositoryConnector connector; - - private TaskRepository repository; - - public RepositorySearchQueryTest() { - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - - data = TestFixture.init010(); - manager = TasksUiPlugin.getRepositoryManager(); - manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); - -// connector = (TracRepositoryConnector) manager.getRepositoryConnector(TracUiPlugin.REPOSITORY_KIND); - TasksUiPlugin.getSynchronizationManager().setForceSyncExec(true); - } - - protected void init(String url, Version version) { - Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER); - - repository = new TaskRepository(TracCorePlugin.REPOSITORY_KIND, url); - repository.setAuthenticationCredentials(credentials.username, credentials.password); - repository.setTimeZoneId(ITracClient.TIME_ZONE); - repository.setCharacterEncoding(ITracClient.CHARSET); - repository.setVersion(version.name()); - - manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath()); - } - - public void testSearch() { - init(TracTestConstants.TEST_TRAC_096_URL, Version.TRAC_0_9); - - TracSearch search = new TracSearch(); - String queryUrl = repository.getUrl() + ITracClient.QUERY_URL + search.toUrl(); - TracRepositoryQuery query = new TracRepositoryQuery(repository.getUrl(), queryUrl, "description"); - SearchHitCollector collector = new SearchHitCollector(TasksUiPlugin.getTaskListManager().getTaskList(), - repository, query, new TaskFactory(repository, false, false)); - - collector.run(new NullProgressMonitor()); - for (AbstractTask task : collector.getTasks()) { - assertEquals(TracTestConstants.TEST_TRAC_096_URL, task.getRepositoryUrl()); - } - assertEquals(data.tickets.size(), collector.getTasks().size()); - } - -} diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TestProxy.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TestProxy.java deleted file mode 100644 index 368262191..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TestProxy.java +++ /dev/null @@ -1,234 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 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.trac.tests; - -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.EOFException; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.InterruptedIOException; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.net.ServerSocket; -import java.net.Socket; -import java.util.HashMap; -import java.util.Map; -import java.util.StringTokenizer; - -public class TestProxy implements Runnable { - - public static final String NOT_FOUND = "HTTP/1.1 404 Not Found"; - - private int listenPort; - - private Message request; - - private Message response; - - private Thread runner; - - private IOException exception; - - private volatile boolean stopped = false; - - public TestProxy(int listenPort) { - this.listenPort = listenPort; - } - - public TestProxy() { - } - - public synchronized int getListenPort() throws InterruptedException { - while (listenPort == 0) { - wait(); - } - return listenPort; - } - - public void start() { - runner = new Thread(this, "TestProxy :" + listenPort); - runner.start(); - } - - public int startAndWait() throws InterruptedException { - start(); - int port = getListenPort(); - // wait for socket to enter accept call - Thread.sleep(100); - return port; - } - - public void run() { - ServerSocket serverSocket = null; - try { - serverSocket = new ServerSocket(listenPort); - synchronized (this) { - listenPort = serverSocket.getLocalPort(); - notifyAll(); - } - while (!stopped) { - Socket socket = serverSocket.accept(); - try { - Message request = readMessage(socket.getInputStream()); - setRequest(request); - - Message response = waitForResponse(); - writeMessage(response, socket.getOutputStream()); - } finally { - try { - socket.close(); - } catch (IOException e1) { - } - } - } - } catch (InterruptedIOException e) { - } catch (IOException e) { - setException(e); - } catch (InterruptedException e) { - } finally { - if (serverSocket != null) { - try { - serverSocket.close(); - } catch (IOException e) { - } - } - } - - } - - private void writeMessage(Message message, OutputStream out) throws IOException { - BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out)); - writer.write(message.toString()); - } - - private synchronized void setException(IOException exception) { - this.exception = exception; - notifyAll(); - } - - public synchronized void checkForException() throws IOException { - if (exception != null) { - throw exception; - } - } - - private Message readMessage(InputStream in) throws IOException { - BufferedReader reader = new BufferedReader(new InputStreamReader(in)); - Message message = null; - String line; - while ((line = reader.readLine()) != null) { - if (line.length() == 0) { - if (message == null) { - throw new IOException("Incomplete message"); - } - return message; - } - - if (message == null) { - message = new Message(line); - } else { - StringTokenizer t = new StringTokenizer(line, ":"); - message.headers.put(t.nextToken(), t.nextToken().trim()); - } - } - throw new EOFException(); - } - - public void stop() { - stopped = true; - runner.interrupt(); - try { - runner.join(500); - } catch (InterruptedException e) { - } - } - - public Message getRequest() { - return request; - } - - public synchronized Message waitForRequest() throws InterruptedException { - while (request == null) { - wait(); - } - return request; - } - - public synchronized Message waitForResponse() throws InterruptedException { - while (response == null) { - wait(); - } - return response; - } - - public synchronized void setResponse(Message response) { - this.response = response; - notifyAll(); - } - - public synchronized void setResponse(String response) { - this.response = new Message(response); - notifyAll(); - } - - public synchronized void setRequest(Message request) { - this.request = request; - notifyAll(); - } - - public static class Message { - - public Message(String request) { - this.request = request; - } - - public String request; - - public Map headers = new HashMap(); - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(request); - sb.append("\n"); - if (headers != null) { - for (String key : headers.keySet()) { - sb.append(key + ": " + headers.get(key)); - sb.append("\n"); - } - } - sb.append("\n"); - return sb.toString(); - } - - public String getMethod() { - int i = request.indexOf(" "); - return (i != -1) ? request.substring(0, i) : request; - } - - } - - public static void main(String[] args) { - TestProxy proxy = new TestProxy(8080); - proxy.start(); - try { - proxy.setResponse(new Message("404 / HTTP 1.1")); - try { - System.out.println(proxy.waitForRequest()); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } finally { - proxy.stop(); - } - - } - -} diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracAttachmentHandlerTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracAttachmentHandlerTest.java deleted file mode 100644 index 9e63498bd..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracAttachmentHandlerTest.java +++ /dev/null @@ -1,210 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mylar project committers - initial API and implementation - *******************************************************************************/ - -package org.eclipse.mylyn.trac.tests; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.InputStream; -import java.io.OutputStream; - -import junit.framework.TestCase; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.mylyn.context.tests.support.TestUtil; -import org.eclipse.mylyn.context.tests.support.TestUtil.Credentials; -import org.eclipse.mylyn.context.tests.support.TestUtil.PrivilegeLevel; -import org.eclipse.mylyn.internal.trac.core.ITracClient; -import org.eclipse.mylyn.internal.trac.core.TracCorePlugin; -import org.eclipse.mylyn.internal.trac.core.TracRepositoryConnector; -import org.eclipse.mylyn.internal.trac.core.TracTask; -import org.eclipse.mylyn.internal.trac.core.ITracClient.Version; -import org.eclipse.mylyn.tasks.core.AbstractAttachmentHandler; -import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; -import org.eclipse.mylyn.tasks.core.FileAttachment; -import org.eclipse.mylyn.tasks.core.RepositoryTaskData; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.TaskRepositoryManager; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; -import org.eclipse.mylyn.trac.tests.support.TestFixture; -import org.eclipse.mylyn.trac.tests.support.XmlRpcServer.TestData; - -/** - * @author Steffen Pingel - */ -public class TracAttachmentHandlerTest extends TestCase { - - private TaskRepository repository; - - private TaskRepositoryManager manager; - - private TracRepositoryConnector connector; - - private AbstractAttachmentHandler attachmentHandler; - - private TestData data; - - @Override - protected void setUp() throws Exception { - super.setUp(); - - manager = TasksUiPlugin.getRepositoryManager(); - manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); - data = TestFixture.init010(); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - } - - protected void init(String url, Version version) { - String kind = TracCorePlugin.REPOSITORY_KIND; - Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER); - - repository = new TaskRepository(kind, url); - repository.setAuthenticationCredentials(credentials.username, credentials.password); - repository.setTimeZoneId(ITracClient.TIME_ZONE); - repository.setCharacterEncoding(ITracClient.CHARSET); - repository.setVersion(version.name()); - - manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath()); - - AbstractRepositoryConnector abstractConnector = manager.getRepositoryConnector(kind); - connector = (TracRepositoryConnector) abstractConnector; - TasksUiPlugin.getSynchronizationManager().setForceSyncExec(true); - - attachmentHandler = connector.getAttachmentHandler(); - } - - public void testDownloadAttachmentXmlRpc010() throws Exception { - downloadAttachmentXmlRpc(TracTestConstants.TEST_TRAC_010_URL); - } - - public void testDownloadAttachmentXmlRpc011() throws Exception { - downloadAttachmentXmlRpc(TracTestConstants.TEST_TRAC_011_URL); - } - - private void downloadAttachmentXmlRpc(String url) throws Exception { - init(url, Version.XML_RPC); - TracTask task = (TracTask) connector.createTaskFromExistingId(repository, data.attachmentTicketId + "", - new NullProgressMonitor()); - TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null); - RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), - task.getTaskId()); - - assertTrue(taskData.getAttachments().size() > 0); - File file = File.createTempFile("attachment", null); - file.deleteOnExit(); - attachmentHandler.downloadAttachment(repository, taskData.getAttachments().get(0), new FileOutputStream(file), - new NullProgressMonitor()); - - byte[] result = new byte[6]; - InputStream in = new FileInputStream(file); - try { - in.read(result); - assertEquals("Mylar\n", new String(result)); - assertEquals(-1, in.read()); - } finally { - in.close(); - } - } - - public void testGetAttachmentDataXmlRpc010() throws Exception { - getAttachmentDataXmlRpc(TracTestConstants.TEST_TRAC_010_URL); - } - - public void testGetAttachmentDataXmlRpc011() throws Exception { - getAttachmentDataXmlRpc(TracTestConstants.TEST_TRAC_011_URL); - } - - private void getAttachmentDataXmlRpc(String url) throws Exception { - init(url, Version.XML_RPC); - TracTask task = (TracTask) connector.createTaskFromExistingId(repository, data.attachmentTicketId + "", - new NullProgressMonitor()); - TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null); - RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), - task.getTaskId()); - - assertTrue(taskData.getAttachments().size() > 0); - InputStream in = attachmentHandler.getAttachmentAsStream(repository, taskData.getAttachments().get(0), - new NullProgressMonitor()); - byte[] result = new byte[6]; - try { - in.read(result); - } finally { - in.close(); - } - assertEquals("Mylar\n", new String(result)); - } - - public void testUploadAttachmentXmlRpc010() throws Exception { - uploadAttachmentXmlRpc(TracTestConstants.TEST_TRAC_010_URL); - } - - public void testUploadAttachmentXmlRpc011() throws Exception { - uploadAttachmentXmlRpc(TracTestConstants.TEST_TRAC_011_URL); - } - - private void uploadAttachmentXmlRpc(String url) throws Exception { - init(url, Version.XML_RPC); - TracTask task = (TracTask) connector.createTaskFromExistingId(repository, data.attachmentTicketId + "", - new NullProgressMonitor()); - File file = File.createTempFile("attachment", null); - file.deleteOnExit(); - OutputStream out = new FileOutputStream(file); - try { - out.write("Mylar".getBytes()); - } finally { - out.close(); - } - FileAttachment attachment = new FileAttachment(file); - attachment.setDescription(""); - attachmentHandler.uploadAttachment(repository, task, attachment, "comment", new NullProgressMonitor()); - - ITracClient client = connector.getClientManager().getRepository(repository); - InputStream in = client.getAttachmentData(data.attachmentTicketId, file.getName()); - byte[] result = new byte[5]; - in.read(result); - assertEquals("Mylar", new String(result)); - } - - public void testCanUploadAttachmentXmlRpc() throws CoreException { - init(TracTestConstants.TEST_TRAC_010_URL, Version.XML_RPC); - TracTask task = (TracTask) connector.createTaskFromExistingId(repository, data.attachmentTicketId + "", - new NullProgressMonitor()); - assertTrue(attachmentHandler.canUploadAttachment(repository, task)); - } - - public void testCanUploadAttachmentWeb() throws CoreException { - init(TracTestConstants.TEST_TRAC_010_URL, Version.TRAC_0_9); - TracTask task = (TracTask) connector.createTaskFromExistingId(repository, data.attachmentTicketId + "", - new NullProgressMonitor()); - assertFalse(attachmentHandler.canUploadAttachment(repository, task)); - } - - public void testCanDownloadAttachmentXmlRpc() throws Exception { - init(TracTestConstants.TEST_TRAC_010_URL, Version.XML_RPC); - TracTask task = (TracTask) connector.createTaskFromExistingId(repository, data.attachmentTicketId + "", - new NullProgressMonitor()); - assertTrue(attachmentHandler.canDownloadAttachment(repository, task)); - } - - public void testCanDownloadAttachmentWeb() throws Exception { - init(TracTestConstants.TEST_TRAC_010_URL, Version.TRAC_0_9); - TracTask task = (TracTask) connector.createTaskFromExistingId(repository, data.attachmentTicketId + "", - new NullProgressMonitor()); - assertFalse(attachmentHandler.canDownloadAttachment(repository, task)); - } - -} diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientFactoryTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientFactoryTest.java deleted file mode 100644 index d7b71c8da..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientFactoryTest.java +++ /dev/null @@ -1,96 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mylar project committers - initial API and implementation - *******************************************************************************/ - -package org.eclipse.mylyn.trac.tests; - -import java.net.Proxy; - -import junit.framework.TestCase; - -import org.eclipse.mylyn.context.tests.support.TestUtil; -import org.eclipse.mylyn.context.tests.support.TestUtil.Credentials; -import org.eclipse.mylyn.context.tests.support.TestUtil.PrivilegeLevel; -import org.eclipse.mylyn.internal.trac.core.ITracClient; -import org.eclipse.mylyn.internal.trac.core.TracWebClient; -import org.eclipse.mylyn.internal.trac.core.TracClientFactory; -import org.eclipse.mylyn.internal.trac.core.TracException; -import org.eclipse.mylyn.internal.trac.core.TracLoginException; -import org.eclipse.mylyn.internal.trac.core.TracXmlRpcClient; -import org.eclipse.mylyn.internal.trac.core.ITracClient.Version; - -/** - * @author Steffen Pingel - */ -public class TracClientFactoryTest extends TestCase { - - public void testCreateClient() throws Exception { - ITracClient client = TracClientFactory.createClient(TracTestConstants.TEST_TRAC_010_URL, Version.TRAC_0_9, - "user", "password", Proxy.NO_PROXY); - assertTrue(client instanceof TracWebClient); - client = TracClientFactory.createClient(TracTestConstants.TEST_TRAC_010_SSL_URL, Version.TRAC_0_9, "user", - "password", Proxy.NO_PROXY); - assertTrue(client instanceof TracWebClient); - - client = TracClientFactory.createClient(TracTestConstants.TEST_TRAC_010_URL, Version.XML_RPC, "user", - "password", Proxy.NO_PROXY); - assertTrue(client instanceof TracXmlRpcClient); - client = TracClientFactory.createClient(TracTestConstants.TEST_TRAC_010_SSL_URL, Version.XML_RPC, "user", - "password", Proxy.NO_PROXY); - assertTrue(client instanceof TracXmlRpcClient); - } - - public void testCreateClientNull() throws Exception { - try { - TracClientFactory.createClient(TracTestConstants.TEST_TRAC_010_URL, null, "user", "password", - Proxy.NO_PROXY); - fail("Expected Exception"); - } catch (Exception e) { - } - } - - public void testProbeClient096() throws Exception { - probeClient(TracTestConstants.TEST_TRAC_096_URL, false); - } - - public void testProbeClient010() throws Exception { - probeClient(TracTestConstants.TEST_TRAC_010_URL, true); - } - - public void testProbeClient010DigestAuth() throws Exception { - probeClient(TracTestConstants.TEST_TRAC_010_DIGEST_AUTH_URL, true); - } - - protected void probeClient(String url, boolean xmlrpcInstalled) throws Exception { - Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER); - Version version = TracClientFactory.probeClient(url, credentials.username, credentials.password, Proxy.NO_PROXY); - if (xmlrpcInstalled) { - assertEquals(Version.XML_RPC, version); - } else { - assertEquals(Version.TRAC_0_9, version); - } - - version = TracClientFactory.probeClient(url, "", "", Proxy.NO_PROXY); - assertEquals(Version.TRAC_0_9, version); - - try { - version = TracClientFactory.probeClient(url, "invaliduser", "password", Proxy.NO_PROXY); - fail("Expected TracLoginException, got " + version); - } catch (TracLoginException e) { - } - - try { - version = TracClientFactory.probeClient(url + "/nonexistant", "", "", Proxy.NO_PROXY); - fail("Expected TracException, got " + version); - } catch (TracException e) { - } - } - -} diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientManagerTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientManagerTest.java deleted file mode 100644 index c508bd402..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientManagerTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mylar project committers - initial API and implementation - *******************************************************************************/ - -package org.eclipse.mylyn.trac.tests; - -import java.io.File; -import java.util.Arrays; - -import junit.framework.TestCase; - -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.mylyn.internal.trac.core.ITracClient; -import org.eclipse.mylyn.internal.trac.core.TracClientManager; -import org.eclipse.mylyn.internal.trac.core.TracCorePlugin; -import org.eclipse.mylyn.internal.trac.core.ITracClient.Version; -import org.eclipse.mylyn.internal.trac.core.model.TracMilestone; -import org.eclipse.mylyn.tasks.core.TaskRepository; - -/** - * @author Steffen Pingel - */ -public class TracClientManagerTest extends TestCase { - - public void testNullCache() throws Exception { - TaskRepository taskRepository = new TaskRepository(TracCorePlugin.REPOSITORY_KIND, - TracTestConstants.TEST_TRAC_096_URL); - taskRepository.setVersion(Version.TRAC_0_9.name()); - - TracClientManager manager = new TracClientManager(null); - ITracClient client = manager.getRepository(taskRepository); - assertNull(client.getMilestones()); - - manager.writeCache(); - assertNull(client.getMilestones()); - } - - public void testReadCache() throws Exception { - TaskRepository taskRepository = new TaskRepository(TracCorePlugin.REPOSITORY_KIND, - TracTestConstants.TEST_TRAC_096_URL); - taskRepository.setVersion(Version.TRAC_0_9.name()); - - File file = File.createTempFile("mylar", null); - file.deleteOnExit(); - - TracClientManager manager = new TracClientManager(file); - ITracClient client = manager.getRepository(taskRepository); - assertNull(client.getMilestones()); - } - - public void testWriteCache() throws Exception { - TaskRepository taskRepository = new TaskRepository(TracCorePlugin.REPOSITORY_KIND, - TracTestConstants.TEST_TRAC_096_URL); - taskRepository.setVersion(Version.TRAC_0_9.name()); - - File file = File.createTempFile("mylar", null); - file.deleteOnExit(); - - TracClientManager manager = new TracClientManager(file); - ITracClient client = manager.getRepository(taskRepository); - assertNull(client.getMilestones()); - - client.updateAttributes(new NullProgressMonitor(), false); - assertTrue(client.getMilestones().length > 0); - TracMilestone[] milestones = client.getMilestones(); - - manager.writeCache(); - manager = new TracClientManager(file); - assertEquals(Arrays.asList(milestones), Arrays.asList(client.getMilestones())); - } - -} diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientProxyTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientProxyTest.java deleted file mode 100644 index b772fae50..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientProxyTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 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.trac.tests; - -import java.net.Proxy; - -import org.eclipse.mylyn.internal.trac.core.ITracClient; -import org.eclipse.mylyn.internal.trac.core.TracException; -import org.eclipse.mylyn.internal.trac.core.ITracClient.Version; -import org.eclipse.mylyn.web.core.WebClientUtil; - -public class TracClientProxyTest extends AbstractTracClientTest { - - private TestProxy testProxy; - - private Proxy proxy; - - private int proxyPort; - - public TracClientProxyTest() { - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - - testProxy = new TestProxy(); - proxyPort = testProxy.startAndWait(); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - - testProxy.stop(); - } - - public void testConnectProxyWeb() throws Exception { - version = Version.TRAC_0_9; - connectProxy(TracTestConstants.TEST_TRAC_010_URL, "GET"); - } - - public void testConnectProxyXmlRpc() throws Exception { - version = Version.XML_RPC; - connectProxy(TracTestConstants.TEST_TRAC_010_URL, "POST"); - } - - public void testConnectProxySslWeb() throws Exception { - version = Version.TRAC_0_9; - connectProxy(TracTestConstants.TEST_TRAC_010_SSL_URL, "CONNECT"); - } - - public void testConnectProxySslXmlRpc() throws Exception { - version = Version.XML_RPC; - connectProxy(TracTestConstants.TEST_TRAC_010_SSL_URL, "CONNECT"); - } - - private void connectProxy(String url, String expectedMethod) throws Exception { - testProxy.setResponse(TestProxy.NOT_FOUND); - proxy = WebClientUtil.getProxy("localhost", proxyPort + "", "", ""); - ITracClient client = connect(url, proxy); - try { - client.validate(); - } catch (TracException e) { - } - - assertEquals(expectedMethod, testProxy.getRequest().getMethod()); - } - -} diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracQueryTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracQueryTest.java deleted file mode 100644 index 46f82c339..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracQueryTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mylar project committers - initial API and implementation - *******************************************************************************/ - -package org.eclipse.mylyn.trac.tests; - -import junit.framework.TestCase; - -import org.eclipse.mylyn.internal.trac.core.ITracClient; -import org.eclipse.mylyn.internal.trac.core.TracRepositoryQuery; -import org.eclipse.mylyn.internal.trac.core.model.TracSearch; - -/** - * @author Steffen Pingel - */ -public class TracQueryTest extends TestCase { - - private TracRepositoryQuery createQuery(String parameter) { - String url = "http://oss.steffenpingel.de/mylar-trac-connector"; - return new TracRepositoryQuery(url, url + ITracClient.QUERY_URL + parameter, "description"); - } - - public void testGetTracSearch() { - String queryParameter = "&order=priority&status=new&status=assigned&status=reopened&milestone=M1&owner=%7E%C3%A4%C3%B6%C3%BC"; - TracRepositoryQuery query = createQuery(queryParameter); - TracSearch search = query.getTracSearch(); - assertEquals(queryParameter, search.toUrl()); - } - -} diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java deleted file mode 100644 index d2baf47f2..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java +++ /dev/null @@ -1,348 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mylar project committers - initial API and implementation - *******************************************************************************/ - -package org.eclipse.mylyn.trac.tests; - -import java.io.File; -import java.net.MalformedURLException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Comparator; -import java.util.List; - -import junit.framework.TestCase; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.mylyn.context.core.ContextCorePlugin; -import org.eclipse.mylyn.context.tests.support.TestUtil; -import org.eclipse.mylyn.context.tests.support.TestUtil.Credentials; -import org.eclipse.mylyn.context.tests.support.TestUtil.PrivilegeLevel; -import org.eclipse.mylyn.internal.tasks.ui.wizards.EditRepositoryWizard; -import org.eclipse.mylyn.internal.trac.core.ITracClient; -import org.eclipse.mylyn.internal.trac.core.InvalidTicketException; -import org.eclipse.mylyn.internal.trac.core.TracCorePlugin; -import org.eclipse.mylyn.internal.trac.core.TracRepositoryConnector; -import org.eclipse.mylyn.internal.trac.core.TracRepositoryQuery; -import org.eclipse.mylyn.internal.trac.core.TracTask; -import org.eclipse.mylyn.internal.trac.core.ITracClient.Version; -import org.eclipse.mylyn.internal.trac.core.model.TracSearch; -import org.eclipse.mylyn.internal.trac.core.model.TracTicket; -import org.eclipse.mylyn.internal.trac.core.model.TracVersion; -import org.eclipse.mylyn.internal.trac.core.model.TracTicket.Key; -import org.eclipse.mylyn.internal.trac.ui.wizard.TracRepositorySettingsPage; -import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; -import org.eclipse.mylyn.tasks.core.AbstractTask; -import org.eclipse.mylyn.tasks.core.QueryHitCollector; -import org.eclipse.mylyn.tasks.core.RepositoryTaskData; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.TaskRepositoryManager; -import org.eclipse.mylyn.tasks.ui.TaskFactory; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; -import org.eclipse.mylyn.trac.tests.support.TestFixture; -import org.eclipse.mylyn.trac.tests.support.XmlRpcServer.TestData; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PlatformUI; - -/** - * @author Steffen Pingel - */ -public class TracRepositoryConnectorTest extends TestCase { - - private TestData data; - - private TaskRepository repository; - - private TaskRepositoryManager manager; - - private TracRepositoryConnector connector; - - @Override - protected void setUp() throws Exception { - super.setUp(); - - manager = TasksUiPlugin.getRepositoryManager(); - manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); - - data = TestFixture.init010(); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - - // TestFixture.cleanupRepository1(); - } - - protected void init(String url, Version version) { - String kind = TracCorePlugin.REPOSITORY_KIND; - Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER); - - repository = new TaskRepository(kind, url); - repository.setAuthenticationCredentials(credentials.username, credentials.password); - repository.setTimeZoneId(ITracClient.TIME_ZONE); - repository.setCharacterEncoding(ITracClient.CHARSET); - repository.setVersion(version.name()); - - manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath()); - - AbstractRepositoryConnector abstractConnector = manager.getRepositoryConnector(kind); - assertEquals(abstractConnector.getConnectorKind(), kind); - - connector = (TracRepositoryConnector) abstractConnector; - TasksUiPlugin.getSynchronizationManager().setForceSyncExec(true); - } - - public void testGetRepositoryUrlFromTaskUrl() { - TracRepositoryConnector connector = new TracRepositoryConnector(); - assertEquals("http://host/repo", connector.getRepositoryUrlFromTaskUrl("http://host/repo/ticket/1")); - assertEquals("http://host", connector.getRepositoryUrlFromTaskUrl("http://host/ticket/2342")); - assertEquals(null, connector.getRepositoryUrlFromTaskUrl("http://host/repo/2342")); - assertEquals(null, connector.getRepositoryUrlFromTaskUrl("http://host/repo/ticket-2342")); - } - - public void testCreateTaskFromExistingKeyXmlRpc011() throws CoreException { - init(TracTestConstants.TEST_TRAC_010_URL, Version.XML_RPC); - createTaskFromExistingKey(); - } - - public void testCreateTaskFromExistingKeyXmlRpc010() throws CoreException { - init(TracTestConstants.TEST_TRAC_010_URL, Version.XML_RPC); - createTaskFromExistingKey(); - } - - public void testCreateTaskFromExistingKeyTracWeb011() throws CoreException { - init(TracTestConstants.TEST_TRAC_010_URL, Version.TRAC_0_9); - createTaskFromExistingKey(); - } - - public void testCreateTaskFromExistingKeyTracWeb010() throws CoreException { - init(TracTestConstants.TEST_TRAC_010_URL, Version.TRAC_0_9); - createTaskFromExistingKey(); - } - - public void testCreateTaskFromExistingKeyTracWeb096() throws CoreException { - init(TracTestConstants.TEST_TRAC_096_URL, Version.TRAC_0_9); - createTaskFromExistingKey(); - } - - protected void createTaskFromExistingKey() throws CoreException { - String id = data.tickets.get(0).getId() + ""; - AbstractTask task = connector.createTaskFromExistingId(repository, id, new NullProgressMonitor()); - assertNotNull(task); - assertEquals(TracTask.class, task.getClass()); - assertTrue(task.getSummary().contains("summary1")); - assertEquals(repository.getUrl() + ITracClient.TICKET_URL + id, task.getUrl()); - - try { - task = connector.createTaskFromExistingId(repository, "does not exist", new NullProgressMonitor()); - fail("Expected CoreException"); - } catch (CoreException e) { - } - - // No longer parsing as an integer - // try { - // task = connector.createTaskFromExistingId(repository, - // Integer.MAX_VALUE + ""); - // fail("Expected CoreException"); - // } catch (CoreException e) { - // } - } - - public void testClientManagerChangeTaskRepositorySettings() throws MalformedURLException { - init(TracTestConstants.TEST_TRAC_010_URL, Version.TRAC_0_9); - ITracClient client = connector.getClientManager().getRepository(repository); - assertEquals(Version.TRAC_0_9, client.getVersion()); - - EditRepositoryWizard wizard = new EditRepositoryWizard(repository); - Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); - WizardDialog dialog = new WizardDialog(shell, wizard); - dialog.create(); - - ((TracRepositorySettingsPage) wizard.getSettingsPage()).setTracVersion(Version.XML_RPC); - assertTrue(wizard.performFinish()); - - client = connector.getClientManager().getRepository(repository); - assertEquals(Version.XML_RPC, client.getVersion()); - } - - public void testPerformQueryXmlRpc011() { - performQuery(TracTestConstants.TEST_TRAC_011_URL, Version.XML_RPC); - } - - public void testPerformQueryXmlRpc010() { - performQuery(TracTestConstants.TEST_TRAC_010_URL, Version.XML_RPC); - } - - public void testPerformQueryWeb011() { - performQuery(TracTestConstants.TEST_TRAC_010_URL, Version.TRAC_0_9); - } - - public void testPerformQueryWeb010() { - performQuery(TracTestConstants.TEST_TRAC_010_URL, Version.TRAC_0_9); - } - - public void testPerformQueryWeb096() { - performQuery(TracTestConstants.TEST_TRAC_096_URL, Version.TRAC_0_9); - } - - @SuppressWarnings("deprecation") - protected void performQuery(String url, Version version) { - init(url, version); - - TracSearch search = new TracSearch(); - search.addFilter("milestone", "milestone1"); - search.addFilter("milestone", "milestone2"); - search.setOrderBy("id"); - - String queryUrl = url + ITracClient.QUERY_URL + search.toUrl(); - TracRepositoryQuery query = new TracRepositoryQuery(url, queryUrl, "description"); - - //MultiStatus queryStatus = new MultiStatus(TracUiPlugin.PLUGIN_ID, IStatus.OK, "Query result", null); - final List result = new ArrayList(); - QueryHitCollector hitCollector = new QueryHitCollector(new TaskFactory(repository)) { - @Override - public void accept(RepositoryTaskData data) { - fail("Unexpected call to accept()"); - } - - @Override - public void accept(AbstractTask hit) { - result.add(hit); - } - }; - IStatus queryStatus = connector.performQuery(query, repository, new NullProgressMonitor(), hitCollector); - - assertTrue(queryStatus.isOK()); - assertEquals(3, result.size()); - assertEquals(data.tickets.get(0).getId() + "", result.get(0).getTaskId()); - assertEquals(data.tickets.get(1).getId() + "", result.get(1).getTaskId()); - assertEquals(data.tickets.get(2).getId() + "", result.get(2).getTaskId()); - } - - public void testUpdateTaskDetails() throws InvalidTicketException { - init(TracTestConstants.TEST_TRAC_010_URL, Version.TRAC_0_9); - - TracTicket ticket = new TracTicket(123); - ticket.putBuiltinValue(Key.DESCRIPTION, "mydescription"); - ticket.putBuiltinValue(Key.PRIORITY, "mypriority"); - ticket.putBuiltinValue(Key.SUMMARY, "mysummary"); - ticket.putBuiltinValue(Key.TYPE, "mytype"); - - TracTask task = new TracTask(TracTestConstants.TEST_TRAC_010_URL, "" + 123, "desc"); - assertEquals(TracTestConstants.TEST_TRAC_010_URL + ITracClient.TICKET_URL + "123", task.getUrl()); - assertEquals("desc", task.getSummary()); - - connector.updateTaskFromTicket(task, ticket, false); - assertEquals(TracTestConstants.TEST_TRAC_010_URL + ITracClient.TICKET_URL + "123", task.getUrl()); - assertEquals("123", task.getTaskKey()); - assertEquals("mysummary", task.getSummary()); - assertEquals("P3", task.getPriority()); - assertEquals("mytype", task.getTaskKind()); - } - - public void testUpdateTaskDetailsSummaryOnly() throws InvalidTicketException { - init(TracTestConstants.TEST_TRAC_010_URL, Version.TRAC_0_9); - - TracTicket ticket = new TracTicket(456); - ticket.putBuiltinValue(Key.SUMMARY, "mysummary"); - - TracTask task = new TracTask(TracTestConstants.TEST_TRAC_010_URL, "" + 456, "desc"); - - connector.updateTaskFromTicket(task, ticket, false); - assertEquals(TracTestConstants.TEST_TRAC_010_URL + ITracClient.TICKET_URL + "456", task.getUrl()); - assertEquals("456", task.getTaskKey()); - assertEquals("mysummary", task.getSummary()); - assertEquals("P3", task.getPriority()); - assertEquals(AbstractTask.DEFAULT_TASK_KIND, task.getTaskKind()); - } - - public void testUpdateAttributesWeb011() throws Exception { - init(TracTestConstants.TEST_TRAC_011_URL, Version.TRAC_0_9); - updateAttributes(); - } - - public void testUpdateAttributesWeb010() throws Exception { - init(TracTestConstants.TEST_TRAC_010_URL, Version.TRAC_0_9); - updateAttributes(); - } - - public void testUpdateAttributesWeb096() throws Exception { - init(TracTestConstants.TEST_TRAC_096_URL, Version.TRAC_0_9); - updateAttributes(); - } - - public void testUpdateAttributesXmlRpc011() throws Exception { - init(TracTestConstants.TEST_TRAC_011_URL, Version.XML_RPC); - updateAttributes(); - } - - public void testUpdateAttributesXmlRpc010() throws Exception { - init(TracTestConstants.TEST_TRAC_010_URL, Version.XML_RPC); - updateAttributes(); - } - - protected void updateAttributes() throws Exception { - connector.updateAttributes(repository, new NullProgressMonitor()); - - ITracClient server = connector.getClientManager().getRepository(repository); - TracVersion[] versions = server.getVersions(); - assertEquals(2, versions.length); - Arrays.sort(versions, new Comparator() { - public int compare(TracVersion o1, TracVersion o2) { - return o1.getName().compareTo(o2.getName()); - } - }); - assertEquals("1.0", versions[0].getName()); - assertEquals("2.0", versions[1].getName()); - } - - public void testContextXmlRpc010() throws Exception { - init(TracTestConstants.TEST_TRAC_010_URL, Version.XML_RPC); - TracTask task = (TracTask) connector.createTaskFromExistingId(repository, data.attachmentTicketId + "", - new NullProgressMonitor()); - TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null); - - //int size = task.getTaskData().getAttachments().size(); - - File sourceContextFile = ContextCorePlugin.getContextManager().getFileForContext(task.getHandleIdentifier()); - sourceContextFile.createNewFile(); - sourceContextFile.deleteOnExit(); - - assertTrue(connector.getAttachmentHandler().attachContext(repository, task, "", new NullProgressMonitor())); - - TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null); - // TODO attachment may have been overridden therefore size may not have changed - //assertEquals(size + 1, task.getTaskData().getAttachments().size()); - - //RepositoryAttachment attachment = task.getTaskData().getAttachments().get(size); - //assertTrue(connector.retrieveContext(repository, task, attachment, TasksUiPlugin.getDefault().getProxySettings(), TasksUiPlugin.getDefault().getDataDirectory())); - } - - public void testContextWeb096() throws Exception { - init(TracTestConstants.TEST_TRAC_096_URL, Version.TRAC_0_9); - TracTask task = (TracTask) connector.createTaskFromExistingId(repository, data.attachmentTicketId + "", - new NullProgressMonitor()); - - File sourceContextFile = ContextCorePlugin.getContextManager().getFileForContext(task.getHandleIdentifier()); - sourceContextFile.createNewFile(); - sourceContextFile.deleteOnExit(); - - try { - connector.getAttachmentHandler().attachContext(repository, task, "", new NullProgressMonitor()); - fail("expected CoreException"); // operation should not be supported - } catch (CoreException e) { - } - } - -} \ No newline at end of file diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryQueryTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryQueryTest.java deleted file mode 100644 index e20d31636..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryQueryTest.java +++ /dev/null @@ -1,80 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mylar project committers - initial API and implementation - *******************************************************************************/ - -package org.eclipse.mylyn.trac.tests; - -import java.util.Arrays; -import java.util.List; - -import junit.framework.TestCase; - -import org.eclipse.mylyn.internal.trac.core.ITracClient; -import org.eclipse.mylyn.internal.trac.core.TracCorePlugin; -import org.eclipse.mylyn.internal.trac.core.TracRepositoryQuery; -import org.eclipse.mylyn.internal.trac.core.TracTask; -import org.eclipse.mylyn.internal.trac.core.model.TracSearch; -import org.eclipse.mylyn.internal.trac.core.model.TracSearchFilter; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.TaskRepositoryManager; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; - -/** - * @author Steffen Pingel - */ -public class TracRepositoryQueryTest extends TestCase { - - public void testChangeRepositoryUrl() { - TaskRepositoryManager manager = TasksUiPlugin.getRepositoryManager(); - manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); - - TaskRepository repository = new TaskRepository(TracCorePlugin.REPOSITORY_KIND, - TracTestConstants.TEST_TRAC_096_URL); - manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath()); - - TracSearch search = new TracSearch(); - String queryUrl = repository.getUrl() + ITracClient.QUERY_URL + search.toUrl(); - TracRepositoryQuery query = new TracRepositoryQuery(repository.getUrl(), queryUrl, "description"); - TasksUiPlugin.getTaskListManager().getTaskList().addQuery(query); - - TracTask task = new TracTask(TracTestConstants.TEST_TRAC_096_URL, "" + 123, "desc"); - TasksUiPlugin.getTaskListManager().getTaskList().addTask(task); - - String oldUrl = repository.getUrl(); - String newUrl = TracTestConstants.TEST_TRAC_010_URL; - TasksUiPlugin.getTaskListManager().refactorRepositoryUrl(oldUrl, newUrl); - repository.setUrl(newUrl); - - assertEquals(newUrl, query.getRepositoryUrl()); - assertEquals(newUrl + ITracClient.QUERY_URL + search.toUrl(), query.getUrl()); - assertEquals(newUrl + ITracClient.TICKET_URL + 123, task.getUrl()); - } - - public void testGetFilterList() { - String repositoryUrl = "https://foo.bar/repo"; - String parameterUrl = "&status=new&status=assigned&status=reopened&milestone=0.1"; - String queryUrl = repositoryUrl + ITracClient.QUERY_URL + parameterUrl; - TracRepositoryQuery query = new TracRepositoryQuery(repositoryUrl, queryUrl, "description"); - - TracSearch filterList = query.getTracSearch(); - - assertEquals(parameterUrl, filterList.toUrl()); - assertEquals("&status=new|assigned|reopened&milestone=0.1", filterList.toQuery()); - - List list = filterList.getFilters(); - TracSearchFilter filter = list.get(0); - assertEquals("status", filter.getFieldName()); - assertEquals(Arrays.asList("new", "assigned", "reopened"), filter.getValues()); - filter = list.get(1); - assertEquals("milestone", filter.getFieldName()); - assertEquals(Arrays.asList("0.1"), filter.getValues()); - } - -} diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositorySettingsPageTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositorySettingsPageTest.java deleted file mode 100644 index da124b6d1..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositorySettingsPageTest.java +++ /dev/null @@ -1,108 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mylar project committers - initial API and implementation - *******************************************************************************/ - -package org.eclipse.mylyn.trac.tests; - -import java.net.Proxy; - -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.mylyn.internal.trac.core.ITracClient; -import org.eclipse.mylyn.internal.trac.core.TracCorePlugin; -import org.eclipse.mylyn.internal.trac.core.ITracClient.Version; -import org.eclipse.mylyn.internal.trac.ui.TracConnectorUi; -import org.eclipse.mylyn.internal.trac.ui.wizard.TracRepositorySettingsPage; -import org.eclipse.mylyn.internal.trac.ui.wizard.TracRepositorySettingsPage.TracValidator; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PlatformUI; - -/** - * @author Steffen Pingel - */ -public class TracRepositorySettingsPageTest extends AbstractTracClientTest { - - private TracConnectorUi connector; - - private TracRepositorySettingsPage page; - - private TracValidator validator; - - public TracRepositorySettingsPageTest() { - super(null); - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - - connector = (TracConnectorUi) TasksUiPlugin.getConnectorUi(TracCorePlugin.REPOSITORY_KIND); - page = new TracRepositorySettingsPage(connector); - - Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); - page.createControl(shell); - page.setVisible(true); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - - // TestFixture.cleanupRepository1(); - } - - @Override - public ITracClient connect(String url, String username, String password, Proxy proxy, Version version) - throws Exception { - page.setUrl(url); - page.setUserId(username); - page.setPassword(password); - page.setTracVersion(version); - validator = page.new TracValidator(page.createTaskRepository(), version); - return null; - } - - public void testValidateXmlRpc() throws Exception { - version = Version.XML_RPC; - connect010(); - - validator.run(new NullProgressMonitor()); - assertNull(validator.getResult()); - assertNull(validator.getStatus()); - } - - public void testValidateWeb() throws Exception { - version = Version.TRAC_0_9; - connect010(); - - validator.run(new NullProgressMonitor()); - assertNull(validator.getResult()); - assertNull(validator.getStatus()); - } - - public void testValidateAutomaticUser() throws Exception { - version = null; - connect010(); - - validator.run(new NullProgressMonitor()); - assertEquals(Version.XML_RPC, validator.getResult()); - assertNull(validator.getStatus()); - } - - public void testValidateAutomaticAnonymous() throws Exception { - version = null; - connect(TracTestConstants.TEST_TRAC_010_URL, "", ""); - - validator.run(new NullProgressMonitor()); - assertEquals(Version.TRAC_0_9, validator.getResult()); - assertNotNull(validator.getStatus()); - } - -} diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracSearchTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracSearchTest.java deleted file mode 100644 index b36b5d265..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracSearchTest.java +++ /dev/null @@ -1,136 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mylar project committers - initial API and implementation - *******************************************************************************/ - -package org.eclipse.mylyn.trac.tests; - -import junit.framework.TestCase; - -import org.eclipse.mylyn.internal.trac.core.model.TracSearch; - -/** - * @author Steffen Pingel - */ -public class TracSearchTest extends TestCase { - - private static final String QUERY1 = "&status=new|assigned|reopened&milestone~=0.1"; - - private static final String URL1 = "&status=new&status=assigned&status=reopened&milestone=%7E0.1"; - - private TracSearch search1; - - @Override - protected void setUp() throws Exception { - super.setUp(); - - search1 = new TracSearch(); - search1.addFilter("status", "new"); - search1.addFilter("status", "assigned"); - search1.addFilter("status", "reopened"); - search1.addFilter("milestone", "~0.1"); - } - - public void testToQuery() { - assertEquals(QUERY1, search1.toQuery()); - } - - public void testToQueryEmpty() { - assertEquals("", new TracSearch().toQuery()); - } - - public void testToQueryOperators1() { - TracSearch search = new TracSearch(); - search.addFilter("is", "a"); - search.addFilter("contains", "~b"); - search.addFilter("starts", "^c"); - search.addFilter("ends", "$d"); - search.addFilter("nis", "!e"); - search.addFilter("ncontains", "!~f"); - search.addFilter("nstarts", "!^g"); - search.addFilter("nends", "!$h"); - - assertEquals("&is=a&contains~=b&starts^=c&ends$=d&nis!=e&ncontains!~=f&nstarts!^=g&nends!$=h", search.toQuery()); - } - - public void testToQueryOperators2() { - TracSearch search = new TracSearch(); - search.addFilter("nstarts", "!^g"); - search.addFilter("nis", "!e"); - search.addFilter("is", "a"); - - assertEquals("&nstarts!^=g&nis!=e&is=a", search.toQuery()); - } - - public void testToQuerySortOrder() { - search1.setOrderBy("id"); - assertEquals("&order=id" + QUERY1, search1.toQuery()); - - search1.setAscending(false); - assertEquals("&order=id&desc=1" + QUERY1, search1.toQuery()); - - search1.setOrderBy("summary"); - search1.setAscending(true); - assertEquals("&order=summary" + QUERY1, search1.toQuery()); - } - - public void testToUrl() { - assertEquals(URL1, search1.toUrl()); - } - - public void testToUrlEmpty() { - // assertEquals("", new TracSearch().toUrl()); - // returns non-empty string to work around a strange Trac behaviour, see - // TracSearch.toUrl() - assertEquals("&order=id", new TracSearch().toUrl()); - } - - public void testToUrlEncoding() { - search1.addFilter("encoded", "&"); - assertEquals(URL1 + "&encoded=%26", search1.toUrl()); - } - - public void testToUrlOperators1() { - TracSearch search = new TracSearch(); - search.addFilter("is", "a"); - search.addFilter("contains", "~b"); - search.addFilter("starts", "^c"); - search.addFilter("ends", "$d"); - search.addFilter("nis", "!e"); - search.addFilter("ncontains", "!~f"); - search.addFilter("nstarts", "!^g"); - search.addFilter("nends", "!$h"); - - assertEquals( - "&is=a&contains=%7Eb&starts=%5Ec&ends=%24d&nis=%21e&ncontains=%21%7Ef&nstarts=%21%5Eg&nends=%21%24h", - search.toUrl()); - } - - public void testToUrlOperators2() { - TracSearch search = new TracSearch(); - search.addFilter("nstarts", "!^g"); - search.addFilter("nis", "!e"); - search.addFilter("is", "a"); - - assertEquals("&nstarts=%21%5Eg&nis=%21e&is=a", search.toUrl()); - } - - public void testToUrlSortOrder() { - search1.setOrderBy("id"); - assertEquals("&order=id" + QUERY1, search1.toQuery()); - - search1.setAscending(false); - assertEquals("&order=id&desc=1" + QUERY1, search1.toQuery()); - - search1.setOrderBy("summary"); - search1.setAscending(true); - assertEquals("&order=summary" + QUERY1, search1.toQuery()); - } - -} diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskDataHandlerTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskDataHandlerTest.java deleted file mode 100644 index f3ded9f15..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskDataHandlerTest.java +++ /dev/null @@ -1,167 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mylar project committers - initial API and implementation - *******************************************************************************/ - -package org.eclipse.mylyn.trac.tests; - -import java.util.HashSet; -import java.util.Set; - -import junit.framework.TestCase; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.mylyn.context.tests.support.TestUtil; -import org.eclipse.mylyn.context.tests.support.TestUtil.Credentials; -import org.eclipse.mylyn.context.tests.support.TestUtil.PrivilegeLevel; -import org.eclipse.mylyn.internal.trac.core.ITracClient; -import org.eclipse.mylyn.internal.trac.core.TracCorePlugin; -import org.eclipse.mylyn.internal.trac.core.TracRepositoryConnector; -import org.eclipse.mylyn.internal.trac.core.TracTask; -import org.eclipse.mylyn.internal.trac.core.ITracClient.Version; -import org.eclipse.mylyn.internal.trac.core.model.TracTicket; -import org.eclipse.mylyn.internal.trac.core.model.TracTicket.Key; -import org.eclipse.mylyn.tasks.core.AbstractTask; -import org.eclipse.mylyn.tasks.core.RepositoryTaskData; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.TaskRepositoryManager; -import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; -import org.eclipse.mylyn.trac.tests.support.TestFixture; -import org.eclipse.mylyn.trac.tests.support.XmlRpcServer.TestData; - -/** - * @author Steffen Pingel - */ -public class TracTaskDataHandlerTest extends TestCase { - - private TracRepositoryConnector connector; - - private TaskRepository repository; - - private TaskRepositoryManager manager; - - private TestData data; - - public TracTaskDataHandlerTest() { - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - - data = TestFixture.init010(); - - manager = TasksUiPlugin.getRepositoryManager(); - manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); - - connector = (TracRepositoryConnector) manager.getRepositoryConnector(TracCorePlugin.REPOSITORY_KIND); - TasksUiPlugin.getSynchronizationManager().setForceSyncExec(true); - } - - protected void init(String url, Version version) { - Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER); - - repository = new TaskRepository(TracCorePlugin.REPOSITORY_KIND, url); - repository.setAuthenticationCredentials(credentials.username, credentials.password); - repository.setTimeZoneId(ITracClient.TIME_ZONE); - repository.setCharacterEncoding(ITracClient.CHARSET); - repository.setVersion(version.name()); - - manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath()); - } - - public void testGetChangedSinceLastSyncWeb096() throws Exception { - init(TracTestConstants.TEST_TRAC_096_URL, Version.TRAC_0_9); - TracTask task = (TracTask) connector.createTaskFromExistingId(repository, data.offlineHandlerTicketId + "", - new NullProgressMonitor()); - - Set tasks = new HashSet(); - tasks.add(task); - - assertEquals(null, repository.getSynchronizationTimeStamp()); - boolean changed = connector.markStaleTasks(repository, tasks, new NullProgressMonitor()); - assertEquals(true, changed); - assertEquals(null, repository.getSynchronizationTimeStamp()); - assertFalse(task.isStale()); - - int time = (int) (System.currentTimeMillis() / 1000) + 1; - repository.setSynchronizationTimeStamp(time + ""); - changed = connector.markStaleTasks(repository, tasks, new NullProgressMonitor()); - assertEquals(true, changed); - assertFalse(task.isStale()); - } - - public void testGetChangedSinceLastSyncXmlRpc010() throws Exception { - init(TracTestConstants.TEST_TRAC_010_URL, Version.XML_RPC); - getChangedSinceLastSync(); - } - - public void testGetChangedSinceLastSyncXmlRpc011() throws Exception { - init(TracTestConstants.TEST_TRAC_011_URL, Version.XML_RPC); - getChangedSinceLastSync(); - } - - private void getChangedSinceLastSync() throws Exception { - TracTask task = (TracTask) connector.createTaskFromExistingId(repository, data.offlineHandlerTicketId + "", - new NullProgressMonitor()); - TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null); - RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), - task.getTaskId()); - - int lastModified = Integer.parseInt(taskData.getLastModified()); - - Set tasks = new HashSet(); - tasks.add(task); - - assertEquals(null, repository.getSynchronizationTimeStamp()); - boolean changed = connector.markStaleTasks(repository, tasks, new NullProgressMonitor()); - assertTrue(changed); - assertTrue(task.isStale()); - - // always returns the ticket because time comparison mode is >= - task.setStale(false); - repository.setSynchronizationTimeStamp(lastModified + ""); - changed = connector.markStaleTasks(repository, tasks, new NullProgressMonitor()); - assertTrue(changed); - assertTrue(task.isStale()); - - task.setStale(false); - repository.setSynchronizationTimeStamp((lastModified + 1) + ""); - changed = connector.markStaleTasks(repository, tasks, new NullProgressMonitor()); - assertTrue(changed); - assertFalse(task.isStale()); - - // change ticket making sure it gets a new change time - Thread.sleep(1000); - ITracClient client = connector.getClientManager().getRepository(repository); - TracTicket ticket = client.getTicket(data.offlineHandlerTicketId); - if (ticket.getValue(Key.DESCRIPTION).equals(lastModified + "")) { - ticket.putBuiltinValue(Key.DESCRIPTION, lastModified + "x"); - } else { - ticket.putBuiltinValue(Key.DESCRIPTION, lastModified + ""); - } - client.updateTicket(ticket, "comment"); - - task.setStale(false); - repository.setSynchronizationTimeStamp((lastModified + 1) + ""); - changed = connector.markStaleTasks(repository, tasks, new NullProgressMonitor()); - assertTrue(changed); - assertTrue(task.isStale()); - } - - public void testNonNumericTaskId() { - try { - connector.getTaskDataHandler().getTaskData(repository, "abc", new NullProgressMonitor()); - fail("Expected CoreException"); - } catch (CoreException e) { - } - } - -} diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskTest.java deleted file mode 100644 index 2154d7c29..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mylar project committers - initial API and implementation - *******************************************************************************/ - -package org.eclipse.mylyn.trac.tests; - -import junit.framework.TestCase; - -import org.eclipse.mylyn.internal.trac.core.TracTask; - -/** - * @author Steffen Pingel - */ -public class TracTaskTest extends TestCase { - - public void testIsCompleted() { - assertTrue(TracTask.isCompleted("closed")); - assertFalse(TracTask.isCompleted("Closed")); - assertFalse(TracTask.isCompleted("new")); - assertFalse(TracTask.isCompleted("assigned")); - assertFalse(TracTask.isCompleted("reopened")); - assertFalse(TracTask.isCompleted("foobar")); - assertFalse(TracTask.isCompleted("")); - assertFalse(TracTask.isCompleted(null)); - } - - public void testGetMylarPriority() { - assertEquals("P1", TracTask.getMylarPriority("blocker")); - assertEquals("P2", TracTask.getMylarPriority("critical")); - assertEquals("P3", TracTask.getMylarPriority("major")); - assertEquals("P3", TracTask.getMylarPriority(null)); - assertEquals("P3", TracTask.getMylarPriority("")); - assertEquals("P3", TracTask.getMylarPriority("foo bar")); - assertEquals("P4", TracTask.getMylarPriority("minor")); - assertEquals("P5", TracTask.getMylarPriority("trivial")); - } -} diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTestConstants.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTestConstants.java deleted file mode 100644 index db47a3df8..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTestConstants.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mylar project committers - initial API and implementation - *******************************************************************************/ - -package org.eclipse.mylyn.trac.tests; - -/** - * @author Steffen Pingel - */ -public class TracTestConstants { - - public static final String TEST_TRAC_096_URL = "http://mylyn.eclipse.org/trac096"; - - public static final String TEST_TRAC_010_URL = "http://mylyn.eclipse.org/trac010"; - - public static final String TEST_TRAC_010_SSL_URL = "https://mylyn.eclipse.org/trac010"; - - public static final String TEST_TRAC_010_DIGEST_AUTH_URL = "http://mylyn.eclipse.org/trac010digest"; - - public static final String TEST_TRAC_010_FORM_AUTH_URL = "http://mylyn.eclipse.org/trac010formauth"; - - public static final String TEST_TRAC_011_URL = "http://mylyn.eclipse.org/trac011"; - - public static final String TEST_TRAC_INVALID_URL = "http://mylyn.eclipse.org/doesnotexist"; - -} diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTestPlugin.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTestPlugin.java deleted file mode 100644 index 784ab7d2e..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTestPlugin.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mylar project committers - initial API and implementation - *******************************************************************************/ - -package org.eclipse.mylyn.trac.tests; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - * - * @author Steffen Pingel - */ -public class TracTestPlugin extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.mylyn.trac.tests"; - - // The shared instance - private static TracTestPlugin plugin; - - public TracTestPlugin() { - plugin = this; - } - - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - } - - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static TracTestPlugin getDefault() { - return plugin; - } - -} diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTicketTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTicketTest.java deleted file mode 100644 index 68ffc9cd9..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTicketTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mylar project committers - initial API and implementation - *******************************************************************************/ - -package org.eclipse.mylyn.trac.tests; - -import java.util.Calendar; -import java.util.Date; -import java.util.TimeZone; - -import junit.framework.TestCase; - -import org.eclipse.mylyn.internal.trac.core.InvalidTicketException; -import org.eclipse.mylyn.internal.trac.core.model.TracTicket; -import org.eclipse.mylyn.internal.trac.core.model.TracTicket.Key; -import org.eclipse.mylyn.internal.trac.core.util.TracUtils; - -/** - * @author Steffen Pingel - */ -public class TracTicketTest extends TestCase { - - public void testValid() { - TracTicket ticket = new TracTicket(); - assertFalse(ticket.isValid()); - - ticket.setId(1); - assertTrue(ticket.isValid()); - } - - public void testPutTracValue() throws InvalidTicketException { - TracTicket ticket = new TracTicket(1); - ticket.putValue("summary", "a"); - assertEquals("a", ticket.getValue(Key.SUMMARY)); - assertEquals(null, ticket.getCustomValue("summary")); - assertEquals(null, ticket.getCustomValue("a")); - - ticket.putValue("summary", "b"); - ticket.putValue("custom", "c"); - assertEquals("b", ticket.getValue(Key.SUMMARY)); - assertEquals(null, ticket.getCustomValue("summary")); - assertEquals("c", ticket.getCustomValue("custom")); - } - - public void testPutTracValueId() throws InvalidTicketException { - TracTicket ticket = new TracTicket(); - assertFalse(ticket.putValue("id", "1")); - } - - public void testSetCreated() throws InvalidTicketException { - TracTicket ticket = new TracTicket(1); - ticket.setCreated(TracUtils.parseDate(0)); - assertEquals(TimeZone.getTimeZone("GMT").getOffset(0) * 1000, ticket.getCreated().getTime()); - - Date date = new Date(); - Calendar utc = Calendar.getInstance(TimeZone.getTimeZone("UTC")); - utc.setTime(date); - ticket.setCreated(TracUtils.parseDate((int) (utc.getTimeInMillis() / 1000))); - - assertEquals(date.getTime() / 1000, ticket.getCreated().getTime() / 1000); - } - -} diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracWebClientSearchTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracWebClientSearchTest.java deleted file mode 100644 index b821557dc..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracWebClientSearchTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mylar project committers - initial API and implementation - *******************************************************************************/ - -package org.eclipse.mylyn.trac.tests; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.mylyn.internal.trac.core.ITracClient.Version; -import org.eclipse.mylyn.internal.trac.core.model.TracSearch; -import org.eclipse.mylyn.internal.trac.core.model.TracTicket; - -/** - * @author Steffen Pingel - */ -public class TracWebClientSearchTest extends AbstractTracClientSearchTest { - - public TracWebClientSearchTest() { - super(Version.TRAC_0_9); - } - - // TODO move this test to AbstracTracClientTest when bug 162094 is resolved - public void testSearchMilestoneAmpersand010() throws Exception { - connect010(); - searchMilestoneAmpersand(); - } - - public void testSearchMilestoneAmpersand011() throws Exception { - connect011(); - searchMilestoneAmpersand(); - } - - private void searchMilestoneAmpersand() throws Exception { - TracSearch search = new TracSearch(); - search.addFilter("milestone", "mile&stone"); - search.setOrderBy("id"); - List result = new ArrayList(); - repository.search(search, result); - assertEquals(1, result.size()); - assertTicketEquals(tickets.get(7), result.get(0)); - } - -} diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracWebClientTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracWebClientTest.java deleted file mode 100644 index 993a7b938..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracWebClientTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mylar project committers - initial API and implementation - *******************************************************************************/ - -package org.eclipse.mylyn.trac.tests; - -import java.util.Arrays; -import java.util.Comparator; - -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.mylyn.internal.trac.core.TracException; -import org.eclipse.mylyn.internal.trac.core.ITracClient.Version; -import org.eclipse.mylyn.internal.trac.core.model.TracVersion; - -/** - * @author Steffen Pingel - */ -public class TracWebClientTest extends AbstractTracClientRepositoryTest { - - public TracWebClientTest() { - super(Version.TRAC_0_9); - } - - public void testValidate096() throws Exception { - validate(TracTestConstants.TEST_TRAC_096_URL); - } - - @Override - public void testValidate011() throws Exception { - try { - validate(TracTestConstants.TEST_TRAC_011_URL); - } catch (TracException e) { - } - } - - public void testValidateAnyPage() throws Exception { - connect("http://mylyn.eclipse.org/"); - try { - repository.validate(); - fail("Expected TracException"); - } catch (TracException e) { - } - } - - public void testValidateAnonymousLogin() throws Exception { - connect(TracTestConstants.TEST_TRAC_010_URL, "", ""); - repository.validate(); - - connect(TracTestConstants.TEST_TRAC_096_URL, "", ""); - repository.validate(); - } - - public void testUpdateAttributesAnonymous096() throws Exception { - connect(TracTestConstants.TEST_TRAC_096_URL, "", ""); - updateAttributes(); - } - - public void testUpdateAttributesAnonymous010() throws Exception { - connect(TracTestConstants.TEST_TRAC_010_URL, "", ""); - updateAttributes(); - } - - private void updateAttributes() throws TracException { - assertNull(repository.getMilestones()); - repository.updateAttributes(new NullProgressMonitor(), true); - TracVersion[] versions = repository.getVersions(); - assertEquals(2, versions.length); - Arrays.sort(versions, new Comparator() { - public int compare(TracVersion o1, TracVersion o2) { - return o1.getName().compareTo(o2.getName()); - } - }); - assertEquals("1.0", versions[0].getName()); - assertEquals("2.0", versions[1].getName()); - } - -} diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcClientSearchTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcClientSearchTest.java deleted file mode 100644 index 37c655806..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcClientSearchTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mylar project committers - initial API and implementation - *******************************************************************************/ - -package org.eclipse.mylyn.trac.tests; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.mylyn.internal.trac.core.ITracClient.Version; -import org.eclipse.mylyn.internal.trac.core.model.TracSearch; -import org.eclipse.mylyn.internal.trac.core.model.TracTicket; -import org.eclipse.mylyn.internal.trac.core.model.TracTicket.Key; - -/** - * @author Steffen Pingel - */ -public class TracXmlRpcClientSearchTest extends AbstractTracClientSearchTest { - - public TracXmlRpcClientSearchTest() { - super(Version.XML_RPC); - } - - public void testSearchValidateTicket010() throws Exception { - connect010(); - searchValidateTicket(); - } - - public void testSearchValidateTicket011() throws Exception { - connect011(); - searchValidateTicket(); - } - - public void searchValidateTicket() throws Exception { - TracSearch search = new TracSearch(); - search.addFilter("summary", "summary1"); - List result = new ArrayList(); - repository.search(search, result); - assertEquals(1, result.size()); - assertTicketEquals(tickets.get(0), result.get(0)); - assertEquals("component1", result.get(0).getValue(Key.COMPONENT)); - assertEquals("description1", result.get(0).getValue(Key.DESCRIPTION)); - assertEquals("milestone1", result.get(0).getValue(Key.MILESTONE)); - assertEquals("anonymous", result.get(0).getValue(Key.REPORTER)); - assertEquals("summary1", result.get(0).getValue(Key.SUMMARY)); - // assertEquals("", result.get(0).getValue(Key.VERSION)); - } - -} diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcClientTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcClientTest.java deleted file mode 100644 index 216c83fa3..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcClientTest.java +++ /dev/null @@ -1,85 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mylar project committers - initial API and implementation - *******************************************************************************/ - -package org.eclipse.mylyn.trac.tests; - -import java.util.Arrays; -import java.util.Comparator; -import java.util.Date; - -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.mylyn.internal.trac.core.TracPermissionDeniedException; -import org.eclipse.mylyn.internal.trac.core.TracRemoteException; -import org.eclipse.mylyn.internal.trac.core.TracXmlRpcClient; -import org.eclipse.mylyn.internal.trac.core.ITracClient.Version; -import org.eclipse.mylyn.internal.trac.core.model.TracVersion; - -/** - * @author Steffen Pingel - */ -public class TracXmlRpcClientTest extends AbstractTracClientRepositoryTest { - - public TracXmlRpcClientTest() { - super(Version.XML_RPC); - } - - @Override - public void testValidate011() throws Exception { - validate(TracTestConstants.TEST_TRAC_011_URL); - } - - public void testValidateFailNoAuth() throws Exception { - connect(TracTestConstants.TEST_TRAC_010_URL, "", ""); - try { - repository.validate(); - fail("Expected TracLoginException"); - } catch (TracPermissionDeniedException e) { - } - } - - public void testMulticallExceptions() throws Exception { - connect010(); - try { - ((TracXmlRpcClient) repository).getTickets(new int[] { 1, Integer.MAX_VALUE }); - fail("Expected TracRemoteException"); - } catch (TracRemoteException e) { - } - } - - public void testUpdateAttributes010() throws Exception { - connect010(); - updateAttributes(); - } - - public void testUpdateAttributes011() throws Exception { - connect011(); - updateAttributes(); - } - - public void updateAttributes() throws Exception { - assertNull(repository.getMilestones()); - repository.updateAttributes(new NullProgressMonitor(), true); - TracVersion[] versions = repository.getVersions(); - assertEquals(2, versions.length); - Arrays.sort(versions, new Comparator() { - public int compare(TracVersion o1, TracVersion o2) { - return o1.getName().compareTo(o2.getName()); - } - }); - assertEquals("1.0", versions[0].getName()); - assertEquals("", versions[0].getDescription()); - assertEquals(new Date(0), versions[0].getTime()); - assertEquals("2.0", versions[1].getName()); - assertEquals("", versions[1].getDescription()); - assertEquals(new Date(0), versions[1].getTime()); - } - -} diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcTest.java deleted file mode 100644 index 7201a3688..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcTest.java +++ /dev/null @@ -1,507 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mylar project committers - initial API and implementation - *******************************************************************************/ - -package org.eclipse.mylyn.trac.tests; - -import java.io.IOException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Date; -import java.util.Hashtable; -import java.util.List; -import java.util.Map; -import java.util.Random; - -import junit.framework.TestCase; - -import org.apache.xmlrpc.XmlRpcException; -import org.apache.xmlrpc.client.XmlRpcClient; -import org.apache.xmlrpc.client.XmlRpcClientConfigImpl; -import org.eclipse.mylyn.context.tests.support.TestUtil; -import org.eclipse.mylyn.context.tests.support.TestUtil.Credentials; -import org.eclipse.mylyn.context.tests.support.TestUtil.PrivilegeLevel; -import org.eclipse.mylyn.internal.trac.core.util.TracHttpClientTransportFactory; - -/** - * Test cases for Trac XML-RPC Plugin API. Revision 1188 or - * higher is required. - * - *

    - * This class does not depend on any Mylar (connector) classes except for TracHttpClientTransportFactory which is needed - * for initialization of HttpClient. - * - * @author Steffen Pingel - */ -public class TracXmlRpcTest extends TestCase { - - public static final String XMLRPC_URL = "/login/xmlrpc"; - - private XmlRpcClient xmlrpc; - - private String username; - - // private String password; - - private Random random; - - private ArrayList tickets; - - @Override - protected void setUp() throws Exception { - super.setUp(); - - random = new Random(); - - Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.ADMIN); - createConnection(new URL(TracTestConstants.TEST_TRAC_010_URL + XMLRPC_URL), credentials.username, - credentials.password); - - tickets = new ArrayList(); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - - for (int id : tickets) { - call("ticket.delete", id); - } - } - - private void createConnection(URL url, String username, String password) throws Exception { - XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); - config.setEncoding("UTF-8"); - config.setBasicUserName(username); - config.setBasicPassword(password); - config.setServerURL(url); - - xmlrpc = new XmlRpcClient(); - xmlrpc.setConfig(config); - - TracHttpClientTransportFactory factory = new TracHttpClientTransportFactory(xmlrpc); - xmlrpc.setTransportFactory(factory); - - this.username = username; - // this.password = password; - } - - private int createTicket(String summary, String description, Map attributes) - throws XmlRpcException, IOException { - int id = (Integer) call("ticket.create", summary, description, attributes); - tickets.add(id); - return id; - } - - private Object call(String method, Object... parameters) throws XmlRpcException, IOException { - Object result = xmlrpc.execute(method, parameters); - if (result instanceof XmlRpcException) { - throw (XmlRpcException) result; - } - return result; - } - - public Map createMultiCall(String methodName, Object... parameters) throws XmlRpcException, - IOException { - Map table = new Hashtable(); - table.put("methodName", methodName); - table.put("params", parameters); - return table; - } - - private void internalTestCrud(String module) throws XmlRpcException, IOException { - try { - call(module + ".delete", "foo"); - } catch (XmlRpcException e) { - } - - call(module + ".create", "foo", "bar"); - try { - assertHasValue((Object[]) call(module + ".getAll"), "foo"); - assertEquals("bar", (String) (call(module + ".get", "foo"))); - - call(module + ".update", "foo", "baz"); - assertEquals("baz", (String) (call(module + ".get", "foo"))); - } finally { - call(module + ".delete", "foo"); - } - } - - private Object createValue(Object fieldName, Object clazz) { - if (clazz == String.class) { - return fieldName.toString() + random.nextInt(); - } else if (clazz == Date.class) { - return new Date(); - } else if (clazz == Boolean.class) { - return random.nextBoolean(); - } else if (clazz == Double.class) { - return random.nextDouble(); - } else if (clazz == Integer.class) { - return random.nextInt(); - } - - throw new RuntimeException("Invalid test data: " + fieldName + ", " + clazz); - } - - private void internalTestComponent(String module, Object... fields) throws XmlRpcException, IOException { - try { - call(module + ".delete", "foo"); - } catch (XmlRpcException e) { - } - - Map attributes = new Hashtable(); - for (int i = 0; i < fields.length; i += 2) { - attributes.put((String) fields[i], createValue(fields[i], fields[i + 1])); - } - - call(module + ".create", "foo", attributes); - - try { - assertHasValue((Object[]) call(module + ".getAll"), "foo"); - Map values = (Map) call(module + ".get", "foo"); - for (String attribute : attributes.keySet()) { - assertEquals(attributes.get(attribute), values.get(attribute)); - } - - for (int i = 0; i < fields.length; i += 2) { - attributes.put((String) fields[i], createValue(fields[i], fields[i + 1])); - } - - call(module + ".update", "foo", attributes); - values = (Map) call(module + ".get", "foo"); - for (String attribute : attributes.keySet()) { - assertEquals(attributes.get(attribute), values.get(attribute)); - } - } finally { - call(module + ".delete", "foo"); - } - } - - public void testMilestoneDate() throws XmlRpcException, IOException { - try { - call("ticket.milestone.delete", "foo"); - } catch (XmlRpcException e) { - } - - int due = (int) (System.currentTimeMillis() / 1000) + 1000; - int completed = (int) (System.currentTimeMillis() / 1000); - - Map attributes = new Hashtable(); - attributes.put("description", "description"); - attributes.put("due", due); - attributes.put("completed", completed); - - call("ticket.milestone.create", "foo", attributes); - - Map values = (Map) call("ticket.milestone.get", "foo"); - assertEquals(new Integer(due), values.get("due")); - assertEquals(new Integer(completed), values.get("completed")); - - call("ticket.milestone.delete", "foo"); - } - - private void assertHasValue(Object[] items, Object value) { - for (Object item : items) { - if (item.equals(value)) { - return; - } - } - fail("Could not find expected value: " + value); - } - - private void assertTicketHasAttributes(Map attributes, int id, Object[] ticket) { - assertTicketHasAttributes(attributes, id, ticket, true); - } - - private void assertTicketHasAttributes(Map attributes, int id, Object[] ticket, boolean newTicket) { - assertEquals(id, ticket[0]); - assertTrue(ticket[1] instanceof Integer); // time created - // time changed - if (newTicket) { - assertEquals(ticket[1], ticket[2]); - } else { - assertTrue((Integer) ticket[2] >= (Integer) ticket[1]); - } - Map values = (Map) ticket[3]; - for (String attribute : attributes.keySet()) { - assertEquals(attributes.get(attribute), values.get(attribute)); - } - } - - public void testGetTicket() throws XmlRpcException, IOException { - Map attributes = new Hashtable(); - attributes.put("type", "task"); - attributes.put("status", "closed"); - int id = createTicket("summary", "description", attributes); - - attributes.put("summary", "summary"); - attributes.put("description", "description"); - - Object[] ticket = (Object[]) call("ticket.get", id); - assertTicketHasAttributes(attributes, id, ticket); - } - - public void testGetTicketNonExistant() throws XmlRpcException, IOException { - try { - call("ticket.delete", Integer.MAX_VALUE); - } catch (Exception e) { - // ignore - } - - try { - List ticket = (List) call("ticket.get", Integer.MAX_VALUE); - fail("Expected XmlRpcException, got ticket instead: " + ticket); - } catch (XmlRpcException e) { - // ignore - } - } - - public void testGetTicketUmlaute() throws XmlRpcException, IOException { - Map attributes = new Hashtable(); - int id = createTicket("summarya\u0308O\u030b", "\u00d8", attributes); - - attributes.put("summary", "summarya\u0308O\u030b"); - attributes.put("description", "\u00d8"); - - Object[] ticket = (Object[]) call("ticket.get", id); - assertTicketHasAttributes(attributes, id, ticket); - } - - public void testUpdateTicket() throws XmlRpcException, IOException { - int id = createTicket("summary", "description", new Hashtable()); - - Map attributes = new Hashtable(); - attributes.put("summary", "changed"); - call("ticket.update", id, "my comment", attributes); - - attributes.put("description", "description"); - - Object[] ticket = (Object[]) call("ticket.get", id); - Map values = (Map) ticket[3]; - for (String attribute : attributes.keySet()) { - assertEquals(attributes.get(attribute), values.get(attribute)); - } - } - - public void testTicketCustomFields() throws XmlRpcException, IOException { - Map attributes = new Hashtable(); - attributes.put("custom_text_field", "myvalue"); - int id = createTicket("summary", "description", attributes); - - // check for default values - attributes.put("custom_checkbox_field", "1"); - attributes.put("custom_select_field", "two"); - attributes.put("custom_radio_field", "baz"); - attributes.put("custom_textarea_field", "default text"); - - Object[] ticket = (Object[]) call("ticket.get", id); - assertTicketHasAttributes(attributes, id, ticket); - - attributes.put("custom_text_field", "myvalue2"); - attributes.put("custom_checkbox_field", "0"); - attributes.put("custom_select_field", "one"); - attributes.put("custom_radio_field", "foo"); - attributes.put("custom_textarea_field", "mytext"); - - call("ticket.update", id, "my comment", attributes); - - ticket = (Object[]) call("ticket.get", id); - assertTicketHasAttributes(attributes, id, ticket, false); - } - - public void testGetChangeLog() throws XmlRpcException, IOException { - int id = createTicket("summary", "description", new Hashtable()); - - Map attributes = new Hashtable(); - attributes.put("summary", "changed"); - call("ticket.update", id, "my comment", attributes); - - Object[] log = (Object[]) call("ticket.changeLog", id, 0); - Object[] entry = (Object[]) log[0]; - assertTrue(entry[0] instanceof Integer); // time - assertEquals(username, entry[1]); // author - assertEquals("summary", entry[2]); // field - assertEquals("summary", entry[3]); // old value - assertEquals("changed", entry[4]); // new value - } - - public void testMultiGetTicket() throws XmlRpcException, IOException { - int id1 = createTicket("summary1", "description1", new Hashtable()); - int id2 = createTicket("summary2", "description2", new Hashtable()); - - List> calls = new ArrayList>(); - calls.add(createMultiCall("ticket.get", id1)); - calls.add(createMultiCall("ticket.get", id2)); - Object[] ret = (Object[]) call("system.multicall", calls); - - Object[] ticket = (Object[]) ((Object[]) ret[0])[0]; - Map attributes = new Hashtable(); - attributes.put("summary", "summary1"); - attributes.put("description", "description1"); - assertTicketHasAttributes(attributes, id1, ticket); - - ticket = (Object[]) ((Object[]) ret[1])[0]; - attributes.clear(); - attributes.put("summary", "summary2"); - attributes.put("description", "description2"); - assertTicketHasAttributes(attributes, id2, ticket); - } - - public void testAttachment() throws XmlRpcException, IOException { - int id = createTicket("summary", "description", new Hashtable()); - - String filename = (String) call("ticket.putAttachment", id, "attach.txt", "description", "data".getBytes(), - true); - // the returned filename may differ, since another ticket may have an - // attachment named "attach.txt" - // assertEquals("attach.txt", filename); - - Object[] ret = (Object[]) call("ticket.listAttachments", id); - assertEquals(1, ret.length); - Object[] attachment = (Object[]) ret[0]; - assertEquals("attach.txt", attachment[0]); - assertEquals("description", attachment[1]); - assertEquals(4, attachment[2]); - // date - assertEquals(username, attachment[4]); - - byte[] bytes = (byte[]) call("ticket.getAttachment", id, filename); - String data = new String(bytes); - assertEquals("data", data); - - // test override - - String filename2 = (String) call("ticket.putAttachment", id, filename, "newdescription", "newdata".getBytes(), - true); - assertEquals(filename, filename2); - ret = (Object[]) call("ticket.listAttachments", id); - assertEquals(1, ret.length); - attachment = (Object[]) ret[0]; - assertEquals("attach.txt", attachment[0]); - assertEquals("newdescription", attachment[1]); - assertEquals(7, attachment[2]); - // date - assertEquals(username, attachment[4]); - bytes = (byte[]) call("ticket.getAttachment", id, filename); - data = new String(bytes); - assertEquals("newdata", data); - - String filename3 = (String) call("ticket.putAttachment", id, "attach.txt", "description", "data".getBytes(), - false); - assertFalse("attach.txt".equals(filename3)); - ret = (Object[]) call("ticket.listAttachments", id); - assertEquals(2, ret.length); - } - - public void testDeleteAttachment() throws XmlRpcException, IOException { - int id = createTicket("summary", "description", new Hashtable()); - - String filename = (String) call("ticket.putAttachment", id, "attach.txt", "description", "data".getBytes(), - true); - - Object[] ret = (Object[]) call("ticket.listAttachments", id); - assertEquals(1, ret.length); - - call("ticket.deleteAttachment", id, filename); - - ret = (Object[]) call("ticket.listAttachments", id); - assertEquals(0, ret.length); - } - - public void testDuplicateAttachment() throws XmlRpcException, IOException { - int id1 = createTicket("summary", "description", new Hashtable()); - int id2 = createTicket("summary", "description", new Hashtable()); - - String filename1 = (String) call("ticket.putAttachment", id1, "attach.txt", "description", "data".getBytes(), - true); - String filename2 = (String) call("ticket.putAttachment", id2, "attach.txt", "description", "data2".getBytes(), - true); - assertEquals("attach.txt", filename1); - assertEquals(filename1, filename2); - - byte[] bytes = (byte[]) call("ticket.getAttachment", id1, "attach.txt"); - String data = new String(bytes); - assertEquals("data", data); - - bytes = (byte[]) call("ticket.getAttachment", id2, "attach.txt"); - data = new String(bytes); - assertEquals("data2", data); - } - - public void testQuery() throws XmlRpcException, IOException { - Object[] ret = (Object[]) call("ticket.query", "summary~=foo|bar|baz"); - for (Object id : ret) { - call("ticket.delete", (Integer) id); - } - - int id1 = createTicket("foobarsum1", "description", new Hashtable()); - int id2 = createTicket("foobaz sum2", "description", new Hashtable()); - int id3 = createTicket("foobarbaz3", "foobarbaz description3", new Hashtable()); - - ret = (Object[]) call("ticket.query", "summary=foobarsum1|foobaz sum2"); - assertEquals(2, ret.length); - assertEquals(id1, ret[0]); - assertEquals(id2, ret[1]); - - // the first criterium is ignored - ret = (Object[]) call("ticket.query", "summary~=foobarsum1&summary~=foobaz sum2"); - assertEquals(1, ret.length); - assertEquals(id2, ret[0]); - - ret = (Object[]) call("ticket.query", "summary~=bar|baz"); - assertEquals(3, ret.length); - - ret = (Object[]) call("ticket.query", "description~=foobarbaz description3"); - assertEquals(1, ret.length); - assertEquals(id3, ret[0]); - } - - public void testQueryAll() throws XmlRpcException, IOException { - int id = createTicket("foo", "description", new Hashtable()); - - Object[] ret = (Object[]) call("ticket.query", "order=id"); - assertTrue(ret.length > 0); - assertHasValue(ret, id); - } - - public void testPriorities() throws XmlRpcException, IOException { - internalTestCrud("ticket.priority"); - } - - public void testSeverities() throws XmlRpcException, IOException { - internalTestCrud("ticket.severity"); - } - - public void testType() throws XmlRpcException, IOException { - internalTestCrud("ticket.type"); - } - - public void testStatus() throws XmlRpcException, IOException { - internalTestCrud("ticket.status"); - } - - public void testResolutions() throws XmlRpcException, IOException { - internalTestCrud("ticket.resolution"); - } - - public void testVersions() throws XmlRpcException, IOException { - internalTestComponent("ticket.version", "time", Integer.class, "description", String.class); - } - - public void testComponents() throws XmlRpcException, IOException { - internalTestComponent("ticket.component", "owner", String.class, "description", String.class); - } - - public void testMilestones() throws XmlRpcException, IOException { - internalTestComponent("ticket.milestone", "due", Integer.class, "completed", Integer.class, "description", - String.class); - } - -} diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TestCleanupUtil.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TestCleanupUtil.java deleted file mode 100644 index 8b7a33f69..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TestCleanupUtil.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 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.trac.tests.support; - -import org.eclipse.mylyn.context.tests.support.TestUtil.PrivilegeLevel; -import org.eclipse.mylyn.internal.trac.core.TracException; -import org.eclipse.mylyn.internal.trac.core.ITracClient.Version; -import org.eclipse.mylyn.internal.trac.core.model.TracAttachment; -import org.eclipse.mylyn.internal.trac.core.model.TracTicket; -import org.eclipse.mylyn.trac.tests.AbstractTracClientTest; -import org.eclipse.mylyn.trac.tests.support.XmlRpcServer.TestData; - -/** - * Utility that cleans up artifacts created by the Trac test suite. This class should be run periodically to speed up - * execution of (attachment) tests. - * - * @author Steffen Pingel - */ -public class TestCleanupUtil extends AbstractTracClientTest { - - private TestData data; - - public TestCleanupUtil() { - super(Version.XML_RPC, PrivilegeLevel.ADMIN); - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - - data = TestFixture.init010(); - } - - public void testCleanup010() throws Exception { - connect010(); - cleanup(); - } - - public void testCleanup011() throws Exception { - connect011(); - cleanup(); - } - - private void cleanup() throws TracException { - TracTicket ticket = repository.getTicket(data.attachmentTicketId); - TracAttachment[] attachments = ticket.getAttachments(); - // skips the first attachment - for (int i = 1; i < attachments.length; i++) { - repository.deleteAttachment(data.attachmentTicketId, attachments[i].getFilename()); - } - } - -} diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TestFixture.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TestFixture.java deleted file mode 100644 index 93a6c7da3..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TestFixture.java +++ /dev/null @@ -1,97 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mylar project committers - initial API and implementation - *******************************************************************************/ - -package org.eclipse.mylyn.trac.tests.support; - -import org.eclipse.mylyn.context.tests.support.TestUtil; -import org.eclipse.mylyn.context.tests.support.TestUtil.Credentials; -import org.eclipse.mylyn.context.tests.support.TestUtil.PrivilegeLevel; -import org.eclipse.mylyn.trac.tests.TracTestConstants; - -/** - * Initializes Trac repositories to a defined state. This is done once per test run, since cleaning and initializing the - * repository for each test method would take too long. - * - * @author Steffen Pingel - */ -public class TestFixture { - - public static XmlRpcServer.TestData data010; - - /** - * Adds the existing repository content to the test data of server. - */ - private static void initializeTestData(XmlRpcServer server) throws Exception { - server.ticketMilestone("milestone1").itemCreated(); - server.ticketMilestone("milestone2").itemCreated(); - server.ticketMilestone("milestone3").itemCreated(); - server.ticketMilestone("milestone4").itemCreated(); - server.ticketMilestone("mile&stone").itemCreated(); - - server.ticketVersion("1.0").itemCreated(); - server.ticketVersion("2.0").itemCreated(); - - server.ticket(1).itemCreated(); - server.ticket(2).itemCreated(); - server.ticket(3).itemCreated(); - server.ticket(4).itemCreated(); - server.ticket(5).itemCreated(); - server.ticket(6).itemCreated(); - server.ticket(7).itemCreated(); - server.ticket(8).itemCreated(); - } - -// private static void initializeRepository(XmlRpcServer server) throws Exception { -// server.ticketVersion(null).deleteAll(); -// server.ticketVersion("1.0").create(0, ""); -// server.ticketVersion("2.0").create(0, ""); -// -// server.ticketMilestone(null).deleteAll(); -// server.ticketMilestone("milestone1").create(); -// server.ticketMilestone("milestone2").create(); -// server.ticketMilestone("milestone3").create(); -// server.ticketMilestone("milestone4").create(); -// -// server.ticket().deleteAll(); -// Ticket ticket = server.ticket().create("summary1", "description1"); -// ticket.update("comment", "milestone", "milestone1"); -// ticket = server.ticket().create("summary2", "description2"); -// ticket.update("comment", "milestone", "milestone2"); -// ticket = server.ticket().create("summary3", "description3"); -// ticket.update("comment", "milestone", "milestone2"); -// ticket = server.ticket().create("summary4", "description4"); -// -// ticket = server.ticket().create("attachment test", ""); -// // create attachment named attachment.txt that contains the text "Mylar" -// ticket = server.ticket().create("test html entities: ���", "���\n\nmulti\nline\n\n'''bold'''\n"); -// ticket = server.ticket().create("offline handler test", ""); -// } - - public static XmlRpcServer.TestData init010() throws Exception { - if (data010 == null) { - Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER); - XmlRpcServer server = new XmlRpcServer(TracTestConstants.TEST_TRAC_010_URL, credentials.username, - credentials.password); - - initializeTestData(server); - data010 = server.getData(); - } - return data010; - } - - public static void cleanup010() throws Exception { - if (data010 != null) { - // data010.cleanup(); - data010 = null; - } - } - -} diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/XmlRpcServer.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/XmlRpcServer.java deleted file mode 100644 index 88698b52e..000000000 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/XmlRpcServer.java +++ /dev/null @@ -1,370 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mylar project committers - initial API and implementation - *******************************************************************************/ - -package org.eclipse.mylyn.trac.tests.support; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.List; -import java.util.Map; -import java.util.Vector; - -import org.apache.xmlrpc.XmlRpcException; -import org.apache.xmlrpc.client.XmlRpcClient; -import org.eclipse.mylyn.internal.trac.core.TracXmlRpcClient; -import org.eclipse.mylyn.internal.trac.core.ITracClient.Version; - -/** - * @author Steffen Pingel - */ -public class XmlRpcServer { - - public abstract class AbstractTracItem { - - public abstract void delete() throws Exception; - - void itemCreated() { - data.items.add(this); - } - - void itemDeleted() { - data.items.remove(this); - } - - } - - /** - * Represents a Trac type with multiple attributes such as a milestone. - */ - public class ModelEnum extends AbstractTracItem { - - private String[] attributes; - - private String id; - - private String module; - - public ModelEnum(String module, String id, String... attributes) { - this.module = module; - this.id = id; - this.attributes = attributes; - } - - public ModelEnum create(Object... params) throws Exception { - call(module + ".create", id, toMap(params)); - itemCreated(); - return this; - } - - @Override - public void delete() throws Exception { - call(module + ".delete", id); - itemDeleted(); - } - - public void deleteAll() throws Exception { - String[] ids = getAll(); - for (String id : ids) { - call(module + ".delete", id); - } - } - - public ModelEnum deleteAndCreate(Object... params) throws Exception { - if (Arrays.asList(getAll()).contains(id)) { - delete(); - } - - return create(params); - } - - @SuppressWarnings("unchecked") - public Object[] get() throws Exception { - Hashtable values = (Hashtable) call(module + ".get", id); - Object[] result = new Object[values.size()]; - for (int i = 0; i < result.length && i < attributes.length; i++) { - result[i] = values.get(attributes[i]); - } - return result; - } - - @SuppressWarnings("unchecked") - public String[] getAll() throws Exception { - return Arrays.asList((Object[]) call(module + ".getAll")).toArray(new String[0]); - } - - private Hashtable toMap(Object... params) { - Hashtable attrs = new Hashtable(); - for (int i = 0; i < attributes.length && i < params.length; i++) { - attrs.put(attributes[i], params[i]); - } - return attrs; - } - - public ModelEnum update(Object... params) throws Exception { - call(module + ".update", id, toMap(params)); - return this; - } - - } - - /** - * Records changes to the repository. - */ - public class TestData { - - // all created items - List items = new ArrayList(); - - // all created tickets - public List tickets = new ArrayList(); - - public int attachmentTicketId = 5; - - public int htmlEntitiesTicketId = 6; - - public int offlineHandlerTicketId = 7; - - /** - * Undo all changes. - */ - public void cleanup() throws Exception { - while (!items.isEmpty()) { - items.get(0).delete(); - } - } - - } - - /** - * Represents a Trac ticket. - */ - public class Ticket extends AbstractTracItem { - - private Integer id; - - public Ticket(Integer id) { - this.id = id; - } - - public Ticket create(String summary, String description) throws Exception { - this.id = (Integer) call("ticket.create", summary, description, new Hashtable()); - if (id == null) { - throw new RuntimeException("Could not create ticket: " + summary); - } - itemCreated(); - return this; - } - - @Override - public void delete() throws Exception { - call("ticket.delete", id); - itemDeleted(); - } - - public void deleteAll() throws Exception { - Integer[] ids = getAll(); - for (Integer id : ids) { - call("ticket.delete", id); - } - } - - public Object getValue(String key) throws Exception { - return getValues().get(key); - } - - public Map getValues() throws Exception { - return (Map) ((Object[]) call("ticket.get", id))[3]; - } - - @SuppressWarnings("unchecked") - public Integer[] getAll() throws Exception { - return Arrays.asList((Object[]) call("ticket.query", "order=id")).toArray(new Integer[0]); - } - - public int getId() { - return id; - } - - @Override - protected void itemCreated() { - super.itemCreated(); - data.tickets.add(this); - } - - @Override - protected void itemDeleted() { - super.itemDeleted(); - data.tickets.remove(this); - } - - public Ticket update(String comment, String key, String value) throws Exception { - Hashtable attrs = new Hashtable(); - attrs.put(key, value); - call("ticket.update", id, comment, attrs); - return this; - } - - } - - /** - * Represents a Trac type that has a single attribute such as a priority. - */ - public class TicketEnum extends AbstractTracItem { - - private String id; - - private String module; - - public TicketEnum(String module, String id) { - this.module = module; - this.id = id; - } - - public TicketEnum create(String param) throws Exception { - call(module + ".create", id, param); - itemCreated(); - return this; - } - - @Override - public void delete() throws Exception { - call(module + ".delete", id); - itemDeleted(); - } - - public void deleteAll() throws Exception { - String[] ids = getAll(); - for (String id : ids) { - call(module + ".delete", id); - } - } - - public TicketEnum deleteAndCreate(String param) throws Exception { - if (Arrays.asList(getAll()).contains(id)) { - delete(); - } - - return create(param); - } - - public String get() throws Exception { - return (String) call(module + ".get", id); - } - - @SuppressWarnings("unchecked") - public String[] getAll() throws Exception { - return Arrays.asList((Object[]) call(module + ".getAll")).toArray(new String[0]); - } - - public TicketEnum update(String param) throws Exception { - call(module + ".update", id, param); - return this; - } - - } - - private XmlRpcClient client; - - private TestData data; - - private String password; - - private TracXmlRpcClient repository; - - private String url; - - private String username; - - public XmlRpcServer(String url, String username, String password) throws Exception { - this.url = url; - this.username = username; - this.password = password; - - this.data = new TestData(); - - this.repository = new TracXmlRpcClient(new URL(url), Version.XML_RPC, username, password, null); - this.client = repository.getClient(); - } - - private Object call(String method, Object... parameters) throws XmlRpcException, IOException { - Vector params = new Vector(parameters.length); - for (Object parameter : parameters) { - params.add(parameter); - } - - Object result = client.execute(method, params); - if (result instanceof XmlRpcException) { - throw (XmlRpcException) result; - } - return result; - } - - public TestData getData() { - return data; - } - - public String getPassword() { - return password; - } - - public TracXmlRpcClient getRepository() throws MalformedURLException { - return repository; - } - - public String getUrl() { - return url; - } - - public String getUsername() { - return username; - } - - public Ticket ticket() throws Exception { - return new Ticket(null); - } - - public Ticket ticket(int id) throws Exception { - return new Ticket(id); - } - - public ModelEnum ticketComponent(String id) throws Exception { - return new ModelEnum("ticket.component", id, "owner", "description"); - } - - public ModelEnum ticketMilestone(String id) throws Exception { - return new ModelEnum("ticket.milestone", id, "due", "completed", "description"); - } - - public TicketEnum ticketPriority(String id) throws Exception { - return new TicketEnum("ticket.priority", id); - } - - public TicketEnum ticketSeverity(String id) throws Exception { - return new TicketEnum("ticket.severity", id); - } - - public TicketEnum ticketStatus(String id) throws Exception { - return new TicketEnum("ticket.status", id); - } - - public TicketEnum ticketType(String id) throws Exception { - return new TicketEnum("ticket.type", id); - } - - public ModelEnum ticketVersion(String id) throws Exception { - return new ModelEnum("ticket.version", id, "time", "description"); - } - -} -- cgit v1.2.3