New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support of PlcDINT for BigInteger in PlcValueHandler #962
Conversation
Enable OpcuaPlcDriverTest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't disable tests ... the test isn't blocking on my computer or on the CI servers, so if your changes make it block, we probably should take care of this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't just disable tests without opening a new issue for it ... this way we have already disabled very many tests, tests we don't know about or forget.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am enabling in this PR, the test was disabled in 0af938f
@@ -83,6 +83,9 @@ public static PlcValue of(Object[] values) { | |||
if (value instanceof Long) { | |||
return PlcLINT.of(value); | |||
} | |||
if (value instanceof BigInteger) { | |||
return PlcDINT.of(value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woudln't a LINT be the better match, as a BigInteger could actually be even bigger than the DINT value space?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, PlcLINT is better choose. I've pushed the change.
@@ -195,7 +195,7 @@ public CompletableFuture<PlcReadResponse> read(PlcReadRequest readRequest) { | |||
future.complete(new DefaultPlcReadResponse(request, status)); | |||
return; | |||
} | |||
} catch (ParseException e) { | |||
} catch (Exception e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the reasoning behind this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The uncaught PlcUnsupportedDataTypeException
thrown by PlcValueHandler
prevents the CompletableFuture
from completing, causing the thread to hang on CompletableFuture.get()
. By making this change, the test will now complete with an Exception instead of hanging indefinitely.
@chrisdutz if you're ok with changes (PlcLINT is in place) I'd proceed with merging. |
Please enable the test first |
As far I can see this PR enables test which was disabled. |
Indeed it does... So ignore my mumbling 😁 |
plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/protocol/OpcuaProtocolLogic.java
Outdated
Show resolved
Hide resolved
…protocol/OpcuaProtocolLogic.java
PlcUnsupportedDataTypeException
fromPlcValueHandler
caused the CompletableFuture not to complete, theOpcuaPlcDriverTest
hangs onCompletableFuture.get()