Made listeners almost work for replication

This commit is contained in:
leventov
2015-06-02 19:02:55 +01:00
parent 62a50e2aee
commit f1da352a5d
45 changed files with 3472 additions and 3279 deletions
@@ -151,7 +151,7 @@ public class BiMapTest {
@Override
public DualLockSuccess remove(@NotNull MapEntry<K, V> entry) {
try (ExternalMapQueryContext<V, K, ?> rq = reverse.queryContext(entry.value().get())) {
try (ExternalMapQueryContext<V, K, ?> rq = reverse.queryContext(entry.value())) {
if (!rq.updateLock().tryLock()) {
if (entry.context() instanceof MapQueryContext)
return FAIL;
@@ -178,7 +178,7 @@ public class BiMapTest {
@Override
public DualLockSuccess insert(@NotNull MapAbsentEntry<K, V> absentEntry,
Value<V, ?> value) {
try (ExternalMapQueryContext<V, K, ?> rq = reverse.queryContext(value.get())) {
try (ExternalMapQueryContext<V, K, ?> rq = reverse.queryContext(value)) {
if (!rq.updateLock().tryLock())
return FAIL;
MapAbsentEntry<V, K> reverseAbsentEntry = rq.absentEntry();
@@ -78,9 +78,9 @@ public class CHMUseCasesTest {
TypeOfMap.SIMPLE
},
// {
// TypeOfMap.REPLICATED
// },
{
TypeOfMap.REPLICATED
},
// it pointless to run these test as the Function and UnaryOperator are not
// serializable as inner classes adn the getUsingLock is not supported by the
@@ -35,7 +35,6 @@ import static org.junit.Assert.assertTrue;
*
* @author Rob Austin.
*/
@Ignore
public class ChannelReplicationTest {
private ChronicleMap<Integer, CharSequence> map1a;
@@ -35,7 +35,6 @@ import static org.junit.Assert.assertTrue;
*
* @author Rob Austin.
*/
@Ignore
public class PostChannelCreationTest {
private ChronicleMap<Integer, CharSequence> map1a;
@@ -34,7 +34,6 @@ import static org.junit.Assert.*;
* Other contributors include Andrew Wright, Jeffrey Hayes,
* Pat Fisher, Mike Judd. Then modified by the Open HFT team.
*/
@Ignore
public class ReplicatedChronicleMapTest extends JSR166TestCase {
ChronicleMap<Integer, CharSequence> newShmIntString() throws IOException {
return ChronicleMapBuilder.of(Integer.class, CharSequence.class)
@@ -18,6 +18,7 @@
package net.openhft.chronicle.map;
import net.openhft.chronicle.hash.Value;
import net.openhft.chronicle.hash.function.SerializableFunction;
import org.jetbrains.annotations.NotNull;
import org.junit.Assert;
@@ -292,6 +293,12 @@ public class ReplicationCheckingMap<K, V> implements ChronicleMap<K, V> {
throw new UnsupportedOperationException();
}
@NotNull
@Override
public ExternalMapQueryContext<K, V, ?> queryContext(Value<K, ?> key) {
throw new UnsupportedOperationException();
}
@Override
public File file() {
throw new UnsupportedOperationException();
@@ -35,7 +35,6 @@ import static org.junit.Assert.assertTrue;
*
* @author Rob Austin.
*/
@Ignore
public class SingleMapChannelTest {
private ChronicleMap<Integer, CharSequence> map1a;
@@ -39,7 +39,6 @@ import static org.junit.Assert.assertTrue;
*
* @author Rob Austin.
*/
@Ignore
public class TCPSocketReplication3VoidValueTest {
private ChronicleMap<Integer, DummyValue> map1;
@@ -38,7 +38,6 @@ import static org.junit.Assert.assertTrue;
*
* @author Rob Austin.
*/
@Ignore
public class TCPSocketReplication3wayPutReturnsNullTest {
private ChronicleMap<Integer, CharSequence> map1;
@@ -36,7 +36,6 @@ import static org.junit.Assert.*;
*
* @author Rob Austin.
*/
@Ignore
public class TCPSocketReplication3wayTest {
private ChronicleMap<Integer, CharSequence> map1;
@@ -37,7 +37,6 @@ import static org.junit.Assert.assertTrue;
*
* @author Rob Austin.
*/
@Ignore
public class TCPSocketReplication4WayMapTest {
private ChronicleMap<Integer, CharSequence> map1;
@@ -124,7 +123,6 @@ public class TCPSocketReplication4WayMapTest {
@Test
@Ignore("TODO fix this test.")
public void testBufferOverflowPutIfAbsent() throws IOException, InterruptedException {
for (int i = 0; i < 1024; i++) {
map1.putIfAbsent(i, "EXAMPLE-1");
@@ -44,7 +44,6 @@ import static org.junit.Assert.assertTrue;
*
* @author Rob Austin.
*/
@Ignore
public class TCPSocketReplicationIntValueTest {
static int s_port = 8010;
@@ -40,7 +40,6 @@ import static org.junit.Assert.assertTrue;
*
* @author Rob Austin.
*/
@Ignore
public class TCPSocketReplicationNativeTest {
private ChronicleMap<Integer, LongValue> map1;
@@ -37,7 +37,6 @@ import static org.junit.Assert.assertTrue;
*
* @author Rob Austin.
*/
@Ignore
public class TCPSocketReplicationPostConnectionTest {
private static int s_port = 13050;
@@ -40,7 +40,6 @@ import static org.junit.Assert.assertTrue;
*
* @author Rob Austin.
*/
@Ignore
public class TCPSocketReplicationTest {
static int s_port = 12050;
@@ -122,7 +121,6 @@ public class TCPSocketReplicationTest {
assertTrue(!map1.isEmpty());
}
@Ignore("failed on TC")
@Test
public void test2() throws IOException, InterruptedException {
@@ -17,7 +17,6 @@ import java.util.concurrent.TimeUnit;
/**
* @author Rob Austin.
*/
@Ignore
public class TcpReplicationLargeEntryTest {
private ChronicleMap<Integer, CharSequence> map1;
@@ -21,7 +21,6 @@ import java.util.concurrent.TimeUnit;
/**
* @author Rob Austin.
*/
@Ignore
public class TcpReplicationSoakTest {
@@ -11,7 +11,6 @@ import java.net.InetSocketAddress;
/**
* @author Rob Austin.
*/
@Ignore
public class TcpReplicationWithAcquireContextTest {
@@ -19,7 +19,6 @@ import java.util.concurrent.TimeUnit;
/**
* @author Rob Austin.
*/
@Ignore
public class TcpTimeBasedReplicationSoakTest {
@@ -102,7 +101,6 @@ public class TcpTimeBasedReplicationSoakTest {
}
@Ignore("fails on TC")
@Test
public void testSoakTestWithRandomData() throws IOException, InterruptedException {
@@ -19,7 +19,6 @@ import static org.junit.Assert.assertEquals;
/**
* @author Rob Austin.
*/
@Ignore
public class TestEntriesSpanningSeveralChunksReplicationHub {
@@ -12,7 +12,6 @@ import java.net.InetSocketAddress;
/**
* Created by Rob Austin
*/
@Ignore
public class TestReplication {
@@ -40,7 +40,6 @@ import static org.junit.Assert.assertEquals;
/**
* @author Rob Austin.
*/
@Ignore
public class TimeBasedReplicationTest extends JSR166TestCase {
public static final byte IDENTIFIER = 1;
@@ -36,7 +36,6 @@ import static org.junit.Assert.assertTrue;
/**
* @author Rob Austin.
*/
@Ignore
public class TwoMapOnDifferentServersTest {
private ChronicleMap<Integer, CharSequence> map1;
@@ -34,7 +34,6 @@ import java.net.Inet4Address;
*
* @author Rob Austin.
*/
@Ignore
public class UDPSocketReplicationTest {
private ChronicleMap<Integer, CharSequence> map2;
@@ -78,7 +77,6 @@ public class UDPSocketReplicationTest {
}
@Test
@Ignore
public void testBufferOverflow() throws IOException, InterruptedException {
for (int i = 0; i < 1024; i++) {
@@ -18,6 +18,7 @@
package net.openhft.chronicle.map.jsr166.map;
import net.openhft.chronicle.hash.Value;
import net.openhft.chronicle.hash.function.SerializableFunction;
import net.openhft.chronicle.hash.replication.TcpTransportAndNetworkConfig;
import net.openhft.chronicle.map.*;
@@ -120,6 +121,12 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
return d.queryContext(key);
}
@NotNull
@Override
public ExternalMapQueryContext<K, V, ?> queryContext(Value<K, ?> key) {
return d.queryContext(key);
}
@Override
public V get(Object key) {
return d.get(key);
@@ -68,7 +68,6 @@ public class DoubleArrayTest {
}
@Test
@Ignore
public void addToAMap2() {
DoubleArray.HACK = false;
DoubleArray a = new DoubleArray(10);