diff options
author | spingel | 2009-09-22 23:54:14 +0000 |
---|---|---|
committer | spingel | 2009-09-22 23:54:14 +0000 |
commit | 74befbfc62ce6c6b31c8a4d4b0a4ee7a00f780fb (patch) | |
tree | dc28e5d8d8880ca2adba991f6157842bab0bab57 /org.eclipse.mylyn.tests.util/src/org/eclipse/mylyn/tests | |
parent | 83e34d1edb4f7c9965ea92ba23e328458224dd55 (diff) | |
download | org.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/src/org/eclipse/mylyn/tests')
-rw-r--r-- | org.eclipse.mylyn.tests.util/src/org/eclipse/mylyn/tests/util/TestUtil.java | 14 |
1 files changed, 9 insertions, 5 deletions
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(); } } |