You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2018/02/16 18:52:11 UTC
[incubator-plc4x] branch hamcrest_migration updated (79105ea ->
59316d3)
This is an automated email from the ASF dual-hosted git repository.
sruehl pushed a change to branch hamcrest_migration
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git.
from 79105ea Merge pull request #4 from niclash/master
new f61c740 manage commons-codec from parent-pom
new 98c1a42 post merge fixes
new 59316d3 ads hamcrest migration
The 3 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/protocols/ads/pom.xml | 1 -
.../apache/plc4x/java/ads/netty/ADSProtocolTest.java | 9 ++++-----
.../plc4x/java/ads/netty/Plc4XADSProtocolTest.java | 17 ++++++-----------
.../plc4x/java/s7/netty/model/types/S7TypeTests.java | 19 ++++++++-----------
pom.xml | 18 +++++++++++++-----
5 files changed, 31 insertions(+), 33 deletions(-)
--
To stop receiving notification emails like this one, please contact
sruehl@apache.org.
[incubator-plc4x] 01/03: manage commons-codec from parent-pom
Posted by sr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sruehl pushed a commit to branch hamcrest_migration
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git
commit f61c74018a1f2670c57aa50c3fb4ad7045636be6
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Fri Feb 16 19:43:42 2018 +0100
manage commons-codec from parent-pom
---
plc4j/protocols/ads/pom.xml | 1 -
pom.xml | 18 +++++++++++++-----
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/plc4j/protocols/ads/pom.xml b/plc4j/protocols/ads/pom.xml
index 53dd86a..96a3292 100644
--- a/plc4j/protocols/ads/pom.xml
+++ b/plc4j/protocols/ads/pom.xml
@@ -76,7 +76,6 @@
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
- <version>1.11</version>
<scope>test</scope>
</dependency>
<!-- Used to create a pcap dump file for wireshark. -->
diff --git a/pom.xml b/pom.xml
index 2ed2681..f745e31 100644
--- a/pom.xml
+++ b/pom.xml
@@ -90,6 +90,7 @@
<sonar.exclusions>**/generated-sources</sonar.exclusions>
<commons-io.version>2.6</commons-io.version>
+ <commons-codec.version>1.11</commons-codec.version>
<commons-lang.version>2.6</commons-lang.version>
<hamcrest.version>1.3</hamcrest.version>
<gson.version>2.8.0</gson.version>
@@ -141,6 +142,11 @@
<version>${commons-io.version}</version>
</dependency>
<dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>${commons-codec.version}</version>
+ </dependency>
+ <dependency>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
<version>${netty.version}</version>
@@ -388,7 +394,8 @@
</goals>
<configuration>
<url>http://netdna.bootstrapcdn.com/bootswatch/2.3.2/flatly/bootstrap.min.css</url>
- <outputDirectory>${project.build.directory}/dependency/META-INF/resources/webjars/bootstrap/2.3.2/css/</outputDirectory>
+ <outputDirectory>${project.build.directory}/dependency/META-INF/resources/webjars/bootstrap/2.3.2/css/
+ </outputDirectory>
<outputFileName>bootstrap.min.css</outputFileName>
</configuration>
</execution>
@@ -421,7 +428,8 @@
<outputDirectory>${project.build.directory}/site</outputDirectory>
<resources>
<resource>
- <directory>${project.build.directory}/dependency/META-INF/resources/webjars/bootstrap/2.3.2</directory>
+ <directory>${project.build.directory}/dependency/META-INF/resources/webjars/bootstrap/2.3.2
+ </directory>
</resource>
<resource>
<directory>${project.build.directory}/dependency/META-INF/resources/webjars/jquery/1.9.1</directory>
@@ -745,7 +753,7 @@
<artifactId>maven-changelog-plugin</artifactId>
<version>2.3</version>
</plugin>
-
+
<!--
This is a fake plugin which is used to tell m2e (Eclipse) how
to process this maven project.
@@ -767,14 +775,14 @@
</goals>
</pluginExecutionFilter>
<action>
- <ignore />
+ <ignore/>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
-
+
</plugins>
</pluginManagement>
</build>
--
To stop receiving notification emails like this one, please contact
sruehl@apache.org.
[incubator-plc4x] 02/03: post merge fixes
Posted by sr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sruehl pushed a commit to branch hamcrest_migration
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git
commit 98c1a422c120dff3d972ef18ed2f936a8c4b7245
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Fri Feb 16 19:50:21 2018 +0100
post merge fixes
---
.../plc4x/java/s7/netty/model/types/S7TypeTests.java | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/plc4j/protocols/s7/src/test/java/org/apache/plc4x/java/s7/netty/model/types/S7TypeTests.java b/plc4j/protocols/s7/src/test/java/org/apache/plc4x/java/s7/netty/model/types/S7TypeTests.java
index fcb6e63..748e4ab 100644
--- a/plc4j/protocols/s7/src/test/java/org/apache/plc4x/java/s7/netty/model/types/S7TypeTests.java
+++ b/plc4j/protocols/s7/src/test/java/org/apache/plc4x/java/s7/netty/model/types/S7TypeTests.java
@@ -45,10 +45,9 @@ public class S7TypeTests {
DataTransportErrorCode dataTransportErrorCode = DataTransportErrorCode.INVALID_ADDRESS;
assertThat(DataTransportErrorCode.valueOf((byte) 0xFE), nullValue());
- assertThat(DataTransportErrorCode.valueOf((byte)0xFE)).isNull();
+ assertThat(DataTransportErrorCode.valueOf((byte) 0xFE), nullValue());
- DataTransportErrorCode dataTransportErrorCode = DataTransportErrorCode.INVALID_ADDRESS;
- assertThat(dataTransportErrorCode.getCode()).isEqualTo((byte) 0x05).withFailMessage("code is not 0x05");
+ assertThat(dataTransportErrorCode.getCode(), equalTo((byte) 0x05));
}
@Test
@@ -64,10 +63,10 @@ public class S7TypeTests {
@Test
@Category(FastTests.class)
public void headerErrorClass() {
- assertThat(HeaderErrorClass.valueOf((byte) 0x87)).isEqualTo(HeaderErrorClass.ACCESS_ERROR).withFailMessage("0x87 incorrectly mapped");
+ assertThat("incorrectly mapped", HeaderErrorClass.valueOf((byte) 0x87), equalTo(HeaderErrorClass.ACCESS_ERROR));
HeaderErrorClass headerErrorClass = HeaderErrorClass.ACCESS_ERROR;
- assertThat(headerErrorClass.getCode()).isEqualTo((byte) 0x87).withFailMessage("code is not 0x87");
+ assertThat(headerErrorClass.getCode(), equalTo((byte) 0x87));
}
@Test
@@ -77,19 +76,18 @@ public class S7TypeTests {
assertThat("2 incorrectly mapped", MessageType.valueOf((byte) 2), equalTo(MessageType.ACK));
assertThat("code is not 2", messageType.getCode(), equalTo((byte) 2));
- assertThat(MessageType.valueOf((byte)2)).isEqualTo(MessageType.ACK).withFailMessage("2 incorrectly mapped");
+ assertThat("2 incorrectly mapped", MessageType.valueOf((byte) 2), equalTo(MessageType.ACK));
- MessageType messageType = MessageType.ACK;
- assertThat(messageType.getCode()).isEqualTo((byte)2).withFailMessage("code is not 2");
+ assertThat(messageType.getCode(), equalTo((byte) 2));
}
@Test
@Category(FastTests.class)
public void parameterError() {
- assertThat(ParameterError.valueOf((short) 0x011C)).isEqualTo(ParameterError.PROTOCOL_ERROR).withFailMessage("0x011C incorrectly mapped");;
+ assertThat("incorrectly mapped", ParameterError.valueOf((short) 0x011C), equalTo(ParameterError.PROTOCOL_ERROR));
ParameterError parameterError = ParameterError.PROTOCOL_ERROR;
- assertThat(parameterError.getCode()).isEqualTo((short) 0x011C).withFailMessage("code is not 0x011C");
+ assertThat(parameterError.getCode(), equalTo((short) 0x011C));
}
@Test
@@ -107,7 +105,6 @@ public class S7TypeTests {
ParameterType parameterType = ParameterType.UPLOAD;
assertThat(ParameterType.valueOf((byte) 0xFF), nullValue());
- ;
}
@Test
--
To stop receiving notification emails like this one, please contact
sruehl@apache.org.
[incubator-plc4x] 03/03: ads hamcrest migration
Posted by sr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sruehl pushed a commit to branch hamcrest_migration
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git
commit 59316d3ab8dca68baa73e873da40f90fb40386f4
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Fri Feb 16 19:51:59 2018 +0100
ads hamcrest migration
---
.../apache/plc4x/java/ads/netty/ADSProtocolTest.java | 9 ++++-----
.../plc4x/java/ads/netty/Plc4XADSProtocolTest.java | 17 ++++++-----------
2 files changed, 10 insertions(+), 16 deletions(-)
diff --git a/plc4j/protocols/ads/src/test/java/org/apache/plc4x/java/ads/netty/ADSProtocolTest.java b/plc4j/protocols/ads/src/test/java/org/apache/plc4x/java/ads/netty/ADSProtocolTest.java
index d5e0a2f..02b683c 100644
--- a/plc4j/protocols/ads/src/test/java/org/apache/plc4x/java/ads/netty/ADSProtocolTest.java
+++ b/plc4j/protocols/ads/src/test/java/org/apache/plc4x/java/ads/netty/ADSProtocolTest.java
@@ -39,7 +39,9 @@ import java.util.Collections;
import java.util.stream.Collectors;
import java.util.stream.Stream;
+import static org.hamcrest.Matchers.hasSize;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
@RunWith(Parameterized.class)
public class ADSProtocolTest {
@@ -176,17 +178,14 @@ public class ADSProtocolTest {
ArrayList<Object> out = new ArrayList<>();
SUT.encode(null, amstcpPaket, out);
assertEquals(1, out.size());
- // TODO: replace with hamcrest
- //assertThat(out, hasSize(1));
+ assertThat(out, hasSize(1));
}
@Test
public void decode() throws Exception {
ArrayList<Object> out = new ArrayList<>();
SUT.decode(null, amstcpPaket.getByteBuf(), out);
- assertEquals(1, out.size());
- // TODO: replace with hamcrest
- //assertThat(out, hasSize(1));
+ assertThat(out, hasSize(1));
}
}
\ No newline at end of file
diff --git a/plc4j/protocols/ads/src/test/java/org/apache/plc4x/java/ads/netty/Plc4XADSProtocolTest.java b/plc4j/protocols/ads/src/test/java/org/apache/plc4x/java/ads/netty/Plc4XADSProtocolTest.java
index 75dc911..96080a7 100644
--- a/plc4j/protocols/ads/src/test/java/org/apache/plc4x/java/ads/netty/Plc4XADSProtocolTest.java
+++ b/plc4j/protocols/ads/src/test/java/org/apache/plc4x/java/ads/netty/Plc4XADSProtocolTest.java
@@ -22,9 +22,7 @@ import org.apache.plc4x.java.ads.api.generic.AMSTCPPaket;
import org.apache.plc4x.java.ads.api.generic.types.AMSNetId;
import org.apache.plc4x.java.ads.api.generic.types.AMSPort;
import org.apache.plc4x.java.ads.model.ADSAddress;
-import org.apache.plc4x.java.api.messages.PlcReadRequest;
-import org.apache.plc4x.java.api.messages.PlcRequestContainer;
-import org.apache.plc4x.java.api.messages.PlcWriteRequest;
+import org.apache.plc4x.java.api.messages.*;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
@@ -39,7 +37,8 @@ import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import static org.junit.Assert.assertEquals;
+import static org.hamcrest.Matchers.hasSize;
+import static org.junit.Assert.assertThat;
@RunWith(Parameterized.class)
public class Plc4XADSProtocolTest {
@@ -48,7 +47,7 @@ public class Plc4XADSProtocolTest {
private Plc4XADSProtocol SUT;
@Parameterized.Parameter(0)
- public PlcRequestContainer plcRequestContainer;
+ public PlcRequestContainer<PlcRequest, PlcResponse> plcRequestContainer;
@Parameterized.Parameter(1)
public CompletableFuture completableFuture;
@@ -82,9 +81,7 @@ public class Plc4XADSProtocolTest {
public void encode() throws Exception {
ArrayList<Object> out = new ArrayList<>();
SUT.encode(null, plcRequestContainer, out);
- assertEquals(1, out.size());
- // TODO: replace with hamcrest
- //assertThat(out, hasSize(1));
+ assertThat(out, hasSize(1));
}
@Ignore("This doesn't work as the correlation requires a response to a request not another response")
@@ -94,8 +91,6 @@ public class Plc4XADSProtocolTest {
SUT.encode(null, plcRequestContainer, in);
ArrayList<Object> out = new ArrayList<>();
SUT.decode(null, ((AMSTCPPaket) in.get(0)), out);
- assertEquals(1, out.size());
- // TODO: replace with hamcrest
- //assertThat(out, hasSize(1));
+ assertThat(out, hasSize(1));
}
}
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
sruehl@apache.org.