You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2020/05/15 14:51:43 UTC

[plc4x] branch rel/0.7 updated (607a5c1 -> d00e452)

This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a change to branch rel/0.7
in repository https://gitbox.apache.org/repos/asf/plc4x.git.


    from 607a5c1  - Disabled the TriggeredScraperImplTest
     new 3277be5  - Disabled the TriggeredScraperImplTest
     new d00e452  - Applied a fix for some tests.

The 2 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:
 plc4j/integrations/apache-camel/src/main/docs/PLC4X.adoc     |  4 ++--
 .../test/java/org/apache/plc4x/camel/Plc4XComponentTest.java |  4 ++--
 .../test/java/org/apache/plc4x/camel/Plc4XProducerTest.java  | 12 ++++++++----
 3 files changed, 12 insertions(+), 8 deletions(-)


[plc4x] 02/02: - Applied a fix for some tests.

Posted by cd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch rel/0.7
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit d00e452bc573eec9cc213df413b3950d438ed150
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Fri May 15 16:51:29 2020 +0200

    - Applied a fix for some tests.
---
 .../test/java/org/apache/plc4x/camel/Plc4XComponentTest.java |  4 ++--
 .../test/java/org/apache/plc4x/camel/Plc4XProducerTest.java  | 12 ++++++++----
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/plc4j/integrations/apache-camel/src/test/java/org/apache/plc4x/camel/Plc4XComponentTest.java b/plc4j/integrations/apache-camel/src/test/java/org/apache/plc4x/camel/Plc4XComponentTest.java
index 7d8f78d..db521b6 100644
--- a/plc4j/integrations/apache-camel/src/test/java/org/apache/plc4x/camel/Plc4XComponentTest.java
+++ b/plc4j/integrations/apache-camel/src/test/java/org/apache/plc4x/camel/Plc4XComponentTest.java
@@ -51,11 +51,11 @@ public class Plc4XComponentTest extends CamelTestSupport {
                 Plc4XEndpoint producer = getContext().getEndpoint("plc4x:mock:10.10.10.1/1/1", Plc4XEndpoint.class);
                 producer.setTags(tags);
                 from("direct:plc4x")
-                    .setBody(constant(Arrays.asList(new TagData("test","testAddress",false))))
+                    .setBody(constant(Collections.singletonMap("test",Collections.singletonMap("testAddress",false))))
                     .to("plc4x:mock:10.10.10.1/1/1")
                     .to("mock:result");
                 from("direct:plc4x2")
-                    .setBody(constant(Arrays.asList(new TagData("test2","testAddress2",0x05))))
+                    .setBody(constant(Collections.singletonMap("test2",Collections.singletonMap("testAddress2",0x05))))
                     .to("plc4x:mock:10.10.10.1/1/1")
                     .to("mock:result");
                 from(producer)
diff --git a/plc4j/integrations/apache-camel/src/test/java/org/apache/plc4x/camel/Plc4XProducerTest.java b/plc4j/integrations/apache-camel/src/test/java/org/apache/plc4x/camel/Plc4XProducerTest.java
index a205b10..e8db835 100644
--- a/plc4j/integrations/apache-camel/src/test/java/org/apache/plc4x/camel/Plc4XProducerTest.java
+++ b/plc4j/integrations/apache-camel/src/test/java/org/apache/plc4x/camel/Plc4XProducerTest.java
@@ -27,6 +27,9 @@ import org.junit.jupiter.api.Test;
 
 import java.lang.reflect.Field;
 import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import static org.mockito.Mockito.*;
@@ -51,11 +54,12 @@ public class Plc4XProducerTest {
         when(endpointMock.getConnection()).thenReturn(mockConnection);
         SUT = new Plc4XProducer(endpointMock);
         testExchange = mock(Exchange.class, RETURNS_DEEP_STUBS);
-
+        Map<String, Map<String,Object>> tags = new HashMap();
+        tags.put("test1", Collections.singletonMap("testAddress1",0));
+        tags.put("test1", Collections.singletonMap("testAddress2",true));
+        tags.put("test1", Collections.singletonMap("testAddress3","TestString"));
         when(testExchange.getIn().getBody())
-            .thenReturn(Arrays.asList(new TagData("testName","testAddress",0),
-                new TagData("testName2","testAddress2",true),
-                new TagData("testName3","testAddress3","testVal")));
+            .thenReturn(tags);
     }
 
     @Test


[plc4x] 01/02: - Disabled the TriggeredScraperImplTest

Posted by cd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch rel/0.7
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit 3277be5e145fffadad1b3a4fff8ab5d1ed660f79
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Fri May 15 16:47:26 2020 +0200

    - Disabled the TriggeredScraperImplTest
---
 plc4j/integrations/apache-camel/src/main/docs/PLC4X.adoc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/plc4j/integrations/apache-camel/src/main/docs/PLC4X.adoc b/plc4j/integrations/apache-camel/src/main/docs/PLC4X.adoc
index 4b0dfc8..4724e0f 100644
--- a/plc4j/integrations/apache-camel/src/main/docs/PLC4X.adoc
+++ b/plc4j/integrations/apache-camel/src/main/docs/PLC4X.adoc
@@ -60,5 +60,5 @@ read from the PLC.
 To write data to the PLC, we also use a `Map`. The difference with the Producer is that the `Value` of the Map has also to
 be a Map. Also, this `Map` has to be set into the `Body` of the `Message`
 
-// endpoint options: START
-// endpoint options: END
\ No newline at end of file
+The used `Map` would be a `Map<String,Map<String,Object>` where the `Map<String,Object>` represent the Query and the
+data we want to write to it.