Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorddunne2011-05-27 10:58:33 -0400
committerRyan D. Brooks2011-05-27 10:58:33 -0400
commitec251295444641a088d3acc3622d9a2c0fe10fb0 (patch)
tree9d1ad96f1b94eb34f3eb85f6895d8b6ba8690d89 /plugins/org.eclipse.osee.framework.database
parent26092c8506d68907539583a42195249f2b2884ff (diff)
downloadorg.eclipse.osee-ec251295444641a088d3acc3622d9a2c0fe10fb0.tar.gz
org.eclipse.osee-ec251295444641a088d3acc3622d9a2c0fe10fb0.tar.xz
org.eclipse.osee-ec251295444641a088d3acc3622d9a2c0fe10fb0.zip
feature: Create DemoDb tests to validate PopulateDemoDb
Diffstat (limited to 'plugins/org.eclipse.osee.framework.database')
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeInfo.java28
1 files changed, 22 insertions, 6 deletions
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeInfo.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeInfo.java
index 28949303061..814d4c39960 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeInfo.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeInfo.java
@@ -54,11 +54,7 @@ public class OseeInfo {
* isCacheEnabled that will cache the value
*/
public static boolean isEnabled(String key) throws OseeCoreException {
- String dbProperty = OseeInfo.getValue(key);
- if (Strings.isValid(dbProperty)) {
- return dbProperty.equals("true");
- }
- return false;
+ return isBoolean(key);
}
/**
@@ -76,7 +72,27 @@ public class OseeInfo {
}
public static void setEnabled(String key, boolean enabled) throws OseeCoreException {
- putValue(key, String.valueOf(enabled));
+ setBoolean(key, enabled);
+ }
+
+ public static void setBoolean(String key, boolean value) throws OseeCoreException {
+ putValue(key, String.valueOf(value));
+
+ }
+
+ /**
+ * Return true if key is set in osee_info table and value = "true". Return false if key is either not in osee_info
+ * table OR value != "true".<br>
+ * <br>
+ * Note: This call will hit the database every time, so shouldn't be used for often repeated calls. use
+ * isCacheEnabled that will cache the value
+ */
+ public static boolean isBoolean(String key) throws OseeCoreException {
+ String dbProperty = OseeInfo.getValue(key);
+ if (Strings.isValid(dbProperty)) {
+ return dbProperty.equals("true");
+ }
+ return false;
}
public static void putValue(String key, String value) throws OseeCoreException {

Back to the top