HCOLL-197 updated tests

This commit is contained in:
Rob Austin
2014-12-23 11:01:21 +00:00
parent 87e30ba7e9
commit 3f26bd197e
@@ -325,6 +325,44 @@ public class CHMUseCasesTest {
}
@Test
public void testOversizedEntry() throws ExecutionException, InterruptedException, IOException {
int salefactor = 100;
int valueSize = 10 * salefactor;
char[] expected = new char[valueSize];
Arrays.fill(expected, 'X');
ChronicleMapBuilder<CharSequence, char[]> builder = ChronicleMapBuilder
.of(CharSequence.class, char[].class)
.keySize(10)
.valueSize(10);
try (ChronicleMap<CharSequence, char[]> map = newInstance(builder)) {
map.put("Key", expected);
mapChecks();
}
}
@Test
public void testKeyValueSizeBySample() throws ExecutionException, InterruptedException,
IOException {
ChronicleMapBuilder<CharSequence, CharSequence> builder = ChronicleMapBuilder
.of(CharSequence.class, CharSequence.class)
.constantKeySizeBySample("Key")
.constantValueSizeBySample("Value")
.entries(1);
try (ChronicleMap<CharSequence, CharSequence> map = newInstance(builder)) {
map.put("Key", "Value");
mapChecks();
}
}
@Test
public void testLargeCharSequenceValue()
throws ExecutionException, InterruptedException, IOException {