[incubator-plc4x] branch master updated: [General/MODBUS/ADS] Fixed date/time support
This is an automated email from the ASF dual-hosted git repository. sruehl pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git The following commit(s) were added to refs/heads/master by this push: new 4750820 [General/MODBUS/ADS] Fixed date/time support 4750820 is described below commit 4750820b85638df4f2104159ed02fc4f6f1c3a97 Author: Sebastian Rühl AuthorDate: Thu Sep 27 16:38:10 2018 +0200 [General/MODBUS/ADS] Fixed date/time support --- .../apache/plc4x/java/ads/model/AdsDataType.java | 9 ++-- .../plc4x/java/ads/model/AdsPlcFieldHandler.java | 58 ++-- .../ads/protocol/util/LittleEndianDecoder.java | 8 ++- .../ads/protocol/util/LittleEndianEncoder.java | 62 +- .../java/ads/protocol/Plc4x2AdsProtocolTest.java | 45 +++- .../java/base/messages/DefaultPlcWriteRequest.java | 2 +- .../base/protocol/Plc4XSupportedDataTypes.java | 32 +++ .../java/modbus/netty/Plc4XModbusProtocolTest.java | 1 - 8 files changed, 168 insertions(+), 49 deletions(-) diff --git a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/model/AdsDataType.java b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/model/AdsDataType.java index b9859f5..e6cf4c2 100644 --- a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/model/AdsDataType.java +++ b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/model/AdsDataType.java @@ -19,6 +19,9 @@ package org.apache.plc4x.java.ads.model; import java.time.Duration; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.temporal.ChronoUnit; /** * Documentation can be found here: @@ -191,15 +194,15 @@ public enum AdsDataType { * * TOD#00:00 TOD#1193:02:47.295 32 Bit *///TODO: strange maximum -TIME_OF_DAY(0, Duration.ofHours(23).plusMinutes(59).plusSeconds(59).plusMillis(999).toMillis(), 32), +TIME_OF_DAY(0, ChronoUnit.MILLIS.between(LocalTime.of(0, 0), LocalTime.of(23, 59, 59)), 32), /** * DATE * Date. The most significant digit is one second. The data type is handled internally like DWORD. * * TypeLower bound Upper bound Memory use * DATED#1970-01-01D#2106-02-0632 Bit - *///TODO: calculate max -DATE(0, -1, 32), + */ +DATE(0, ChronoUnit.SECONDS.between(LocalDateTime.of(1970, 1, 1, 0, 0), LocalDateTime.of(2106, 2, 6, 0, 0)), 32), /** * DATE_AND_TIME * DT diff --git a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/model/AdsPlcFieldHandler.java b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/model/AdsPlcFieldHandler.java index df751cb..bb9be24 100644 --- a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/model/AdsPlcFieldHandler.java +++ b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/model/AdsPlcFieldHandler.java @@ -27,10 +27,14 @@ import org.apache.plc4x.java.base.messages.items.*; import java.math.BigDecimal; import java.math.BigInteger; import java.nio.charset.Charset; +import java.time.LocalDate; import java.time.LocalDateTime; +import java.time.LocalTime; +import java.util.Arrays; import java.util.BitSet; import java.util.LinkedList; import java.util.List; +import java.util.stream.Collectors; // TODO: implement me acording to ads. currently copy pasta from S7 // Use endian decoders. @@ -551,7 +555,7 @@ public class AdsPlcFieldHandler extends DefaultPlcFieldHandler { case STRUCT: case ALIAS: case SUB_RANGE_DATA_TYPE: -return internalEncodeTemporal(field, values); +return internalTimeTemporal(field, values); case UNKNOWN: default: throw new PlcRuntimeException("Invalid encoder for type " + adsField.getAdsDataType().name()); @@ -602,7 +606,7 @@ public class AdsPlcFieldHandler extends DefaultPlcFieldHandler { case STRUCT: case ALIAS: case SUB_RANGE_DATA_TYPE: -return internalEncodeTemporal(field, values); +return internalDateTemporal(field, values); case UNKNOWN: default: throw new PlcRuntimeException("Invalid encoder for type " + adsField.getAdsDataType().name()); @@ -653,7 +657,7 @@ public class AdsPlcFieldHandler extends DefaultPlcFieldHandler { case STRUCT: case ALIAS: case SUB_RANGE_DATA_TYPE: -return internalEncodeTemporal(field, values); +return internalDateTimeTemporal(field, values); case UNKNOWN: default: throw new PlcRuntimeException("Invalid encoder for type " + adsField.getAdsDataType().name()); @@ -930,16 +934,60 @@ public class AdsPlcFieldHandler extends DefaultPlcFieldHandler { return new DefaultStringFieldItem
[incubator-plc4x] branch feature/TopLevelItemSpliting deleted (was b2f0fa3)
This is an automated email from the ASF dual-hosted git repository. sruehl pushed a change to branch feature/TopLevelItemSpliting in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git. was b2f0fa3 [MODBUS/ADS] Integrate SingleItemToSingleRequestProtocol for now The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository.
[incubator-plc4x] branch feature/TopLevelItemSpliting updated: [MODBUS/ADS] Integrate SingleItemToSingleRequestProtocol for now
This is an automated email from the ASF dual-hosted git repository. sruehl pushed a commit to branch feature/TopLevelItemSpliting in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git The following commit(s) were added to refs/heads/feature/TopLevelItemSpliting by this push: new b2f0fa3 [MODBUS/ADS] Integrate SingleItemToSingleRequestProtocol for now b2f0fa3 is described below commit b2f0fa335c832ed9385a4f1975857dce7e7b Author: Sebastian Rühl AuthorDate: Thu Sep 27 12:36:24 2018 +0200 [MODBUS/ADS] Integrate SingleItemToSingleRequestProtocol for now --- .../ads/connection/AdsSerialPlcConnection.java | 2 ++ .../java/ads/connection/AdsTcpPlcConnection.java | 2 ++ .../modbus/connection/ModbusTcpPlcConnection.java | 2 ++ .../plc4x/java/modbus/ManualPlc4XModbusTest.java | 32 ++ 4 files changed, 38 insertions(+) diff --git a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/connection/AdsSerialPlcConnection.java b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/connection/AdsSerialPlcConnection.java index 03a0588..203ebad 100644 --- a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/connection/AdsSerialPlcConnection.java +++ b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/connection/AdsSerialPlcConnection.java @@ -29,6 +29,7 @@ import org.apache.plc4x.java.ads.protocol.Payload2SerialProtocol; import org.apache.plc4x.java.ads.protocol.Plc4x2AdsProtocol; import org.apache.plc4x.java.ads.protocol.util.SingleMessageRateLimiter; import org.apache.plc4x.java.base.connection.SerialChannelFactory; +import org.apache.plc4x.java.base.protocol.SingleItemToSingleRequestProtocol; import java.util.concurrent.CompletableFuture; @@ -61,6 +62,7 @@ public class AdsSerialPlcConnection extends AdsAbstractPlcConnection { pipeline.addLast(new SingleMessageRateLimiter()); pipeline.addLast(new Ads2PayloadProtocol()); pipeline.addLast(new Plc4x2AdsProtocol(targetAmsNetId, targetAmsPort, sourceAmsNetId, sourceAmsPort, fieldMapping)); +pipeline.addLast(new SingleItemToSingleRequestProtocol()); } }; } diff --git a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/connection/AdsTcpPlcConnection.java b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/connection/AdsTcpPlcConnection.java index d498694..9483d22 100644 --- a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/connection/AdsTcpPlcConnection.java +++ b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/connection/AdsTcpPlcConnection.java @@ -46,6 +46,7 @@ import org.apache.plc4x.java.base.messages.*; import org.apache.plc4x.java.base.model.DefaultPlcConsumerRegistration; import org.apache.plc4x.java.base.model.InternalPlcConsumerRegistration; import org.apache.plc4x.java.base.model.InternalPlcSubscriptionHandle; +import org.apache.plc4x.java.base.protocol.SingleItemToSingleRequestProtocol; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -113,6 +114,7 @@ public class AdsTcpPlcConnection extends AdsAbstractPlcConnection implements Plc pipeline.addLast(new Payload2TcpProtocol()); pipeline.addLast(new Ads2PayloadProtocol()); pipeline.addLast(new Plc4x2AdsProtocol(targetAmsNetId, targetAmsPort, sourceAmsNetId, sourceAmsPort, fieldMapping)); +pipeline.addLast(new SingleItemToSingleRequestProtocol()); } }; } diff --git a/plc4j/protocols/modbus/src/main/java/org/apache/plc4x/java/modbus/connection/ModbusTcpPlcConnection.java b/plc4j/protocols/modbus/src/main/java/org/apache/plc4x/java/modbus/connection/ModbusTcpPlcConnection.java index 92f5337..15fe6dc 100644 --- a/plc4j/protocols/modbus/src/main/java/org/apache/plc4x/java/modbus/connection/ModbusTcpPlcConnection.java +++ b/plc4j/protocols/modbus/src/main/java/org/apache/plc4x/java/modbus/connection/ModbusTcpPlcConnection.java @@ -26,6 +26,7 @@ import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelInitializer; import org.apache.plc4x.java.base.connection.ChannelFactory; import org.apache.plc4x.java.base.connection.TcpSocketChannelFactory; +import org.apache.plc4x.java.base.protocol.SingleItemToSingleRequestProtocol; import org.apache.plc4x.java.modbus.netty.Plc4XModbusProtocol; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -68,6 +69,7 @@ public class ModbusTcpPlcConnection extends BaseModbusPlcConnection { protected void initChannel(Channel channel) { channel.pipeline().addLast(new ModbusTcpCodec(new ModbusRequestEncoder(), new ModbusResponseDecoder())); channel.pipeline().addLast(new Plc4XModbusProtocol()); +channel.pipeline().addLast(new SingleItemToSingleRequestProtocol()); } }; } diff --git a/plc4j/protocols/modbus/sr
[incubator-plc4x] branch master updated (d594ff6 -> b2f0fa3)
This is an automated email from the ASF dual-hosted git repository. sruehl pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git. from d594ff6 [General] updated mockito and added assertj for easier testing. add 3d7494f Introduced protocol layer to split requestItems to several requests. add a53cbbf [General] some progress on the SingleItemToSingleRequestProtocol add 5afff50 [General] SingleItemToSingleRequestProtocol implemented ErrorHandler add 33e754b [General] SingleItemToSingleRequestProtocol small Bugfixes add e36b6b2 [General] SingleItemToSingleRequestProtocol added abstract javadoc add 6703953 [General] SingleItemToSingleRequestProtocol replace throwing of RuntimeExceptions with log statements. add 327cc6f [General] updated mockito and added assertj for easier testing. add b2f0fa3 [MODBUS/ADS] Integrate SingleItemToSingleRequestProtocol for now No new revisions were added by this update. Summary of changes: .../ads/connection/AdsSerialPlcConnection.java | 2 + .../java/ads/connection/AdsTcpPlcConnection.java | 2 + .../SingleItemToSingleRequestProtocol.java | 335 + .../SingleItemToSingleRequestProtocolTest.java | 290 ++ .../modbus/connection/ModbusTcpPlcConnection.java | 2 + .../plc4x/java/modbus/ManualPlc4XModbusTest.java | 32 ++ 6 files changed, 663 insertions(+) create mode 100644 plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java create mode 100644 plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocolTest.java
[incubator-plc4x] branch feature/TopLevelItemSpliting updated (5951fc5 -> 327cc6f)
This is an automated email from the ASF dual-hosted git repository. sruehl pushed a change to branch feature/TopLevelItemSpliting in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git. discard 5951fc5 [General] SingleItemToSingleRequestProtocol fixed a bunch of bugs and added tests new 327cc6f [General] updated mockito and added assertj for easier testing. This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (5951fc5) \ N -- N -- N refs/heads/feature/TopLevelItemSpliting (327cc6f) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omit" are not gone; other references still refer to them. Any revisions marked "discard" are gone forever. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: pom.xml | 34 ++ 1 file changed, 10 insertions(+), 24 deletions(-)
[incubator-plc4x] 01/01: [General] updated mockito and added assertj for easier testing.
This is an automated email from the ASF dual-hosted git repository. sruehl pushed a commit to branch feature/TopLevelItemSpliting in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git commit 327cc6fad663b675745258f08c918be07603a8c1 Author: Sebastian Rühl AuthorDate: Thu Sep 27 12:18:11 2018 +0200 [General] updated mockito and added assertj for easier testing. --- .../SingleItemToSingleRequestProtocol.java | 125 ++--- .../SingleItemToSingleRequestProtocolTest.java | 290 + 2 files changed, 375 insertions(+), 40 deletions(-) diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java index fa578f2..724ffad 100644 --- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java +++ b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java @@ -36,29 +36,50 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; /** * This layer can be used to split a {@link org.apache.plc4x.java.api.messages.PlcRequest} which addresses multiple {@link PlcField}s into multiple subsequent {@link org.apache.plc4x.java.api.messages.PlcRequest}s. */ -// TODO: write test public class SingleItemToSingleRequestProtocol extends ChannelDuplexHandler { public static final Logger LOGGER = LoggerFactory.getLogger(SingleItemToSingleRequestProtocol.class); private PendingWriteQueue queue; -private ConcurrentMap>> sentButUnacknowledgedRequestItems; +// Map to track send subcontainers +private ConcurrentMap>> sentButUnacknowledgedSubContainer; +// Map to map tdpu to original parent container +private ConcurrentMap>> correlationToParentContainer; + +// Map to track tdpus per container private ConcurrentMap, Set> containerCorrelationIdMap; +// Map to track a list of responses per parent container private ConcurrentMap, List>> responsesToBeDelivered; private AtomicInteger correlationId; +public SingleItemToSingleRequestProtocol() { +this(true); +} + +public SingleItemToSingleRequestProtocol(boolean betterImplementationPossible) { +if (betterImplementationPossible) { +String callStack = Arrays.stream(Thread.currentThread().getStackTrace()) +.map(StackTraceElement::toString) +.collect(Collectors.joining("\n")); +LOGGER.warn("Unoptimized Usage of {} detected at:\n{}", this.getClass(), callStack); +LOGGER.info("Consider implementing item splitting native to the protocol."); +} +} + @Override public void channelRegistered(ChannelHandlerContext ctx) throws Exception { this.queue = new PendingWriteQueue(ctx); -this.sentButUnacknowledgedRequestItems = new ConcurrentHashMap<>(); +this.sentButUnacknowledgedSubContainer = new ConcurrentHashMap<>(); +this.correlationToParentContainer = new ConcurrentHashMap<>(); this.containerCorrelationIdMap = new ConcurrentHashMap<>(); this.responsesToBeDelivered = new ConcurrentHashMap<>(); this.correlationId = new AtomicInteger(); @@ -68,6 +89,11 @@ public class SingleItemToSingleRequestProtocol extends ChannelDuplexHandler { @Override public void channelUnregistered(ChannelHandlerContext ctx) throws Exception { this.queue.removeAndWriteAll(); +this.sentButUnacknowledgedSubContainer.clear(); +this.correlationToParentContainer.clear(); +this.containerCorrelationIdMap.clear(); +this.responsesToBeDelivered.clear(); +this.correlationId.set(0); super.channelUnregistered(ctx); } @@ -82,20 +108,22 @@ public class SingleItemToSingleRequestProtocol extends ChannelDuplexHandler { // Decoding -private void tryFinish(int correlationId, InternalPlcResponse msg) { -PlcRequestContainer> plcRequestContainer = sentButUnacknowledgedRequestItems.remove(correlationId); -if (plcRequestContainer == null) { +protected void tryFinish(Integer correlationId, InternalPlcResponse msg, CompletableFuture> originalResponseFuture) { +PlcRequestContainer> subPlcRequestContainer = sentButUnacknowledgedSubContainer.remove(correlationId); +LOGGER.info("{} got acknowledged", subPlcRequestContainer); +PlcRequestContainer> originalPlcRequestContainer = correlationToParentContainer
[incubator-plc4x] 01/07: Introduced protocol layer to split requestItems to several requests.
This is an automated email from the ASF dual-hosted git repository. sruehl pushed a commit to branch feature/TopLevelItemSpliting in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git commit 3d7494f06e23233fc5c5108db5727dc065a01792 Author: Sebastian Rühl AuthorDate: Thu Jul 5 13:20:43 2018 +0200 Introduced protocol layer to split requestItems to several requests. --- .../base/messages/item/CorrelatedRequestItem.java | 81 + .../base/messages/item/CorrelatedResponseItem.java | 70 .../SingleItemToSingleRequestProtocol.java | 193 + 3 files changed, 344 insertions(+) diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/item/CorrelatedRequestItem.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/item/CorrelatedRequestItem.java new file mode 100644 index 000..5212618 --- /dev/null +++ b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/item/CorrelatedRequestItem.java @@ -0,0 +1,81 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + */ +package org.apache.plc4x.java.base.messages.item; + +import org.apache.plc4x.java.api.messages.PlcRequestContainer; +import org.apache.plc4x.java.api.messages.PlcResponse; +import org.apache.plc4x.java.api.messages.items.RequestItem; + +import java.util.Objects; + +public class CorrelatedRequestItem> { + +private final int correlationId; + +private final REQUEST_ITEM requestItem; + +private final PlcRequestContainer> plcRequestContainer; + +public CorrelatedRequestItem(int correlationId, REQUEST_ITEM requestItem, PlcRequestContainer> plcRequestContainer) { +this.correlationId = correlationId; +this.requestItem = requestItem; +this.plcRequestContainer = plcRequestContainer; +} + +public int getCorrelationId() { +return correlationId; +} + +public REQUEST_ITEM getRequestItem() { +return requestItem; +} + +public PlcRequestContainer> getPlcRequestContainer() { +return plcRequestContainer; +} + +@Override +public boolean equals(Object o) { +if (this == o) { +return true; +} +if (!(o instanceof CorrelatedRequestItem)) { +return false; +} +CorrelatedRequestItem that = (CorrelatedRequestItem) o; +return correlationId == that.correlationId && +Objects.equals(requestItem, that.requestItem) && +Objects.equals(plcRequestContainer, that.plcRequestContainer); +} + +@Override +public int hashCode() { + +return Objects.hash(correlationId, requestItem, plcRequestContainer); +} + +@Override +public String toString() { +return "CorrelatedRequestItem{" + +"correlationId=" + correlationId + +", requestItem=" + requestItem + +", plcRequestContainer=" + plcRequestContainer + +'}'; +} +} diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/item/CorrelatedResponseItem.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/item/CorrelatedResponseItem.java new file mode 100644 index 000..38a9032 --- /dev/null +++ b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/item/CorrelatedResponseItem.java @@ -0,0 +1,70 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + und
[incubator-plc4x] 07/07: [General] SingleItemToSingleRequestProtocol fixed a bunch of bugs and added tests
This is an automated email from the ASF dual-hosted git repository. sruehl pushed a commit to branch feature/TopLevelItemSpliting in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git commit 5951fc5e1ecc208363f653175c922b7ca2a3b53a Author: Sebastian Rühl AuthorDate: Thu Sep 27 12:13:30 2018 +0200 [General] SingleItemToSingleRequestProtocol fixed a bunch of bugs and added tests --- .../SingleItemToSingleRequestProtocol.java | 125 ++--- .../SingleItemToSingleRequestProtocolTest.java | 290 + pom.xml| 34 ++- 3 files changed, 399 insertions(+), 50 deletions(-) diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java index fa578f2..724ffad 100644 --- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java +++ b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java @@ -36,29 +36,50 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; /** * This layer can be used to split a {@link org.apache.plc4x.java.api.messages.PlcRequest} which addresses multiple {@link PlcField}s into multiple subsequent {@link org.apache.plc4x.java.api.messages.PlcRequest}s. */ -// TODO: write test public class SingleItemToSingleRequestProtocol extends ChannelDuplexHandler { public static final Logger LOGGER = LoggerFactory.getLogger(SingleItemToSingleRequestProtocol.class); private PendingWriteQueue queue; -private ConcurrentMap>> sentButUnacknowledgedRequestItems; +// Map to track send subcontainers +private ConcurrentMap>> sentButUnacknowledgedSubContainer; +// Map to map tdpu to original parent container +private ConcurrentMap>> correlationToParentContainer; + +// Map to track tdpus per container private ConcurrentMap, Set> containerCorrelationIdMap; +// Map to track a list of responses per parent container private ConcurrentMap, List>> responsesToBeDelivered; private AtomicInteger correlationId; +public SingleItemToSingleRequestProtocol() { +this(true); +} + +public SingleItemToSingleRequestProtocol(boolean betterImplementationPossible) { +if (betterImplementationPossible) { +String callStack = Arrays.stream(Thread.currentThread().getStackTrace()) +.map(StackTraceElement::toString) +.collect(Collectors.joining("\n")); +LOGGER.warn("Unoptimized Usage of {} detected at:\n{}", this.getClass(), callStack); +LOGGER.info("Consider implementing item splitting native to the protocol."); +} +} + @Override public void channelRegistered(ChannelHandlerContext ctx) throws Exception { this.queue = new PendingWriteQueue(ctx); -this.sentButUnacknowledgedRequestItems = new ConcurrentHashMap<>(); +this.sentButUnacknowledgedSubContainer = new ConcurrentHashMap<>(); +this.correlationToParentContainer = new ConcurrentHashMap<>(); this.containerCorrelationIdMap = new ConcurrentHashMap<>(); this.responsesToBeDelivered = new ConcurrentHashMap<>(); this.correlationId = new AtomicInteger(); @@ -68,6 +89,11 @@ public class SingleItemToSingleRequestProtocol extends ChannelDuplexHandler { @Override public void channelUnregistered(ChannelHandlerContext ctx) throws Exception { this.queue.removeAndWriteAll(); +this.sentButUnacknowledgedSubContainer.clear(); +this.correlationToParentContainer.clear(); +this.containerCorrelationIdMap.clear(); +this.responsesToBeDelivered.clear(); +this.correlationId.set(0); super.channelUnregistered(ctx); } @@ -82,20 +108,22 @@ public class SingleItemToSingleRequestProtocol extends ChannelDuplexHandler { // Decoding -private void tryFinish(int correlationId, InternalPlcResponse msg) { -PlcRequestContainer> plcRequestContainer = sentButUnacknowledgedRequestItems.remove(correlationId); -if (plcRequestContainer == null) { +protected void tryFinish(Integer correlationId, InternalPlcResponse msg, CompletableFuture> originalResponseFuture) { +PlcRequestContainer> subPlcRequestContainer = sentButUnacknowledgedSubContainer.remove(correlationId); +LOGGER.info("{} got acknowledged", subPlcRequestContainer); +
[incubator-plc4x] 05/07: [General] SingleItemToSingleRequestProtocol added abstract javadoc
This is an automated email from the ASF dual-hosted git repository. sruehl pushed a commit to branch feature/TopLevelItemSpliting in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git commit e36b6b2650b839b42c07f958f7b8b181457fa6fe Author: Sebastian Rühl AuthorDate: Wed Sep 26 18:25:14 2018 +0200 [General] SingleItemToSingleRequestProtocol added abstract javadoc --- .../plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java| 3 +++ 1 file changed, 3 insertions(+) diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java index 717b4dc..2ab0937 100644 --- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java +++ b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java @@ -37,6 +37,9 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.atomic.AtomicInteger; +/** + * This layer can be used to split a {@link org.apache.plc4x.java.api.messages.PlcRequest} which addresses multiple {@link PlcField}s into multiple subsequent {@link org.apache.plc4x.java.api.messages.PlcRequest}s. + */ // TODO: write test public class SingleItemToSingleRequestProtocol extends ChannelDuplexHandler {
[incubator-plc4x] 03/07: [General] SingleItemToSingleRequestProtocol implemented ErrorHandler
This is an automated email from the ASF dual-hosted git repository. sruehl pushed a commit to branch feature/TopLevelItemSpliting in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git commit 5afff507142c30d321f74117e3ea48e2d0a73c53 Author: Sebastian Rühl AuthorDate: Wed Sep 26 18:07:56 2018 +0200 [General] SingleItemToSingleRequestProtocol implemented ErrorHandler --- .../plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java index 267f9a8..0fdebf5 100644 --- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java +++ b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java @@ -118,7 +118,11 @@ public class SingleItemToSingleRequestProtocol extends ChannelDuplexHandler { } private void errored(int correlationId, Throwable throwable) { - +PlcRequestContainer> plcRequestContainer = sentButUnacknowledgedRequestItems.remove(correlationId); +if (plcRequestContainer == null) { +throw new PlcRuntimeException("Unrelated error received ", throwable); +} + plcRequestContainer.getResponseFuture().completeExceptionally(throwable); }
[incubator-plc4x] 06/07: [General] SingleItemToSingleRequestProtocol replace throwing of RuntimeExceptions with log statements.
This is an automated email from the ASF dual-hosted git repository. sruehl pushed a commit to branch feature/TopLevelItemSpliting in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git commit 670395354c056dcaa690b4225ae54efdaae1f562 Author: Sebastian Rühl AuthorDate: Wed Sep 26 18:30:57 2018 +0200 [General] SingleItemToSingleRequestProtocol replace throwing of RuntimeExceptions with log statements. --- .../plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java index 2ab0937..fa578f2 100644 --- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java +++ b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java @@ -85,7 +85,8 @@ public class SingleItemToSingleRequestProtocol extends ChannelDuplexHandler { private void tryFinish(int correlationId, InternalPlcResponse msg) { PlcRequestContainer> plcRequestContainer = sentButUnacknowledgedRequestItems.remove(correlationId); if (plcRequestContainer == null) { -throw new PlcRuntimeException("Unrelated package received " + msg); +LOGGER.warn("Unrelated package received {}", msg); +return; } List> correlatedResponseItems = responsesToBeDelivered.computeIfAbsent(plcRequestContainer, ignore -> new LinkedList<>()); correlatedResponseItems.add(msg); @@ -124,7 +125,8 @@ public class SingleItemToSingleRequestProtocol extends ChannelDuplexHandler { private void errored(int correlationId, Throwable throwable) { PlcRequestContainer> plcRequestContainer = sentButUnacknowledgedRequestItems.remove(correlationId); if (plcRequestContainer == null) { -throw new PlcRuntimeException("Unrelated error received ", throwable); +LOGGER.warn("Unrelated error received ", throwable); +return; } plcRequestContainer.getResponseFuture().completeExceptionally(throwable); }
[incubator-plc4x] 04/07: [General] SingleItemToSingleRequestProtocol small Bugfixes
This is an automated email from the ASF dual-hosted git repository. sruehl pushed a commit to branch feature/TopLevelItemSpliting in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git commit 33e754b13510535209080878167c0534f6c49f03 Author: Sebastian Rühl AuthorDate: Wed Sep 26 18:23:42 2018 +0200 [General] SingleItemToSingleRequestProtocol small Bugfixes --- .../java/base/protocol/SingleItemToSingleRequestProtocol.java| 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java index 0fdebf5..717b4dc 100644 --- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java +++ b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java @@ -48,7 +48,7 @@ public class SingleItemToSingleRequestProtocol extends ChannelDuplexHandler { private ConcurrentMap, Set> containerCorrelationIdMap; -private ConcurrentMap, List>> responsesToBeDevliered; +private ConcurrentMap, List>> responsesToBeDelivered; private AtomicInteger correlationId; @@ -57,6 +57,7 @@ public class SingleItemToSingleRequestProtocol extends ChannelDuplexHandler { this.queue = new PendingWriteQueue(ctx); this.sentButUnacknowledgedRequestItems = new ConcurrentHashMap<>(); this.containerCorrelationIdMap = new ConcurrentHashMap<>(); +this.responsesToBeDelivered = new ConcurrentHashMap<>(); this.correlationId = new AtomicInteger(); super.channelRegistered(ctx); } @@ -83,7 +84,7 @@ public class SingleItemToSingleRequestProtocol extends ChannelDuplexHandler { if (plcRequestContainer == null) { throw new PlcRuntimeException("Unrelated package received " + msg); } -List> correlatedResponseItems = responsesToBeDevliered.computeIfAbsent(plcRequestContainer, ignore -> new LinkedList<>()); +List> correlatedResponseItems = responsesToBeDelivered.computeIfAbsent(plcRequestContainer, ignore -> new LinkedList<>()); correlatedResponseItems.add(msg); Set integers = containerCorrelationIdMap.get(plcRequestContainer); integers.remove(correlationId); @@ -113,7 +114,7 @@ public class SingleItemToSingleRequestProtocol extends ChannelDuplexHandler { throw new PlcRuntimeException("Unknown type detected " + plcRequestContainer.getRequest()); } plcRequestContainer.getResponseFuture().complete(plcResponse); -responsesToBeDevliered.remove(plcRequestContainer); +responsesToBeDelivered.remove(plcRequestContainer); } } @@ -144,7 +145,6 @@ public class SingleItemToSingleRequestProtocol extends ChannelDuplexHandler { if (internalPlcFieldRequest instanceof InternalPlcReadRequest) { InternalPlcReadRequest internalPlcReadRequest = (InternalPlcReadRequest) internalPlcFieldRequest; -// TODO: repackage internalPlcReadRequest.getNamedFields().forEach(field -> { ChannelPromise subPromise = new DefaultChannelPromise(promise.channel()); @@ -167,7 +167,6 @@ public class SingleItemToSingleRequestProtocol extends ChannelDuplexHandler { } if (internalPlcFieldRequest instanceof InternalPlcWriteRequest) { InternalPlcWriteRequest internalPlcWriteRequest = (InternalPlcWriteRequest) internalPlcFieldRequest; -// TODO: repackage internalPlcWriteRequest.getNamedFieldTriples().forEach(fieldItemTriple -> { ChannelPromise subPromise = new DefaultChannelPromise(promise.channel());
[incubator-plc4x] branch feature/TopLevelItemSpliting updated (86041d3 -> 5951fc5)
This is an automated email from the ASF dual-hosted git repository. sruehl pushed a change to branch feature/TopLevelItemSpliting in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git. discard 86041d3 [General] SingleItemToSingleRequestProtocol replace throwing of RuntimeExceptions with log statements. discard bd66350 [General] SingleItemToSingleRequestProtocol added abstract javadoc discard d3844ed [General] SingleItemToSingleRequestProtocol small Bugfixes discard 9e25460 [General] SingleItemToSingleRequestProtocol implemented ErrorHandler discard be82ba7 [General] some progress on the SingleItemToSingleRequestProtocol discard 10cf16a Introduced protocol layer to split requestItems to several requests. add f9707df PLC4X-60 - Fix findings by the last release add ee88f24 PLC4X-60 - Fix findings by the last release add b482930 PLC4X-60 - Fix findings by the last release add e292f32 PLC4X-60 - Fix findings by the last release add e31e741 PLC4X-56 - [S7] S7Field does not recognize addresses with numElements present add 374fd74 PLC4X-56 - [S7] S7Field does not recognize addresses with numElements present add d57e7ea PLC4X-54 - Installation Process isn't working SSL Errors add 776f2b7 PLC4X-56 - [S7] S7Field does not recognize addresses with numElements present add d594ff6 [General] updated mockito and added assertj for easier testing. new 3d7494f Introduced protocol layer to split requestItems to several requests. new a53cbbf [General] some progress on the SingleItemToSingleRequestProtocol new 5afff50 [General] SingleItemToSingleRequestProtocol implemented ErrorHandler new 33e754b [General] SingleItemToSingleRequestProtocol small Bugfixes new e36b6b2 [General] SingleItemToSingleRequestProtocol added abstract javadoc new 6703953 [General] SingleItemToSingleRequestProtocol replace throwing of RuntimeExceptions with log statements. new 5951fc5 [General] SingleItemToSingleRequestProtocol fixed a bunch of bugs and added tests This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (86041d3) \ N -- N -- N refs/heads/feature/TopLevelItemSpliting (5951fc5) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omit" are not gone; other references still refer to them. Any revisions marked "discard" are gone forever. The 7 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../google/src/remote-resources/META-INF/LICENSE |5 + mvnw.cmd |2 +- plc4j/protocols/driver-bases/base/pom.xml |5 + .../SingleItemToSingleRequestProtocol.java | 125 ++- .../SingleItemToSingleRequestProtocolTest.java | 290 ++ plc4j/protocols/driver-bases/test/pom.xml |6 + .../org/apache/plc4x/java/s7/model/S7Field.java|4 +- .../org/apache/plc4x/java/issues/PLC4X56.java} | 46 +- .../rawsockets/netty/AbstractRawSocketChannel.java | 740 -- .../netty/AbstractRawSocketStreamChannel.java | 1042 .../utils/rawsockets/netty/RawSocketChannel.java | 133 --- .../rawsockets/netty/RawSocketChannelConfig.java | 187 .../rawsockets/netty/RawSocketChannelSav.java | 186 .../rawsockets/netty/RawSocketEventArray.java | 104 -- .../utils/rawsockets/netty/RawSocketEventLoop.java | 449 - .../src/remote-resources/META-INF/LICENSE |9 + .../src/remote-resources/META-INF/NOTICE |4 + pom.xml| 66 +- src/site/asciidoc/developers/release.adoc | 79 +- .../ads/index.adoc => users/download.adoc} | 13 +- src/site/site.xml |2 + 21 files changed, 568 insertions(+), 2929 deletions(-) create mode 100644 examples/google/src/remote-resources/META-INF/LICENSE create mode 100644 plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocolTest.java copy plc4j/protocols/s7/src/{main/java/org/apache/plc4x/java/s7/messages/items/S7LocalDateTimeFieldItem.java => test/java/org/apache/plc4x/java/issues/PLC4X56.java} (52%) delete mode 100644 plc4j/utils/raw-sockets/src/main/java-sav/org/apache/plc4x/java/utils/rawsockets/netty/AbstractRawSocke
[incubator-plc4x] 02/07: [General] some progress on the SingleItemToSingleRequestProtocol
This is an automated email from the ASF dual-hosted git repository. sruehl pushed a commit to branch feature/TopLevelItemSpliting in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git commit a53cbbf8e022409ef4c3aaa79c93b029e39375bf Author: Sebastian Rühl AuthorDate: Wed Sep 26 18:01:46 2018 +0200 [General] some progress on the SingleItemToSingleRequestProtocol --- .../base/messages/item/CorrelatedRequestItem.java | 81 .../base/messages/item/CorrelatedResponseItem.java | 70 --- .../SingleItemToSingleRequestProtocol.java | 217 +++-- 3 files changed, 153 insertions(+), 215 deletions(-) diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/item/CorrelatedRequestItem.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/item/CorrelatedRequestItem.java deleted file mode 100644 index 5212618..000 --- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/item/CorrelatedRequestItem.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ -package org.apache.plc4x.java.base.messages.item; - -import org.apache.plc4x.java.api.messages.PlcRequestContainer; -import org.apache.plc4x.java.api.messages.PlcResponse; -import org.apache.plc4x.java.api.messages.items.RequestItem; - -import java.util.Objects; - -public class CorrelatedRequestItem> { - -private final int correlationId; - -private final REQUEST_ITEM requestItem; - -private final PlcRequestContainer> plcRequestContainer; - -public CorrelatedRequestItem(int correlationId, REQUEST_ITEM requestItem, PlcRequestContainer> plcRequestContainer) { -this.correlationId = correlationId; -this.requestItem = requestItem; -this.plcRequestContainer = plcRequestContainer; -} - -public int getCorrelationId() { -return correlationId; -} - -public REQUEST_ITEM getRequestItem() { -return requestItem; -} - -public PlcRequestContainer> getPlcRequestContainer() { -return plcRequestContainer; -} - -@Override -public boolean equals(Object o) { -if (this == o) { -return true; -} -if (!(o instanceof CorrelatedRequestItem)) { -return false; -} -CorrelatedRequestItem that = (CorrelatedRequestItem) o; -return correlationId == that.correlationId && -Objects.equals(requestItem, that.requestItem) && -Objects.equals(plcRequestContainer, that.plcRequestContainer); -} - -@Override -public int hashCode() { - -return Objects.hash(correlationId, requestItem, plcRequestContainer); -} - -@Override -public String toString() { -return "CorrelatedRequestItem{" + -"correlationId=" + correlationId + -", requestItem=" + requestItem + -", plcRequestContainer=" + plcRequestContainer + -'}'; -} -} diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/item/CorrelatedResponseItem.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/item/CorrelatedResponseItem.java deleted file mode 100644 index 38a9032..000 --- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/item/CorrelatedResponseItem.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions
[incubator-plc4x] branch master updated: [General] updated mockito and added assertj for easier testing.
This is an automated email from the ASF dual-hosted git repository. sruehl pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git The following commit(s) were added to refs/heads/master by this push: new d594ff6 [General] updated mockito and added assertj for easier testing. d594ff6 is described below commit d594ff64a9e4df30f7d92b6ab8c781f9b298e5e8 Author: Sebastian Rühl AuthorDate: Thu Sep 27 12:15:05 2018 +0200 [General] updated mockito and added assertj for easier testing. --- plc4j/protocols/driver-bases/base/pom.xml | 5 + plc4j/protocols/driver-bases/test/pom.xml | 6 ++ pom.xml | 26 -- 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/plc4j/protocols/driver-bases/base/pom.xml b/plc4j/protocols/driver-bases/base/pom.xml index 82c90c0..66753a7 100644 --- a/plc4j/protocols/driver-bases/base/pom.xml +++ b/plc4j/protocols/driver-bases/base/pom.xml @@ -65,6 +65,11 @@ logback-classic test + + org.assertj + assertj-core + 3.9.1 + \ No newline at end of file diff --git a/plc4j/protocols/driver-bases/test/pom.xml b/plc4j/protocols/driver-bases/test/pom.xml index 830ea1b..e70cd2c 100644 --- a/plc4j/protocols/driver-bases/test/pom.xml +++ b/plc4j/protocols/driver-bases/test/pom.xml @@ -73,6 +73,12 @@ compile + org.mockito + mockito-junit-jupiter + + compile + + commons-io commons-io diff --git a/pom.xml b/pom.xml index 85fcfc2..b4b2867 100644 --- a/pom.xml +++ b/pom.xml @@ -98,7 +98,8 @@ 5.2.0 1.2.0 1.2.3 -2.13.0 +2.22.0 +3.11.1 4.1.23.Final 1.7.3 1.7.25 @@ -245,6 +246,17 @@ ${mockito.version} +org.mockito +mockito-junit-jupiter +${mockito.version} + + +org.assertj +assertj-core +${assertj.version} +test + + org.slf4j slf4j-api ${slf4j.version} @@ -1051,7 +1063,16 @@ org.mockito mockito-core - 2.13.0 + test + + + org.mockito + mockito-junit-jupiter + test + + + org.assertj + assertj-core test @@ -1089,6 +1110,7 @@ org.hamcrest:hamcrest-core org.hamcrest:hamcrest-library org.mockito:mockito-core + org.mockito:mockito-junit-jupiter org.slf4j:slf4j-api ch.qos.logback:logback-classic