sruehl commented on a change in pull request #40: Alias registry for opm
URL: https://github.com/apache/incubator-plc4x/pull/40#discussion_r235888638
##########
File path:
plc4j/utils/opm/src/test/java/org/apache/plc4x/java/opm/PlcEntityInterceptorTest.java
##########
@@ -49,12 +51,27 @@ private void runGetPlcResponseWIthException(Answer a)
throws InterruptedExceptio
PlcEntityInterceptor.getPlcReadResponse(request);
}
- @Test(expected = OPMException.class)
- public void getPlcReadResponse_catchesInterruptedException_rethrows()
throws OPMException, InterruptedException, ExecutionException, TimeoutException
{
- runGetPlcResponseWIthException(invocation -> {
- throw new InterruptedException();
+ @Test
+ public void getPlcReadResponse_catchesInterruptedException_rethrows()
throws InterruptedException {
+ AtomicBoolean exceptionWasThrown = new AtomicBoolean(false);
+ // Run in different Thread
+ Thread thread = new Thread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ runGetPlcResponseWIthException(invocation -> {
+ throw new InterruptedException();
+ });
+ } catch (InterruptedException | ExecutionException |
TimeoutException e) {
+ e.printStackTrace();
Review comment:
use logger here instead of e.printStackTrace();
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services