From 94e2e14d0a9acecda288a639393ea105cef17cb3 Mon Sep 17 00:00:00 2001 From: Rob Austin Date: Wed, 29 Oct 2014 10:06:56 +0000 Subject: [PATCH] removed test -ng --- pom.xml | 6 ------ .../openhft/chronicle/map/TcpReplicator.java | 19 ++++++++----------- .../map/ConstantSizeBySampleTest.java | 12 ++++++------ 3 files changed, 14 insertions(+), 23 deletions(-) diff --git a/pom.xml b/pom.xml index 8c9b6b52f..252b46436 100755 --- a/pom.xml +++ b/pom.xml @@ -91,12 +91,6 @@ test - - org.testng - testng - test - - org.mockito mockito-core diff --git a/src/main/java/net/openhft/chronicle/map/TcpReplicator.java b/src/main/java/net/openhft/chronicle/map/TcpReplicator.java index cf497d9e3..c06313b70 100644 --- a/src/main/java/net/openhft/chronicle/map/TcpReplicator.java +++ b/src/main/java/net/openhft/chronicle/map/TcpReplicator.java @@ -1276,7 +1276,6 @@ class StatelessServerConnector { } - final long sizeLocation = reflectTransactionId(reader, writer); switch (event) { @@ -1396,6 +1395,7 @@ class StatelessServerConnector { } catch (RuntimeException e) { return sendException(writer, sizeLocation, e); } + writeSizeAndFlags(sizeLocation, false, writer); return null; } @@ -1446,15 +1446,13 @@ class StatelessServerConnector { private Work isEmpty(Bytes reader, Bytes writer, final long sizeLocation) { - if (MAP_SUPPORTS_BYTES) { - map.isEmpty(reader, writer); - } else { - try { - writer.writeBoolean(map.isEmpty()); - } catch (RuntimeException e) { - return sendException(writer, sizeLocation, e); - } + + try { + writer.writeBoolean(map.isEmpty()); + } catch (RuntimeException e) { + return sendException(writer, sizeLocation, e); } + writeSizeAndFlags(sizeLocation, false, writer); return null; } @@ -1540,10 +1538,9 @@ class StatelessServerConnector { } } + writeSizeAndFlags(sizeLocation, false, writer); return null; - - } private Work putAll(Bytes reader, Bytes writer, final long sizeLocation) { diff --git a/src/test/java/net/openhft/chronicle/map/ConstantSizeBySampleTest.java b/src/test/java/net/openhft/chronicle/map/ConstantSizeBySampleTest.java index 5bbea3e17..78ab35c73 100644 --- a/src/test/java/net/openhft/chronicle/map/ConstantSizeBySampleTest.java +++ b/src/test/java/net/openhft/chronicle/map/ConstantSizeBySampleTest.java @@ -18,9 +18,9 @@ package net.openhft.chronicle.map; +import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; -import org.testng.Assert; import java.io.*; import java.nio.ByteBuffer; @@ -62,7 +62,7 @@ public class ConstantSizeBySampleTest { value[42] = 1; map.put(1L, value); - Assert.assertEquals(map.get(1L), value); + Assert.assertTrue(Arrays.equals(map.get(1L), value)); } static class ExternalizableData implements Externalizable { @@ -90,10 +90,10 @@ public class ConstantSizeBySampleTest { public void testUnexpectedlyLongConstantExternalizableValues() throws IOException { ChronicleMap map = ChronicleMapBuilder.of(Long.class, ExternalizableData.class) - .constantValueSizeBySample(new ExternalizableData()) - .entries(100) - .actualSegments(1) - .create(); + .constantValueSizeBySample(new ExternalizableData()) + .entries(100) + .actualSegments(1) + .create(); ExternalizableData value = new ExternalizableData(); value.data[42] = 1;