diff options
author | Frank Becker | 2014-08-20 19:01:59 +0000 |
---|---|---|
committer | Frank Becker | 2014-08-21 03:54:04 +0000 |
commit | 990e798fedde4c83e885f839af9dfff3d4cf1c28 (patch) | |
tree | a4067af5630a9ad3dc53862d91c5cb0ea9eb43f5 /org.eclipse.mylyn.tasks.tests/src | |
parent | 1d9df855c6dcaf1ca1a96d8f96dc0038290703af (diff) | |
download | org.eclipse.mylyn.tasks-990e798fedde4c83e885f839af9dfff3d4cf1c28.tar.gz org.eclipse.mylyn.tasks-990e798fedde4c83e885f839af9dfff3d4cf1c28.tar.xz org.eclipse.mylyn.tasks-990e798fedde4c83e885f839af9dfff3d4cf1c28.zip |
442088: fix failing test for Luna
(org.eclipse.core.runtime.compatibility.auth removed)
Change-Id: Id0080523bf8c292ca7cf7d21db9921d1f97a8941
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=442088
Diffstat (limited to 'org.eclipse.mylyn.tasks.tests/src')
3 files changed, 44 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryCredentialsTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryCredentialsTest.java index 6ef2dedc9..8faab95de 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryCredentialsTest.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryCredentialsTest.java @@ -25,6 +25,7 @@ import org.eclipse.mylyn.commons.repositories.core.auth.ICredentialsStore; import org.eclipse.mylyn.internal.commons.repositories.core.LocationService; import org.eclipse.mylyn.internal.tasks.core.IRepositoryConstants; import org.eclipse.mylyn.tasks.core.TaskRepository; +import org.eclipse.mylyn.tasks.tests.util.TestUtils; /** * @author Mik Kersten @@ -78,6 +79,10 @@ public class TaskRepositoryCredentialsTest extends TestCase { @SuppressWarnings("deprecation") public void testPlatformAuthHandlerAvailable() throws Exception { + if (!TestUtils.isCompatibilityAuthInstalled()) { + System.err.println("Skipping TaskRepositoryCredentialsTest.testPlatformAuthHandlerAvailable()"); + return; + } URL url = new URL("http://mylyn"); Platform.addAuthorizationInfo(url, "", "", Collections.EMPTY_MAP); assertNotNull("Tests require org.eclipse.core.runtime.compatibility.auth", diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java index 535ee15f5..fa3104665 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java @@ -44,6 +44,7 @@ import org.eclipse.mylyn.tasks.core.TaskRepository; import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryConnector; import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryQuery; import org.eclipse.mylyn.tasks.tests.connector.MockTask; +import org.eclipse.mylyn.tasks.tests.util.TestUtils; /** * @author Mik Kersten @@ -134,6 +135,10 @@ public class TaskRepositoryManagerTest extends TestCase { } public void testMigrationFromKeyring() throws Exception { + if (!TestUtils.isCompatibilityAuthInstalled()) { + System.err.println("Skipping TaskRepositoryManagerTest.testMigrationFromKeyring()"); + return; + } Map<String, String> authInfo = createAuthInfo(); TaskRepository repository = new TaskRepository("bugzilla", "http://example.com/"); @@ -150,6 +155,10 @@ public class TaskRepositoryManagerTest extends TestCase { } public void testMigrationFromKeyringAfterGetUserNameCalled() throws Exception { + if (!TestUtils.isCompatibilityAuthInstalled()) { + System.err.println("Skipping TaskRepositoryManagerTest.testMigrationFromKeyringAfterGetUserNameCalled()"); + return; + } Map<String, String> authInfo = createAuthInfo(); TaskRepository repository = new TaskRepository("bugzilla", "http://example.com/"); @@ -369,7 +378,7 @@ public class TaskRepositoryManagerTest extends TestCase { } public void testRepositoryWithCustomAttributes() throws Exception { - // Note: if a connector doesn't exist the associated repositories are not loaded (orphaned) + // Note: if a connector doesn't exist the associated repositories are not loaded (orphaned) // causing this test to fail. AbstractRepositoryConnector connector = new MockRepositoryConnector(); manager.addRepositoryConnector(connector); diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/util/TestUtils.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/util/TestUtils.java new file mode 100644 index 000000000..c9991a282 --- /dev/null +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/util/TestUtils.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright (c) 2014 Tasktop Technologies and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ + +package org.eclipse.mylyn.tasks.tests.util; + +import org.eclipse.core.runtime.Platform; + +public class TestUtils { + + private static class CompatibilityAuthChecker { + public static final boolean result; + static { + result = Platform.getBundle("org.eclipse.core.runtime.compatibility.auth") != null; //$NON-NLS-1$ + } + } + + public static boolean isCompatibilityAuthInstalled() { + return CompatibilityAuthChecker.result; + } + +} |