Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2014-08-20 15:01:59 -0400
committerFrank Becker2014-08-20 23:54:04 -0400
commit990e798fedde4c83e885f839af9dfff3d4cf1c28 (patch)
treea4067af5630a9ad3dc53862d91c5cb0ea9eb43f5
parent1d9df855c6dcaf1ca1a96d8f96dc0038290703af (diff)
downloadorg.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
-rw-r--r--org.eclipse.mylyn.tasks.tests/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryCredentialsTest.java5
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java11
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/util/TestUtils.java29
4 files changed, 45 insertions, 2 deletions
diff --git a/org.eclipse.mylyn.tasks.tests/META-INF/MANIFEST.MF b/org.eclipse.mylyn.tasks.tests/META-INF/MANIFEST.MF
index dca08d7c2..314dac87a 100644
--- a/org.eclipse.mylyn.tasks.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.tasks.tests/META-INF/MANIFEST.MF
@@ -31,7 +31,7 @@ Require-Bundle: org.junit;bundle-version="4.8.2",
org.eclipse.mylyn.tasks.ui,
org.eclipse.mylyn.tests.util,
org.eclipse.mylyn.commons.repositories.core,
- org.eclipse.core.runtime.compatibility.auth
+ org.eclipse.core.runtime.compatibility.auth;resolution:=optional
Export-Package: org.eclipse.mylyn.tasks.tests;x-internal:=true,
org.eclipse.mylyn.tasks.tests.bugs;x-internal:=true,
org.eclipse.mylyn.tasks.tests.connector;x-friends:="org.eclipse.mylyn.tasks.ui.tests",
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;
+ }
+
+}

Back to the top