From 4ff4babc6dd9f69dc42af96f9350733f05568e8a Mon Sep 17 00:00:00 2001 From: Rob Austin Date: Fri, 12 Dec 2014 12:20:09 +0000 Subject: [PATCH] HCOLL-247 added test - "automatically register ByteBufferMarshaller" --- .../chronicle/map/CHMUseCasesTest.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/test/java/net/openhft/chronicle/map/CHMUseCasesTest.java b/src/test/java/net/openhft/chronicle/map/CHMUseCasesTest.java index e1fba23fa..48e84f69f 100644 --- a/src/test/java/net/openhft/chronicle/map/CHMUseCasesTest.java +++ b/src/test/java/net/openhft/chronicle/map/CHMUseCasesTest.java @@ -425,6 +425,32 @@ public class CHMUseCasesTest { } } + @Ignore("HCOLL-247 automatically register ByteBufferMarshaller") + @Test + public void testByteBufferByteBufferDefaultKeyValueMarshaller() throws ExecutionException, + InterruptedException { + try (ChronicleMap map = ChronicleMapBuilder + .of(ByteBuffer.class, ByteBuffer.class) + // .keyMarshaller(ByteBufferMarshaller.INSTANCE) + // .valueMarshaller(ByteBufferMarshaller.INSTANCE) + .keySize(8) + .valueSize(8) + .maxEntryOversizeFactor(1) + .create()) { + ByteBuffer key1 = ByteBuffer.wrap(new byte[]{1, 1, 1, 1}); + ByteBuffer key2 = ByteBuffer.wrap(new byte[]{2, 2, 2, 2}); + ByteBuffer value1 = ByteBuffer.wrap(new byte[]{11, 11, 11, 11}); + ByteBuffer value2 = ByteBuffer.wrap(new byte[]{22, 22, 22, 22}); + assertNull(map.put(key1, value1)); + assertBBEquals(value1, map.put(key1, value2)); + assertBBEquals(value2, map.get(key1)); + assertNull(map.get(key2)); + + + map.put(key1, value1); + } + } + @Test public void testByteBufferByteBufferMap() throws ExecutionException, InterruptedException { try (ChronicleMap map = ChronicleMapBuilder