Skip to content

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 /sortation and GET /destination return replayed queue data.
  • POST /sortation and POST /destination return HTTP 200 acknowledgements, 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

  1. Open the config file used by your runtime deployment (EuroAPI.dll.config or equivalent app config).
  2. Set TestMode to true.
  3. Confirm Port is set as desired (default is 8081).
  4. Save config and restart EuroAPI.

Test data file selection order

At startup, EuroAPI checks test files in this order:

  1. EuroAPI_PLC.csv
  2. EuroAPI_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

  1. Start EuroAPI.
  2. Open Swagger UI at http://localhost:8081/.
  3. Call GET /status and confirm service responds.
  4. Call GET /sortation?timeOut=2 repeatedly.
  5. Call GET /destination?timeOut=2 repeatedly.
  6. Expect 210, 211, 212, or 204 depending on queued data.

Typical local test loop

  1. Poll GET /sortation?timeOut=10.
  2. On 210 (REQUEST), send POST /sortation assignment.
  3. Poll GET /destination?timeOut=10 for SCAN events.
  4. Send POST /destination updates as needed.

Troubleshooting

  • Only 204 responses:
  • 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