Conversation
Changes to be committed:
modified: src/mtconnect/sink/rest_sink/rest_service.cpp
- RestService::createAssetRoutings
- added asset, assets commands to the handler routings
- added assetsById command to to the idHandler routings
- RestService::createSampleRoutings
- added code to set the request->parameter<int32_t>("count") parameter to 100 if it's not instantiated.
wsobel
left a comment
There was a problem hiding this comment.
I'll review and test the changes. We need to have some test cases to validate that this works. I will see about the test framework to make that happen. The current WebSocket tests are just for the websocket layer. We need to have a headless test environment as well where we pass JSON commands and they get parsed.
|
It does require adding an additional websocket command "assetsById". I was actually considering expanding my current Websocket program to test all of the Websocket Functionality. |
|
I would like to build a test framework so we can also run it headless like we do with the REST requests. It would bypass the connection and upgrading to websockets and just send the JSON commands directly through to the parser and dispatcher. This will make it easier to validate that all the routes are working correctly. |
|
Got you. I was going to take a look at doing something similar to that. I had intended to make the Shop Floor meeting this morning but had to take care of some other personal business.
From: William Sobel ***@***.***>
Sent: Wednesday, December 17, 2025 5:06 AM
To: mtconnect/cppagent ***@***.***>
Cc: David Wickelhaus ***@***.***>; Author ***@***.***>
Subject: Re: [mtconnect/cppagent] Main websocket fixes 3 (PR #586)
[https://avatars.githubusercontent.com/u/1302665?s=20&v=4]wsobel left a comment (mtconnect/cppagent#586)<#586 (comment)>
I would like to build a test framework so we can also run it headless like we do with the REST requests. It would bypass the connection and upgrading to websockets and just send the JSON commands directly through to the parser and dispatcher. This will make it easier to validate that all the routes are working correctly.
—
Reply to this email directly, view it on GitHub<#586 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AC4DQ4NHKWZRTXMPHYFL3ZD4CETJJAVCNFSM6AAAAACPDU4RPGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTMNRUGYYTCMZVGQ>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
|
This completes the refactoring of the websocket session to make it testable and fixing issues discovered during the testing. There are two tests remaining for asset put. This has not been implemented yet, but can be. One thing to consider first is finishing the asset json parser. Otherwise the payload needs to be in XML. |
update to correct the issue "Webocket does not respond to asset or assets request #578" #580