Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2007-06-22 23:00:26 +0000
committermkersten2007-06-22 23:00:26 +0000
commit09f0db667d81f101a06d6ad664d47d3271371b17 (patch)
treedfafa789f0aafe5e1913031b863b375ecc009acd /org.eclipse.mylyn.bugzilla.tests
parente1302bdc874028bcb074345cdd4fcef3e15d02a7 (diff)
downloadorg.eclipse.mylyn.tasks-09f0db667d81f101a06d6ad664d47d3271371b17.tar.gz
org.eclipse.mylyn.tasks-09f0db667d81f101a06d6ad664d47d3271371b17.tar.xz
org.eclipse.mylyn.tasks-09f0db667d81f101a06d6ad664d47d3271371b17.zip
NEW - bug 193842: [api] review Mylyn 2.0 APIs
https://bugs.eclipse.org/bugs/show_bug.cgi?id=193842
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.tests')
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java4
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java40
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java10
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListNotificationManagerTest.java8
4 files changed, 31 insertions, 31 deletions
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
index f0a6874ab..475e60fca 100644
--- 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
@@ -102,7 +102,7 @@ public abstract class AbstractBugzillaTest extends TestCase {
AbstractRepositoryConnector abstractRepositoryClient = manager.getRepositoryConnector(DEFAULT_KIND);
- assertEquals(abstractRepositoryClient.getRepositoryType(), DEFAULT_KIND);
+ assertEquals(abstractRepositoryClient.getConnectorKind(), DEFAULT_KIND);
connector = (BugzillaRepositoryConnector) abstractRepositoryClient;
@@ -136,7 +136,7 @@ public abstract class AbstractBugzillaTest extends TestCase {
protected void synchAndAssertState(Set<AbstractTask> tasks, RepositoryTaskSyncState state) {
for (AbstractTask task : tasks) {
TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null);
- assertEquals(task.getSyncState(), state);
+ assertEquals(task.getSynchronizationState(), state);
}
}
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 650d372d4..901b93bb3 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
@@ -84,7 +84,7 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
BugzillaTask task = generateLocalTaskAndDownload("1");
assertNotNull(task);
assertNotNull(TasksUiPlugin.getDefault().getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId()));
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSyncState());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState());
BugzillaTask retrievedTask = (BugzillaTask) taskList.getTask(task.getHandleIdentifier());
assertNotNull(retrievedTask);
@@ -163,14 +163,14 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
assertNotNull(TasksUiPlugin.getDefault().getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId()));
TasksUiPlugin.getTaskListManager().activateTask(task);
File sourceContextFile = ContextCorePlugin.getContextManager().getFileForContext(task.getHandleIdentifier());
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSyncState());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState());
sourceContextFile.createNewFile();
sourceContextFile.deleteOnExit();
repository.setAuthenticationCredentials("wrong", "wrong");
try {
- connector.attachContext(repository, task, "", new NullProgressMonitor());
+ connector.getAttachmentHandler().attachContext(repository, task, "", new NullProgressMonitor());
} catch (CoreException e) {
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSyncState());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState());
return;
}
fail("Should have failed due to invalid userid and password.");
@@ -203,13 +203,13 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null);
// After submit task should be in SYNCHRONIZED state
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSyncState());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState());
RepositoryTaskData taskData2 = TasksUiPlugin.getDefault().getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId());
assertFalse(taskData2.getLastModified().equals(taskData.getLastModified()));
// Still not read
- assertFalse(taskData2.getLastModified().equals(task.getLastSyncDateStamp()));
+ assertFalse(taskData2.getLastModified().equals(task.getLastReadTimeStamp()));
TasksUiPlugin.getSynchronizationManager().setTaskRead(task, true);
- assertEquals(taskData2.getLastModified(), task.getLastSyncDateStamp());
+ assertEquals(taskData2.getLastModified(), task.getLastReadTimeStamp());
assertTrue(taskData2.getComments().size() > numComments);
// Has no outgoing changes or conflicts yet needs synch
@@ -218,7 +218,7 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
// task.setSyncState(RepositoryTaskSyncState.SYNCHRONIZED);
TasksUiPlugin.getDefault().getTaskDataManager().remove(task.getRepositoryUrl(), task.getTaskId());
TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, false, null);
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSyncState());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState());
RepositoryTaskData bugReport2 = null;
bugReport2 = TasksUiPlugin.getDefault().getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId());
assertNotNull(bugReport2);
@@ -270,7 +270,7 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
assertNotNull(task);
assertNotNull(taskData);
TasksUiPlugin.getSynchronizationManager().setTaskRead(task, true);
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSyncState());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState());
assertEquals(taskNumber, taskData.getId());
int numAttached = taskData.getAttachments().size();
String fileName = "test-attach-" + System.currentTimeMillis() + ".txt";
@@ -303,7 +303,7 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
// assertFalse(attachmentHandler.uploadAttachment(attachment,
// repository.getUserName(), repository.getPassword(),
// Proxy.NO_PROXY));
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSyncState());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState());
task = (BugzillaTask) connector.createTaskFromExistingId(repository, taskNumber, new NullProgressMonitor());
TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null);
@@ -359,14 +359,14 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
RepositoryTaskData taskData4 = TasksUiPlugin.getDefault().getTaskDataManager().getEditableCopy(task4.getRepositoryUrl(), task4.getTaskId());
assertNotNull(task4);
assertNotNull(taskData4);
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task4.getSyncState());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task4.getSynchronizationState());
assertEquals(taskID, taskData4.getId());
BugzillaTask task5 = generateLocalTaskAndDownload("5");
RepositoryTaskData taskData5 = TasksUiPlugin.getDefault().getTaskDataManager().getEditableCopy(task5.getRepositoryUrl(), task5.getTaskId());
assertNotNull(task5);
assertNotNull(taskData5);
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task5.getSyncState());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task5.getSynchronizationState());
assertEquals("5", taskData5.getId());
Set<AbstractTask> tasks = new HashSet<AbstractTask>();
@@ -377,7 +377,7 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
// AFTER
// task4's
- TasksUiPlugin.getRepositoryManager().setSyncTime(repository, task5.getLastSyncDateStamp(),
+ TasksUiPlugin.getRepositoryManager().setSyncTime(repository, task5.getLastReadTimeStamp(),
TasksUiPlugin.getDefault().getRepositoriesFilePath());
boolean changed = connector.markStaleTasks(repository, tasks, new NullProgressMonitor());
@@ -434,13 +434,13 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
RepositoryTaskData recentTaskData = TasksUiPlugin.getDefault().getTaskDataManager().getNewTaskData(task7.getRepositoryUrl(), task7.getTaskId());
assertNotNull(recentTaskData);
TasksUiPlugin.getSynchronizationManager().setTaskRead(task7, true);
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task7.getSyncState());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task7.getSynchronizationState());
assertEquals("7", recentTaskData.getId());
Set<AbstractTask> tasks = new HashSet<AbstractTask>();
tasks.add(task7);
- TasksUiPlugin.getRepositoryManager().setSyncTime(repository, task7.getLastSyncDateStamp(),
+ TasksUiPlugin.getRepositoryManager().setSyncTime(repository, task7.getLastReadTimeStamp(),
TasksUiPlugin.getDefault().getRepositoriesFilePath());
assertNotNull(TasksUiPlugin.getDefault().getTaskDataManager().getNewTaskData(IBugzillaConstants.TEST_BUGZILLA_222_URL, "7"));
@@ -448,8 +448,8 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
assertNull(TasksUiPlugin.getDefault().getTaskDataManager().getNewTaskData(IBugzillaConstants.TEST_BUGZILLA_222_URL, "7"));
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task7.getSyncState());
- assertNotNull(task7.getLastSyncDateStamp());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task7.getSynchronizationState());
+ assertNotNull(task7.getLastReadTimeStamp());
// Task no longer stored offline
// make an external change
assertNotNull(repository.getUserName());
@@ -467,7 +467,7 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
TasksUiPlugin.getDefault().getTaskDataManager().clear();
connector.getTaskDataHandler().postTaskData(repository, recentTaskData, new NullProgressMonitor());
TasksUiPlugin.getSynchronizationManager().synchronizeChanged(connector, repository);
- assertEquals(RepositoryTaskSyncState.INCOMING, task7.getSyncState());
+ assertEquals(RepositoryTaskSyncState.INCOMING, task7.getSynchronizationState());
}
public void testTimeTracker222() throws Exception {
@@ -501,14 +501,14 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
RepositoryTaskData bugtaskdata = TasksUiPlugin.getDefault().getTaskDataManager().getNewTaskData(bugtask.getRepositoryUrl(), bugtask.getTaskId());
assertNotNull(bugtaskdata);
assertEquals(taskid + "", bugtaskdata.getId());
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, bugtask.getSyncState());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, bugtask.getSynchronizationState());
Set<AbstractTask> tasks = new HashSet<AbstractTask>();
tasks.add(bugtask);
// synchAndAssertState(tasks, RepositoryTaskSyncState.SYNCHRONIZED);
- TasksUiPlugin.getRepositoryManager().setSyncTime(repository, bugtask.getLastSyncDateStamp(),
+ TasksUiPlugin.getRepositoryManager().setSyncTime(repository, bugtask.getLastReadTimeStamp(),
TasksUiPlugin.getDefault().getRepositoriesFilePath());
// connector.synchronizeChanged(repository);
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 acb8eeeaa..960c88fa9 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
@@ -85,13 +85,13 @@ public class BugzillaTaskListManagerTest extends TestCase {
assertNotNull(tasksReturned);
assertEquals(1, tasksReturned.size());
for (AbstractTask task : tasksReturned) {
- assertTrue(task.hasBeenReminded());
+ assertTrue(task.isReminded());
}
}
public void testRepositoryTaskExternalization() {
BugzillaTask repositoryTask = new BugzillaTask("repo", "1", "label");
- repositoryTask.setKind("kind");
+ repositoryTask.setTaskKind("kind");
manager.getTaskList().moveToContainer(repositoryTask, TasksUiPlugin.getTaskListManager().getTaskList().getDefaultCategory());
manager.saveTaskList();
@@ -116,8 +116,8 @@ public class BugzillaTaskListManagerTest extends TestCase {
// query.setLastRefresh(oldDate);
assertEquals("repositoryUrl", query.getRepositoryUrl());
assertEquals("queryUrl", query.getUrl());
- assertEquals("<never>", query.getLastRefreshTimeStamp());
- query.setLastRefreshTimeStamp("today");
+ assertEquals("<never>", query.getLastSynchronizedTimeStamp());
+ query.setLastSynchronizedStamp("today");
// assertEquals(time, query.getLastSynchronized().getTime());
manager.getTaskList().addQuery(query);
manager.saveTaskList();
@@ -129,7 +129,7 @@ public class BugzillaTaskListManagerTest extends TestCase {
AbstractRepositoryQuery readQuery = manager.getTaskList().getQueries().iterator().next();
assertEquals(query.getUrl(), readQuery.getUrl());
assertEquals(query.getRepositoryUrl(), readQuery.getRepositoryUrl());
- assertEquals("today", query.getLastRefreshTimeStamp());
+ assertEquals("today", query.getLastSynchronizedTimeStamp());
assertEquals("repositoryUrl", readQuery.getRepositoryUrl());
// assertEquals(time, readQuery.getLastSynchronized().getTime());
}
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 c3c2bdbdf..0dfca0666 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
@@ -62,13 +62,13 @@ public class TaskListNotificationManagerTest extends TestCase {
task0 = TasksUiPlugin.getTaskListManager().getTaskList().getTask("local-0");
assertNotNull(task0);
- assertTrue(task0.hasBeenReminded());
+ assertTrue(task0.isReminded());
task1 = TasksUiPlugin.getTaskListManager().getTaskList().getTask("local-1");
assertNotNull(task1);
- assertTrue(task1.hasBeenReminded());
+ assertTrue(task1.isReminded());
task2 = TasksUiPlugin.getTaskListManager().getTaskList().getTask("local-2");
assertNotNull(task2);
- assertTrue(task2.hasBeenReminded());
+ assertTrue(task2.isReminded());
}
@@ -78,7 +78,7 @@ public class TaskListNotificationManagerTest extends TestCase {
TasksUiPlugin.getRepositoryManager().addRepository(repository,
TasksUiPlugin.getDefault().getRepositoriesFilePath());
AbstractTask task = new BugzillaTask("https://bugs.eclipse.org/bugs", "142891", "label");
- assertEquals( RepositoryTaskSyncState.SYNCHRONIZED, task.getSyncState());
+ assertEquals( RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState());
assertFalse(task.isNotified());
TasksUiPlugin.getTaskListManager().getTaskList().addTask(task);
TaskListNotificationManager notificationManager = TasksUiPlugin.getDefault().getTaskListNotificationManager();

Back to the top