summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2012-03-02 18:48:34 (EST)
committerSteffen Pingel2012-03-02 18:48:34 (EST)
commit8467de45a34ee2730b3b6e97a7230876c97d6eb5 (patch)
tree9dfffa69da30fa8778955b20f12c531becbfffc9
parent2befecfd0c9ea65a84504ad94eea486e317407cf (diff)
downloadorg.eclipse.mylyn.tasks-8467de45a34ee2730b3b6e97a7230876c97d6eb5.zip
org.eclipse.mylyn.tasks-8467de45a34ee2730b3b6e97a7230876c97d6eb5.tar.gz
org.eclipse.mylyn.tasks-8467de45a34ee2730b3b6e97a7230876c97d6eb5.tar.bz2
NEW - bug 373165: deprecate TestUtil in favor of CommonTestUtil
https://bugs.eclipse.org/bugs/show_bug.cgi?id=373165 Change-Id: I32cb93b3e05eed4ff6676f2d1c2418d82c16c0f1
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/META-INF/MANIFEST.MF1
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaAttachmentHandlerTest.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTestWithGuest.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchTest.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskDataHandlerTest.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/EncodingTest.java10
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryReportFactoryTest.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaClientTest.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaCustomFieldsTest.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaRepositoryConnectorConfigurationTest.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaRepositoryConnectorStandaloneTest.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaXmlRpcClientTest.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java11
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaRepositorySettingsPageTest.java11
-rw-r--r--org.eclipse.mylyn.tests.util/META-INF/MANIFEST.MF1
-rw-r--r--org.eclipse.mylyn.tests.util/src/org/eclipse/mylyn/tests/util/TestFixture.java21
-rw-r--r--org.eclipse.mylyn.tests.util/src/org/eclipse/mylyn/tests/util/TestUtil.java2
-rw-r--r--org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF1
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracClientFactoryTest.java10
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracClientTest.java12
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracXmlRpcTest.java12
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracFixture.java16
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestCleanupUtil.java2
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestUtil.java2
25 files changed, 70 insertions, 64 deletions
diff --git a/org.eclipse.mylyn.bugzilla.tests/META-INF/MANIFEST.MF b/org.eclipse.mylyn.bugzilla.tests/META-INF/MANIFEST.MF
index 02ce6c3..f4113c1 100644
--- a/org.eclipse.mylyn.bugzilla.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.bugzilla.tests/META-INF/MANIFEST.MF
@@ -18,6 +18,7 @@ Require-Bundle: org.junit,
org.eclipse.mylyn.bugzilla.ui,
org.eclipse.mylyn.commons.ui,
org.eclipse.mylyn.commons.core,
+ org.eclipse.mylyn.commons.repositories.core,
org.eclipse.mylyn.commons.sdk.util,
org.eclipse.mylyn.commons.workbench,
org.eclipse.mylyn.commons.xmlrpc,
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaAttachmentHandlerTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaAttachmentHandlerTest.java
index 2405cd8..3a10423 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaAttachmentHandlerTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaAttachmentHandlerTest.java
@@ -37,7 +37,7 @@ import org.eclipse.mylyn.tasks.core.data.TaskAttachmentMapper;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.ui.TasksUi;
-import org.eclipse.mylyn.tests.util.TestUtil.PrivilegeLevel;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
/**
* @author Robert Elves
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 9275482..48dc8f9 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
@@ -57,7 +57,7 @@ import org.eclipse.mylyn.tasks.core.data.TaskDataModel;
import org.eclipse.mylyn.tasks.core.data.TaskOperation;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
-import org.eclipse.mylyn.tests.util.TestUtil.PrivilegeLevel;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
/**
* @author Rob Elves
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTestWithGuest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTestWithGuest.java
index 4b3c8b7..8692b98 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTestWithGuest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTestWithGuest.java
@@ -33,7 +33,7 @@ import org.eclipse.mylyn.tasks.core.data.TaskDataModel;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
import org.eclipse.mylyn.tests.util.TestFixture;
-import org.eclipse.mylyn.tests.util.TestUtil.PrivilegeLevel;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
public class BugzillaRepositoryConnectorTestWithGuest extends AbstractBugzillaTest {
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchTest.java
index 86d0e99..9c87e72 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchTest.java
@@ -25,7 +25,7 @@ import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.core.data.TaskDataCollector;
import org.eclipse.mylyn.tasks.ui.TasksUi;
-import org.eclipse.mylyn.tests.util.TestUtil.PrivilegeLevel;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
/**
* @author Rob Elves
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskDataHandlerTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskDataHandlerTest.java
index 4aded4e..e976c2d 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskDataHandlerTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskDataHandlerTest.java
@@ -24,7 +24,7 @@ import org.eclipse.mylyn.tasks.core.data.AbstractTaskDataHandler;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
import org.eclipse.mylyn.tasks.core.data.TaskData;
-import org.eclipse.mylyn.tests.util.TestUtil.PrivilegeLevel;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
/**
* @author Frank Becker
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
index d949d60..8dcdbaa 100644
--- 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
@@ -18,6 +18,9 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.mylyn.bugzilla.tests.support.BugzillaFixture;
import org.eclipse.mylyn.commons.net.AuthenticationType;
import org.eclipse.mylyn.commons.net.WebLocation;
+import org.eclipse.mylyn.commons.repositories.core.auth.UserCredentials;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
@@ -27,9 +30,6 @@ import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.core.data.TaskDataModel;
import org.eclipse.mylyn.tasks.ui.TasksUi;
-import org.eclipse.mylyn.tests.util.TestUtil;
-import org.eclipse.mylyn.tests.util.TestUtil.Credentials;
-import org.eclipse.mylyn.tests.util.TestUtil.PrivilegeLevel;
/**
* @author Mik Kersten
@@ -61,8 +61,8 @@ public class EncodingTest extends AbstractBugzillaTest {
assertTrue(data.getRoot().getMappedAttribute(TaskAttribute.SUMMARY).getValue().equals("\u00E6"));//"\u05D0"));
WebLocation location = new WebLocation(repository.getRepositoryUrl());
- Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
- location.setCredentials(AuthenticationType.REPOSITORY, credentials.username, credentials.password);
+ UserCredentials credentials = CommonTestUtil.getCredentials(PrivilegeLevel.USER);
+ location.setCredentials(AuthenticationType.REPOSITORY, credentials.getUserName(), credentials.getPassword());
BugzillaClient client2 = BugzillaFixture.current().client(location, "ISO-8859-1");
data = BugzillaFixture.current().getTask(data.getTaskId(), client2);
assertNotNull(data);
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
index f97cb07..78183a3 100644
--- 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
@@ -28,7 +28,7 @@ import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.core.data.TaskMapper;
-import org.eclipse.mylyn.tests.util.TestUtil.PrivilegeLevel;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
/**
* @author Rob Elves
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaClientTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaClientTest.java
index d59753f..794c12c 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaClientTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaClientTest.java
@@ -40,7 +40,7 @@ import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.core.data.TaskDataCollector;
-import org.eclipse.mylyn.tests.util.TestUtil.PrivilegeLevel;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
import org.eclipse.mylyn.tests.util.UrlBuilder;
/**
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaCustomFieldsTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaCustomFieldsTest.java
index 5f6ed77..580b014 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaCustomFieldsTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaCustomFieldsTest.java
@@ -28,7 +28,7 @@ import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.core.data.TaskMapper;
-import org.eclipse.mylyn.tests.util.TestUtil.PrivilegeLevel;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
/**
* Tests should be run against Bugzilla 3.2.4 or greater
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaRepositoryConnectorConfigurationTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaRepositoryConnectorConfigurationTest.java
index 7d51b10..f263f43 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaRepositoryConnectorConfigurationTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaRepositoryConnectorConfigurationTest.java
@@ -18,7 +18,7 @@ import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion;
import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration;
import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.eclipse.mylyn.tests.util.TestUtil.PrivilegeLevel;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
/**
* @author Frank Becker
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaRepositoryConnectorStandaloneTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaRepositoryConnectorStandaloneTest.java
index 9353140..a8f56d9 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaRepositoryConnectorStandaloneTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaRepositoryConnectorStandaloneTest.java
@@ -42,7 +42,7 @@ import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.core.data.TaskDataCollector;
-import org.eclipse.mylyn.tests.util.TestUtil.PrivilegeLevel;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
/**
* @author Nathan Hapke
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaXmlRpcClientTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaXmlRpcClientTest.java
index 6713353..767eda0 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaXmlRpcClientTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaXmlRpcClientTest.java
@@ -67,7 +67,7 @@ import org.eclipse.mylyn.tasks.core.sync.SubmitJob;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
import org.eclipse.mylyn.tests.util.TestFixture;
-import org.eclipse.mylyn.tests.util.TestUtil.PrivilegeLevel;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
/**
* Tests should be run against Bugzilla 3.6 or greater
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java
index 470e18e..d082f07 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java
@@ -23,7 +23,9 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.mylyn.commons.net.AbstractWebLocation;
import org.eclipse.mylyn.commons.net.AuthenticationType;
import org.eclipse.mylyn.commons.net.WebLocation;
+import org.eclipse.mylyn.commons.repositories.core.auth.UserCredentials;
import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
import org.eclipse.mylyn.commons.sdk.util.TestConfiguration;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient;
@@ -40,9 +42,6 @@ import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.core.data.TaskDataCollector;
import org.eclipse.mylyn.tests.util.TestFixture;
-import org.eclipse.mylyn.tests.util.TestUtil;
-import org.eclipse.mylyn.tests.util.TestUtil.Credentials;
-import org.eclipse.mylyn.tests.util.TestUtil.PrivilegeLevel;
/**
* @author Steffen Pingel
@@ -151,8 +150,8 @@ public class BugzillaFixture extends TestFixture {
}
public BugzillaClient client() throws CoreException, IOException {
- Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
- return client(getRepositoryUrl(), credentials.username, credentials.password, "", "", "UTF-8");
+ UserCredentials credentials = CommonTestUtil.getCredentials(PrivilegeLevel.USER);
+ return client(getRepositoryUrl(), credentials.getUserName(), credentials.getPassword(), "", "", "UTF-8");
}
public BugzillaClient client(String hostUrl, String username, String password, String htAuthUser,
@@ -201,7 +200,7 @@ public class BugzillaFixture extends TestFixture {
}
public static File getFile(String filename) throws IOException {
- return TestUtil.getFile(BugzillaFixture.class, filename);
+ return CommonTestUtil.getFile(BugzillaFixture.class, filename);
}
public static InputStream getResource(String filename) throws IOException {
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaRepositorySettingsPageTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaRepositorySettingsPageTest.java
index 0ef623d..e47f0e6 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaRepositorySettingsPageTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaRepositorySettingsPageTest.java
@@ -20,6 +20,9 @@ import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.mylyn.bugzilla.tests.support.BugzillaFixture;
import org.eclipse.mylyn.commons.net.AuthenticationCredentials;
import org.eclipse.mylyn.commons.net.AuthenticationType;
+import org.eclipse.mylyn.commons.repositories.core.auth.UserCredentials;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClientFactory;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
@@ -30,8 +33,6 @@ import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.wizards.EditRepositoryWizard;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.TasksUi;
-import org.eclipse.mylyn.tests.util.TestUtil;
-import org.eclipse.mylyn.tests.util.TestUtil.Credentials;
import org.eclipse.ui.PlatformUI;
/**
@@ -49,9 +50,9 @@ public class BugzillaRepositorySettingsPageTest extends TestCase {
manager = TasksUiPlugin.getRepositoryManager();
manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath());
repository = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, BugzillaFixture.current().getRepositoryUrl());
- Credentials credentials = TestUtil.readCredentials();
- repository.setCredentials(AuthenticationType.REPOSITORY, new AuthenticationCredentials(credentials.username,
- credentials.password), false);
+ UserCredentials credentials = CommonTestUtil.getCredentials(PrivilegeLevel.USER);
+ repository.setCredentials(AuthenticationType.REPOSITORY,
+ new AuthenticationCredentials(credentials.getUserName(), credentials.getPassword()), false);
TasksUiPlugin.getRepositoryManager().addRepository(repository);
}
diff --git a/org.eclipse.mylyn.tests.util/META-INF/MANIFEST.MF b/org.eclipse.mylyn.tests.util/META-INF/MANIFEST.MF
index 1070187..b71e8e6 100644
--- a/org.eclipse.mylyn.tests.util/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.tests.util/META-INF/MANIFEST.MF
@@ -10,6 +10,7 @@ Require-Bundle: org.junit,
org.eclipse.ui,
org.eclipse.mylyn.commons.core,
org.eclipse.mylyn.commons.net,
+ org.eclipse.mylyn.commons.repositories.core,
org.eclipse.mylyn.commons.sdk.util,
org.eclipse.mylyn.tasks.core;bundle-version="3.7.0",
org.eclipse.mylyn.tasks.ui;bundle-version="3.7.0"
diff --git a/org.eclipse.mylyn.tests.util/src/org/eclipse/mylyn/tests/util/TestFixture.java b/org.eclipse.mylyn.tests.util/src/org/eclipse/mylyn/tests/util/TestFixture.java
index a67515a..417b611 100644
--- a/org.eclipse.mylyn.tests.util/src/org/eclipse/mylyn/tests/util/TestFixture.java
+++ b/org.eclipse.mylyn.tests.util/src/org/eclipse/mylyn/tests/util/TestFixture.java
@@ -26,6 +26,9 @@ import org.eclipse.mylyn.commons.net.AuthenticationType;
import org.eclipse.mylyn.commons.net.IProxyProvider;
import org.eclipse.mylyn.commons.net.WebLocation;
import org.eclipse.mylyn.commons.net.WebUtil;
+import org.eclipse.mylyn.commons.repositories.core.auth.UserCredentials;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager;
import org.eclipse.mylyn.internal.tasks.ui.ITasksUiPreferenceConstants;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
@@ -33,8 +36,6 @@ import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.TasksUi;
-import org.eclipse.mylyn.tests.util.TestUtil.Credentials;
-import org.eclipse.mylyn.tests.util.TestUtil.PrivilegeLevel;
/**
* @author Steffen Pingel
@@ -172,8 +173,8 @@ public abstract class TestFixture {
}
public AbstractWebLocation location(PrivilegeLevel level, Proxy proxy) throws Exception {
- Credentials credentials = TestUtil.readCredentials(level);
- return location(credentials.username, credentials.password, proxy);
+ UserCredentials credentials = CommonTestUtil.getCredentials(level);
+ return location(credentials.getUserName(), credentials.getPassword(), proxy);
}
public AbstractWebLocation location(String username, String password) throws Exception {
@@ -190,9 +191,9 @@ public abstract class TestFixture {
public TaskRepository repository() {
TaskRepository repository = new TaskRepository(connectorKind, repositoryUrl);
- Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
- repository.setCredentials(AuthenticationType.REPOSITORY, new AuthenticationCredentials(credentials.username,
- credentials.password), false);
+ UserCredentials credentials = CommonTestUtil.getCredentials(PrivilegeLevel.USER);
+ repository.setCredentials(AuthenticationType.REPOSITORY,
+ new AuthenticationCredentials(credentials.getUserName(), credentials.getPassword()), false);
return repository;
}
@@ -218,9 +219,9 @@ public abstract class TestFixture {
resetRepositories();
TaskRepository repository = new TaskRepository(connectorKind, repositoryUrl);
- Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
- repository.setCredentials(AuthenticationType.REPOSITORY, new AuthenticationCredentials(credentials.username,
- credentials.password), true);
+ UserCredentials credentials = CommonTestUtil.getCredentials(PrivilegeLevel.USER);
+ repository.setCredentials(AuthenticationType.REPOSITORY,
+ new AuthenticationCredentials(credentials.getUserName(), credentials.getPassword()), true);
configureRepository(repository);
if (manager != null) {
manager.addRepository(repository);
diff --git a/org.eclipse.mylyn.tests.util/src/org/eclipse/mylyn/tests/util/TestUtil.java b/org.eclipse.mylyn.tests.util/src/org/eclipse/mylyn/tests/util/TestUtil.java
index 9150159..92862d7 100644
--- a/org.eclipse.mylyn.tests.util/src/org/eclipse/mylyn/tests/util/TestUtil.java
+++ b/org.eclipse.mylyn.tests.util/src/org/eclipse/mylyn/tests/util/TestUtil.java
@@ -23,7 +23,9 @@ import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil;
/**
* @author Steffen Pingel
+ * @deprecated use {@link CommonTestUtil} instead
*/
+@Deprecated
public class TestUtil {
public static final String KEY_CREDENTIALS_FILE = "mylyn.credentials";
diff --git a/org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF b/org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF
index e3573ca..7ac4503 100644
--- a/org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF
@@ -10,6 +10,7 @@ Require-Bundle: org.junit,
org.eclipse.ui,
org.eclipse.ui.workbench.texteditor,
org.eclipse.mylyn.commons.net,
+ org.eclipse.mylyn.commons.repositories.core,
org.eclipse.mylyn.commons.sdk.util,
org.eclipse.mylyn.tasks.core,
org.eclipse.mylyn.tasks.ui,
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracClientFactoryTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracClientFactoryTest.java
index 31a6e5f..49e567f 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracClientFactoryTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracClientFactoryTest.java
@@ -14,6 +14,9 @@ package org.eclipse.mylyn.trac.tests.client;
import junit.framework.TestCase;
import org.eclipse.mylyn.commons.net.WebLocation;
+import org.eclipse.mylyn.commons.repositories.core.auth.UserCredentials;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
import org.eclipse.mylyn.internal.trac.core.TracClientFactory;
import org.eclipse.mylyn.internal.trac.core.client.ITracClient;
import org.eclipse.mylyn.internal.trac.core.client.ITracClient.Version;
@@ -21,9 +24,6 @@ import org.eclipse.mylyn.internal.trac.core.client.TracException;
import org.eclipse.mylyn.internal.trac.core.client.TracLoginException;
import org.eclipse.mylyn.internal.trac.core.client.TracWebClient;
import org.eclipse.mylyn.internal.trac.core.client.TracXmlRpcClient;
-import org.eclipse.mylyn.tests.util.TestUtil;
-import org.eclipse.mylyn.tests.util.TestUtil.Credentials;
-import org.eclipse.mylyn.tests.util.TestUtil.PrivilegeLevel;
import org.eclipse.mylyn.trac.tests.support.TracFixture;
/**
@@ -57,8 +57,8 @@ public class TracClientFactoryTest extends TestCase {
public void testProbeClient() throws Exception {
String url = fixture.getRepositoryUrl();
- Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
- WebLocation location = new WebLocation(url, credentials.username, credentials.password);
+ UserCredentials credentials = CommonTestUtil.getCredentials(PrivilegeLevel.USER);
+ WebLocation location = new WebLocation(url, credentials.getUserName(), credentials.getPassword());
Version version = TracClientFactory.probeClient(location);
if (fixture.isXmlRpcEnabled()) {
assertEquals(Version.XML_RPC, version);
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracClientTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracClientTest.java
index 6dfec1c..525f371 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracClientTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracClientTest.java
@@ -22,6 +22,9 @@ import java.util.List;
import junit.framework.TestCase;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.mylyn.commons.repositories.core.auth.UserCredentials;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
import org.eclipse.mylyn.internal.trac.core.TracAttribute;
import org.eclipse.mylyn.internal.trac.core.client.ITracClient;
import org.eclipse.mylyn.internal.trac.core.client.ITracClient.Version;
@@ -34,9 +37,6 @@ 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.model.TracTicketField;
import org.eclipse.mylyn.internal.trac.core.model.TracVersion;
-import org.eclipse.mylyn.tests.util.TestUtil;
-import org.eclipse.mylyn.tests.util.TestUtil.Credentials;
-import org.eclipse.mylyn.tests.util.TestUtil.PrivilegeLevel;
import org.eclipse.mylyn.trac.tests.support.TracFixture;
import org.eclipse.mylyn.trac.tests.support.TracTestUtil;
import org.eclipse.mylyn.trac.tests.support.XmlRpcServer.TestData;
@@ -239,7 +239,7 @@ public class TracClientTest extends TestCase {
}
public void testValidate() throws Exception {
- Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
+ UserCredentials credentials = CommonTestUtil.getCredentials(PrivilegeLevel.USER);
// standard connect
client.validate(new NullProgressMonitor());
@@ -255,7 +255,7 @@ public class TracClientTest extends TestCase {
String url = TracFixture.current().getRepositoryUrl();
// invalid password
- client = TracFixture.current().connect(url, credentials.username, "wrongpassword");
+ client = TracFixture.current().connect(url, credentials.getUserName(), "wrongpassword");
try {
client.validate(new NullProgressMonitor());
fail("Expected TracLoginException");
@@ -263,7 +263,7 @@ public class TracClientTest extends TestCase {
}
// invalid username
- client = TracFixture.current().connect(url, "wrongusername", credentials.password);
+ client = TracFixture.current().connect(url, "wrongusername", credentials.getPassword());
try {
client.validate(new NullProgressMonitor());
fail("Expected TracLoginException");
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracXmlRpcTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracXmlRpcTest.java
index 3a0aa3f..8843c0c 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracXmlRpcTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracXmlRpcTest.java
@@ -26,10 +26,10 @@ import org.apache.commons.httpclient.HttpClient;
import org.apache.xmlrpc.XmlRpcException;
import org.apache.xmlrpc.client.XmlRpcClient;
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
+import org.eclipse.mylyn.commons.repositories.core.auth.UserCredentials;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
import org.eclipse.mylyn.internal.trac.core.util.TracHttpClientTransportFactory;
-import org.eclipse.mylyn.tests.util.TestUtil;
-import org.eclipse.mylyn.tests.util.TestUtil.Credentials;
-import org.eclipse.mylyn.tests.util.TestUtil.PrivilegeLevel;
import org.eclipse.mylyn.trac.tests.support.TracTestConstants;
/**
@@ -61,9 +61,9 @@ public class TracXmlRpcTest extends TestCase {
random = new Random();
- Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.ADMIN);
- createConnection(new URL(TracTestConstants.TEST_TRAC_010_URL + XMLRPC_URL), credentials.username,
- credentials.password);
+ UserCredentials credentials = CommonTestUtil.getCredentials(PrivilegeLevel.ADMIN);
+ createConnection(new URL(TracTestConstants.TEST_TRAC_010_URL + XMLRPC_URL), credentials.getUserName(),
+ credentials.getPassword());
tickets = new ArrayList<Integer>();
}
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 646ddbe..ce3ae6a 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
@@ -16,6 +16,9 @@ import java.net.Proxy;
import org.eclipse.mylyn.commons.net.IProxyProvider;
import org.eclipse.mylyn.commons.net.WebLocation;
import org.eclipse.mylyn.commons.net.WebUtil;
+import org.eclipse.mylyn.commons.repositories.core.auth.UserCredentials;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
import org.eclipse.mylyn.internal.trac.core.TracClientFactory;
import org.eclipse.mylyn.internal.trac.core.TracCorePlugin;
import org.eclipse.mylyn.internal.trac.core.TracRepositoryConnector;
@@ -23,9 +26,6 @@ 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;
import org.eclipse.mylyn.tests.util.TestFixture;
-import org.eclipse.mylyn.tests.util.TestUtil;
-import org.eclipse.mylyn.tests.util.TestUtil.Credentials;
-import org.eclipse.mylyn.tests.util.TestUtil.PrivilegeLevel;
/**
* Initializes Trac repositories to a defined state. This is done once per test run, since cleaning and initializing the
@@ -118,9 +118,9 @@ public class TracFixture extends TestFixture {
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);
+ UserCredentials credentials = CommonTestUtil.getCredentials(PrivilegeLevel.USER);
+ XmlRpcServer server = new XmlRpcServer(TracTestConstants.TEST_TRAC_010_URL, credentials.getUserName(),
+ credentials.getPassword());
initializeTestData(server);
data010 = server.getData();
@@ -191,8 +191,8 @@ public class TracFixture extends TestFixture {
}
public ITracClient connect(String url, Proxy proxy, PrivilegeLevel level) throws Exception {
- Credentials credentials = TestUtil.readCredentials(level);
- return connect(url, credentials.username, credentials.password, proxy);
+ UserCredentials credentials = CommonTestUtil.getCredentials(level);
+ return connect(url, credentials.getUserName(), credentials.getPassword(), proxy);
}
public ITracClient connect(String url, String username, String password) throws Exception {
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestCleanupUtil.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestCleanupUtil.java
index 3482013..915a1aa 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestCleanupUtil.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestCleanupUtil.java
@@ -21,7 +21,7 @@ import org.eclipse.mylyn.internal.trac.core.client.TracException;
import org.eclipse.mylyn.internal.trac.core.model.TracAttachment;
import org.eclipse.mylyn.internal.trac.core.model.TracSearch;
import org.eclipse.mylyn.internal.trac.core.model.TracTicket;
-import org.eclipse.mylyn.tests.util.TestUtil.PrivilegeLevel;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
import org.eclipse.mylyn.trac.tests.support.XmlRpcServer.TestData;
/**
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestUtil.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestUtil.java
index 7262d06..687f693 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestUtil.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestUtil.java
@@ -58,7 +58,7 @@ public class TracTestUtil {
// TaskRepositoryManager manager = TasksUiPlugin.getRepositoryManager();
// manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath());
//
-// Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
+// Credentials credentials = CommonTestUtil.getCredentials(PrivilegeLevel.USER);
// TaskRepository repository = new TaskRepository(TracCorePlugin.CONNECTOR_KIND, repositoryUrl);
// repository.setCredentials(AuthenticationType.REPOSITORY, new AuthenticationCredentials(credentials.username,
// credentials.password), false);