Skip to content

Commit

Permalink
Adds a method to get datastore map (#520)
Browse files Browse the repository at this point in the history
* Adds a method to get datastore items
* Bumping the versions for release

Signed-off-by: Haroon Sheikh <[email protected]>
  • Loading branch information
haroon-sheikh authored Oct 22, 2020
1 parent 8819e6c commit 7581776
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion java.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "java",
"version": "0.7.12",
"version": "0.7.13",
"description": "Java support for gauge",
"install": {
"windows": [],
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@

<properties>
<maven.build.timestamp.format>yyyy-MM-dd</maven.build.timestamp.format>
<projectVersion>0.7.12</projectVersion>
<projectVersion>0.7.13</projectVersion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

package com.thoughtworks.gauge.datastore;

import java.util.Collections;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

public class ScenarioDataStore {
Expand Down Expand Up @@ -43,7 +45,16 @@ public static synchronized Object get(Object key) {
return null;
}

/**
* Returns a {@link Set} view of the keys in datastore.
* @return A set of keys stored in datastore
*/
public static synchronized Set<Object> items() {
return Collections.unmodifiableSet(map.get().keySet());
}

static synchronized void clear() {
map.get().clear();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

package com.thoughtworks.gauge.datastore;

import java.util.Collections;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

public class SpecDataStore {
Expand Down Expand Up @@ -43,6 +45,13 @@ public static synchronized Object get(Object key) {
return null;
}

/**
* Returns a {@link Set} view of the keys in datastore.
* @return A set of keys stored in datastore
*/
public static synchronized Set<Object> items() {
return Collections.unmodifiableSet(map.get().keySet());
}

static synchronized void clear() {
map.get().clear();
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/thoughtworks/gauge/datastore/SuiteDataStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

package com.thoughtworks.gauge.datastore;

import java.util.Collections;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

public class SuiteDataStore {
Expand Down Expand Up @@ -43,6 +45,14 @@ public static synchronized Object get(Object key) {
return null;
}

/**
* Returns a {@link Set} view of the keys in datastore.
* @return A set of keys stored in datastore
*/
public static synchronized Set<Object> items() {
return Collections.unmodifiableSet(map.get().keySet());
}

static synchronized void clear() {
map.get().clear();
}
Expand Down

0 comments on commit 7581776

Please sign in to comment.