Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2014-02-20 00:21:10 -0500
committerFrank Becker2014-02-21 12:52:46 -0500
commitbb4ca77e42fbd5032c9211d53a6f9ad2ca798cf9 (patch)
treed8e72a2144524444680a87f24dbe8fd081a47c64 /connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests
parent928b4a7b3d1915240ed9662ca5a5f21e6cfac22d (diff)
downloadorg.eclipse.mylyn.tasks-bb4ca77e42fbd5032c9211d53a6f9ad2ca798cf9.tar.gz
org.eclipse.mylyn.tasks-bb4ca77e42fbd5032c9211d53a6f9ad2ca798cf9.tar.xz
org.eclipse.mylyn.tasks-bb4ca77e42fbd5032c9211d53a6f9ad2ca798cf9.zip
278474: perform migration of credentials to secure storage
Change-Id: I3631390f36bcbc6535a64f894e2b2db3a3b2a783 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=278474
Diffstat (limited to 'connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests')
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/src/org/eclipse/mylyn/bugzilla/rest/tests/TckFixture.java9
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/src/org/eclipse/mylyn/bugzilla/rest/tests/tck/AbstractRepositoryConnectorTest.java2
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/src/org/eclipse/mylyn/bugzilla/rest/tests/tck/ValidationTest.java6
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/src/org/eclipse/mylyn/bugzilla/rest/tests/tck/ui/AbstractRepositorySettingsPageTest.java2
4 files changed, 7 insertions, 12 deletions
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/src/org/eclipse/mylyn/bugzilla/rest/tests/TckFixture.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/src/org/eclipse/mylyn/bugzilla/rest/tests/TckFixture.java
index 21ac642a4..74923c7e3 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/src/org/eclipse/mylyn/bugzilla/rest/tests/TckFixture.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/src/org/eclipse/mylyn/bugzilla/rest/tests/TckFixture.java
@@ -9,8 +9,6 @@ public class TckFixture extends AbstractTestFixture {
private final FixtureConfiguration config;
- protected TaskRepository repository;
-
public TckFixture(FixtureConfiguration config) {
super("org.eclipse.mylyn.bugzilla.rest", config);
this.config = config;
@@ -26,11 +24,8 @@ public class TckFixture extends AbstractTestFixture {
return this;
}
- public TaskRepository repository() {
- if (repository == null) {
- repository = new TaskRepository(getConnectorKind(), getRepositoryUrl());
- }
- return repository;
+ public TaskRepository createRepository() {
+ return new TaskRepository(getConnectorKind(), getRepositoryUrl());
}
@SuppressWarnings("restriction")
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/src/org/eclipse/mylyn/bugzilla/rest/tests/tck/AbstractRepositoryConnectorTest.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/src/org/eclipse/mylyn/bugzilla/rest/tests/tck/AbstractRepositoryConnectorTest.java
index ff5825ee5..9cfd20b37 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/src/org/eclipse/mylyn/bugzilla/rest/tests/tck/AbstractRepositoryConnectorTest.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/src/org/eclipse/mylyn/bugzilla/rest/tests/tck/AbstractRepositoryConnectorTest.java
@@ -31,7 +31,7 @@ public class AbstractRepositoryConnectorTest extends AbstractTckTest {
@Test
public void testApplyDefaultCategory() throws Exception {
- TaskRepository repository = fixture().repository();
+ TaskRepository repository = fixture().createRepository();
assertNull("repository.getCategory() should be null", repository.getCategory());
fixture().connector().applyDefaultCategory(repository);
assertNotNull("repository.getCategory() should not be null", repository.getCategory());
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/src/org/eclipse/mylyn/bugzilla/rest/tests/tck/ValidationTest.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/src/org/eclipse/mylyn/bugzilla/rest/tests/tck/ValidationTest.java
index 2e1b7fb9d..961946dd5 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/src/org/eclipse/mylyn/bugzilla/rest/tests/tck/ValidationTest.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/src/org/eclipse/mylyn/bugzilla/rest/tests/tck/ValidationTest.java
@@ -25,11 +25,11 @@ public class ValidationTest extends AbstractTckTest {
@Test
public void testValidateCredentials() throws Exception {
- TaskRepository repository = fixture().repository();
+ TaskRepository repository = fixture().createRepository();
org.eclipse.mylyn.commons.net.AuthenticationCredentials mylynCreds = new org.eclipse.mylyn.commons.net.AuthenticationCredentials(
"tests@mylyn.eclipse.org", "mylyntest");
repository.setCredentials(org.eclipse.mylyn.commons.net.AuthenticationType.REPOSITORY, mylynCreds, true);
- RepositoryInfo info = fixture().connector().validateRepository(fixture().repository(), monitor);
+ RepositoryInfo info = fixture().connector().validateRepository(repository, monitor);
assertNotNull(info);
assertEquals(fixture().getVersion(), info.getVersion().toString());
}
@@ -38,7 +38,7 @@ public class ValidationTest extends AbstractTckTest {
public void testInvalidateCredentials() throws CoreException {
thrown.expect(CoreException.class);
thrown.expectMessage("Authentication failed");
- TaskRepository repository = fixture().repository();
+ TaskRepository repository = fixture().createRepository();
org.eclipse.mylyn.commons.net.AuthenticationCredentials invalideCreds = new org.eclipse.mylyn.commons.net.AuthenticationCredentials(
"invalidateCredentials", "invalidateCredentials");
repository.setCredentials(org.eclipse.mylyn.commons.net.AuthenticationType.REPOSITORY, invalideCreds, true);
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/src/org/eclipse/mylyn/bugzilla/rest/tests/tck/ui/AbstractRepositorySettingsPageTest.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/src/org/eclipse/mylyn/bugzilla/rest/tests/tck/ui/AbstractRepositorySettingsPageTest.java
index d76e46f22..847bf6ea6 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/src/org/eclipse/mylyn/bugzilla/rest/tests/tck/ui/AbstractRepositorySettingsPageTest.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/src/org/eclipse/mylyn/bugzilla/rest/tests/tck/ui/AbstractRepositorySettingsPageTest.java
@@ -44,7 +44,7 @@ public class AbstractRepositorySettingsPageTest extends AbstractTckTest {
@Test
public void testApplyTo() {
- TaskRepository repository = fixture().repository();
+ TaskRepository repository = fixture().createRepository();
EditRepositoryWizard wizard = new EditRepositoryWizard(repository);
dialog = new WizardDialog(new Shell(), wizard);
dialog.create();

Back to the top