Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Struckmann2014-12-09 15:05:56 +0000
committerSebastian Struckmann2014-12-09 15:06:33 +0000
commitc17410a52ef32d7986564f759bd43b70bea25bc6 (patch)
tree8195da5653dc447649b05226c98881b1ef4246d6 /org.eclipse.jubula.qa.api.rcp
parentc4678894a21ae78c6ea1886cb143d427ad18722a (diff)
downloadorg.eclipse.jubula.core-c17410a52ef32d7986564f759bd43b70bea25bc6.tar.gz
org.eclipse.jubula.core-c17410a52ef32d7986564f759bd43b70bea25bc6.tar.xz
org.eclipse.jubula.core-c17410a52ef32d7986564f759bd43b70bea25bc6.zip
Sprint task - Java API - Added variable store to converter, small adjustments
Diffstat (limited to 'org.eclipse.jubula.qa.api.rcp')
-rw-r--r--org.eclipse.jubula.qa.api.rcp/src/main/java/org/eclipse/jubula/qa/api/VariableStore.java55
1 files changed, 55 insertions, 0 deletions
diff --git a/org.eclipse.jubula.qa.api.rcp/src/main/java/org/eclipse/jubula/qa/api/VariableStore.java b/org.eclipse.jubula.qa.api.rcp/src/main/java/org/eclipse/jubula/qa/api/VariableStore.java
new file mode 100644
index 000000000..217fb8131
--- /dev/null
+++ b/org.eclipse.jubula.qa.api.rcp/src/main/java/org/eclipse/jubula/qa/api/VariableStore.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2014 BREDEX GmbH.
+ * 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:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.qa.api;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @created 08.12.2014
+ */
+public class VariableStore {
+ /** the logger */
+ private static Logger log = LoggerFactory.getLogger(VariableStore.class);
+
+ private static VariableStore instance;
+
+ private Map<String, String> variablePool = new HashMap<String, String>();
+
+ /**
+ * Storing variables
+ */
+ private VariableStore() {
+ //empty
+ }
+
+ public static VariableStore getInstance() {
+ if (instance == null) {
+ instance = new VariableStore();
+ }
+ return instance;
+ }
+
+ public void addVariable(String name, String value) {
+ variablePool.put(name, value);
+ }
+
+ public String getValue(String variableName) {
+ String value = variablePool.get(variableName);
+ if (value == null) {
+ log.error("Variable '" + variableName + "' was not set in variable pool."); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ return value;
+ }
+} \ No newline at end of file

Back to the top