This is an automated email from the ASF dual-hosted git repository.
cdutz pushed a commit to branch feature/s7strings
in repository https://gitbox.apache.org/repos/asf/plc4x.git
The following commit(s) were added to refs/heads/feature/s7strings by this push:
new cefb32a5ea fix: Fixed some tests.
cefb32a5ea is described below
commit cefb32a5ea3b1b3ae0ed514f63a95d0305b30845
Author: Christofer Dutz <[email protected]>
AuthorDate: Thu Nov 30 19:41:50 2023 +0100
fix: Fixed some tests.
---
.../readwrite/tag/S7StringFixedLengthTagTest.java | 44 ++++++++++++++++++++++
.../plc4x/java/s7/readwrite/tag/S7TagTest.java | 17 ---------
2 files changed, 44 insertions(+), 17 deletions(-)
diff --git
a/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/tag/S7StringFixedLengthTagTest.java
b/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/tag/S7StringFixedLengthTagTest.java
new file mode 100644
index 0000000000..e267001724
--- /dev/null
+++
b/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/tag/S7StringFixedLengthTagTest.java
@@ -0,0 +1,44 @@
+/*
+ * 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.s7.readwrite.tag;
+
+import org.apache.plc4x.java.s7.readwrite.MemoryArea;
+import org.apache.plc4x.java.s7.readwrite.TransportSize;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+public class S7StringFixedLengthTagTest {
+ /**
+ * PLC4X-312 - CAN NOT READ STRING FROM S7 PLC
+ */
+ @Test
+ public void testStringAddress() {
+ final S7StringFixedLengthTag s7StringFixedLengthTag =
S7StringFixedLengthTag.of("%DB145.DBX38:STRING(8)[1]");
+ Assertions.assertEquals(TransportSize.STRING,
s7StringFixedLengthTag.getDataType());
+ Assertions.assertEquals(1,
s7StringFixedLengthTag.getNumberOfElements());
+ Assertions.assertEquals(145, s7StringFixedLengthTag.getBlockNumber());
+ Assertions.assertEquals(MemoryArea.DATA_BLOCKS,
s7StringFixedLengthTag.getMemoryArea());
+ Assertions.assertEquals(38, s7StringFixedLengthTag.getByteOffset());
+ Assertions.assertEquals(0, s7StringFixedLengthTag.getBitOffset());
+ Assertions.assertEquals("S7StringFixedLengthTag",
s7StringFixedLengthTag.getClass().getSimpleName());
+ Assertions.assertEquals(8, s7StringFixedLengthTag.getStringLength());
+ }
+
+}
diff --git
a/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/tag/S7TagTest.java
b/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/tag/S7TagTest.java
index 3c4a672c3a..3f14d47608 100644
---
a/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/tag/S7TagTest.java
+++
b/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/tag/S7TagTest.java
@@ -36,21 +36,4 @@ public class S7TagTest {
Assertions.assertEquals(0, s7Tag.getBitOffset());
}
- /**
- * PLC4X-312 - CAN NOT READ STRING FROM S7 PLC
- */
- @Test
- public void testStringAddress() {
- final S7Tag s7Tag = S7Tag.of("%DB145.DBX38:STRING(8)[1]");
- Assertions.assertEquals(TransportSize.STRING, s7Tag.getDataType());
- Assertions.assertEquals(1, s7Tag.getNumberOfElements());
- Assertions.assertEquals(145, s7Tag.getBlockNumber());
- Assertions.assertEquals(MemoryArea.DATA_BLOCKS, s7Tag.getMemoryArea());
- Assertions.assertEquals(38, s7Tag.getByteOffset());
- Assertions.assertEquals(0, s7Tag.getBitOffset());
- Assertions.assertEquals("S7StringTag",
s7Tag.getClass().getSimpleName());
- S7StringFixedLengthTag s7StringTag = (S7StringFixedLengthTag) s7Tag;
- Assertions.assertEquals(8, s7StringTag.getStringLength());
- }
-
}