Skip to content

Commit b4adad5

Browse files
darnjodarnjo
andauthored
#110: Skip has test for string enums (#159)
Co-authored-by: darnjo <[email protected]>
1 parent acdae70 commit b4adad5

File tree

6 files changed

+19
-5
lines changed

6 files changed

+19
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ build/
77
*.log
88
*.iml
99
.run/
10+
.DS_Store

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ explains how to run the following tests:
1515

1616
* Data Dictionary 1.7
1717
* Data Dictionary Availability Report
18-
* IDX Payload 1.7
1918
* Web API Core 2.0.0
2019

2120
## [Command-Line OData Web API Tools](/doc/CLI.md)

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ tasks.register('testWebApiCore_2_0_0') {
109109
'\nExample: ' +
110110
'\n ./gradlew testWebApiCore_2_0_0 -DpathToRESOScript=/path/to/web-api-core-2.0.0.resoscript -DshowResponses=true' +
111111
'\n\nNote: by default the Web API tests assume Collection(Edm.EnumType).' +
112+
'\nPass -DuseStringEnums=true if using string enumerations and the Lookup Resource.' +
112113
'\nPass -DuseCollections=false if using OData IsFlags.' +
113114
'\n\n[Report location: ' + certReportsDir + ']' +
114115
'\n\n'

doc/Certification.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ The RESO Commander is the basis for automated Data Dictionary, Payloads, and Web
1111

1212

1313
## Java and the JDK
14-
To run the Commander as an _automated testing tool_, the Java JDK must be installed. The Commander has been tested with JDK 1.8 and 10 at this point. Those using JDK 11+, please [report issues](https://github.com/RESOStandards/web-api-commander/issues) if they arise.
14+
To run the Commander as an _automated testing tool_, a Java 64-bit JDK must be installed.
15+
16+
The Commander has been tested with JDK 1.8 and 10 at this point.
17+
18+
Those using JDK 11+, please [report issues](https://github.com/RESOStandards/web-api-commander/issues) if they arise.
1519

1620
To see whether you have the JDK installed, type the following using your local command line environment:
1721
```
@@ -87,6 +91,7 @@ RESO Certification tasks
8791
testDataAvailability_1_7 - Data Dictionary 1.7 Data Availability Tests
8892
Example:
8993
./gradlew testDataAvailability_1_7 -DpathToRESOScript=/path/to/web-api-core-2.0.0.resoscript
94+
9095
[Report location: build/certification/reports]
9196
9297
@@ -114,6 +119,7 @@ Example:
114119
./gradlew testWebApiCore_2_0_0 -DpathToRESOScript=/path/to/web-api-core-2.0.0.resoscript -DshowResponses=true
115120
116121
Note: by default the Web API tests assume Collection(Edm.EnumType).
122+
Pass -DuseStringEnums=true if using string enumerations and the Lookup Resource.
117123
Pass -DuseCollections=false if using OData IsFlags.
118124
119125
[Report location: build/certification/reports]
@@ -143,7 +149,8 @@ These tasks will also produce reports in the local `/build/certification` direct
143149

144150
This will run the Core tests against the Web API 2.0.0 Server provided as `WebAPIURI` in your `web-api-server.core.2.0.0.resoscript` file.
145151

146-
**Note**: by default, the Commander uses `Collection(Edm.EnumType)` for multiple enumerations testing.
152+
**Note**: by default, the Commander assumes `Edm.EnumType` for single- and `Collection(Edm.EnumType)` for multiple-enumeration testing.
153+
Pass `-DuseStringEnums=true` if you are using string enumerations.
147154
Pass `-DuseCollections=false` if you are using `IsFlags="true"` instead.
148155

149156
##### MacOS or Linux

odata-openapi

src/main/java/org/reso/certification/stepdefs/WebAPIServerCore.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public class WebAPIServerCore implements En {
5757
private static final Logger LOG = LogManager.getLogger(WebAPIServerCore.class);
5858
private static final String
5959
SHOW_RESPONSES_PARAM = "showResponses",
60+
USE_STRING_ENUMS_PARAM = "useStringEnums",
6061
USE_COLLECTIONS_PARAM = "useCollections";
6162

6263
private static final String PATH_TO_RESOSCRIPT_KEY = "pathToRESOScript";
@@ -67,6 +68,7 @@ public class WebAPIServerCore implements En {
6768
// boolean used for indicating whether Web API tests are using collections of enums or not
6869
// defaults to useCollections=true since IsFlags is being deprecated
6970
private static final boolean useCollections = Boolean.parseBoolean(System.getProperty(USE_COLLECTIONS_PARAM, "true"));
71+
private static final boolean useStringEnums = Boolean.parseBoolean(System.getProperty(USE_STRING_ENUMS_PARAM, "false"));
7072

7173
/*
7274
* Used to store a static instance of the WebAPITestContainer class
@@ -287,8 +289,12 @@ public WebAPIServerCore(WebAPITestContainer c) {
287289
final Set<String> collectionRequestIds = new HashSet<>(Arrays.asList("filter-coll-enum-any", "filter-coll-enum-all"));
288290
final Set<String> isFlagsRequestIds = new HashSet<>(Arrays.asList("filter-enum-multi-has", "filter-enum-multi-has-and"));
289291

292+
if (useStringEnums) {
293+
assumeFalse("Using string enumerations. Skipping Test: " + requestId, requestId.contentEquals("filter-enum-single-has"));
294+
}
295+
290296
if (useCollections) {
291-
assumeFalse("Using Collection(Edm.EnumType). Skipping Test: " + requestId, isFlagsRequestIds.contains(requestId));
297+
assumeFalse("Using Collections for enumerations. Skipping Test: " + requestId, isFlagsRequestIds.contains(requestId));
292298
} else {
293299
assumeFalse("Using IsFlags=\"true\". Skipping Test: " + requestId, collectionRequestIds.contains(requestId));
294300
}

0 commit comments

Comments
 (0)