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 <sru...@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 sru...@apache.org.