use of net.openhft.lang.values.LongValue$$Native in project HugeCollections-OLD by peter-lawrey.
the class IntValueMapTest method test.
@Test
@Ignore
public void test() throws IOException {
final SharedHashMap<IntValue, CharSequence> map = new SharedHashMapBuilder().entries(1000).entries(20000).file(getPersistenceFile()).kClass(IntValue.class).vClass(CharSequence.class).create();
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);
final CharSequence actual = map.get(value);
assertEquals(expected, actual);
// this will fail
map.toString();
}
use of net.openhft.lang.values.LongValue$$Native in project HugeCollections-OLD by peter-lawrey.
the class SharedHashMapTest method testGetWithNullContainer.
@Test
public void testGetWithNullContainer() throws Exception {
SharedHashMap<CharSequence, LongValue> map = getSharedMap(10 * 1000, 128, 24);
map.acquireUsing("key", new LongValue$$Native());
assertEquals(0, map.getUsing("key", null).getValue());
map.close();
}
Aggregations