Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2010-01-16 21:42:36 +0000
committerspingel2010-01-16 21:42:36 +0000
commit1d9ebba2e342e94e3dd4d018e56d52cc59e14e53 (patch)
treeda675cfc0c6a7c586b4485ac8237073f96ff05cc /org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac
parent50cf2bf9cfcfb9556a32527bd9b55965b5b8926f (diff)
downloadorg.eclipse.mylyn.tasks-1d9ebba2e342e94e3dd4d018e56d52cc59e14e53.tar.gz
org.eclipse.mylyn.tasks-1d9ebba2e342e94e3dd4d018e56d52cc59e14e53.tar.xz
org.eclipse.mylyn.tasks-1d9ebba2e342e94e3dd4d018e56d52cc59e14e53.zip
REOPENED - bug 296894: [releng] fix failing tests for 3.4
https://bugs.eclipse.org/bugs/show_bug.cgi?id=296894
Diffstat (limited to 'org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac')
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracAttachmentHandlerTest.java2
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryConnectorTest.java5
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryConnectorWebTest.java2
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracTaskDataHandlerXmlRpcTest.java2
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracFixture.java17
5 files changed, 17 insertions, 11 deletions
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracAttachmentHandlerTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracAttachmentHandlerTest.java
index 30c490c1e..2458867b3 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracAttachmentHandlerTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracAttachmentHandlerTest.java
@@ -51,7 +51,7 @@ public class TracAttachmentHandlerTest extends TestCase {
data = TracFixture.init010();
connector = (TracRepositoryConnector) TasksUi.getRepositoryConnector(TracCorePlugin.CONNECTOR_KIND);
attachmentHandler = connector.getTaskAttachmentHandler();
- repository = TracFixture.current().singleRepository();
+ repository = TracFixture.current().singleRepository(connector);
}
public void testDownloadAttachment() throws Exception {
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryConnectorTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryConnectorTest.java
index 37847f4fe..3f85325a3 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryConnectorTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryConnectorTest.java
@@ -71,10 +71,7 @@ public class TracRepositoryConnectorTest extends TestCase {
super.setUp();
data = TracFixture.init010();
connector = (TracRepositoryConnector) TasksUi.getRepositoryConnector(TracCorePlugin.CONNECTOR_KIND);
- repository = TracFixture.current().singleRepository();
-
- // XXX avoid failing test due to stale client
- connector.getClientManager().clearClients();
+ repository = TracFixture.current().singleRepository(connector);
}
public void testGetRepositoryUrlFromTaskUrl() {
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryConnectorWebTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryConnectorWebTest.java
index 4b22798c3..322339145 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryConnectorWebTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryConnectorWebTest.java
@@ -47,7 +47,7 @@ public class TracRepositoryConnectorWebTest extends TestCase {
super.setUp();
data = TracFixture.init010();
connector = (TracRepositoryConnector) TasksUi.getRepositoryConnector(TracCorePlugin.CONNECTOR_KIND);
- repository = TracFixture.current(TracFixture.TRAC_0_10_WEB).singleRepository();
+ repository = TracFixture.current(TracFixture.TRAC_0_10_WEB).singleRepository(connector);
}
private SynchronizationSession createSession(ITask... tasks) {
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracTaskDataHandlerXmlRpcTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracTaskDataHandlerXmlRpcTest.java
index 166297740..7c7c8a8b4 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracTaskDataHandlerXmlRpcTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracTaskDataHandlerXmlRpcTest.java
@@ -79,7 +79,7 @@ public class TracTaskDataHandlerXmlRpcTest extends TestCase {
data = TracFixture.init010();
connector = (TracRepositoryConnector) TasksUi.getRepositoryConnector(TracCorePlugin.CONNECTOR_KIND);
taskDataHandler = connector.getTaskDataHandler();
- repository = TracFixture.current().singleRepository();
+ repository = TracFixture.current().singleRepository(connector);
client = connector.getClientManager().getTracClient(repository);
}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracFixture.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracFixture.java
index 378dcaf46..dc4a3df54 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracFixture.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracFixture.java
@@ -17,6 +17,7 @@ import org.eclipse.mylyn.commons.net.IProxyProvider;
import org.eclipse.mylyn.commons.net.WebLocation;
import org.eclipse.mylyn.internal.trac.core.TracClientFactory;
import org.eclipse.mylyn.internal.trac.core.TracCorePlugin;
+import org.eclipse.mylyn.internal.trac.core.TracRepositoryConnector;
import org.eclipse.mylyn.internal.trac.core.client.ITracClient;
import org.eclipse.mylyn.internal.trac.core.client.ITracClient.Version;
import org.eclipse.mylyn.tasks.core.TaskRepository;
@@ -196,15 +197,23 @@ public class TracFixture extends TestFixture {
return version;
}
- @Override
- public TaskRepository singleRepository() {
- TracCorePlugin.getDefault().getConnector().getClientManager().writeCache();
+ public TaskRepository singleRepository(TracRepositoryConnector connector) {
+ connector.getClientManager().writeCache();
TaskRepository repository = super.singleRepository();
- TracCorePlugin.getDefault().getConnector().getClientManager().readCache();
+
+ // XXX avoid failing test due to stale client
+ connector.getClientManager().clearClients();
+
+ connector.getClientManager().readCache();
return repository;
}
@Override
+ public TaskRepository singleRepository() {
+ return singleRepository(TracCorePlugin.getDefault().getConnector());
+ }
+
+ @Override
protected void configureRepository(TaskRepository repository) {
repository.setTimeZoneId(ITracClient.TIME_ZONE);
repository.setCharacterEncoding(ITracClient.CHARSET);

Back to the top