Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2012-03-02 18:48:34 -0500
committerSteffen Pingel2012-03-02 18:48:34 -0500
commit8467de45a34ee2730b3b6e97a7230876c97d6eb5 (patch)
tree9dfffa69da30fa8778955b20f12c531becbfffc9 /org.eclipse.mylyn.tests.util/src/org
parent2befecfd0c9ea65a84504ad94eea486e317407cf (diff)
downloadorg.eclipse.mylyn.tasks-8467de45a34ee2730b3b6e97a7230876c97d6eb5.tar.gz
org.eclipse.mylyn.tasks-8467de45a34ee2730b3b6e97a7230876c97d6eb5.tar.xz
org.eclipse.mylyn.tasks-8467de45a34ee2730b3b6e97a7230876c97d6eb5.zip
NEW - bug 373165: deprecate TestUtil in favor of CommonTestUtil
https://bugs.eclipse.org/bugs/show_bug.cgi?id=373165 Change-Id: I32cb93b3e05eed4ff6676f2d1c2418d82c16c0f1
Diffstat (limited to 'org.eclipse.mylyn.tests.util/src/org')
-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
2 files changed, 13 insertions, 10 deletions
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 a67515a9f..417b61118 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 9150159f4..92862d7c7 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";

Back to the top