mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
HCOLL-250 providing better error message for failure and attempts to create using reflection
This commit is contained in:
@@ -332,8 +332,8 @@ public class CHMUseCasesTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Ignore("HCOLL-250 map.newKeyInstance() throws NPE for simple types like Long")
|
||||
@Test
|
||||
|
||||
@Test(expected = IllegalStateException.class)
|
||||
public void testLongNewKeyValueInstance() {
|
||||
try (ChronicleMap map = ChronicleMapBuilder
|
||||
.of(Long.class, Long.class)
|
||||
@@ -344,6 +344,42 @@ public class CHMUseCasesTest {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test(expected = IllegalStateException.class)
|
||||
public void testNewKeyValueInstanceWithMapType() {
|
||||
try (ChronicleMap map = ChronicleMapBuilder
|
||||
.of(Map.class, Map.class)
|
||||
.create()) {
|
||||
|
||||
map.newKeyInstance();
|
||||
map.newValueInstance();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNewKeyValueInstanceWithHahMapType() {
|
||||
try (ChronicleMap map = ChronicleMapBuilder
|
||||
.of(HashMap.class, HashMap.class)
|
||||
.create()) {
|
||||
|
||||
map.newKeyInstance();
|
||||
map.newValueInstance();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test(expected = IllegalStateException.class)
|
||||
public void testNewKeyValueInstanceWithByteArray() {
|
||||
try (ChronicleMap map = ChronicleMapBuilder
|
||||
.of(byte[].class, byte[].class)
|
||||
.create()) {
|
||||
|
||||
map.newKeyInstance();
|
||||
map.newValueInstance();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* StringValue represents any bean which contains a String Value
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user