HCOLL-218 ReplicatedChronicleMapTest appears to use too much resources - I've looked at other tests as well and have attempted to ensure that close is called on every test, also prompting the GC to run after each test.

This commit is contained in:
Rob Austin
2014-11-26 16:24:57 +00:00
parent f3161e31bb
commit 84a9581c7f
31 changed files with 844 additions and 857 deletions
@@ -37,22 +37,24 @@ public class IntValueMapTest {
@Test
public void test() throws IOException {
final ChronicleMap<IntValue, CharSequence> map = OnHeapUpdatableChronicleMapBuilder
try (final ChronicleMap<IntValue, CharSequence> map = OnHeapUpdatableChronicleMapBuilder
.of(IntValue.class, CharSequence.class)
.entries(20000)
.keyMarshaller(ByteableIntValueMarshaller.INSTANCE).create();
.keyMarshaller(ByteableIntValueMarshaller.INSTANCE).create()) {
IntValue$$Native value = new IntValue$$Native();
value.bytes(new ByteBufferBytes(ByteBuffer.allocateDirect(4)), 0);
IntValue$$Native value = new IntValue$$Native();
value.bytes(new ByteBufferBytes(ByteBuffer.allocateDirect(4)), 0);
value.setValue(1);
final String expected = "test";
map.put(value, expected);
value.setValue(1);
final String expected = "test";
map.put(value, expected);
final CharSequence actual = map.get(value);
assertEquals(expected, actual);
final CharSequence actual = map.get(value);
assertEquals(expected, actual);
// this will fail
map.toString();
// this will fail
map.toString();
}
}
}