Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrelves2007-06-07 17:58:36 +0000
committerrelves2007-06-07 17:58:36 +0000
commit0f301b3a53988ccbaf4782fb3dce11143af4386a (patch)
treec5988792c17c4e139fec3c6ebfea69af4d31ebdc /org.eclipse.mylyn.bugzilla.tests
parent00efdf6ed0ee49ba4bc3b0e64ee1ddd3282191d4 (diff)
downloadorg.eclipse.mylyn.tasks-0f301b3a53988ccbaf4782fb3dce11143af4386a.tar.gz
org.eclipse.mylyn.tasks-0f301b3a53988ccbaf4782fb3dce11143af4386a.tar.xz
org.eclipse.mylyn.tasks-0f301b3a53988ccbaf4782fb3dce11143af4386a.zip
ASSIGNED - bug 189066: [api] updateTaskFromTaskData() should not block
https://bugs.eclipse.org/bugs/show_bug.cgi?id=189066
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.tests')
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaConfigurationTest.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java33
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchEngineTest.java106
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java42
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListNotificationManagerTest.java12
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListStandaloneTest.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskReportGeneratorTest.java8
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaQueryTest.java3
8 files changed, 112 insertions, 96 deletions
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
index 8c6b7ea50..f2f46afae 100644
--- 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
@@ -130,7 +130,7 @@ public class BugzillaConfigurationTest extends TestCase {
assertEquals(7, config.getSeverities().size());
assertTrue(config.getProducts().size() > 50);
assertEquals(4, config.getOpenStatusValues().size());
- assertEquals(12, config.getComponents("Mylar").size());
+ assertEquals(13, config.getComponents("Mylar").size());
assertEquals(23, config.getKeywords().size());
// assertEquals(10, config.getComponents("Hyades").size());
// assertEquals(1, config.getTargetMilestones("TestProduct").size());
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
index d62ea93b3..8e21b53b6 100644
--- 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
@@ -56,7 +56,7 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
BugzillaRepositoryQuery bugQuery = new BugzillaRepositoryQuery(
IBugzillaConstants.TEST_BUGZILLA_222_URL,
"http://mylar.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);
+ "testFocedQuerySynchronization");
taskList.addQuery(bugQuery);
@@ -111,13 +111,11 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
// null, collector, "-1");
//
String queryUrl = "http://mylar.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",
- taskList);
+ BugzillaRepositoryQuery bugzillaQuery = new BugzillaRepositoryQuery(repository.getUrl(), queryUrl, "search");
SearchHitCollector collector = new SearchHitCollector(taskList, repository, bugzillaQuery, taskFactory);
- RepositorySearchResult result = (RepositorySearchResult)collector.getSearchResult();
-
-
+ RepositorySearchResult result = (RepositorySearchResult) collector.getSearchResult();
+
// operation.run(new NullProgressMonitor());
// BugzillaSearchQuery searchQuery = new BugzillaSearchQuery(collector);
collector.run(new NullProgressMonitor());
@@ -242,16 +240,17 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
public void testUniqueQueryHitObjects() {
init222();
BugzillaRepositoryQuery query1 = new BugzillaRepositoryQuery(IBugzillaConstants.TEST_BUGZILLA_222_URL,
- "queryurl", "description1", taskList);
+ "queryurl", "description1");
BugzillaTask query1Hit = new BugzillaTask(IBugzillaConstants.TEST_BUGZILLA_222_URL, "1", "description1");
- query1.addHit(query1Hit);
taskList.addQuery(query1);
-
+ taskList.addTask(query1Hit, query1);
+
BugzillaRepositoryQuery query2 = new BugzillaRepositoryQuery(IBugzillaConstants.TEST_BUGZILLA_222_URL,
- "queryurl2", "description2", taskList);
+ "queryurl2", "description2");
BugzillaTask query2Hit = new BugzillaTask(IBugzillaConstants.TEST_BUGZILLA_222_URL, "1", "description2");
- query2.addHit(query2Hit);
taskList.addQuery(query2);
+ taskList.addTask(query2Hit, query1);
+
assertEquals(2, taskList.getQueries().size());
assertEquals(1, taskList.getAllTasks().size());
for (AbstractRepositoryTask hit : query1.getHits()) {
@@ -290,10 +289,11 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
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);
@@ -317,7 +317,9 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
File attachFile = new File(fileName);
attachment.setFilePath(attachFile.getAbsolutePath());
BufferedWriter write = new BufferedWriter(new FileWriter(attachFile));
- attachment.setFile(new File(attachment.getFilePath()));
+ attachFile = new File(attachment.getFilePath());
+ attachment.setFile(attachFile);
+ attachment.setFilename(attachFile.getName());
// assertFalse(attachmentHandler.uploadAttachment(attachment,
// repository.getUserName(), repository.getPassword(),
// Proxy.NO_PROXY));
@@ -338,7 +340,10 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
// assertTrue(attachmentHandler.uploadAttachment(attachment,
// repository.getUserName(), repository.getPassword(),
// Proxy.NO_PROXY));
- attachment.setFile(new File(attachment.getFilePath()));
+ 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());
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
index d9966f3c3..287e61ec3 100644
--- 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
@@ -33,16 +33,21 @@ import org.eclipse.mylar.tasks.ui.TasksUiPlugin;
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&amp";
+
+ private static final String BUG_DESC_SUBSTRING_SEARCH = "/buglist.cgi?short_desc_type=allwordssubstr&short_desc=";// search-match-test&amp";
+
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());
+ assertEquals(NUM_REPOSITORIES, TasksUiPlugin.getRepositoryManager().getRepositories(
+ BugzillaCorePlugin.REPOSITORY_KIND).size());
}
@Override
@@ -51,63 +56,74 @@ public class BugzillaSearchEngineTest extends TestCase {
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<AbstractQueryHit> hits = runQuery(IBugzillaConstants.TEST_BUGZILLA_216_URL, SEARCH_DESCRIPTION);
-// assertEquals(NUM_EXPECTED_HITS, hits.size());
-// }
-
+// 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<AbstractQueryHit> 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());
+ 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());
+ 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());
+ 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());
+ 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<AbstractRepositoryTask> hits = runQuery(IBugzillaConstants.TEST_BUGZILLA_222_URL, SEARCH_DESCRIPTION);
- assertEquals(NUM_EXPECTED_HITS, hits.size());
+ assertEquals(NUM_EXPECTED_HITS, hits.size());
}
-
- private Set<AbstractRepositoryTask> 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,
- TasksUiPlugin.getTaskListManager().getTaskList());
-
- AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(BugzillaCorePlugin.REPOSITORY_KIND);
+
+ private Set<AbstractRepositoryTask> 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(taskList, new TaskFactory(repository));
-
+
connector.performQuery(repositoryQuery, repository, new NullProgressMonitor(), collector, false);
-
- //results.addAll(connector.performQuery(repositoryQuery, new NullProgressMonitor(), new MultiStatus(TasksUiPlugin.PLUGIN_ID, IStatus.OK, "Query result", null)));
- return collector.getTaskHits();
+
+ // results.addAll(connector.performQuery(repositoryQuery, new
+ // NullProgressMonitor(), new MultiStatus(TasksUiPlugin.PLUGIN_ID,
+ // IStatus.OK, "Query result", null)));
+ return collector.getTaskHits();
}
-
-
-
+
}
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
index bb0fcc6d2..611c9830d 100644
--- 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
@@ -40,16 +40,17 @@ public class BugzillaTaskListManagerTest extends TestCase {
private TaskListManager manager;
private TaskRepository repository;
-
+
@Override
protected void setUp() throws Exception {
super.setUp();
- manager = TasksUiPlugin.getTaskListManager();
+ 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());
+ TasksUiPlugin.getRepositoryManager().addRepository(repository,
+ TasksUiPlugin.getDefault().getRepositoriesFilePath());
assertEquals(0, manager.getTaskList().getAllTasks().size());
}
@@ -57,11 +58,12 @@ public class BugzillaTaskListManagerTest extends TestCase {
protected void tearDown() throws Exception {
super.tearDown();
manager.resetTaskList();
- TasksUiPlugin.getTaskListManager().saveTaskList();
-// TasksUiPlugin.getDefault().getTaskListSaveManager().saveTaskList(true);
- TasksUiPlugin.getRepositoryManager().removeRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath());
+ TasksUiPlugin.getTaskListManager().saveTaskList();
+// TasksUiPlugin.getDefault().getTaskListSaveManager().saveTaskList(true);
+ TasksUiPlugin.getRepositoryManager().removeRepository(repository,
+ TasksUiPlugin.getDefault().getRepositoriesFilePath());
}
-
+
// TODO: move
public void testRemindedPersistance() {
@@ -87,7 +89,7 @@ public class BugzillaTaskListManagerTest extends TestCase {
assertTrue(task.hasBeenReminded());
}
}
-
+
public void testRepositoryTaskExternalization() {
BugzillaTask repositoryTask = new BugzillaTask("repo", "1", "label");
repositoryTask.setKind("kind");
@@ -107,10 +109,9 @@ public class BugzillaTaskListManagerTest extends TestCase {
assertEquals(repositoryTask.getSummary(), readTask.getSummary());
assertEquals(repositoryTask.getTaskKind(), readTask.getTaskKind());
}
-
+
public void testQueryExternalization() {
- AbstractRepositoryQuery query = new BugzillaRepositoryQuery("repositoryUrl", "queryUrl", "label", manager
- .getTaskList());
+ AbstractRepositoryQuery query = new BugzillaRepositoryQuery("repositoryUrl", "queryUrl", "label");
// long time = 1234;
// Date oldDate = new Date(time);
// query.setLastRefresh(oldDate);
@@ -133,10 +134,9 @@ public class BugzillaTaskListManagerTest extends TestCase {
assertEquals("repositoryUrl", readQuery.getRepositoryUrl());
// assertEquals(time, readQuery.getLastSynchronized().getTime());
}
-
+
public void testBugzillaCustomQueryExternalization() {
- BugzillaRepositoryQuery query = new BugzillaRepositoryQuery("repositoryUrl", "queryUrl", "label", manager
- .getTaskList());
+ BugzillaRepositoryQuery query = new BugzillaRepositoryQuery("repositoryUrl", "queryUrl", "label");
query.setCustomQuery(true);
manager.getTaskList().addQuery(query);
manager.saveTaskList();
@@ -151,7 +151,7 @@ public class BugzillaTaskListManagerTest extends TestCase {
.next();
assertTrue(readQuery.isCustomQuery());
}
-
+
public void testLegacyTaskListReading() throws IOException {
File originalFile = manager.getTaskListFile();
File legacyListFile = new File("temptasklist.xml");
@@ -200,8 +200,7 @@ public class BugzillaTaskListManagerTest extends TestCase {
}
public void testDeleteQuery() {
- AbstractRepositoryQuery query = new BugzillaRepositoryQuery("repositoryUrl", "queryUrl", "label", manager
- .getTaskList());
+ AbstractRepositoryQuery query = new BugzillaRepositoryQuery("repositoryUrl", "queryUrl", "label");
manager.getTaskList().addQuery(query);
AbstractRepositoryQuery readQuery = manager.getTaskList().getQueries().iterator().next();
@@ -212,8 +211,7 @@ public class BugzillaTaskListManagerTest extends TestCase {
}
public void testDeleteQueryAfterRename() {
- AbstractRepositoryQuery query = new BugzillaRepositoryQuery("repositoryUrl", "queryUrl", "label", manager
- .getTaskList());
+ AbstractRepositoryQuery query = new BugzillaRepositoryQuery("repositoryUrl", "queryUrl", "label");
manager.getTaskList().addQuery(query);
AbstractRepositoryQuery readQuery = manager.getTaskList().getQueries().iterator().next();
@@ -224,15 +222,13 @@ public class BugzillaTaskListManagerTest extends TestCase {
}
public void testCreateQueryWithSameName() {
- AbstractRepositoryQuery query = new BugzillaRepositoryQuery("repositoryUrl", "queryUrl", "label", manager
- .getTaskList());
+ 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", manager.getTaskList()));
+ 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/TaskListNotificationManagerTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListNotificationManagerTest.java
index 481af7b69..436d47b60 100644
--- 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
@@ -79,9 +79,8 @@ public class TaskListNotificationManagerTest extends TestCase {
TasksUiPlugin.getRepositoryManager().addRepository(repository,
TasksUiPlugin.getDefault().getRepositoriesFilePath());
AbstractRepositoryTask task = new BugzillaTask("https://bugs.eclipse.org/bugs", "142891", "label");
- assertTrue(task.getSyncState() == RepositoryTaskSyncState.INCOMING);
+ assertEquals( RepositoryTaskSyncState.SYNCHRONIZED, task.getSyncState());
assertFalse(task.isNotified());
- task.setNotified(false);
TasksUiPlugin.getTaskListManager().getTaskList().addTask(task);
TaskListNotificationManager notificationManager = TasksUiPlugin.getDefault().getTaskListNotificationManager();
notificationManager.collectNotifications();
@@ -96,9 +95,10 @@ public class TaskListNotificationManagerTest extends TestCase {
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());
- query.addHit(hit);
+ "summary");
TasksUiPlugin.getTaskListManager().getTaskList().addQuery(query);
+ TasksUiPlugin.getTaskListManager().getTaskList().addTask(hit, query);
+
TaskListNotificationManager notificationManager = TasksUiPlugin.getDefault().getTaskListNotificationManager();
assertFalse(hit.isNotified());
notificationManager.collectNotifications();
@@ -115,9 +115,9 @@ public class TaskListNotificationManagerTest extends TestCase {
String hitHandle = hit.getHandleIdentifier();
assertFalse(hit.isNotified());
BugzillaRepositoryQuery query = new BugzillaRepositoryQuery("https://bugs.eclipse.org/bugs", "queryUrl",
- "summary", TasksUiPlugin.getTaskListManager().getTaskList());
- query.addHit(hit);
+ "summary");
TasksUiPlugin.getTaskListManager().getTaskList().addQuery(query);
+ TasksUiPlugin.getTaskListManager().getTaskList().addTask(hit, query);
TaskListNotificationManager notificationManager = TasksUiPlugin.getDefault().getTaskListNotificationManager();
notificationManager.collectNotifications();
for (ITaskListNotification notification : notificationManager.getNotifications()) {
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
index 77b361361..953c744d4 100644
--- 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
@@ -173,7 +173,7 @@ public class TaskListStandaloneTest extends TestCase {
externalizers.add(new BugzillaTaskExternalizer());
// make a query
BugzillaRepositoryQuery query = new BugzillaRepositoryQuery(IBugzillaConstants.TEST_BUGZILLA_222_URL,
- "http://queryurl", "summary", TasksUiPlugin.getTaskListManager().getTaskList());
+ "http://queryurl", "summary");
manager.getTaskList().addQuery(query);
manager.saveTaskList();
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
index 48f67387c..9518853d4 100644
--- 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
@@ -112,7 +112,7 @@ public class TaskReportGeneratorTest extends TestCase {
Task task1 = new Task(TasksUiPlugin.getTaskListManager().genUniqueTaskHandle(), "task 1");
manager.getTaskList().moveToRoot(task1);
task1.setCompleted(true);
- TaskCategory cat1 = new TaskCategory("TaskReportGeneratorTest Category", manager.getTaskList());
+ TaskCategory cat1 = new TaskCategory("TaskReportGeneratorTest Category");
manager.getTaskList().addCategory(cat1);
Set<ITaskListElement> catagories = new HashSet<ITaskListElement>();
@@ -135,7 +135,7 @@ public class TaskReportGeneratorTest extends TestCase {
BugzillaTask task1 = new BugzillaTask("repo", "1", "task 1");
manager.getTaskList().moveToRoot(task1);
task1.setCompleted(true);
- TaskCategory cat1 = new TaskCategory("TaskReportGeneratorTest Category", manager.getTaskList());
+ TaskCategory cat1 = new TaskCategory("TaskReportGeneratorTest Category");
manager.getTaskList().addCategory(cat1);
Set<ITaskListElement> catagories = new HashSet<ITaskListElement>();
@@ -160,7 +160,7 @@ public class TaskReportGeneratorTest extends TestCase {
task1.setCompleted(false);
BugzillaRepositoryQuery bugQuery = new BugzillaRepositoryQuery("repositoryUrl", "queryUrl",
- "TaskReportGeneratorBugzillaQueryCategory", manager.getTaskList());
+ "TaskReportGeneratorBugzillaQueryCategory");
manager.getTaskList().addQuery(bugQuery);
@@ -173,7 +173,7 @@ public class TaskReportGeneratorTest extends TestCase {
generator.run(new NullProgressMonitor());
assertEquals(0, generator.getAllCollectedTasks().size());
- bugQuery.addHit(task1);
+ manager.getTaskList().addTask(task1, bugQuery);
generator.run(new NullProgressMonitor());
assertEquals(0, generator.getAllCollectedTasks().size());
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
index 5f43da257..a8c31eaa8 100644
--- 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
@@ -135,8 +135,7 @@ public class BugzillaQueryTest extends TestCase {
QueryHitCollector collector = new QueryHitCollector(taskList, new TaskFactory(repository));
BugzillaRepositoryConnector connector = new BugzillaRepositoryConnector();
connector.init(taskList);
- BugzillaRepositoryQuery query = new BugzillaRepositoryQuery(repository.getUrl(), queryUrlString, "summary",
- taskList);
+ BugzillaRepositoryQuery query = new BugzillaRepositoryQuery(repository.getUrl(), queryUrlString, "summary");
connector.performQuery(query, repository, new NullProgressMonitor(), collector, false);
assertEquals(2, collector.getTaskHits().size());
for (ITask hit : collector.getTaskHits()) {

Back to the top