fixed set the expected value size

This commit is contained in:
Rob Austin
2018-11-16 17:15:15 +00:00
parent dbecb72115
commit 5cb73e7dd9
@@ -46,7 +46,6 @@ import java.io.IOException;
import java.io.Serializable;
import java.nio.ByteBuffer;
import java.util.*;
import java.util.concurrent.ExecutionException;
import java.util.function.BiFunction;
import static java.lang.Math.max;
@@ -338,8 +337,7 @@ public class CHMUseCasesTest {
}
@Test
public void testArrayOfString() throws ExecutionException, InterruptedException,
IOException {
public void testArrayOfString() throws IOException {
ChronicleMapBuilder<CharSequence, I1> builder = ChronicleMapBuilder
.of(CharSequence.class, I1.class)
@@ -381,7 +379,7 @@ public class CHMUseCasesTest {
}
@Test
public void testCharArrayValue() throws ExecutionException, InterruptedException, IOException {
public void testCharArrayValue() throws IOException {
int valueSize = 10;
@@ -390,6 +388,7 @@ public class CHMUseCasesTest {
ChronicleMapBuilder<CharSequence, char[]> builder = ChronicleMapBuilder
.of(CharSequence.class, char[].class)
.averageValue(expected)
.entries(1);
try (ChronicleMap<CharSequence, char[]> map = newInstance(builder)) {
@@ -402,7 +401,7 @@ public class CHMUseCasesTest {
@Test
public void testByteArrayArrayValue()
throws ExecutionException, InterruptedException, IOException {
throws IOException {
ChronicleMapBuilder<byte[], byte[][]> builder = ChronicleMapBuilder
.of(byte[].class, byte[][].class)
@@ -422,7 +421,7 @@ public class CHMUseCasesTest {
}
@Test
public void bondExample() throws IOException, InterruptedException {
public void bondExample() throws IOException {
ChronicleMapBuilder builder = ChronicleMapBuilder.of(String.class, BondVOInterface.class)
.entries(1)
@@ -449,7 +448,7 @@ public class CHMUseCasesTest {
}
@Test
public void testLargeCharSequenceValueWriteOnly() throws ExecutionException, InterruptedException, IOException {
public void testLargeCharSequenceValueWriteOnly() throws IOException {
int valueSize = 1000000;
@@ -468,7 +467,7 @@ public class CHMUseCasesTest {
@Test
public void testEntrySpanningSeveralChunks()
throws ExecutionException, InterruptedException, IOException {
throws IOException {
int salefactor = 100;
int valueSize = 10 * salefactor;
@@ -489,7 +488,7 @@ public class CHMUseCasesTest {
}
@Test
public void testKeyValueSizeBySample() throws ExecutionException, InterruptedException,
public void testKeyValueSizeBySample() throws
IOException {
ChronicleMapBuilder<CharSequence, CharSequence> builder = ChronicleMapBuilder
@@ -506,7 +505,7 @@ public class CHMUseCasesTest {
@Test
public void testLargeCharSequenceValue()
throws ExecutionException, InterruptedException, IOException {
throws IOException {
int valueSize = 5_000_000;
@@ -524,7 +523,7 @@ public class CHMUseCasesTest {
}
@Test
public void testStringStringMap() throws ExecutionException, InterruptedException,
public void testStringStringMap() throws
IOException {
ChronicleMapBuilder<String, String> builder = ChronicleMapBuilder
@@ -542,7 +541,7 @@ public class CHMUseCasesTest {
}
@Test
public void testStringStringMapMutableValue() throws ExecutionException, InterruptedException, IOException {
public void testStringStringMapMutableValue() throws IOException {
ChronicleMapBuilder<String, String> builder = ChronicleMapBuilder
.of(String.class, String.class)
@@ -556,7 +555,7 @@ public class CHMUseCasesTest {
}
@Test
public void testCharSequenceMixingKeyTypes() throws ExecutionException, InterruptedException, IOException {
public void testCharSequenceMixingKeyTypes() throws IOException {
ChronicleMapBuilder<CharSequence, CharSequence> builder = ChronicleMapBuilder
.of(CharSequence.class, CharSequence.class)
@@ -573,7 +572,7 @@ public class CHMUseCasesTest {
}
@Test
public void testCharSequenceMixingValueTypes() throws ExecutionException, InterruptedException, IOException {
public void testCharSequenceMixingValueTypes() throws IOException {
ChronicleMapBuilder<CharSequence, CharSequence> builder = ChronicleMapBuilder
.of(CharSequence.class, CharSequence.class)
@@ -595,7 +594,7 @@ public class CHMUseCasesTest {
*/
@Test
public void testCharSequenceCharSequenceMap()
throws ExecutionException, InterruptedException, IOException {
throws IOException {
ChronicleMapBuilder<CharSequence, CharSequence> builder = ChronicleMapBuilder
.of(CharSequence.class, CharSequence.class)
@@ -891,7 +890,7 @@ public class CHMUseCasesTest {
@Test
public void testIntegerIntegerMap()
throws ExecutionException, InterruptedException, IOException {
throws IOException {
ChronicleMapBuilder<Integer, Integer> builder = ChronicleMapBuilder
.of(Integer.class, Integer.class)
@@ -950,7 +949,7 @@ public class CHMUseCasesTest {
}
@Test
public void testLongLongMap() throws ExecutionException, InterruptedException, IOException {
public void testLongLongMap() throws IOException {
ChronicleMapBuilder<Long, Long> builder = ChronicleMapBuilder
.of(Long.class, Long.class)
@@ -990,7 +989,7 @@ public class CHMUseCasesTest {
}
@Test
public void testDoubleDoubleMap() throws ExecutionException, InterruptedException, IOException {
public void testDoubleDoubleMap() throws IOException {
ChronicleMapBuilder<Double, Double> builder = ChronicleMapBuilder
.of(Double.class, Double.class)
@@ -1026,7 +1025,7 @@ public class CHMUseCasesTest {
@Test
public void testByteArrayByteArrayMap()
throws ExecutionException, InterruptedException, IOException {
throws IOException {
ChronicleMapBuilder<byte[], byte[]> builder = ChronicleMapBuilder
.of(byte[].class, byte[].class).averageKeySize(4).averageValueSize(4)
@@ -1072,8 +1071,8 @@ public class CHMUseCasesTest {
}
@Test
public void testByteBufferByteBufferDefaultKeyValueMarshaller() throws ExecutionException,
InterruptedException, IOException {
public void testByteBufferByteBufferDefaultKeyValueMarshaller() throws
IOException {
ChronicleMapBuilder<ByteBuffer, ByteBuffer> builder = ChronicleMapBuilder
.of(ByteBuffer.class, ByteBuffer.class)
@@ -1100,7 +1099,7 @@ public class CHMUseCasesTest {
@Test
public void testByteBufferByteBufferMap()
throws ExecutionException, InterruptedException, IOException {
throws IOException {
ChronicleMapBuilder<ByteBuffer, ByteBuffer> builder = ChronicleMapBuilder
.of(ByteBuffer.class, ByteBuffer.class)
@@ -1209,7 +1208,7 @@ public class CHMUseCasesTest {
@Test
public void testByteBufferDirectByteBufferMap()
throws ExecutionException, InterruptedException, IOException {
throws IOException {
ChronicleMapBuilder<ByteBuffer, ByteBuffer> builder = ChronicleMapBuilder
.of(ByteBuffer.class, ByteBuffer.class)
@@ -2316,7 +2315,7 @@ public class CHMUseCasesTest {
new StringBytesReader(), CharSequenceBytesWriter.INSTANCE));
try (ChronicleMap<String, List<String>> map = newInstance(builder)) {
map.put("1", Collections.<String>emptyList());
map.put("1", Collections.emptyList());
map.put("2", asList("two-A"));
List<String> list1 = new ArrayList<>();
@@ -2362,7 +2361,7 @@ public class CHMUseCasesTest {
new StringBytesReader(), CharSequenceBytesWriter.INSTANCE));
try (ChronicleMap<String, Set<String>> map = newInstance(builder)) {
map.put("1", Collections.<String>emptySet());
map.put("1", Collections.emptySet());
map.put("2", new LinkedHashSet<>(asList("one")));
Set<String> list1 = new LinkedHashSet<>();
@@ -2409,7 +2408,7 @@ public class CHMUseCasesTest {
.valueMarshaller(valueMarshaller);
try (ChronicleMap<String, Map<String, String>> map = newInstance(builder)) {
map.put("1", Collections.<String, String>emptyMap());
map.put("1", Collections.emptyMap());
map.put("2", mapOf("one", "uni"));
Map<String, String> map1 = new LinkedHashMap<>();
@@ -2451,7 +2450,7 @@ public class CHMUseCasesTest {
.valueMarshaller(valueMarshaller);
try (ChronicleMap<String, Map<String, Integer>> map = newInstance(builder)) {
map.put("1", Collections.<String, Integer>emptyMap());
map.put("1", Collections.emptyMap());
map.put("2", mapOf("one", 1));
Map<String, Integer> map1 = new LinkedHashMap<>();
@@ -2489,7 +2488,7 @@ public class CHMUseCasesTest {
.averageValue(mapOf("two", 2))
.entries(2);
try (ChronicleMap<String, Map<String, Integer>> map = newInstance(builder)) {
map.put("1", Collections.<String, Integer>emptyMap());
map.put("1", Collections.emptyMap());
map.put("2", mapOf("two", 2));
assertEquals(mapOf("two", 2), map.get("2"));