summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2012-03-03 13:45:53 (EST)
committerSteffen Pingel2012-03-03 13:45:53 (EST)
commit7d5e7ebc8d6757c5dfc7d09e914386d29c27050d (patch)
treefb93b2e2bac3db78f91c637af388b014b4ccbc66
parent55262f34e75da6b3bf98c6a4defc8d15e950ea63 (diff)
downloadorg.eclipse.mylyn.commons-7d5e7ebc8d6757c5dfc7d09e914386d29c27050d.zip
org.eclipse.mylyn.commons-7d5e7ebc8d6757c5dfc7d09e914386d29c27050d.tar.gz
org.eclipse.mylyn.commons-7d5e7ebc8d6757c5dfc7d09e914386d29c27050d.tar.bz2
support checking for credentials availability
-rw-r--r--org.eclipse.mylyn.commons.sdk.util/src/org/eclipse/mylyn/commons/sdk/util/CommonTestUtil.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/org.eclipse.mylyn.commons.sdk.util/src/org/eclipse/mylyn/commons/sdk/util/CommonTestUtil.java b/org.eclipse.mylyn.commons.sdk.util/src/org/eclipse/mylyn/commons/sdk/util/CommonTestUtil.java
index 53fd10c..35eb280 100644
--- a/org.eclipse.mylyn.commons.sdk.util/src/org/eclipse/mylyn/commons/sdk/util/CommonTestUtil.java
+++ b/org.eclipse.mylyn.commons.sdk.util/src/org/eclipse/mylyn/commons/sdk/util/CommonTestUtil.java
@@ -194,6 +194,15 @@ public class CommonTestUtil {
}
}
+ public static boolean hasCredentials(PrivilegeLevel level) {
+ try {
+ CommonTestUtil.getCredentials(level);
+ return true;
+ } catch (AssertionFailedError error) {
+ return false;
+ }
+ }
+
public static UserCredentials getCredentials(PrivilegeLevel level) {
return getCredentials(level, null);
}
@@ -376,8 +385,8 @@ public class CommonTestUtil {
}
if (username == null || password == null) {
- throw new AssertionFailedError(
- "username or password not found in <plug-in dir>/credentials.properties, make sure file is valid");
+ throw new AssertionFailedError("username or password not found for " + prefix
+ + " in <plug-in dir>/credentials.properties, make sure file is valid");
}
return new UserCredentials(username, password);