"HCOLL-257 added test for - "Object serialization is failing when calling writeObject() / readObject()"

This commit is contained in:
Rob Austin
2014-12-16 16:33:16 +00:00
parent 933ef796bc
commit 349b2e0093
@@ -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<String, String> 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<Closeable> closeables = new ArrayList<Closeable>();