Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/META-INF/MANIFEST.MF3
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java10
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskDataHandlerTest.java4
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryReportFactoryTest.java4
-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/BugzillaRepositoryConnectorStandaloneTest.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java9
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/TestFixture.java180
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaRepositorySettingsPageTest.java4
-rw-r--r--org.eclipse.mylyn.test-feature/feature.xml7
-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/TestUtil.java14
12 files changed, 35 insertions, 205 deletions
diff --git a/org.eclipse.mylyn.bugzilla.tests/META-INF/MANIFEST.MF b/org.eclipse.mylyn.bugzilla.tests/META-INF/MANIFEST.MF
index eeebb43eb..ddc918297 100644
--- a/org.eclipse.mylyn.bugzilla.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.bugzilla.tests/META-INF/MANIFEST.MF
@@ -14,8 +14,7 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.mylyn.bugzilla.core,
org.eclipse.mylyn.bugzilla.ui,
org.eclipse.mylyn.tasks.ui,
- org.eclipse.mylyn.context.tests,
- org.eclipse.mylyn.tasks.tests,
+ org.eclipse.mylyn.tests.util,
org.eclipse.mylyn.context.core,
org.eclipse.mylyn.tasks.core,
org.eclipse.ui.forms,
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java
index b5f032e67..5b36aa99b 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java
@@ -19,8 +19,6 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.mylyn.commons.net.AuthenticationCredentials;
import org.eclipse.mylyn.commons.net.AuthenticationType;
-import org.eclipse.mylyn.context.tests.support.TestUtil;
-import org.eclipse.mylyn.context.tests.support.TestUtil.Credentials;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
@@ -39,8 +37,10 @@ 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.core.sync.SubmitJob;
-import org.eclipse.mylyn.tasks.tests.TaskTestUtil;
import org.eclipse.mylyn.tasks.ui.TasksUi;
+import org.eclipse.mylyn.tests.util.TestFixture;
+import org.eclipse.mylyn.tests.util.TestUtil;
+import org.eclipse.mylyn.tests.util.TestUtil.Credentials;
/**
* @author Mik Kersten
@@ -69,13 +69,13 @@ public abstract class AbstractBugzillaTest extends TestCase {
TasksUiPlugin.getDefault().getPreferenceStore().setValue(
ITasksUiPreferenceConstants.REPOSITORY_SYNCH_SCHEDULE_ENABLED, false);
manager = TasksUiPlugin.getRepositoryManager();
- TaskTestUtil.resetTaskListAndRepositories();
+ TestFixture.resetTaskListAndRepositories();
}
@Override
protected void tearDown() throws Exception {
super.tearDown();
- TaskTestUtil.resetTaskList();
+ TestFixture.resetTaskList();
manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath());
}
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 eb4e2d8e0..52a23c9c4 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
@@ -17,8 +17,6 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.mylyn.commons.net.AuthenticationCredentials;
import org.eclipse.mylyn.commons.net.AuthenticationType;
-import org.eclipse.mylyn.context.tests.support.TestUtil;
-import org.eclipse.mylyn.context.tests.support.TestUtil.Credentials;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector;
@@ -30,6 +28,8 @@ import org.eclipse.mylyn.tasks.core.data.AbstractTaskDataHandler;
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.ui.TasksUi;
+import org.eclipse.mylyn.tests.util.TestUtil;
+import org.eclipse.mylyn.tests.util.TestUtil.Credentials;
/**
* @author Frank Becker
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 8da4bc2cf..97847da62 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
@@ -18,8 +18,6 @@ import junit.framework.TestCase;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.mylyn.context.tests.support.TestUtil;
-import org.eclipse.mylyn.context.tests.support.TestUtil.Credentials;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
@@ -30,6 +28,8 @@ import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskCommentMapper;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.core.data.TaskMapper;
+import org.eclipse.mylyn.tests.util.TestUtil;
+import org.eclipse.mylyn.tests.util.TestUtil.Credentials;
/**
* @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 233fd1ad7..0d1a596a4 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
@@ -21,7 +21,6 @@ import junit.framework.TestCase;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.mylyn.bugzilla.tests.support.BugzillaFixture;
import org.eclipse.mylyn.commons.net.AbstractWebLocation;
-import org.eclipse.mylyn.context.tests.support.TestUtil.PrivilegeLevel;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttributeMapper;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient;
@@ -36,6 +35,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.TaskDataCollector;
+import org.eclipse.mylyn.tests.util.TestUtil.PrivilegeLevel;
/**
* @author Robert Elves
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 b41b7df76..0f81cb2b2 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
@@ -23,7 +23,6 @@ import org.eclipse.core.runtime.NullProgressMonitor;
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.context.tests.support.TestUtil.PrivilegeLevel;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector;
@@ -34,6 +33,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.TaskDataCollector;
+import org.eclipse.mylyn.tests.util.TestUtil.PrivilegeLevel;
/**
* @author Nathan Hapke
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 3bdea8704..35a96e120 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
@@ -21,9 +21,6 @@ import org.eclipse.mylyn.bugzilla.tests.BugzillaTestConstants;
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.context.tests.support.TestUtil;
-import org.eclipse.mylyn.context.tests.support.TestUtil.Credentials;
-import org.eclipse.mylyn.context.tests.support.TestUtil.PrivilegeLevel;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClientManager;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
@@ -35,6 +32,10 @@ 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.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
@@ -157,7 +158,7 @@ public class BugzillaFixture extends TestFixture {
}
public static File getFile(String filename) throws IOException {
- return TestFixture.getFile("org.eclipse.mylyn.bugzilla.tests", BugzillaFixture.class, filename);
+ return TestUtil.getFile("org.eclipse.mylyn.bugzilla.tests", BugzillaFixture.class, filename);
}
/**
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/TestFixture.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/TestFixture.java
deleted file mode 100644
index 87799d8de..000000000
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/TestFixture.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.bugzilla.tests.support;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.Proxy;
-import java.net.URL;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.mylyn.commons.net.AbstractWebLocation;
-import org.eclipse.mylyn.commons.net.AuthenticationCredentials;
-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.context.tests.support.TestUtil;
-import org.eclipse.mylyn.context.tests.support.TestUtil.Credentials;
-import org.eclipse.mylyn.context.tests.support.TestUtil.PrivilegeLevel;
-import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager;
-import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
-import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
-import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.osgi.framework.Bundle;
-
-/**
- * @author Steffen Pingel
- * @author Thomas Ehrnhoefer
- */
-public abstract class TestFixture {
-
- private final String connectorKind;
-
- private String info;
-
- protected final String repositoryUrl;
-
- protected AbstractRepositoryConnector connector;
-
- public TestFixture(String connectorKind, String repositoryUrl) {
- this.connectorKind = connectorKind;
- this.repositoryUrl = repositoryUrl;
- }
-
- protected abstract TestFixture activate();
-
- public void add(TestSuite suite, Class<? extends TestCase> clazz) {
- if (Boolean.parseBoolean(System.getProperty("mylyn.tests.annotate")) && getInfo() != null) {
- suite.addTest(new TestSuite(clazz, clazz.getName() + " [" + getInfo() + "]"));
- } else {
- suite.addTestSuite(clazz);
- }
- }
-
- public TestSuite createSuite() {
- TestSuite suite = new TestSuite("Testing on " + getInfo());
- suite.addTest(new TestCase("activiating " + getRepositoryUrl()) {
- @Override
- protected void runTest() throws Throwable {
- activate();
- }
- });
- return suite;
- }
-
- public String getConnectorKind() {
- return connectorKind;
- }
-
- public String getInfo() {
- return info;
- }
-
- public String getRepositoryUrl() {
- return repositoryUrl;
- }
-
- public AbstractWebLocation location() throws Exception {
- return location(PrivilegeLevel.USER);
- }
-
- public AbstractWebLocation location(PrivilegeLevel level) throws Exception {
- return location(level, Proxy.NO_PROXY);
- }
-
- public AbstractWebLocation location(PrivilegeLevel level, Proxy proxy) throws Exception {
- Credentials credentials = TestUtil.readCredentials(level);
- return location(credentials.username, credentials.password, proxy);
- }
-
- public AbstractWebLocation location(String username, String password) throws Exception {
- return location(username, password, Proxy.NO_PROXY);
- }
-
- public AbstractWebLocation location(String username, String password, final Proxy proxy) throws Exception {
- return new WebLocation(repositoryUrl, username, password, new IProxyProvider() {
- public Proxy getProxyForHost(String host, String proxyType) {
- return proxy;
- }
- });
- }
-
- 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);
- return repository;
- }
-
- protected void setInfo(String info) {
- this.info = info;
- }
-
- public TaskRepository singleRepository() {
- TaskRepositoryManager manager = TasksUiPlugin.getRepositoryManager();
- manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath());
-
- TaskRepository repository = new TaskRepository(connectorKind, repositoryUrl);
- Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
- repository.setCredentials(AuthenticationType.REPOSITORY, new AuthenticationCredentials(credentials.username,
- credentials.password), false);
- manager.addRepository(repository);
- return repository;
- }
-
- public AbstractRepositoryConnector connector() {
- return connector;
- }
-
- public static File getFile(String bundleId, Class<?> clazz, String filename) throws IOException {
- Bundle bundle = Platform.getBundle(bundleId);
- if (bundle != null) {
- URL localURL = FileLocator.toFileURL(bundle.getEntry(filename));
- filename = localURL.getFile();
- } else {
- URL localURL = clazz.getResource("");
- String path = localURL.getFile();
- int i = path.indexOf("!");
- if (i != -1) {
- int j = path.lastIndexOf(File.separatorChar, i);
- if (j != -1) {
- path = path.substring(0, j) + File.separator;
- } else {
- Assert.fail("Unable to determine location for '" + filename + "' at '" + path + "'");
- }
- // class file is nested in jar, use jar path as base
- if (path.startsWith("file:")) {
- path = path.substring(5);
- }
- } else {
- // create relative path to base of class file location
- String[] tokens = path.split("\\.");
- for (@SuppressWarnings("unused")
- String token : tokens) {
- path += ".." + File.separator;
- }
- if (path.contains("bin" + File.separator)) {
- path += ".." + File.separator;
- }
- }
- filename = path + filename.replaceAll("/", File.separator);
- }
- return new File(filename);
- }
-
-}
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 1a6ce0e6e..0249717c3 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,8 +20,6 @@ import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.mylyn.bugzilla.tests.BugzillaTestConstants;
import org.eclipse.mylyn.commons.net.AuthenticationCredentials;
import org.eclipse.mylyn.commons.net.AuthenticationType;
-import org.eclipse.mylyn.context.tests.support.TestUtil;
-import org.eclipse.mylyn.context.tests.support.TestUtil.Credentials;
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,6 +28,8 @@ import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager;
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.tests.util.TestUtil;
+import org.eclipse.mylyn.tests.util.TestUtil.Credentials;
import org.eclipse.ui.PlatformUI;
/**
diff --git a/org.eclipse.mylyn.test-feature/feature.xml b/org.eclipse.mylyn.test-feature/feature.xml
index b6bb25437..80576df00 100644
--- a/org.eclipse.mylyn.test-feature/feature.xml
+++ b/org.eclipse.mylyn.test-feature/feature.xml
@@ -287,4 +287,11 @@ Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in t
version="0.0.0"
unpack="false"/>
+ <plugin
+ id="org.eclipse.mylyn.tests.util"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
</feature>
diff --git a/org.eclipse.mylyn.tests.util/META-INF/MANIFEST.MF b/org.eclipse.mylyn.tests.util/META-INF/MANIFEST.MF
index c01357218..fb7323477 100644
--- a/org.eclipse.mylyn.tests.util/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.tests.util/META-INF/MANIFEST.MF
@@ -12,7 +12,6 @@ Require-Bundle: org.eclipse.core.resources,
org.eclipse.mylyn.commons.net,
org.eclipse.mylyn.tasks.core,
org.eclipse.mylyn.tasks.ui
-Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Export-Package: org.eclipse.mylyn.tests.util;x-internal:=true
Bundle-RequiredExecutionEnvironment: J2SE-1.5
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 c5231550c..86d3f94f5 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
@@ -66,7 +66,12 @@ public class TestUtil {
File file;
String filename = System.getProperty(KEY_CREDENTIALS_FILE);
if (filename == null) {
- file = getFile("org.eclipse.context.tests", TestUtil.class, "credentials.properties");
+ file = getFile("org.eclipse.mylyn.context.tests", TestUtil.class, "credentials.properties");
+ if (!file.exists()) {
+ // lookup may have reverted to this plug-in, try to lookup file in org.eclipse.context.tests plug-in
+ File path = new File(file.getParentFile().getParentFile(), "org.eclipse.mylyn.context.tests");
+ file = new File(path, file.getName());
+ }
} else {
file = new File(filename);
}
@@ -135,9 +140,8 @@ public class TestUtil {
}
} else {
// create relative path to base of class file location
- String[] tokens = path.split("\\.");
- for (@SuppressWarnings("unused")
- String token : tokens) {
+ String[] tokens = clazz.getName().split("\\.");
+ for (int j = 0; j < tokens.length - 1; j++) {
path += ".." + File.separator;
}
if (path.contains("bin" + File.separator)) {
@@ -146,6 +150,6 @@ public class TestUtil {
}
filename = path + filename.replaceAll("/", File.separator);
}
- return new File(filename);
+ return new File(filename).getCanonicalFile();
}
}

Back to the top