How to use test classes ? #1237
Replies: 3 comments 3 replies
-
It looks like this test sort of bypasses all that, and is mostly just trying to exercise the stack. At some point it sets a read handler that seems to be enough for it to send read requests/responses back and forth: https://github.com/eclipse/milo/blob/cd0f3d97f78de3823541229032642f8af9f00040/opc-ua-stack/stack-tests/src/test/java/org/eclipse/milo/opcua/stack/ClientServerTest.java#L151-L171 It must not have been that useful because it seems I've deleted it in |
Beta Was this translation helpful? Give feedback.
-
Ah, right, because in 1.0 there are no more "stack" client/server implementations. Just the full fat SDK client/server, and transport implementations. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your quick reply! I had a look at AbstractClientServerTest.java, if my understanding is correct, all I need to do is make my test class extend this class and I should be able to connect to a local test server from within my test cases ? |
Beta Was this translation helpful? Give feedback.
-
Hello,
I am trying to add some unit tests to my project and when trying to connect to a test server I create before running my test suites, I get org.eclipse.milo.opcua.sdk.client.SessionFsm - [2] CreateSession failed: UaServiceFaultException: status=Bad_ServiceUnsupported, message=The server does not support the requested service.
I tried to mimic ClientServerTest.java but either I missed something or I misunderstood the way these test classes should work.
From what I've seen in the stack test class, the test server setup does not include adding a SessionServiceSet, so I don't understand why mine should. Am I completely off the mark here?
Beta Was this translation helpful? Give feedback.
All reactions