In order to run your own local server you need a linux / Unix environment with the following dependencies:
- Maven
- docker-compose
- wget or curl
Run the build.sh
This will create everything to run the test server.
Run the run.sh
Assuming you're running the server locally, go to http://localhost:8080/core/2.0.0/$metadata
Otherwise, you will have to replace localhost
with the IP of your Docker machine.
If you set the SQL_HOST
Environment Variable, then the build script will not build the test database.
It will only build the reference server.
You will need to configure the following environment variables, so the server can connect to your custom database.
- SQL_HOST
- SQL_USER
- SQL_PASSWORD
The build scripts were moved to take place in a Docker container so that they would work consistently across environments.
In Windows, running under a Bash shell will work, assuming you meet the above requirements. Don't forget to have Docker installed for Windows.
There is an env-default-windows
file you should rename to .env
before running the build script.
The docker/docker-builder
file has a line commented out for Windows users, and a line that needs to be commented out.
This has not been tested. Anyone wanting to give feedback would be appreciated.
In the case this happens, and you have fixed the source of the error and need to rebuild everything using the build scripts, you should delete any prior Docker containers.
You can have your own SQL database. Just copy the env-default
file to .env
and modify the appropriate properties.
Before running the tests, ensure you have the following installed:
- Java 8+ (Ensure it's properly set in your environment)
- Gradle
- Docker (with Docker Compose)
- Node.js (for
reso-certification-utils
) reso-certification-utils
installed globally
(Check withwhere reso-certification-utils
on Windows orwhich reso-certification-utils
on Linux/Mac)- on
.env
add the env variable:WEB_API_COMMANDER_PATH=<your-webapicommander-repo-folder>\web-api-commander
refServLocal.json
should be on the root of<your-webapicommander-repo-folder>\web-api-commander
folder
To execute all JUnit tests, run:
./gradlew test --rerun-tasks --info
This will:
- Start the RESO Reference Server (via Docker).
- Run Data Dictionary compliance tests.
- Validate different Lookup Types (STRING, ENUM_FLAGS, ENUM_COLLECTION).
Each test modifies the LOOKUP_TYPE
environment variable dynamically.
To run tests manually with a specific lookup type:
LOOKUP_TYPE=STRING ./gradlew test --tests org.reso.tests.LookupStringTest
LOOKUP_TYPE=ENUM_FLAGS ./gradlew test --tests org.reso.tests.LookupEnumFlagsTest
LOOKUP_TYPE=ENUM_COLLECTION ./gradlew test --tests org.reso.tests.LookupEnumTest
$env:LOOKUP_TYPE="STRING"; ./gradlew test --tests org.reso.tests.LookupStringTest
$env:LOOKUP_TYPE="ENUM_FLAGS"; ./gradlew test --tests org.reso.tests.LookupEnumFlagsTest
$env:LOOKUP_TYPE="ENUM_COLLECTION"; ./gradlew test --tests org.reso.tests.LookupEnumTest
You can run aditional tests for $expand funtionallity:
./gradlew runExpandUtilsTest --rerun-tasks --info
./gradlew runExpandUtilsTest --rerun-tasks --info
- Docker Stops During Tests? Check the container logs:
docker ps -a
docker logs <container_id>
Restart Docker and try again
LOOKUP_TYPE
Not Changing?
System.out.println("LOOKUP_TYPE: " + System.getenv("LOOKUP_TYPE"));
- Gradle Not Picking Up Changes?
./gradlew clean test --rerun-tasks --info
This repository contains scripts to add missing lookup fields to a MongoDB database for the RESO Web API reference implementation.
A MongoDB shell script that adds missing lookup fields directly.
Usage:
mongo localhost:27017/reso add_missing_lookups.js
A Python implementation that provides the same functionality with interactive confirmation.
Requirements:
- Python 3.6+
- PyMongo library
Installation:
pip install pymongo
Usage:
python add_missing_lookups.py
A command-line version of the Python script with additional options for automation.
Usage:
python add_missing_lookups_auto.py [options]
Options:
--auto
: Run without confirmation prompts--mongo-uri URI
: Specify MongoDB connection URI (default: mongodb://localhost:27017/)--db-name NAME
: Specify database name (default: reso)
Example:
python add_missing_lookups_auto.py --auto --mongo-uri mongodb://localhost:27017/ --db-name reso
These scripts:
- Check for 100+ standard lookup fields specified in the RESO Data Dictionary
- Add missing fields with standard values (3 values per field)
- Skip fields that already exist in the database
- Generate unique hash keys for each lookup value
- Add proper formatting for
LegacyODataValue
fields - Include
ModificationTimestamp
with current date/time
The scripts add standard values for common lookup fields like:
- PropertyType, PropertySubType
- StandardStatus, OpenHouseStatus
- StructureType, ConstructionMaterials
- Heating, Cooling, Appliances
- And many more (100+ fields total)
Each field gets three standard values appropriate for that field type.
After running any of the scripts, you can verify the added fields with:
// In MongoDB shell
db.lookup.find({LookupName: "PropertyType"}).pretty()
// Count by LookupName
db.lookup.aggregate([
{$group: {_id: "$LookupName", count: {$sum: 1}}},
{$sort: {_id: 1}}
])