mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
update bom version, add test for BytesMarshallable key/values
This commit is contained in:
@@ -45,7 +45,7 @@
|
||||
<dependency>
|
||||
<groupId>net.openhft</groupId>
|
||||
<artifactId>chronicle-bom</artifactId>
|
||||
<version>1.14.68</version>
|
||||
<version>1.14.79</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package net.openhft.chronicle.map;
|
||||
|
||||
import net.openhft.chronicle.wire.AbstractMarshallable;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
public final class AbstractMarshallableKeyValueTest {
|
||||
|
||||
@Test
|
||||
public void shouldAcceptAbstractMarshallableComponents() throws Exception {
|
||||
final ChronicleMap<Key, Value> map = ChronicleMapBuilder.of(Key.class, Value.class).entries(10).
|
||||
averageKey(new Key()).averageValue(new Value()).create();
|
||||
|
||||
map.put(new Key(), new Value());
|
||||
|
||||
assertThat(map.get(new Key()).number, is(new Value().number));
|
||||
}
|
||||
|
||||
private static final class Key extends AbstractMarshallable {
|
||||
private String k = "key";
|
||||
}
|
||||
|
||||
private static final class Value extends AbstractMarshallable {
|
||||
private Integer number = Integer.valueOf(17);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user