diff --git a/src/test/java/net/openhft/chronicle/map/CHMUseCasesTest.java b/src/test/java/net/openhft/chronicle/map/CHMUseCasesTest.java index 7eac9d042..1f010bc2b 100644 --- a/src/test/java/net/openhft/chronicle/map/CHMUseCasesTest.java +++ b/src/test/java/net/openhft/chronicle/map/CHMUseCasesTest.java @@ -98,15 +98,26 @@ public class CHMUseCasesTest { } - /** - * String is not as efficient as CharSequence as a key or value but easier to use. The key can - * only be on heap and variable length serialised. - */ + @Ignore("HCOLL-257 Object serialization is failing when calling writeObject() / readObject()") + @Test + public void testPrefixStingFunctionSerialization() throws ExecutionException, + InterruptedException, IOException { + + ByteBufferBytes b = new ByteBufferBytes(ByteBuffer.allocate(512)); + + PrefixStingFunction expected = new PrefixStingFunction("New "); + b.writeObject(expected); + + b.clear(); + PrefixStingFunction actual = b.readObject(PrefixStingFunction.class); + assertEquals(expected, actual); + + } + + @Ignore("HCOLL-257 Object serialization is failing when calling writeObject() / readObject()") @Test public void testStringStringMap() throws ExecutionException, InterruptedException, IOException { - if (typeOfMap == TypeOfMap.STATELESS) - return; ChronicleMapBuilder builder = ChronicleMapBuilder .of(String.class, String.class); @@ -121,6 +132,22 @@ public class CHMUseCasesTest { } } + @Test + public void testStringSerialization() throws ExecutionException, + InterruptedException, IOException { + + ByteBufferBytes b = new ByteBufferBytes(ByteBuffer.allocate(512)); + + String expected = "Hello"; + b.writeObject(expected); + + b.clear(); + + String actual = (String) b.readObject(); + assertEquals(expected, actual); + + } + Collection closeables = new ArrayList();