mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
HCOLL-325 Issue when bootstrapping with a large number of entries, and removed a few @Ignores on tests that should work.
This commit is contained in:
@@ -33,7 +33,6 @@ public class BooleanValuesTest {
|
||||
* see issue http://stackoverflow.com/questions/26219313/strange-npe-from-chronicle-map-toy-code
|
||||
*/
|
||||
@Test
|
||||
@Ignore
|
||||
public void testTestBooleanValues() throws IOException, InterruptedException {
|
||||
try (ChronicleMap<Integer, Boolean> map =
|
||||
ChronicleMapBuilder.of(Integer.class, Boolean.class).create()) {
|
||||
|
||||
@@ -415,7 +415,7 @@ public class CHMUseCasesTest {
|
||||
}
|
||||
|
||||
|
||||
@Ignore
|
||||
@Ignore
|
||||
@Test
|
||||
public void testByteArrayArrayValue() throws ExecutionException, InterruptedException, IOException {
|
||||
|
||||
@@ -2538,7 +2538,7 @@ public class CHMUseCasesTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Ignore
|
||||
|
||||
@Test
|
||||
public void testMapStringIntegerValue() throws IOException {
|
||||
|
||||
|
||||
@@ -43,7 +43,6 @@ import static net.openhft.chronicle.map.StatelessClientTest.localClient;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
@SuppressWarnings({"unchecked", "ResultOfMethodCallIgnored"})
|
||||
@Ignore
|
||||
public class ChronicleMapTest {
|
||||
|
||||
static long count = 0;
|
||||
|
||||
@@ -20,7 +20,6 @@ import java.util.concurrent.TimeUnit;
|
||||
/**
|
||||
* @author Rob Austin.
|
||||
*/
|
||||
@Ignore
|
||||
public class TcpReplicationSoakTest {
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package net.openhft.chronicle.map;
|
||||
|
||||
import net.openhft.chronicle.hash.replication.TcpTransportAndNetworkConfig;
|
||||
import net.openhft.chronicle.map.ChronicleMap;
|
||||
import net.openhft.chronicle.map.ChronicleMapBuilder;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
|
||||
/**
|
||||
* Created by Rob Austin
|
||||
*/
|
||||
public class TestReplication {
|
||||
|
||||
|
||||
@Test
|
||||
public void testAllDataGetsReplicated() throws InterruptedException {
|
||||
|
||||
|
||||
TcpTransportAndNetworkConfig tcpConfigServer1 =
|
||||
TcpTransportAndNetworkConfig.of(8082);
|
||||
|
||||
TcpTransportAndNetworkConfig tcpConfigServer2 =
|
||||
TcpTransportAndNetworkConfig.of(8083, new InetSocketAddress("localhost",
|
||||
8082));
|
||||
|
||||
final ChronicleMap<Integer, Integer> map2 = ChronicleMapBuilder.of(Integer.class,
|
||||
Integer.class)
|
||||
.replication((byte) 2, tcpConfigServer2)
|
||||
.create();
|
||||
|
||||
|
||||
final ChronicleMap<Integer, Integer> map1 = ChronicleMapBuilder.of(Integer.class,
|
||||
Integer.class)
|
||||
.replication((byte) 1, tcpConfigServer1)
|
||||
.create();
|
||||
|
||||
|
||||
for (int i = 0; i < 7000; i++) {
|
||||
map1.put(i, i);
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
|
||||
Thread.sleep(100);
|
||||
System.out.println(map2.size());
|
||||
}
|
||||
|
||||
|
||||
Assert.assertEquals(map1.size(),map2.size());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user