{"id":23624745,"url":"https://github.com/hcl-tech-software/rt-test-probe","last_synced_at":"2026-01-21T08:39:26.764Z","repository":{"id":103912051,"uuid":"322017156","full_name":"HCL-TECH-SOFTWARE/rt-test-probe","owner":"HCL-TECH-SOFTWARE","description":"JavaScript implementation of a test probe for testing real-time applications created with DevOps Model RealTime","archived":false,"fork":false,"pushed_at":"2024-10-15T09:35:50.000Z","size":72,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-20T12:15:46.481Z","etag":null,"topics":["model-realtime","test-automation"],"latest_commit_sha":null,"homepage":"https://www.hcl-software.com/devops-model-realtime","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HCL-TECH-SOFTWARE.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-12-16T15:04:57.000Z","updated_at":"2024-10-15T09:35:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"8e10558b-c777-4d81-b172-e50b23d6be85","html_url":"https://github.com/HCL-TECH-SOFTWARE/rt-test-probe","commit_stats":null,"previous_names":["hcl-pnp-rtist/rt-test-probe"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HCL-TECH-SOFTWARE%2Frt-test-probe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HCL-TECH-SOFTWARE%2Frt-test-probe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HCL-TECH-SOFTWARE%2Frt-test-probe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HCL-TECH-SOFTWARE%2Frt-test-probe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HCL-TECH-SOFTWARE","download_url":"https://codeload.github.com/HCL-TECH-SOFTWARE/rt-test-probe/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231539820,"owners_count":18392343,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["model-realtime","test-automation"],"created_at":"2024-12-27T21:16:20.794Z","updated_at":"2026-01-21T08:39:26.725Z","avatar_url":"https://github.com/HCL-TECH-SOFTWARE.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rt-test-probe\nJavaScript implementation of a test probe for testing real-time applications created with [DevOps Model RealTime](https://www.hcl-software.com/devops-model-realtime).\n\nThis repo contains a few JavaScript utilities (in the file `testProbe.js`) which let you send and invoke events to a real-time application that uses the [TcpServer](https://github.com/HCL-TECH-SOFTWARE/lib-tcp-server) library. It also allows you intercept outgoing events sent or invoked by the real-time application.\n\nAlthough this can be used as a means for general interaction with a real-time application from a JavaScript application, the main intended use case is to support testing of a real-time application. You can for example use the popular [Mocha](https://mochajs.org/) testing framework to write test cases for your real-time applications.\n\nIn the `models` folder you will find a few sample models, created with Model RealTime, which all are variants of the [traffic-light-web](https://github.com/HCL-TECH-SOFTWARE/traffic-light-web) sample application. In the `test` folder there are some Mocha tests for testing those models (both module testing, and unit testing of individual capsules).\n\nFeel free to extend `testProbe.js` to cover your testing needs, whether you are using Mocha or another testing framework. Pull requests are welcome!\n\n## Steps for running a Mocha capsule unit test\n1. Start Model RealTime and import the \"TrafficLight\" project (located in the [trafficlight-demo](https://github.com/HCL-TECH-SOFTWARE/rt-test-probe/tree/main/models/trafficlight-demo) folder).\n2. Build the TC it contains (`app.tcjs`). Note that it's set-up to build the application using Visual Studio and links with the prebuilt version of the TcpServer library that is part of Model RealTime. You need to update the TC if you want to use another target configuration.\n3. Launch the built executable from Model RealTime or from the command-line. If you run it from the command-line start it like this:\n```plaintext\nexecutable.EXE -URTS_DEBUG=quit\n```\n4. You will see a printout similar to this:\n```plaintext\nRT C++ Target Run Time System - Release 8.0.02\n\ntargetRTS: observability listening not enabled\n  Task 0 detached\nTrafficLight starts up\nOut message: { \"event\" : \"lightChanged\" , \"type\" : \"RTString\" , \"data\" : \"RTString\\\"Red\\\"\", \"command\" : \"sendEvent\", \"priority\" : \"General\", \"port\" : \"trafficLight_control\", \"portIndex\" : 0}\nError: Failed to write to socket for 127.0.0.1@2234: Connection refused: 127.0.0.1:2234\n```\nThis just shows that the application sent the \"lightChanged\" event but failed to deliver it to the test application since it's not yet running.\n\n5. Before you can start the test application you need to go to the `rt-test-probe` folder and run the command\n```plaintext\nnpm install\n```\nThis requires that you have Node.js installed.\n\n6. Now you can run some unit tests for the TrafficLight capsule of the RT application that you launched. From the command-line you can do this:\n```plaintext\nD:\\github\\HCL-TECH-SOFTWARE\\rt-test-probe\u003enpm test test/TrafficLight_unit2.js\n\n\u003e rt-test-probe@0.0.1 test D:\\github\\HCL-TECH-SOFTWARE\\rt-test-probe\n\u003e mocha \"test/TrafficLight_unit2.js\"\n\n\n\n  TrafficLight\n    √ should initially be in the Red state\n    √ should be in the Green state after we have sent the Green event\n    √ should ask for the duration of inactivity when we send the \"deactivateLight\" event, be inactive for the returned duration, and finally go back to the Green state (5026ms)\n\n\n  3 passing (5s)\n```\nYou can also try with the test in `TrafficLight_unit3.js`.\nIf you are a Visual Studio Code user there is a `launch.json` file [here](https://github.com/HCL-TECH-SOFTWARE/rt-test-probe/blob/main/.vscode/launch.json) which lets you debug the Mocha tests from within Visual Studio Code.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhcl-tech-software%2Frt-test-probe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhcl-tech-software%2Frt-test-probe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhcl-tech-software%2Frt-test-probe/lists"}