Test Mode¶
Test Mode lets you run EuroAPI without a live sorter connection by replaying test data from local files.
What Test Mode does¶
When TestMode=true:
- EuroAPI does not connect to the live sorter.
- Messages are loaded from test data files into in-memory queues.
GET /sortationandGET /destinationreturn replayed queue data.POST /sortationandPOST /destinationreturn HTTP200acknowledgements, but no live sorter send occurs.
Prerequisites¶
- EuroAPI executable and config file in the same folder
- One of the supported test data files in that same folder:
EuroAPI_PLC.csv(preferred if present)EuroAPI_PLC.log(fallback)
Configure Test Mode¶
- Open the config file used by your runtime deployment (
EuroAPI.dll.configor equivalent app config). - Set
TestModetotrue. - Confirm
Portis set as desired (default is8081). - Save config and restart EuroAPI.
Test data file selection order¶
At startup, EuroAPI checks test files in this order:
EuroAPI_PLC.csvEuroAPI_PLC.log
If both exist, CSV is used. If neither exists, API starts but no test message stream is loaded.
CSV format quick reference¶
Use header:
Type,MessageCode,DeviceID,TrackID,Barcode,Length,Width,Height,Weight,RecircCount,DestinationStatus,LightStatus,LightColor,DestinationText,ButtonID
Minimal examples:
REQUEST,10,INJ-M-0080-6-B,01.028.018908585,000112237094335303,,,,10,0,,,,,
VERIFY,18010,DST-CH-0050-1-A,01.028.018908585,000112237094335303,,,,,,,,,,
SCAN,50011,DST-CH-0050-1-A,,,,,,,,Ready,Off,BLUE,,NONE
Verify Test Mode is working¶
- Start EuroAPI.
- Open Swagger UI at
http://localhost:8081/. - Call
GET /statusand confirm service responds. - Call
GET /sortation?timeOut=2repeatedly. - Call
GET /destination?timeOut=2repeatedly. - Expect
210,211,212, or204depending on queued data.
Typical local test loop¶
- Poll
GET /sortation?timeOut=10. - On
210(REQUEST), sendPOST /sortationassignment. - Poll
GET /destination?timeOut=10for SCAN events. - Send
POST /destinationupdates as needed.
Troubleshooting¶
- Only
204responses: - Confirm
TestMode=true - Confirm test data file is present in executable folder
- Confirm file format and delimiter are correct
- API unavailable:
- Check configured
Port - Verify process is running
- Unexpected field values:
- Validate CSV keyword spelling and casing against Keywords and Casing