Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2009-09-22 23:54:14 +0000
committerspingel2009-09-22 23:54:14 +0000
commit74befbfc62ce6c6b31c8a4d4b0a4ee7a00f780fb (patch)
treedc28e5d8d8880ca2adba991f6157842bab0bab57 /org.eclipse.mylyn.tests.util
parent83e34d1edb4f7c9965ea92ba23e328458224dd55 (diff)
downloadorg.eclipse.mylyn.tasks-74befbfc62ce6c6b31c8a4d4b0a4ee7a00f780fb.tar.gz
org.eclipse.mylyn.tasks-74befbfc62ce6c6b31c8a4d4b0a4ee7a00f780fb.tar.xz
org.eclipse.mylyn.tasks-74befbfc62ce6c6b31c8a4d4b0a4ee7a00f780fb.zip
NEW - bug 290198: move test utilities to a separate plug-in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=290198
Diffstat (limited to 'org.eclipse.mylyn.tests.util')
-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
2 files changed, 9 insertions, 6 deletions
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