Merge commit '0733366' into 2.1

Conflicts:
	src/test/java/net/openhft/chronicle/map/MarkTest.java
This commit is contained in:
leventov
2015-01-31 23:25:01 +07:00
9 changed files with 44 additions and 36 deletions
@@ -76,14 +76,14 @@ public class CHMMetaDataTest {
}
@Override
public void onPut(Bytes entry, long metaDataPos, long keyPos, long valuePos, boolean added) {
public void onPut(Bytes entry, long metaDataPos, long keyPos, long valuePos, boolean added, boolean replicationEvent) {
if (added)
assertEquals(0, entry.readLong(metaDataPos));
entry.writeLong(metaDataPos, timeStamps.incrementAndGet());
}
@Override
public void onRemove(Bytes entry, long metaDataPos, long keyPos, long valuePos) {
public void onRemove(Bytes entry, long metaDataPos, long keyPos, long valuePos, boolean replicationEvent) {
System.out.println("Removed entry with ts of " + entry.readLong(metaDataPos));;
}
}
@@ -56,7 +56,7 @@ public class EventListenerWithTCPSocketReplicationTest {
private static final long serialVersionUID = 1L;
@Override
public void onPut(Integer key, CharSequence value, CharSequence replacedValue) {
public void onPut(Integer key, CharSequence value, CharSequence replacedValue, boolean replicationEvent) {
putWasCalled.getAndSet(true);
keyRef.set(key);
valueRef.set(value);
@@ -64,7 +64,7 @@ public class EventListenerWithTCPSocketReplicationTest {
}
@Override
public void onRemove(Integer key, CharSequence value) {
public void onRemove(Integer key, CharSequence value, boolean replicationEvent) {
wasRemoved.set(true);
valueRemoved.set(value);
}
@@ -43,10 +43,12 @@ public class MarkTest {
});
}
@Test(timeout = 50000)
@Test(timeout = 25000)
public void persistedTest() {
final File db = Paths.get(System.getProperty("java.io.tmpdir"), "mark").toFile();
int rnd = new Random().nextInt();
final File db = Paths.get(System.getProperty("java.io.tmpdir"), "mark" + rnd).toFile();
if (db.exists())
db.delete();
try {
test(new Function<ChronicleMapBuilder<Integer, Integer>,
ChronicleMap<Integer, Integer>>() {
@@ -37,11 +37,15 @@ import static org.junit.Assert.*;
public class ReplicatedChronicleMapTest extends JSR166TestCase {
ChronicleMap<Integer, CharSequence> newShmIntString() throws IOException {
return ChronicleMapBuilder.of(Integer.class, CharSequence.class)
.replication((byte) 1)
.entries(1000)
.create();
}
ChronicleMap<CharSequence, CharSequence> newShmStringString() throws IOException {
return ChronicleMapBuilder.of(CharSequence.class, CharSequence.class)
.replication((byte) 1)
.entries(1000)
.create();
}