From df1bb8356e86d082f310b64859bdf6dab18f8461 Mon Sep 17 00:00:00 2001 From: Rob Austin Date: Fri, 3 Oct 2014 10:26:21 +0100 Subject: [PATCH] HCOLL-134 improved test cases --- .../openhft/chronicle/map/TcpReplicator.java | 2 -- .../chronicle/map/ChronicleMapTest.java | 3 +- .../map/TCPSocketReplicationIntValueTest.java | 2 +- .../map/TCPSocketReplicationTest.java | 29 ------------------- .../map/fromdocs/GettingStartedTest.java | 3 +- 5 files changed, 3 insertions(+), 36 deletions(-) diff --git a/src/main/java/net/openhft/chronicle/map/TcpReplicator.java b/src/main/java/net/openhft/chronicle/map/TcpReplicator.java index c0810c89e..61a013ce3 100644 --- a/src/main/java/net/openhft/chronicle/map/TcpReplicator.java +++ b/src/main/java/net/openhft/chronicle/map/TcpReplicator.java @@ -751,8 +751,6 @@ class TcpReplicator extends AbstractChannelReplicator implements Closeable { if (remoteIdentifier != Byte.MIN_VALUE) TcpReplicator.this.opWriteUpdater.set(remoteIdentifier); - - selector.wakeup(); } diff --git a/src/test/java/net/openhft/chronicle/map/ChronicleMapTest.java b/src/test/java/net/openhft/chronicle/map/ChronicleMapTest.java index 3277f74db..aaa6ec54d 100644 --- a/src/test/java/net/openhft/chronicle/map/ChronicleMapTest.java +++ b/src/test/java/net/openhft/chronicle/map/ChronicleMapTest.java @@ -202,10 +202,9 @@ public class ChronicleMapTest { } @Test - @Ignore //todo: fails on my machine public void testRemoveInteger() throws IOException { - int count = 3000; + int count = 300; final ChronicleMap map = ChronicleMapBuilder.of(Object.class, Object.class) .entrySize(count) .minSegments(2) diff --git a/src/test/java/net/openhft/chronicle/map/TCPSocketReplicationIntValueTest.java b/src/test/java/net/openhft/chronicle/map/TCPSocketReplicationIntValueTest.java index 2671e4d40..aa28fa89c 100644 --- a/src/test/java/net/openhft/chronicle/map/TCPSocketReplicationIntValueTest.java +++ b/src/test/java/net/openhft/chronicle/map/TCPSocketReplicationIntValueTest.java @@ -95,6 +95,7 @@ public class TCPSocketReplicationIntValueTest { } + // see https://higherfrequencytrading.atlassian.net/browse/HCOLL-148 @Test @Ignore public void test() throws IOException, InterruptedException { @@ -155,7 +156,6 @@ public class TCPSocketReplicationIntValueTest { @Test public void testSoakTestWithRandomData() throws IOException, InterruptedException { - final long start = System.currentTimeMillis(); System.out.print("SoakTesting "); for (int j = 1; j < 100 * 1000; j++) { diff --git a/src/test/java/net/openhft/chronicle/map/TCPSocketReplicationTest.java b/src/test/java/net/openhft/chronicle/map/TCPSocketReplicationTest.java index 52fc00cac..022c29f7e 100644 --- a/src/test/java/net/openhft/chronicle/map/TCPSocketReplicationTest.java +++ b/src/test/java/net/openhft/chronicle/map/TCPSocketReplicationTest.java @@ -18,7 +18,6 @@ package net.openhft.chronicle.map; import org.junit.After; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import java.io.Closeable; @@ -136,7 +135,6 @@ public class TCPSocketReplicationTest { @Test - @Ignore public void testSoakTestWithRandomData() throws IOException, InterruptedException { final long start = System.currentTimeMillis(); System.out.print("SoakTesting "); @@ -167,35 +165,8 @@ public class TCPSocketReplicationTest { } - @Ignore - @Test - public void testObjectAllocationWithYourKit() throws IOException, InterruptedException { - System.out.print("SoakTesting "); - for (; ; ) { - - Random rnd = new Random(0); - for (int i = 1; i < 10; i++) { - - final int select = rnd.nextInt(2); - final ChronicleMap map = select > 0 ? map1 : map2; - - switch (rnd.nextInt(2)) { - case 0: - map.put(rnd.nextInt(1000) /* + select * 100 */, "test"); - break; - case 1: - map.remove(rnd.nextInt(1000) /*+ select * 100 */); - break; - } - } - - } - - - } - } diff --git a/src/test/java/net/openhft/chronicle/map/fromdocs/GettingStartedTest.java b/src/test/java/net/openhft/chronicle/map/fromdocs/GettingStartedTest.java index cde364bb9..8e338784a 100644 --- a/src/test/java/net/openhft/chronicle/map/fromdocs/GettingStartedTest.java +++ b/src/test/java/net/openhft/chronicle/map/fromdocs/GettingStartedTest.java @@ -17,7 +17,6 @@ package net.openhft.chronicle.map.fromdocs; import net.openhft.chronicle.map.ChronicleMapBuilder; -import org.junit.Ignore; import org.junit.Test; import java.io.Closeable; @@ -31,8 +30,8 @@ import static org.junit.Assert.assertEquals; * Created by peter on 28/02/14. */ public class GettingStartedTest { + @Test - @Ignore public void testTheCodeInGuide() throws IOException { String tmpdir = System.getProperty("java.io.tmpdir"); Map map = ChronicleMapBuilder.of(String.class, String.class)