mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Merge remote-tracking branch 'origin/master'
Conflicts: pom.xml
This commit is contained in:
@@ -416,7 +416,8 @@ public class CHMUseCasesTest {
|
||||
Arrays.fill(expected, 'X');
|
||||
|
||||
ChronicleMapBuilder<CharSequence, char[]> builder = ChronicleMapBuilder
|
||||
.of(CharSequence.class, char[].class).entries(1).constantValueSizeBySample(expected);
|
||||
.of(CharSequence.class, char[].class).entries(1)
|
||||
.constantValueSizeBySample(expected);
|
||||
|
||||
try (ChronicleMap<CharSequence, char[]> map = newInstance(builder)) {
|
||||
map.put("Key", expected);
|
||||
@@ -658,28 +659,6 @@ public class CHMUseCasesTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetUsingWithCharSequenceNoValue() throws IOException {
|
||||
ChronicleMapBuilder<CharSequence, CharSequence> builder = ChronicleMapBuilder
|
||||
.of(CharSequence.class, CharSequence.class);
|
||||
|
||||
if (typeOfMap == TypeOfMap.STATELESS)
|
||||
return; // context supported by the STATELESS client
|
||||
|
||||
try (ChronicleMap<CharSequence, CharSequence> map = newInstance(builder)) {
|
||||
|
||||
try (MapKeyContext<CharSequence, CharSequence> c = map.context("1")) {
|
||||
CharSequence value = c.get();
|
||||
assertTrue(value instanceof StringBuilder);
|
||||
((StringBuilder) value).append("Hello World");
|
||||
}
|
||||
|
||||
assertEquals(null, map.get("1"));
|
||||
mapChecks();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testGetUsingWithIntValueNoValue() throws IOException {
|
||||
|
||||
@@ -701,32 +680,6 @@ public class CHMUseCasesTest {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test(expected = IllegalStateException.class)
|
||||
public void testAcquireUsingWithIntValueNoValue() throws IOException {
|
||||
|
||||
if (typeOfMap == TypeOfMap.STATELESS)
|
||||
throw new IllegalStateException(); // acquireContext supported by the STATELESS
|
||||
|
||||
|
||||
ChronicleMapBuilder<CharSequence, IntValue> builder = ChronicleMapBuilder
|
||||
.of(CharSequence.class, IntValue.class);
|
||||
|
||||
try (ChronicleMap<CharSequence, IntValue> map = newInstance(builder)) {
|
||||
|
||||
try (MapKeyContext<CharSequence, IntValue> c = map.context("1")) {
|
||||
c.updateLock().lock();
|
||||
IntValue value = c.get();
|
||||
assertTrue(value instanceof IntValue);
|
||||
value.setValue(1);
|
||||
}
|
||||
|
||||
assertEquals(null, map.get("1"));
|
||||
mapChecks();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void testAcquireUsingImmutableUsing() throws IOException {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user