From 1e868262408a05a27b33419f189169809f4e6fae Mon Sep 17 00:00:00 2001 From: Rob Austin Date: Fri, 12 Dec 2014 10:34:50 +0000 Subject: [PATCH] HCOLL-239 - added test - The JSON to Map import/export should work on the stateless client. --- .../map/ChronicleMapImportExportTest.java | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/test/java/net/openhft/chronicle/map/ChronicleMapImportExportTest.java b/src/test/java/net/openhft/chronicle/map/ChronicleMapImportExportTest.java index 1ddb86d9a..671ac426c 100644 --- a/src/test/java/net/openhft/chronicle/map/ChronicleMapImportExportTest.java +++ b/src/test/java/net/openhft/chronicle/map/ChronicleMapImportExportTest.java @@ -1,6 +1,7 @@ package net.openhft.chronicle.map; import junit.framework.Assert; +import net.openhft.chronicle.hash.replication.TcpTransportAndNetworkConfig; import net.openhft.lang.values.LongValue; import net.openhft.lang.values.LongValue$$Native; import org.junit.Ignore; @@ -8,6 +9,7 @@ import org.junit.Test; import java.io.File; import java.io.IOException; +import java.net.InetSocketAddress; import java.util.HashMap; import java.util.Map; @@ -152,6 +154,36 @@ public class ChronicleMapImportExportTest { } } + + @Ignore("HCOLL-239 - The JSON to Map import/export should work on the stateless client.") + @Test + public void testToJsonWithStatlessClient() throws IOException, InterruptedException { + File file = new File(TMP + "/chronicle-map-" + System.nanoTime() + ".json"); + file.deleteOnExit(); + try (ChronicleMap expected = ChronicleMapBuilder.of(CharSequence.class, CharSequence + .class) + .create()) { + try (ChronicleMap serverMap = ChronicleMapBuilder.of(Integer.class, CharSequence.class) + .replication((byte) 2, TcpTransportAndNetworkConfig.of(8056)).create()) { + try (ChronicleMap actual = ChronicleMapBuilder.of(Integer + .class, CharSequence.class) + .statelessClient(new InetSocketAddress("localhost", 8056)).create()) { + expected.put("hello", "world"); + + expected.getAll(file); + + + actual.putAll(file); + + Assert.assertEquals(expected, actual); + + + } + } + } + } + + @Ignore("this type of off heap reference is not currently supported") @Test public void testWithLongValue() throws IOException, InterruptedException { @@ -187,4 +219,5 @@ public class ChronicleMapImportExportTest { } } + }