2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.cucumber.utils;
23 import java.util.HashMap;
27 * Store Data here that is relevant for the whole runner and not just a single scenario.
31 public class RunnerSession {
32 private static final RunnerSession instance = new RunnerSession();
33 private Map<String, String> stringElements;
34 private Map<String, Integer> intElements;
35 private Map<String, Object> elements;
36 private RunnerSession(){
37 stringElements = new HashMap<>();
38 intElements = new HashMap<>();
39 elements = new HashMap<>();
41 public static RunnerSession getSession(){
45 public void putInSession(String key, String value){
46 stringElements.put(key, value);
49 public String getString(String key){
50 return stringElements.get(key);
54 public void putInSession(String key, Integer value){
55 intElements.put(key, value);
59 public Integer getInt(String key){
60 return intElements.get(key);
63 public void putInSession(String key, Object value) {
64 elements.put(key, value);
68 public Object get(String key){
69 return elements.get(key);
74 stringElements.clear();