Skip to content

Support for Field and Lookup Resources #95

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Dec 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ explains how to run the following tests:
* Data Dictionary 1.7
* Data Dictionary Availability Report
* IDX Payload 1.7
* Web API Core 1.0.2
* Web API Core 2.0.0

## [Command-Line OData Web API Tools](/doc/CLI.md)
The RESO Commander contains command line tools for working with OData Web APIs.
Expand Down
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,17 @@ final String certOutputDir = 'build/certification',
certReportsDir = certOutputDir + '/reports'


task testWebApiCore_1_0_2() {
task testWebApiCore_2_0_0() {
group = 'RESO Certification'
description = 'Web API Core 1.0.2 Acceptance Tests' +
description = 'Web API Core 2.0.0 Acceptance Tests' +
'\nExample: ' +
'\n ./gradlew testWebApiServer_1_0_2_Core -DpathToRESOScript=/path/to/web-api-core-1.0.2.resoscript -DshowResponses=true' +
'\n ./gradlew testWebApiCore_2_0_0 -DpathToRESOScript=/path/to/web-api-core-2.0.0.resoscript -DshowResponses=true' +
'\n\nNote: by default the Web API tests assume Collection(Edm.EnumType).' +
'\nPass -DuseCollections=false if using OData IsFlags.' +
'\n\n[Report location: ' + certReportsDir + ']' +
'\n\n'

String reportName = 'web-api-server.core.1.0.2'
String reportName = 'web-api-server.core.2.0.0'

dependsOn jar
doLast {
Expand All @@ -115,7 +115,7 @@ task testWebApiCore_1_0_2() {
'--plugin',
'html:' + certReportsDir + '/' + reportName + '.html',
'--glue',
'org.reso.certification.stepdefs#WebAPIServer_1_0_2',
'org.reso.certification.stepdefs#WebAPIServerCore',
'src/main/java/org/reso/certification/features/web-api',
'--tags',
'@core-endorsement'
Expand Down Expand Up @@ -177,7 +177,7 @@ task testDataAvailability_1_7() {
group = 'RESO Certification'
description = 'Data Dictionary 1.7 Data Availability Tests' +
'\nExample:' +
'\n ./gradlew testDataAvailability_1_7 -DpathToRESOScript=/path/to/web-api-core-1.0.2.resoscript' +
'\n ./gradlew testDataAvailability_1_7 -DpathToRESOScript=/path/to/web-api-core-2.0.0.resoscript' +
'\n\n[Report location: ' + certReportsDir + ']' +
'\n\n'

Expand Down Expand Up @@ -209,7 +209,7 @@ task testIdxPayload_1_7() {
group = 'RESO Certification'
description = 'Data Dictionary 1.7 Payloads Sampling Tests' +
'\nExample:' +
'\n ./gradlew testIdxPayload_1_7 -DpathToRESOScript=/path/to/web-api-core-1.0.2.resoscript' +
'\n ./gradlew testIdxPayload_1_7 -DpathToRESOScript=/path/to/web-api-core-2.0.0.resoscript' +
'\n\n[Report location: ' + certReportsDir + ']' +
'\n\n'

Expand Down
4 changes: 2 additions & 2 deletions doc/CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ This should display something similar to the following:
Web API Commander Starting... Press <ctrl+c> at any time to exit.
==============================================================
Displaying 44 Request(s)
RESOScript: src/test/resources/mock.web-api-server.core.1.0.2.resoscript
RESOScript: src/test/resources/mock.web-api-server.core.2.0.0.resoscript
==============================================================


Expand Down Expand Up @@ -196,5 +196,5 @@ Results will be saved to the filenames specified in the given RESOScript, and er
**RESOScript File Format**
For examples of files using the RESOScript format, see:
* [Data Dictionary 1.7 RESOScript Template](sample-data-dictionary.1.7.0.resoscript)
* [Web API Core 1.0.2 RESOScript Template](sample-web-api-server.core.1.0.2.resoscript)
* [Web API Core 2.0.0 RESOScript Template](sample-web-api-server.core.2.0.0.resoscript)

26 changes: 13 additions & 13 deletions doc/Certification.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ RESO Certification tasks
------------------------
testDataAvailability_1_7 - Data Dictionary 1.7 Data Availability Tests
Example:
./gradlew testDataAvailability_1_7 -DpathToRESOScript=/path/to/web-api-core-1.0.2.resoscript
./gradlew testDataAvailability_1_7 -DpathToRESOScript=/path/to/web-api-core-2.0.0.resoscript
[Report location: build/certification/reports]


Expand All @@ -104,14 +104,14 @@ To disable strict mode, remove the -Dstrict=true parameter. All applicants MUST

testIdxPayload_1_7 - Data Dictionary 1.7 Payloads Sampling Tests
Example:
./gradlew testIdxPayload_1_7 -DpathToRESOScript=/path/to/web-api-core-1.0.2.resoscript
./gradlew testIdxPayload_1_7 -DpathToRESOScript=/path/to/web-api-core-2.0.0.resoscript

[Report location: build/certification/reports]


testWebApiCore_1_0_2 - Web API Core 1.0.2 Acceptance Tests
testWebApiCore_2_0_0 - Web API Core 2.0.0 Acceptance Tests
Example:
./gradlew testWebApiCore_1_0_2 -DpathToRESOScript=/path/to/web-api-core-1.0.2.resoscript -DshowResponses=true
./gradlew testWebApiCore_2_0_0 -DpathToRESOScript=/path/to/web-api-core-2.0.0.resoscript -DshowResponses=true

Note: by default the Web API tests assume Collection(Edm.EnumType).
Pass -DuseCollections=false if using OData IsFlags.
Expand All @@ -128,34 +128,34 @@ To use the automated RESO testing tools, you must have a [JDK installed](#java-a
### Web API Core RESOScript Template
To use the Commander for automated Web API Core testing, you need a RESOScript.

For Web API 1.0.2 Server Core Certification, use [this resoscript](sample-web-api-server.core.1.0.2.resoscript) as a template.
For Web API 2.0.0 Server Core Certification, use [this resoscript](sample-web-api-server.core.2.0.0.resoscript) as a template.

For more information regarding Parameters and Client Settings, see the [Web API Walkthrough](https://github.com/RESOStandards/web-api-commander/wiki/Walkthrough:-Automated-Web-API-Certification-Using-the-RESO-Commander#configuring-the-resoscript-file) (in-progress).

### Web API Cucumber Acceptance Tests
The Cucumber BDD acceptance tests for Web API 1.0.2 Core certification are [here](https://github.com/RESOStandards/web-api-commander/blob/issue-37-data-dictionary-testing/src/main/java/org/reso/certification/features/web-api/web-api-server.core.1.0.2.feature). If you have any questions, please [send us an email](mailto:dev@reso.org).
The Cucumber BDD acceptance tests for Web API 2.0.0 Core certification are [here](https://github.com/RESOStandards/web-api-commander/blob/issue-37-data-dictionary-testing/src/main/java/org/reso/certification/features/web-api/web-api-server.core.2.0.0.feature). If you have any questions, please [send us an email](mailto:dev@reso.org).

### Gradle Tasks for Web API 1.0.2 Server Certification
### Gradle Tasks for Web API 2.0.0 Server Certification
While you may use tags to filter tests as you choose, explained in the next section, it's convenient
to be able to run a predefined set of tests Web API Core Certification.

These tasks will also produce reports in the local `build` directory, named according to which test you ran.

#### Core Certification

This will run the Core tests against the Web API 1.0.2 Server provided as `WebAPIURI` in your `web-api-server.core.1.0.2.resoscript` file.
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.

**Note**: by default, the Commander uses `Collection(Edm.EnumType)` for multiple enumerations testing.
Pass `-DuseCollections=false` if you are using `IsFlags="true"` instead.

##### MacOS or Linux
```
$ ./gradlew testWebApiCore_1_0_2 -DpathToRESOScript=/path/to/your.web-api-server.core.1.0.2.resoscript -DshowResponses=true
$ ./gradlew testWebApiCore_2_0_0 -DpathToRESOScript=/path/to/your.web-api-server.core.2.0.0.resoscript -DshowResponses=true
```

##### Windows
```
C:\path\to\web-api-commander> gradlew testWebApiCore_1_0_2 -DpathToRESOScript=C:\path\to\your.web-api-server.core.1.0.2.resoscript -DshowResponses=true
C:\path\to\web-api-commander> gradlew testWebApiCore_2_0_0 -DpathToRESOScript=C:\path\to\your.web-api-server.core.2.0.0.resoscript -DshowResponses=true
```

*Note: the first time you run these tasks, they will take some time as the environment must be configured and code is being compiled from the contents of the source directory downloaded in the previous step.
Expand All @@ -165,12 +165,12 @@ C:\path\to\web-api-commander> gradlew testWebApiCore_1_0_2 -DpathToRESOScript=C:
A sample of the runtime terminal output follows:

```gherkin
> Task :testWebApiCore_1_0_2
> Task :testWebApiCore_2_0_0

@metadata-request @2.4.1
Scenario: REQ-WA103-END3 - Request and Validate Server Metadata

Using RESOScript: ./web-api-server.core.1.0.2.resoscript
Using RESOScript: ./web-api-server.core.2.0.0.resoscript
Given a RESOScript file was provided

RESOScript loaded successfully!
Expand Down Expand Up @@ -311,7 +311,7 @@ You may filter by tags in any of the Web API or Data Dictionary tests. These are

**Run Web API Core Metadata Tests Only**
```
$ gradle testWebApiCore_1_0_2 -DpathToRESOScript=/path/to/your.web-api-server.core.1.0.2.resoscript -Dcucumber.filter.tags="@metadata"
$ gradle testWebApiCore_2_0_0 -DpathToRESOScript=/path/to/your.web-api-server.core.2.0.0.resoscript -Dcucumber.filter.tags="@metadata"
```

**Run Data Dictionary Tests on IDX Fields Only**
Expand Down
19 changes: 13 additions & 6 deletions doc/Codegen.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Codegen
The RESO Commander CLI contains code generation for the following items:
* [Generating RESO Data Dictionary Acceptance Tests](#Generating RESO Data Dictionary Acceptance Tests)
* [Generating RESO Web API Reference Server Data Models](#Generating RESO Web API Reference Server Data Models)
* [Generating RESO Data Dictionary Reference Metadata](#Generating RESO Data Dictionary Reference Metadata)
* [Generating RESO Data Dictionary 1.7 Reference DDL](#Generating RESO Data Dictionary 1.7 Reference DDL)
* [Converting OData XML Metadata to Open API 3 Format](#Converting OData XML Metadata to Open API 3 Format)
* [Generating RESO Data Dictionary Acceptance Tests](#generating-reso-data-dictionary-acceptance-tests)
* [Generating RESO Web API Reference Server Data Models](#generating-reso-web-api-reference-server-data-models)
* [Generating RESO Data Dictionary Reference Metadata](#generating-reso-data-dictionary-reference-metadata)
* [Generating RESO Data Dictionary 1.7 Reference DDL](#generating-reso-data-dictionary-17-reference-ddl)
* [Converting OData XML Metadata to Open API 3 Format](#converting-odata-xml-metadata-to-open-api-3-format)

## Generating RESO Data Dictionary Acceptance Tests
The RESO Commander can be used to generate Data Dictionary acceptance tests from the currently approved [Data Dictionary Spreadsheet](src/main/resources/RESODataDictionary-1.7.xlsx).
Expand Down Expand Up @@ -74,6 +74,13 @@ The following items need to be added to the DDL generator still:


## Converting OData XML Metadata to Open API 3 Format
See documentation regarding running the [nodejs-based tools in odata-openapi/lib/README.md](odata-openapi/lib/README.md).
In order to generate an Open API 3 Spec from the reference metadata, run the following command from
the root of the odata-openapi3 directory:
```
$ odata-openapi3 --host 'api.reso.org' --scheme 'https' --basePath '' ../src/main/resources/RESODataDictionary-1.7.xml
```
You will need to issue an `npm install` command from the odata-openapi3 directory in order for the packages to be available.

See documentation regarding running the nodejs-based tools [in the odata-openapi README.md](../odata-openapi/README.md).


4 changes: 2 additions & 2 deletions doc/Docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ mkdir commander-tmp; \
cd commander-tmp; \
git clone https://github.com/RESOStandards/web-api-commander.git; \
cd web-api-commander; \
docker run --rm -u gradle -v "$PWD":/home/gradle/project -v /path/to/your/resoscripts:/home/gradle/project/resoscripts -w /home/gradle/project gradle gradle testWebAPIServer_1_0_2_Core -DpathToRESOScript=/home/gradle/project/resoscripts/your.web-api-server.core.1.0.2.resoscript -DshowResponses=true
docker run --rm -u gradle -v "$PWD":/home/gradle/project -v /path/to/your/resoscripts:/home/gradle/project/resoscripts -w /home/gradle/project gradle gradle testWebAPIServer_2_0_0_Core -DpathToRESOScript=/home/gradle/project/resoscripts/your.web-api-server.core.2.0.0.resoscript -DshowResponses=true
```

Note that this will create a directory in your home directory for the project, and build artifacts and the log will be placed in that directory,
Expand All @@ -44,5 +44,5 @@ which is also where you will end up after runtime.

#### Windows All-In-One WIP
```
cd C:\;mkdir commander-tmp;cd commander-tmp;git clone https://github.com/RESOStandards/web-api-commander.git;cd web-api-commander; docker run --rm -u gradle -v C:\current\path\web-api-commander:/home/gradle/project -v C:\path\to\your\resoscripts:/home/gradle/project/resoscripts -w /home/gradle/project gradle gradle testWebAPIServer_1_0_2_Core -DpathToRESOScript=/home/gradle/project/resoscripts/your.web-api-server.core.1.0.2.resoscript -DshowResponses=true
cd C:\;mkdir commander-tmp;cd commander-tmp;git clone https://github.com/RESOStandards/web-api-commander.git;cd web-api-commander; docker run --rm -u gradle -v C:\current\path\web-api-commander:/home/gradle/project -v C:\path\to\your\resoscripts:/home/gradle/project/resoscripts -w /home/gradle/project gradle gradle testWebAPIServer_2_0_0_Core -DpathToRESOScript=/home/gradle/project/resoscripts/your.web-api-server.core.2.0.0.resoscript -DshowResponses=true
```
118 changes: 118 additions & 0 deletions runResoscripts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test
.env.production

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
Loading