mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Remove double and triple blank lines
This commit is contained in:
@@ -18,7 +18,6 @@
|
||||
|
||||
package net.openhft.chronicle.map;
|
||||
|
||||
|
||||
import net.openhft.chronicle.hash.replication.TcpTransportAndNetworkConfig;
|
||||
|
||||
import java.io.File;
|
||||
@@ -59,7 +58,6 @@ public class Builder {
|
||||
return file;
|
||||
}
|
||||
|
||||
|
||||
public static <T extends ChronicleMap<Integer, Void>> T newMapVoid(
|
||||
final byte identifier,
|
||||
final int serverPort,
|
||||
@@ -80,5 +78,4 @@ public class Builder {
|
||||
.replication(identifier, tcpConfig);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -42,7 +42,6 @@ public class CHMTestIterator1 {
|
||||
chm.put("k5", alValue.incrementAndGet());*/
|
||||
//chm.keySet();
|
||||
|
||||
|
||||
for (int i = 0; i < runs; i++) {
|
||||
chm.put("k" + alKey.incrementAndGet(), alValue.incrementAndGet());
|
||||
}
|
||||
@@ -59,5 +58,4 @@ public class CHMTestIterator1 {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -477,7 +477,6 @@ public class CHMUseCasesTest {
|
||||
|
||||
assertBBEquals(ByteBuffer.wrap(new byte[]{12, 10, 11, 11}), map.get(key1));
|
||||
|
||||
|
||||
map.put(key1, value1);
|
||||
map.put(key2, value2);
|
||||
ByteBuffer valueA = ByteBuffer.allocateDirect(8);
|
||||
@@ -500,7 +499,6 @@ public class CHMUseCasesTest {
|
||||
assertBBEquals(value2, valueB);
|
||||
}
|
||||
|
||||
|
||||
try (WriteContext wc = map.acquireUsingLocked(key1, valueA)) {
|
||||
assertBBEquals(value1, valueA);
|
||||
appendMode(valueA);
|
||||
@@ -591,7 +589,6 @@ public class CHMUseCasesTest {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void assertBBEquals(ByteBuffer bb1, ByteBuffer bb2) {
|
||||
assertEquals(bb1.remaining(), bb2.remaining());
|
||||
for (int i = 0; i < bb1.remaining(); i++)
|
||||
@@ -1421,7 +1418,6 @@ public class CHMUseCasesTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testListValue() {
|
||||
try (ChronicleMap<String, List<String>> map = ChronicleMapBuilder
|
||||
|
||||
@@ -18,10 +18,12 @@
|
||||
|
||||
package net.openhft.chronicle.map;
|
||||
|
||||
|
||||
import net.openhft.chronicle.hash.replication.ReplicationHub;
|
||||
import net.openhft.chronicle.hash.replication.TcpTransportAndNetworkConfig;
|
||||
import org.junit.*;
|
||||
import org.junit.After;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
@@ -104,7 +106,6 @@ public class ChannelReplicationTest {
|
||||
StatelessClientTest.checkThreadsShutdown(threads);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void test() throws IOException, InterruptedException {
|
||||
|
||||
@@ -132,7 +133,6 @@ public class ChannelReplicationTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* waits until map1 and map2 show the same value
|
||||
*
|
||||
@@ -152,5 +152,3 @@ public class ChannelReplicationTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ import static org.junit.Assert.assertEquals;
|
||||
*/
|
||||
public class ChronicleMapImportExportTest {
|
||||
|
||||
|
||||
public static final String TMP = System.getProperty("java.io.tmpdir");
|
||||
|
||||
@Test
|
||||
@@ -47,10 +46,8 @@ public class ChronicleMapImportExportTest {
|
||||
file.delete();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testWithMapValue() throws IOException, InterruptedException {
|
||||
|
||||
@@ -81,7 +78,6 @@ public class ChronicleMapImportExportTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testWithMapOfMapValue() throws IOException, InterruptedException {
|
||||
|
||||
@@ -112,10 +108,8 @@ public class ChronicleMapImportExportTest {
|
||||
file.delete();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testWithIntegerAndDouble() throws IOException, InterruptedException {
|
||||
|
||||
@@ -126,10 +120,8 @@ public class ChronicleMapImportExportTest {
|
||||
.class)
|
||||
.create()) {
|
||||
|
||||
|
||||
expected.put(1, 1.0);
|
||||
|
||||
|
||||
expected.getAll(file);
|
||||
|
||||
try (ChronicleMap<Integer, Double> actual = ChronicleMapBuilder.of(Integer.class, Double
|
||||
@@ -144,10 +136,8 @@ public class ChronicleMapImportExportTest {
|
||||
file.delete();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testWithCharSeq() throws IOException, InterruptedException {
|
||||
|
||||
@@ -159,10 +149,8 @@ public class ChronicleMapImportExportTest {
|
||||
.class)
|
||||
.create()) {
|
||||
|
||||
|
||||
expected.put("hello", "world");
|
||||
|
||||
|
||||
expected.getAll(file);
|
||||
|
||||
try (ChronicleMap<CharSequence, CharSequence> actual = ChronicleMapBuilder.of(CharSequence.class, CharSequence
|
||||
@@ -177,7 +165,6 @@ public class ChronicleMapImportExportTest {
|
||||
file.delete();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Ignore("this type of off heap reference is not currently supported")
|
||||
@@ -216,7 +203,6 @@ public class ChronicleMapImportExportTest {
|
||||
file.delete();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -186,7 +186,6 @@ public class ChronicleMapTest {
|
||||
.minSegments(1024)
|
||||
.removeReturnsNull(true).create();
|
||||
|
||||
|
||||
for (int i = 1; i < 1024; i++) {
|
||||
map.put("key" + i, "value");
|
||||
assertEquals(i, map.size());
|
||||
@@ -208,7 +207,6 @@ public class ChronicleMapTest {
|
||||
.entrySize(count)
|
||||
.minSegments(2).create();
|
||||
|
||||
|
||||
for (int i = 1; i < count; i++) {
|
||||
map.put(i, i);
|
||||
assertEquals(i, map.size());
|
||||
@@ -278,7 +276,6 @@ public class ChronicleMapTest {
|
||||
ChronicleMapBuilder.of(CharSequence.class, CharSequence.class)
|
||||
.minSegments(2).create();
|
||||
|
||||
|
||||
map.put("key1", "one");
|
||||
map.put("key2", "two");
|
||||
assertEquals(2, map.size());
|
||||
@@ -385,26 +382,22 @@ public class ChronicleMapTest {
|
||||
ChronicleMapBuilder.of(CharSequence.class, CharSequence.class)
|
||||
.minSegments(2).create();
|
||||
|
||||
|
||||
map.put("key1", "one");
|
||||
map.put("key2", "two");
|
||||
|
||||
assertEquals("one", map.get("key1"));
|
||||
assertEquals("two", map.get("key2"));
|
||||
|
||||
|
||||
// a false remove
|
||||
final boolean wasRemoved1 = map.remove("key1", "three");
|
||||
|
||||
assertFalse(wasRemoved1);
|
||||
|
||||
|
||||
assertEquals(null, map.get("key1"), "one");
|
||||
assertEquals("two", map.get("key2"), "two");
|
||||
|
||||
map.put("key1", "one");
|
||||
|
||||
|
||||
final boolean wasRemoved2 = map.remove("key1", "three");
|
||||
assertFalse(wasRemoved2);
|
||||
|
||||
@@ -539,7 +532,6 @@ public class ChronicleMapTest {
|
||||
testAcquireFromMultipleThreads(getSharedMap(entries, 128, 24, OF_8_BYTES));
|
||||
}
|
||||
|
||||
|
||||
public void testAcquireFromMultipleThreads(ChronicleMap<CharSequence, LongValue> map)
|
||||
throws Exception {
|
||||
|
||||
@@ -1406,7 +1398,6 @@ public class ChronicleMapTest {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Ignore("JIRA raised for failing test HCOLL-222")
|
||||
@Test
|
||||
public void testPutLongValue() throws IOException {
|
||||
@@ -1432,7 +1423,6 @@ public class ChronicleMapTest {
|
||||
|
||||
LongValue value = nativeLongValue();
|
||||
|
||||
|
||||
// this will add the entry
|
||||
try (WriteContext<?, LongValue> context = map.acquireUsingLocked("one", value)) {
|
||||
assertEquals(0, context.value().getValue());
|
||||
@@ -1448,7 +1438,6 @@ public class ChronicleMapTest {
|
||||
assertEquals(1, context.value().getValue());
|
||||
}
|
||||
|
||||
|
||||
// this will remove the entry
|
||||
try (WriteContext<?, LongValue> context = map.acquireUsingLocked("one", value)) {
|
||||
assert value == context.value();
|
||||
@@ -1461,13 +1450,11 @@ public class ChronicleMapTest {
|
||||
assertEquals(null, context.value());
|
||||
}
|
||||
|
||||
|
||||
try (WriteContext<?, LongValue> context = map.acquireUsingLocked("one", value)) {
|
||||
assert value == context.value();
|
||||
assertEquals(0, context.value().getValue());
|
||||
}
|
||||
|
||||
|
||||
try (WriteContext<?, LongValue> context = map.acquireUsingLocked("one", value)) {
|
||||
assert value == context.value();
|
||||
context.value().addValue(1);
|
||||
@@ -1482,7 +1469,6 @@ public class ChronicleMapTest {
|
||||
map.close();
|
||||
}
|
||||
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void testAcquireUsingLockedWithString() throws IOException {
|
||||
|
||||
@@ -1492,22 +1478,17 @@ public class ChronicleMapTest {
|
||||
.defaultValue("")
|
||||
.entrySize(16);
|
||||
|
||||
|
||||
try (final ChronicleMap<CharSequence, String> map = builder.create()) {
|
||||
|
||||
|
||||
// this will add the entry
|
||||
try (WriteContext<?, String> context = map.acquireUsingLocked("one", "")) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testOnheapAcquireUsingLockedStringBuilder() throws IOException {
|
||||
|
||||
@@ -1528,7 +1509,6 @@ public class ChronicleMapTest {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testOnheapAcquireUsingLocked() throws IOException {
|
||||
ChronicleMapBuilder<CharSequence, LongValue> builder = ChronicleMapBuilder
|
||||
@@ -1541,7 +1521,6 @@ public class ChronicleMapTest {
|
||||
|
||||
LongValue value = DataValueClasses.newDirectReference(LongValue.class);
|
||||
|
||||
|
||||
try (ReadContext<?, LongValue> context = map.getUsingLocked("one", value)) {
|
||||
assertEquals(false, context.present());
|
||||
assertEquals(null, context.value());
|
||||
@@ -1563,7 +1542,6 @@ public class ChronicleMapTest {
|
||||
assertEquals(11, context.value().getValue());
|
||||
}
|
||||
|
||||
|
||||
// this will remove the entry
|
||||
try (WriteContext<?, LongValue> context = map.acquireUsingLocked("one", value)) {
|
||||
context.removeEntry();
|
||||
@@ -1600,4 +1578,3 @@ public class ChronicleMapTest {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@ public class ConcurrentMap8Test extends JSR166TestCase {
|
||||
|
||||
final ChronicleMapOnHeapUpdatableBuilder<Long, Long> builder = ChronicleMapBuilder.of(Long.class, Long.class);
|
||||
|
||||
|
||||
//// don't include this, just to check it is as expected.
|
||||
assertEquals(8, builder.minSegments());
|
||||
//// end of test
|
||||
@@ -56,18 +55,15 @@ public class ConcurrentMap8Test extends JSR166TestCase {
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
|
||||
|
||||
// return new ConcurrentMap(5);
|
||||
|
||||
}
|
||||
|
||||
private static ConcurrentMap newIntegerStringMap() {
|
||||
|
||||
|
||||
final ChronicleMapOnHeapUpdatableBuilder<Integer, String> builder = ChronicleMapBuilder.of(Integer.class,
|
||||
String.class);
|
||||
|
||||
|
||||
//// don't include this, just to check it is as expected.
|
||||
assertEquals(8, builder.minSegments());
|
||||
//// end of test
|
||||
@@ -80,7 +76,6 @@ public class ConcurrentMap8Test extends JSR166TestCase {
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
*//**
|
||||
|
||||
@@ -24,7 +24,6 @@ public class DemoChronicleMapTest {
|
||||
.entries(maxEntries)
|
||||
.createPersistedTo(file)) {
|
||||
|
||||
|
||||
IntValue key = DataValueClasses.newDirectInstance(IntValue.class);
|
||||
|
||||
DemoOrderVOInterface value = DataValueClasses.newDirectReference(DemoOrderVOInterface.class);
|
||||
@@ -55,7 +54,6 @@ public class DemoChronicleMapTest {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testMapLocked() throws Exception {
|
||||
File file = File.createTempFile("DummyOrders", ".test");
|
||||
@@ -68,7 +66,6 @@ public class DemoChronicleMapTest {
|
||||
.entries(maxEntries)
|
||||
.createPersistedTo(file)) {
|
||||
|
||||
|
||||
IntValue key = DataValueClasses.newDirectInstance(IntValue.class);
|
||||
|
||||
DemoOrderVOInterface value = DataValueClasses.newDirectReference(DemoOrderVOInterface.class);
|
||||
|
||||
@@ -198,5 +198,4 @@ public class EntryCountMapTest {
|
||||
return sum;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
-16
@@ -37,7 +37,6 @@ import java.util.concurrent.atomic.AtomicReference;
|
||||
*/
|
||||
public class EventListenerTestWithTCPSocketReplication {
|
||||
|
||||
|
||||
ChronicleMap<Integer, CharSequence> map1;
|
||||
ChronicleMap<Integer, CharSequence> map2;
|
||||
|
||||
@@ -69,7 +68,6 @@ public class EventListenerTestWithTCPSocketReplication {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@After
|
||||
public void tearDown() throws InterruptedException {
|
||||
|
||||
@@ -89,11 +87,9 @@ public class EventListenerTestWithTCPSocketReplication {
|
||||
System.gc();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testAdded() throws IOException, InterruptedException {
|
||||
|
||||
|
||||
// ---------- SERVER1 1 ----------
|
||||
{
|
||||
|
||||
@@ -123,10 +119,8 @@ public class EventListenerTestWithTCPSocketReplication {
|
||||
Assert.assertEquals(Integer.valueOf(5), keyRef.get());
|
||||
Assert.assertEquals("EXAMPLE", valueRef.get());
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testRemoteNotifyPutLargerValue() throws IOException, InterruptedException {
|
||||
|
||||
@@ -139,7 +133,6 @@ public class EventListenerTestWithTCPSocketReplication {
|
||||
|
||||
map1 = map1Builder.create();
|
||||
|
||||
|
||||
}
|
||||
// ---------- SERVER2 2 on the same server as ----------
|
||||
|
||||
@@ -149,12 +142,10 @@ public class EventListenerTestWithTCPSocketReplication {
|
||||
map2.put(5, "WILL_GET_OVER-WRITTEN");
|
||||
}
|
||||
|
||||
|
||||
// we will stores some data into one map here
|
||||
map1.put(5, "EXAMPLE");
|
||||
waitTillReplicated();
|
||||
|
||||
|
||||
Assert.assertTrue("The eventListener.onPut should have been called", putWasCalled.get());
|
||||
Assert.assertEquals(Integer.valueOf(5), keyRef.get());
|
||||
Assert.assertEquals("EXAMPLE", valueRef.get());
|
||||
@@ -162,11 +153,9 @@ public class EventListenerTestWithTCPSocketReplication {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testRemoteNotifyPutSmallerValue() throws IOException, InterruptedException {
|
||||
|
||||
|
||||
// ---------- SERVER1 1 ----------
|
||||
{
|
||||
|
||||
@@ -183,13 +172,11 @@ public class EventListenerTestWithTCPSocketReplication {
|
||||
map2.put(5, "small");
|
||||
}
|
||||
|
||||
|
||||
// we will stores some data into one map here
|
||||
map1.put(5, "EXAMPLE");
|
||||
|
||||
waitTillReplicated();
|
||||
|
||||
|
||||
Assert.assertTrue("The eventListener.onPut should have been called", putWasCalled.get());
|
||||
Assert.assertEquals(Integer.valueOf(5), keyRef.get());
|
||||
Assert.assertEquals("small", replacedValueRef.get());
|
||||
@@ -197,7 +184,6 @@ public class EventListenerTestWithTCPSocketReplication {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@Ignore("TODO Failing test")
|
||||
public void testRemoteNotifyRemove() throws IOException, InterruptedException {
|
||||
@@ -211,7 +197,6 @@ public class EventListenerTestWithTCPSocketReplication {
|
||||
|
||||
map1 = map1Builder.create();
|
||||
|
||||
|
||||
}
|
||||
|
||||
// ---------- SERVER2 2 on the same server as ----------
|
||||
@@ -247,7 +232,6 @@ public class EventListenerTestWithTCPSocketReplication {
|
||||
.eventListener(eventListener);
|
||||
}
|
||||
|
||||
|
||||
private void waitTillReplicated() throws InterruptedException {
|
||||
int t = 0;
|
||||
for (; t < 5000; t++) {
|
||||
|
||||
@@ -32,7 +32,6 @@ import java.util.Map;
|
||||
|
||||
import static com.google.common.collect.testing.features.MapFeature.*;
|
||||
|
||||
|
||||
public class GuavaTest extends TestCase {
|
||||
|
||||
public static Test suite() {
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
package net.openhft.chronicle.map;
|
||||
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
import net.openhft.lang.collection.SingleThreadedDirectBitSet;
|
||||
|
||||
@@ -28,7 +28,6 @@ import java.nio.ByteBuffer;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
|
||||
/**
|
||||
* @author Rob Austin.
|
||||
*/
|
||||
|
||||
@@ -32,7 +32,6 @@ import static junit.framework.Assert.assertEquals;
|
||||
*/
|
||||
public class MapByNameTest {
|
||||
|
||||
|
||||
private ReplicationHubFindByName<CharSequence> findMapByName;
|
||||
|
||||
@Before
|
||||
@@ -66,7 +65,6 @@ public class MapByNameTest {
|
||||
// findMapByName.get("hello");
|
||||
// }
|
||||
|
||||
|
||||
@Test
|
||||
@Ignore("currently work in progress")
|
||||
public void testConnectByName() throws IOException, InterruptedException, TimeoutException {
|
||||
@@ -89,7 +87,6 @@ public class MapByNameTest {
|
||||
public static void main(String... args) throws IOException, InterruptedException, TimeoutException {
|
||||
NodeDiscovery nodeDiscovery = new NodeDiscovery();
|
||||
|
||||
|
||||
final ReplicationHubFindByName<CharSequence> mapByName = nodeDiscovery.mapByName();
|
||||
Thread.sleep(2000);
|
||||
|
||||
@@ -105,7 +102,6 @@ public class MapByNameTest {
|
||||
|
||||
// final ChronicleMap<CharSequence, CharSequence> map = mapByName.from("myMap5");
|
||||
|
||||
|
||||
// allow time for replication
|
||||
Thread.sleep(2000);
|
||||
System.out.print(map);
|
||||
|
||||
@@ -35,11 +35,9 @@ public class NodeDiscoveryBroadcasterTest extends TestCase {
|
||||
public static final int SERVER2_IDENTIFER = 10;
|
||||
public static final int PROPOSED_IDENTIFIER = 5;
|
||||
|
||||
|
||||
@Test
|
||||
public void testsTheSerializationOfTheNodeDiscovery() throws IOException, InterruptedException {
|
||||
|
||||
|
||||
AtomicReference ref = new AtomicReference();
|
||||
final AddressAndPort ourAddressAndPort1 = new AddressAndPort(InetAddress.getLocalHost()
|
||||
.getAddress(),
|
||||
@@ -81,7 +79,6 @@ public class NodeDiscoveryBroadcasterTest extends TestCase {
|
||||
|
||||
// add our identifier and host:port to the list of known identifiers
|
||||
|
||||
|
||||
// SERVER 2 - is the node already in the cluster
|
||||
// read the bootstrap along with the host and port it came from
|
||||
{
|
||||
@@ -101,7 +98,6 @@ public class NodeDiscoveryBroadcasterTest extends TestCase {
|
||||
|
||||
// RemoteNodes remoteNodes = new RemoteNodes(bitSetBytes);
|
||||
|
||||
|
||||
udpData.clear();
|
||||
|
||||
// broadcasts in response to the bootstrap all the host:ports and identifiers that it knows about
|
||||
@@ -111,7 +107,6 @@ public class NodeDiscoveryBroadcasterTest extends TestCase {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// SERER1
|
||||
// receive
|
||||
|
||||
@@ -160,7 +155,6 @@ public class NodeDiscoveryBroadcasterTest extends TestCase {
|
||||
(new DiscoveryNodeBytesMarshallable.ProposedNodes(server1AddressAndPort, (byte) PROPOSED_IDENTIFIER)));
|
||||
}
|
||||
|
||||
|
||||
// SERVER 2
|
||||
// write/broadcast the the response to receiving a bootstrap message
|
||||
{
|
||||
@@ -169,7 +163,6 @@ public class NodeDiscoveryBroadcasterTest extends TestCase {
|
||||
|
||||
// RemoteNodes remoteNodes = new RemoteNodes(bitSetBytes);
|
||||
|
||||
|
||||
udpData.clear();
|
||||
|
||||
// broadcasts in response to the bootstrap all the host:ports and identifiers that it knows about
|
||||
@@ -179,7 +172,6 @@ public class NodeDiscoveryBroadcasterTest extends TestCase {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// SERVER 1
|
||||
// read the bootstrap along with all the proposed identifiers ( this will include our
|
||||
// PROPOSED_IDENTIFIER and any that come from other server
|
||||
@@ -198,8 +190,6 @@ public class NodeDiscoveryBroadcasterTest extends TestCase {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
package net.openhft.chronicle.map;
|
||||
|
||||
|
||||
import net.openhft.chronicle.hash.replication.ReplicationHub;
|
||||
import net.openhft.chronicle.hash.replication.TcpTransportAndNetworkConfig;
|
||||
import org.junit.After;
|
||||
@@ -57,7 +56,6 @@ public class PostChannelCreationTest {
|
||||
return file;
|
||||
}
|
||||
|
||||
|
||||
@Before
|
||||
public void setup() throws IOException {
|
||||
|
||||
@@ -79,7 +77,6 @@ public class PostChannelCreationTest {
|
||||
.instance().replicatedViaChannel(hubA.createChannel((short) 2)).create();
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
final TcpTransportAndNetworkConfig tcpConfig = TcpTransportAndNetworkConfig
|
||||
.of(8087, new InetSocketAddress("localhost", 8086))
|
||||
@@ -98,7 +95,6 @@ public class PostChannelCreationTest {
|
||||
.instance().replicatedViaChannel(hubB.createChannel((short) 2)).create();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@After
|
||||
@@ -114,7 +110,6 @@ public class PostChannelCreationTest {
|
||||
System.gc();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* sets up a 2 clusters ( notionally one for each host ), and replicates 2 Chronicle Maps between them
|
||||
*
|
||||
@@ -138,7 +133,6 @@ public class PostChannelCreationTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* waits until map1 and map2 show the same value
|
||||
*
|
||||
@@ -158,5 +152,3 @@ public class PostChannelCreationTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -41,14 +41,12 @@ public class ReplicatedChronicleMapTest extends JSR166TestCase {
|
||||
|
||||
}
|
||||
|
||||
|
||||
ChronicleMap<CharSequence, CharSequence> newShmStringString() throws IOException {
|
||||
return ChronicleMapBuilder.of(CharSequence.class, CharSequence.class)
|
||||
.create();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a new map from Integers 1-5 to Strings "A"-"E".
|
||||
*/
|
||||
@@ -119,7 +117,6 @@ public class ReplicatedChronicleMapTest extends JSR166TestCase {
|
||||
assertFalse(map.containsValue("Z"));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Inserted elements that are subclasses of the same Comparable
|
||||
* class are found.
|
||||
|
||||
@@ -104,7 +104,6 @@ public class ReplicationCheckingMap<K, V> implements ChronicleMap<K, V> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
Assert.assertEquals(map1, map2);
|
||||
System.out.print(map1);
|
||||
System.out.print(map2);
|
||||
@@ -112,7 +111,6 @@ public class ReplicationCheckingMap<K, V> implements ChronicleMap<K, V> {
|
||||
if (r1 != null)
|
||||
Assert.assertEquals(r1.toString(), r2.toString());
|
||||
|
||||
|
||||
return (R) r1;
|
||||
|
||||
}
|
||||
@@ -133,7 +131,6 @@ public class ReplicationCheckingMap<K, V> implements ChronicleMap<K, V> {
|
||||
@Override
|
||||
public boolean containsKey(final Object key) {
|
||||
|
||||
|
||||
return check(new Call<K, V>() {
|
||||
@Override
|
||||
public Object method(ConcurrentMap<K, V> map) {
|
||||
@@ -160,7 +157,6 @@ public class ReplicationCheckingMap<K, V> implements ChronicleMap<K, V> {
|
||||
@Override
|
||||
public V get(final Object key) {
|
||||
|
||||
|
||||
return check(new Call<K, V>() {
|
||||
@Override
|
||||
public Object method(ConcurrentMap<K, V> map) {
|
||||
@@ -195,7 +191,6 @@ public class ReplicationCheckingMap<K, V> implements ChronicleMap<K, V> {
|
||||
@Override
|
||||
public Set<K> keySet() {
|
||||
|
||||
|
||||
return check(new Call<K, V>() {
|
||||
@Override
|
||||
public Object method(ConcurrentMap<K, V> map) {
|
||||
@@ -210,7 +205,6 @@ public class ReplicationCheckingMap<K, V> implements ChronicleMap<K, V> {
|
||||
@Override
|
||||
public Collection<V> values() {
|
||||
|
||||
|
||||
return check(new Call<K, V>() {
|
||||
@Override
|
||||
public Collection<V> method(ConcurrentMap<K, V> map) {
|
||||
@@ -326,5 +320,4 @@ public class ReplicationCheckingMap<K, V> implements ChronicleMap<K, V> {
|
||||
Object method(ConcurrentMap<K, V> map);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -47,7 +47,6 @@ public class SerializerTest {
|
||||
testReadWriteValue(new MyTestClassObjectGraph(3));
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testKeyMarshallable() throws Exception {
|
||||
testReadWriteKey("Test");
|
||||
@@ -64,7 +63,6 @@ public class SerializerTest {
|
||||
testReadWriteKey(new MyTestClassObjectGraph(3));
|
||||
}
|
||||
|
||||
|
||||
public void testReadWriteValue(Object value) throws Exception {
|
||||
|
||||
Class valueClass = value.getClass();
|
||||
@@ -72,12 +70,10 @@ public class SerializerTest {
|
||||
final ByteBufferBytes out = new ByteBufferBytes(ByteBuffer.allocateDirect(1024));
|
||||
ByteBufferBytes in = out.slice();
|
||||
|
||||
|
||||
ChronicleMapBuilder cBuilder = ChronicleMapBuilder.of(Integer.class, valueClass);
|
||||
|
||||
OnHeapUpdatableChronicleMapBuilder builder = (OnHeapUpdatableChronicleMapBuilder) cBuilder.delegate;
|
||||
|
||||
|
||||
builder.preMapConstruction(false);
|
||||
|
||||
WriterWithSize valueWriterWithSize = new WriterWithSize(builder.valueBuilder);
|
||||
@@ -88,12 +84,10 @@ public class SerializerTest {
|
||||
long position = out.position();
|
||||
in.limit(position);
|
||||
|
||||
|
||||
Object actual = valueReaderWithSize.read(in, null);
|
||||
Assert.assertEquals(actual, value);
|
||||
}
|
||||
|
||||
|
||||
public void testReadWriteKey(Object key) throws Exception {
|
||||
|
||||
Class clazz = key.getClass();
|
||||
@@ -120,7 +114,6 @@ public class SerializerTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static class MyTestClassExternalizable implements Externalizable {
|
||||
@@ -129,7 +122,6 @@ public class SerializerTest {
|
||||
public MyTestClassExternalizable() {
|
||||
}
|
||||
|
||||
|
||||
MyTestClassExternalizable(int a) {
|
||||
this.a = a;
|
||||
}
|
||||
@@ -263,5 +255,4 @@ public class SerializerTest {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
package net.openhft.chronicle.map;
|
||||
|
||||
|
||||
import net.openhft.chronicle.hash.replication.ReplicationHub;
|
||||
import net.openhft.chronicle.hash.replication.TcpTransportAndNetworkConfig;
|
||||
import org.junit.After;
|
||||
@@ -55,7 +54,6 @@ public class SingleMapChannelTest {
|
||||
return file;
|
||||
}
|
||||
|
||||
|
||||
@Before
|
||||
public void setup() throws IOException {
|
||||
|
||||
@@ -76,7 +74,6 @@ public class SingleMapChannelTest {
|
||||
.instance().replicatedViaChannel(hubA.createChannel((short) 1)).create();
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
final TcpTransportAndNetworkConfig tcpConfig = TcpTransportAndNetworkConfig
|
||||
.of(8087, new InetSocketAddress("localhost", 8086))
|
||||
@@ -107,7 +104,6 @@ public class SingleMapChannelTest {
|
||||
System.gc();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void test() throws IOException, InterruptedException {
|
||||
|
||||
@@ -118,13 +114,10 @@ public class SingleMapChannelTest {
|
||||
|
||||
Assert.assertEquals("map1a=map1b", map1a, map1b);
|
||||
|
||||
|
||||
assertTrue("map1a.empty", !map1a.isEmpty());
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* waits until map1 and map2 show the same value
|
||||
*
|
||||
@@ -144,5 +137,3 @@ public class SingleMapChannelTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -75,7 +75,6 @@ public class TCPSocketReplication3VoidValueTest {
|
||||
StatelessClientTest.checkThreadsShutdown(threads);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void test3() throws IOException, InterruptedException {
|
||||
|
||||
@@ -111,7 +110,6 @@ public class TCPSocketReplication3VoidValueTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testClear() throws IOException, InterruptedException {
|
||||
|
||||
@@ -147,5 +145,3 @@ public class TCPSocketReplication3VoidValueTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
-5
@@ -40,7 +40,6 @@ import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class TCPSocketReplication3wayPutReturnsNullTest {
|
||||
|
||||
|
||||
private ChronicleMap<Integer, CharSequence> map1;
|
||||
private ChronicleMap<Integer, CharSequence> map2;
|
||||
private ChronicleMap<Integer, CharSequence> map3;
|
||||
@@ -57,7 +56,6 @@ public class TCPSocketReplication3wayPutReturnsNullTest {
|
||||
.replication(identifier, tcpConfig).create();
|
||||
}
|
||||
|
||||
|
||||
@Before
|
||||
public void setup() throws IOException {
|
||||
map1 = newTcpSocketShmIntString((byte) 1, 8026, new InetSocketAddress("localhost", 8027),
|
||||
@@ -129,7 +127,6 @@ public class TCPSocketReplication3wayPutReturnsNullTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testPutIfAbsent() throws IOException, InterruptedException {
|
||||
|
||||
@@ -168,5 +165,3 @@ public class TCPSocketReplication3wayPutReturnsNullTest {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ import static org.junit.Assert.*;
|
||||
|
||||
public class TCPSocketReplication3wayTest {
|
||||
|
||||
|
||||
private ChronicleMap<Integer, CharSequence> map1;
|
||||
private ChronicleMap<Integer, CharSequence> map2;
|
||||
private ChronicleMap<Integer, CharSequence> map3;
|
||||
@@ -74,7 +73,6 @@ public class TCPSocketReplication3wayTest {
|
||||
StatelessClientTest.checkThreadsShutdown(threads);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void test3() throws IOException, InterruptedException {
|
||||
|
||||
@@ -113,7 +111,6 @@ public class TCPSocketReplication3wayTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testClear() throws IOException, InterruptedException {
|
||||
|
||||
@@ -137,7 +134,6 @@ public class TCPSocketReplication3wayTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testPutIfAbsent() throws IOException, InterruptedException {
|
||||
|
||||
@@ -176,5 +172,3 @@ public class TCPSocketReplication3wayTest {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
package net.openhft.chronicle.map;
|
||||
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -52,7 +51,6 @@ public class TCPSocketReplication4WayMapTest {
|
||||
identifier, serverPort, endpoints).create();
|
||||
}
|
||||
|
||||
|
||||
@Before
|
||||
public void setup() throws IOException {
|
||||
|
||||
@@ -89,7 +87,6 @@ public class TCPSocketReplication4WayMapTest {
|
||||
StatelessClientTest.checkThreadsShutdown(threads);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void test() throws IOException, InterruptedException {
|
||||
Thread.sleep(1000);
|
||||
@@ -108,7 +105,6 @@ public class TCPSocketReplication4WayMapTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testBufferOverflow() throws IOException, InterruptedException {
|
||||
Thread.sleep(1000);
|
||||
@@ -126,7 +122,6 @@ public class TCPSocketReplication4WayMapTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testBufferOverflowPutIfAbsent() throws IOException, InterruptedException {
|
||||
Thread.sleep(1000);
|
||||
@@ -149,7 +144,6 @@ public class TCPSocketReplication4WayMapTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* waits until map1 and map2 show the same value
|
||||
*
|
||||
@@ -174,5 +168,3 @@ public class TCPSocketReplication4WayMapTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -88,7 +88,6 @@ public class TCPSocketReplicationBootStrapTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testBootstrapAndHeartbeat() throws IOException, InterruptedException {
|
||||
|
||||
@@ -121,7 +120,6 @@ public class TCPSocketReplicationBootStrapTest {
|
||||
|
||||
map2a.close();
|
||||
|
||||
|
||||
{
|
||||
// restart map 2 but does not connect it to map1
|
||||
final ChronicleMap<Integer, CharSequence> map2b = ChronicleMapBuilder.of(Integer.class,
|
||||
@@ -141,7 +139,6 @@ public class TCPSocketReplicationBootStrapTest {
|
||||
waitTillEqual(20000000);
|
||||
assertEquals("ADDED WHEN DISCONNECTED TO MAP1", map1.get(11));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@After
|
||||
@@ -187,5 +184,3 @@ public class TCPSocketReplicationBootStrapTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -70,7 +70,6 @@ public class TCPSocketReplicationIntValueTest {
|
||||
s_port += 2;
|
||||
}
|
||||
|
||||
|
||||
@After
|
||||
public void tearDown() throws InterruptedException {
|
||||
|
||||
@@ -97,7 +96,6 @@ public class TCPSocketReplicationIntValueTest {
|
||||
StatelessClientTest.checkThreadsShutdown(threads);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void test3() throws IOException, InterruptedException {
|
||||
|
||||
@@ -116,7 +114,6 @@ public class TCPSocketReplicationIntValueTest {
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
// see https://higherfrequencytrading.atlassian.net/browse/HCOLL-148
|
||||
@Test
|
||||
public void test() throws IOException, InterruptedException {
|
||||
@@ -141,7 +138,6 @@ public class TCPSocketReplicationIntValueTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testBufferOverflow() throws IOException, InterruptedException {
|
||||
|
||||
@@ -173,7 +169,6 @@ public class TCPSocketReplicationIntValueTest {
|
||||
assertEquals(map1, map2);
|
||||
}
|
||||
|
||||
|
||||
// TODO test this with larger sizes.
|
||||
@Test(timeout = 12000)
|
||||
@Ignore("Doesn't work, maps need to check equality.")
|
||||
@@ -189,7 +184,6 @@ public class TCPSocketReplicationIntValueTest {
|
||||
final int select = rnd.nextInt(2);
|
||||
final ChronicleMap<IntValue, CharSequence> map = select > 0 ? map1 : map2;
|
||||
|
||||
|
||||
if (rnd.nextBoolean()) {
|
||||
map.put(set(rnd.nextInt(Builder.SIZE)), "test");
|
||||
} else {
|
||||
@@ -210,5 +204,3 @@ public class TCPSocketReplicationIntValueTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -42,11 +42,9 @@ import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class TCPSocketReplicationNativeTest {
|
||||
|
||||
|
||||
private ChronicleMap<Integer, LongValue> map1;
|
||||
private ChronicleMap<Integer, LongValue> map2;
|
||||
|
||||
|
||||
@Before
|
||||
public void setup() throws IOException {
|
||||
InetSocketAddress endpoint = new InetSocketAddress("localhost", 8077);
|
||||
@@ -101,7 +99,6 @@ public class TCPSocketReplicationNativeTest {
|
||||
value.setValue(10);
|
||||
}
|
||||
|
||||
|
||||
// allow time for the recompilation to resolve
|
||||
waitTillEqual(5000);
|
||||
|
||||
@@ -110,7 +107,6 @@ public class TCPSocketReplicationNativeTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void test2Puts() throws IOException, InterruptedException {
|
||||
|
||||
@@ -152,8 +148,5 @@ public class TCPSocketReplicationNativeTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -57,7 +57,6 @@ public class TCPSocketReplicationPostConnectionTest {
|
||||
@Test
|
||||
public void testPostConnection() throws IOException, InterruptedException {
|
||||
|
||||
|
||||
map1 = TCPSocketReplication4WayMapTest.newTcpSocketShmIntString((byte) 1, 8076);
|
||||
map1.put(5, "EXAMPLE-2");
|
||||
Thread.sleep(1);
|
||||
@@ -74,7 +73,6 @@ public class TCPSocketReplicationPostConnectionTest {
|
||||
@Test
|
||||
public void testPostConnectionNoSleep() throws IOException, InterruptedException {
|
||||
|
||||
|
||||
map1 = TCPSocketReplication4WayMapTest.newTcpSocketShmIntString((byte) 1, 8076);
|
||||
map1.put(5, "EXAMPLE-2");
|
||||
map2 = TCPSocketReplication4WayMapTest.newTcpSocketShmIntString((byte) 2, 8077, new InetSocketAddress("localhost", 8076));
|
||||
@@ -102,14 +100,12 @@ public class TCPSocketReplicationPostConnectionTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
Thread.sleep(1);
|
||||
map1.put(6, "EXAMPLE-1");
|
||||
|
||||
// recreate map2 with new unique file
|
||||
map2 = map2aBuilder.createPersistedTo(Builder.getPersistenceFile());
|
||||
|
||||
|
||||
// allow time for the recompilation to resolve
|
||||
waitTillEqual(5000);
|
||||
|
||||
@@ -119,7 +115,6 @@ public class TCPSocketReplicationPostConnectionTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
|
||||
@@ -134,7 +129,6 @@ public class TCPSocketReplicationPostConnectionTest {
|
||||
System.gc();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* * waits until map1 and map2 show the same value
|
||||
*
|
||||
@@ -153,5 +147,3 @@ public class TCPSocketReplicationPostConnectionTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@ import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class TCPSocketReplicationTest {
|
||||
|
||||
|
||||
static int s_port = 12050;
|
||||
private ChronicleMap<Integer, CharSequence> map1;
|
||||
private ChronicleMap<Integer, CharSequence> map2;
|
||||
@@ -95,7 +94,6 @@ public class TCPSocketReplicationTest {
|
||||
assertTrue(!map1.isEmpty());
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void test() throws IOException, InterruptedException {
|
||||
|
||||
@@ -119,7 +117,6 @@ public class TCPSocketReplicationTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testBufferOverflow() throws IOException, InterruptedException {
|
||||
|
||||
@@ -164,7 +161,6 @@ public class TCPSocketReplicationTest {
|
||||
final int select = rnd.nextInt(2);
|
||||
final ChronicleMap<Integer, CharSequence> map = select > 0 ? map1 : map2;
|
||||
|
||||
|
||||
switch (rnd.nextInt(2)) {
|
||||
case 0:
|
||||
map.put(rnd.nextInt(Builder.SIZE), "test");
|
||||
@@ -181,8 +177,5 @@ public class TCPSocketReplicationTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ import org.junit.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
/**
|
||||
* @author Rob Austin.
|
||||
*/
|
||||
|
||||
@@ -37,7 +37,6 @@ import static org.junit.Assert.*;
|
||||
*/
|
||||
public class TimeBasedReplicationTest extends JSR166TestCase {
|
||||
|
||||
|
||||
public static final byte IDENTIFIER = 1;
|
||||
|
||||
private static File getPersistenceFile() {
|
||||
@@ -59,7 +58,6 @@ public class TimeBasedReplicationTest extends JSR166TestCase {
|
||||
StatelessClientTest.checkThreadsShutdown(threads);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testIgnoreALatePut() throws IOException {
|
||||
|
||||
@@ -80,7 +78,6 @@ public class TimeBasedReplicationTest extends JSR166TestCase {
|
||||
// now test assume that we receive a late update to the map, the following update should be ignored
|
||||
late(timeProvider);
|
||||
|
||||
|
||||
map.put("key-1", "value-2");
|
||||
|
||||
// we'll now flip the time back to the current in order to do the read the result
|
||||
@@ -109,7 +106,6 @@ public class TimeBasedReplicationTest extends JSR166TestCase {
|
||||
// now test assume that we receive a late update to the map, the following update should be ignored
|
||||
late(timeProvider);
|
||||
|
||||
|
||||
final Object o = map.putIfAbsent("key-1", "value-2");
|
||||
assertEquals(o, null);
|
||||
|
||||
@@ -132,18 +128,15 @@ public class TimeBasedReplicationTest extends JSR166TestCase {
|
||||
|
||||
current(timeProvider);
|
||||
|
||||
|
||||
// we do a put at the current time
|
||||
map.put("key-1", "value-1");
|
||||
assertEquals(1, map.size());
|
||||
assertEquals("value-1", map.get("key-1"));
|
||||
|
||||
|
||||
// now test assume that we receive a late update to the map,
|
||||
// the following update should be ignored
|
||||
late(timeProvider);
|
||||
|
||||
|
||||
final Object o = map.replace("key-1", "value-2");
|
||||
assertEquals(o, null);
|
||||
|
||||
@@ -175,10 +168,8 @@ public class TimeBasedReplicationTest extends JSR166TestCase {
|
||||
// now test assume that we receive a late update to the map, the following update should be ignored
|
||||
late(timeProvider);
|
||||
|
||||
|
||||
assertEquals(null, map.replace("key-1", "value-2"));
|
||||
|
||||
|
||||
// we'll now flip the time back to the current in order to do the read the result
|
||||
current(timeProvider);
|
||||
assertEquals(1, map.size());
|
||||
@@ -206,7 +197,6 @@ public class TimeBasedReplicationTest extends JSR166TestCase {
|
||||
// now test assume that we receive a late update to the map, the following update should be ignored
|
||||
late(timeProvider);
|
||||
|
||||
|
||||
assertEquals(false, map.remove("key-1", "value-1"));
|
||||
|
||||
// we'll now flip the time back to the current in order to do the read the result
|
||||
@@ -247,7 +237,6 @@ public class TimeBasedReplicationTest extends JSR166TestCase {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testIgnoreWithRemoteRemove() throws IOException {
|
||||
|
||||
@@ -281,11 +270,9 @@ public class TimeBasedReplicationTest extends JSR166TestCase {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testIgnoreWithRemotePut() throws IOException {
|
||||
|
||||
|
||||
final TimeProvider timeProvider = Mockito.mock(TimeProvider.class);
|
||||
try (ReplicatedChronicleMap map = (ReplicatedChronicleMap) ChronicleMapBuilder.of
|
||||
(CharSequence.class, CharSequence.class)
|
||||
@@ -306,7 +293,6 @@ public class TimeBasedReplicationTest extends JSR166TestCase {
|
||||
final long late = System.currentTimeMillis() - TimeUnit.SECONDS.toMillis(5);
|
||||
assertEquals(null, map.put("key-1", "value-2", IDENTIFIER, late));
|
||||
|
||||
|
||||
// we'll now flip the time back to the current in order to do the read the result
|
||||
current(timeProvider);
|
||||
|
||||
@@ -316,7 +302,6 @@ public class TimeBasedReplicationTest extends JSR166TestCase {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testRemoveFollowedByLatePut() throws IOException {
|
||||
|
||||
@@ -347,7 +332,6 @@ public class TimeBasedReplicationTest extends JSR166TestCase {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testPutRemovePut() throws IOException {
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@ import static org.junit.Assert.assertTrue;
|
||||
*/
|
||||
public class TwoMapOnDifferentServersTest {
|
||||
|
||||
|
||||
private ChronicleMap<Integer, CharSequence> map1;
|
||||
private ChronicleMap<Integer, CharSequence> map2;
|
||||
|
||||
@@ -48,7 +47,6 @@ public class TwoMapOnDifferentServersTest {
|
||||
TcpTransportAndNetworkConfig.of(8076, new InetSocketAddress("localhost", 8077))
|
||||
.heartBeatInterval(1, SECONDS).autoReconnectedUponDroppedConnection(true);
|
||||
|
||||
|
||||
map1 = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.entries(20000)
|
||||
.replication((byte) 1, tcpConfig).create();
|
||||
@@ -98,7 +96,6 @@ public class TwoMapOnDifferentServersTest {
|
||||
assertTrue(!map1.isEmpty());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* * waits until map1 and map2 show the same value
|
||||
*
|
||||
@@ -115,5 +112,4 @@ public class TwoMapOnDifferentServersTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -75,7 +75,6 @@ public class UDPSocketReplicationTest {
|
||||
System.gc();
|
||||
}
|
||||
|
||||
|
||||
/* @Test
|
||||
@Ignore
|
||||
public void testBufferOverflow() throws IOException, InterruptedException {
|
||||
@@ -90,5 +89,3 @@ public class UDPSocketReplicationTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -44,11 +44,9 @@ public class ChannelReplicationTest {
|
||||
private ChronicleMap<CharSequence, CharSequence> favoriteColourServer2;
|
||||
private ChronicleMap<CharSequence, CharSequence> favoriteColourServer1;
|
||||
|
||||
|
||||
private ReplicationHub hubOnServer1;
|
||||
private ReplicationHub hubOnServer2;
|
||||
|
||||
|
||||
@Test
|
||||
public void test() throws IOException, InterruptedException {
|
||||
|
||||
@@ -64,7 +62,6 @@ public class ChannelReplicationTest {
|
||||
.of(8086, new InetSocketAddress("localhost", 8087))
|
||||
.heartBeatInterval(1, SECONDS).autoReconnectedUponDroppedConnection(true);
|
||||
|
||||
|
||||
hubOnServer1 = ReplicationHub.builder()
|
||||
.tcpTransportAndNetwork(tcpConfig)
|
||||
.createWithId(identifier);
|
||||
@@ -103,14 +100,12 @@ public class ChannelReplicationTest {
|
||||
.tcpTransportAndNetwork(tcpConfig)
|
||||
.createWithId(identifier);
|
||||
|
||||
|
||||
// this demotes favoriteColour
|
||||
short channel1 = (short) 1;
|
||||
|
||||
favoriteColourServer2 = smallStringToStringMapBuilder.instance()
|
||||
.replicatedViaChannel(hubOnServer2.createChannel(channel1)).create();
|
||||
|
||||
|
||||
favoriteColourServer2.put("rob", "blue");
|
||||
|
||||
// this demotes favoriteComputer
|
||||
@@ -123,7 +118,6 @@ public class ChannelReplicationTest {
|
||||
favoriteComputerServer2.put("daniel", "mac");
|
||||
}
|
||||
|
||||
|
||||
// allow time for the recompilation to resolve
|
||||
for (int t = 0; t < 2500; t++) {
|
||||
if (favoriteComputerServer2.equals(favoriteComputerServer1) &&
|
||||
@@ -132,31 +126,25 @@ public class ChannelReplicationTest {
|
||||
Thread.sleep(1);
|
||||
}
|
||||
|
||||
|
||||
assertEquals(favoriteComputerServer1, favoriteComputerServer2);
|
||||
Assert.assertEquals(3, favoriteComputerServer2.size());
|
||||
|
||||
|
||||
assertEquals(favoriteColourServer1, favoriteColourServer2);
|
||||
Assert.assertEquals(2, favoriteColourServer1.size());
|
||||
|
||||
|
||||
favoriteColourServer1.close();
|
||||
favoriteComputerServer2.close();
|
||||
favoriteColourServer2.close();
|
||||
favoriteComputerServer1.close();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testPublishOnOneMapOnlyBootstrapTwice() throws IOException, InterruptedException {
|
||||
|
||||
|
||||
ChronicleMap<CharSequence, CharSequence> favoriteComputerServer3;
|
||||
|
||||
ChronicleMap<CharSequence, CharSequence> favoriteColourServer3;
|
||||
|
||||
|
||||
// server 1 with identifier = 1
|
||||
{
|
||||
ChronicleMapBuilder<CharSequence, CharSequence> smallStringToStringMapBuilder =
|
||||
@@ -169,7 +157,6 @@ public class ChannelReplicationTest {
|
||||
.of(8086)
|
||||
.heartBeatInterval(1, SECONDS).autoReconnectedUponDroppedConnection(true);
|
||||
|
||||
|
||||
hubOnServer1 = ReplicationHub.builder()
|
||||
.tcpTransportAndNetwork(tcpConfig)
|
||||
.createWithId(identifier);
|
||||
@@ -190,7 +177,6 @@ public class ChannelReplicationTest {
|
||||
|
||||
favoriteComputerServer1.put("peter", "dell");
|
||||
|
||||
|
||||
}
|
||||
|
||||
// server 2 with identifier = 2
|
||||
@@ -218,7 +204,6 @@ public class ChannelReplicationTest {
|
||||
favoriteColourServer2 = instance.create();
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
ChronicleMapBuilder<CharSequence, CharSequence> smallStringToStringMapBuilder =
|
||||
ChronicleMapBuilder.of(CharSequence.class, CharSequence.class)
|
||||
@@ -235,7 +220,6 @@ public class ChannelReplicationTest {
|
||||
.tcpTransportAndNetwork(tcpConfig)
|
||||
.createWithId(identifier);
|
||||
|
||||
|
||||
// this demotes favoriteColour
|
||||
short channel1 = (short) 1;
|
||||
|
||||
@@ -248,10 +232,8 @@ public class ChannelReplicationTest {
|
||||
favoriteComputerServer3 = smallStringToStringMapBuilder.instance()
|
||||
.replicatedViaChannel(hubOnServer3.createChannel(channel2)).create();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// allow time for the recompilation to resolve
|
||||
for (int t = 0; t < 250000; t++) {
|
||||
if (favoriteComputerServer1.equals(favoriteComputerServer3) &&
|
||||
@@ -261,11 +243,9 @@ public class ChannelReplicationTest {
|
||||
Thread.sleep(1);
|
||||
}
|
||||
|
||||
|
||||
assertEquals(favoriteComputerServer3, favoriteComputerServer1);
|
||||
assertEquals(favoriteColourServer2, favoriteColourServer3);
|
||||
|
||||
|
||||
Assert.assertEquals(1, favoriteColourServer3.size());
|
||||
Assert.assertEquals(1, favoriteComputerServer1.size());
|
||||
|
||||
@@ -275,13 +255,10 @@ public class ChannelReplicationTest {
|
||||
favoriteComputerServer1.close();
|
||||
favoriteColourServer1.close();
|
||||
|
||||
|
||||
favoriteColourServer2.close();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testPublishOnOneMapOnly() throws IOException, InterruptedException {
|
||||
|
||||
@@ -298,7 +275,6 @@ public class ChannelReplicationTest {
|
||||
.heartBeatInterval(1, SECONDS)
|
||||
.autoReconnectedUponDroppedConnection(true);
|
||||
|
||||
|
||||
hubOnServer1 = ReplicationHub.builder()
|
||||
.tcpTransportAndNetwork(tcpConfig)
|
||||
.createWithId(identifier);
|
||||
@@ -337,14 +313,12 @@ public class ChannelReplicationTest {
|
||||
.tcpTransportAndNetwork(tcpConfig)
|
||||
.createWithId(identifier);
|
||||
|
||||
|
||||
// this demotes favoriteColour
|
||||
short channel1 = (short) 1;
|
||||
|
||||
favoriteColourServer2 = smallStringToStringMapBuilder.instance()
|
||||
.replicatedViaChannel(hubOnServer2.createChannel(channel1)).create();
|
||||
|
||||
|
||||
// this demotes favoriteComputer
|
||||
short channel2 = (short) 2;
|
||||
|
||||
@@ -352,7 +326,6 @@ public class ChannelReplicationTest {
|
||||
.replicatedViaChannel(hubOnServer2.createChannel(channel2)).create();
|
||||
}
|
||||
|
||||
|
||||
// allow time for the recompilation to resolve
|
||||
for (int t = 0; t < 2500; t++) {
|
||||
if (favoriteComputerServer2.equals(favoriteComputerServer1) &&
|
||||
@@ -361,15 +334,12 @@ public class ChannelReplicationTest {
|
||||
Thread.sleep(1);
|
||||
}
|
||||
|
||||
|
||||
assertEquals(favoriteComputerServer1, favoriteComputerServer2);
|
||||
Assert.assertEquals(1, favoriteComputerServer2.size());
|
||||
|
||||
|
||||
assertEquals(favoriteColourServer1, favoriteColourServer2);
|
||||
Assert.assertEquals(1, favoriteColourServer1.size());
|
||||
|
||||
|
||||
favoriteColourServer1.close();
|
||||
favoriteComputerServer2.close();
|
||||
favoriteColourServer2.close();
|
||||
@@ -377,6 +347,3 @@ public class ChannelReplicationTest {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ import static org.junit.Assert.assertEquals;
|
||||
public class OpenJDKAndHashMapExamplesTest {
|
||||
private static final SimpleDateFormat YYYYMMDD = new SimpleDateFormat("yyyyMMdd");
|
||||
|
||||
|
||||
private static final String TMP = System.getProperty("java.io.tmpdir");
|
||||
|
||||
private static long parseYYYYMMDD(String s) {
|
||||
@@ -125,7 +124,6 @@ public class OpenJDKAndHashMapExamplesTest {
|
||||
// now perform thread safe operations on my reference
|
||||
bond.addAtomicMaturityDate(16 * 24 * 3600 * 1000L); //20440331
|
||||
|
||||
|
||||
bond.addAtomicCoupon(-1 * bond.getCoupon()); //MT-safe! now a Zero Coupon Bond.
|
||||
|
||||
// cleanup.
|
||||
|
||||
@@ -181,7 +181,6 @@ public class StringEncodingExamplesTest {
|
||||
testCustomKeyMarshaller(gbkStringMarshaller);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testNoEncodingMarshaller() throws IOException {
|
||||
Utf16Marshaller<CharSequence> noEncodingMarshaller =
|
||||
|
||||
@@ -37,10 +37,8 @@ import static org.junit.Assert.*;
|
||||
* Pat Fisher, Mike Judd.
|
||||
*/
|
||||
|
||||
|
||||
public class ChronicleMapTest extends JSR166TestCase {
|
||||
|
||||
|
||||
private static File getPersistenceFile() {
|
||||
String TMP = System.getProperty("java.io.tmpdir");
|
||||
File file = new File(TMP + "/chm-test" + System.nanoTime());
|
||||
@@ -54,15 +52,11 @@ public class ChronicleMapTest extends JSR166TestCase {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static ChronicleMap<ArrayList, CharSequence> newShmListBoolean(int size) throws IOException {
|
||||
return ChronicleMapBuilder.of(ArrayList.class, CharSequence.class)
|
||||
.entries(size).create();
|
||||
}
|
||||
|
||||
|
||||
static ChronicleMap<ArrayList, CharSequence> newShmListBoolean() throws IOException {
|
||||
return ChronicleMapBuilder.of(ArrayList.class, CharSequence.class).create();
|
||||
}
|
||||
@@ -72,7 +66,6 @@ public class ChronicleMapTest extends JSR166TestCase {
|
||||
.entries(size).create();
|
||||
}
|
||||
|
||||
|
||||
static ChronicleMap<Integer, CharSequence> newShmIntString() throws IOException {
|
||||
return ChronicleMapBuilder.of(Integer.class, CharSequence.class).create();
|
||||
}
|
||||
@@ -97,8 +90,6 @@ public class ChronicleMapTest extends JSR166TestCase {
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* clear removes all pairs
|
||||
*/
|
||||
@@ -159,8 +150,6 @@ public class ChronicleMapTest extends JSR166TestCase {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* isEmpty is true of empty map and false for non-empty
|
||||
*/
|
||||
@@ -300,7 +289,6 @@ public class ChronicleMapTest extends JSR166TestCase {
|
||||
assertTrue(empty.containsKey(four));
|
||||
assertTrue(empty.containsKey(five));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -529,7 +517,6 @@ public class ChronicleMapTest extends JSR166TestCase {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* replace(null, x) throws NPE
|
||||
*/
|
||||
@@ -556,7 +543,6 @@ public class ChronicleMapTest extends JSR166TestCase {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* putIfAbsent(x, null) throws NPE
|
||||
*/
|
||||
@@ -645,10 +631,6 @@ public class ChronicleMapTest extends JSR166TestCase {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// classes for testing Comparable fallbacks
|
||||
static class BI implements Comparable<BI> {
|
||||
private final int value;
|
||||
|
||||
@@ -83,7 +83,6 @@ class LoopHelpers {
|
||||
return x * 134775813 + 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Yet another random number generator
|
||||
*/
|
||||
@@ -123,7 +122,6 @@ class LoopHelpers {
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
public static String rightJustify(long n) {
|
||||
// There's probably a better way to do this...
|
||||
String field = " ";
|
||||
|
||||
@@ -60,7 +60,6 @@ public class MapCheck {
|
||||
if (args.length == 0)
|
||||
System.out.println("Usage: MapCheck mapclass [int|float|string|object] [trials] [size] [serialtest]");
|
||||
|
||||
|
||||
if (args.length > 1) {
|
||||
String et = args[1].toLowerCase();
|
||||
if (et.startsWith("i"))
|
||||
@@ -85,7 +84,6 @@ public class MapCheck {
|
||||
|
||||
while ((size & 3) != 0) ++size;
|
||||
|
||||
|
||||
System.out.print(" elements: " + eclass.getName());
|
||||
System.out.print(" trials: " + numTests);
|
||||
System.out.print(" size: " + size);
|
||||
@@ -120,7 +118,6 @@ public class MapCheck {
|
||||
return file;
|
||||
}
|
||||
|
||||
|
||||
static Map newMap() {
|
||||
try {
|
||||
return ChronicleMapBuilder.of(Object.class, Object.class).create();
|
||||
@@ -186,7 +183,6 @@ public class MapCheck {
|
||||
closeMap(m);
|
||||
}
|
||||
|
||||
|
||||
static void getTest(String nm, int n, Map s, Object[] key, int expect) {
|
||||
int sum = 0;
|
||||
timer.start(nm, n);
|
||||
@@ -200,7 +196,6 @@ public class MapCheck {
|
||||
checkSum += sum;
|
||||
}
|
||||
|
||||
|
||||
// unused
|
||||
static void getTestBoxed(String nm, int n, Map s, Object[] key, int expect) {
|
||||
int sum = 0;
|
||||
@@ -287,7 +282,6 @@ public class MapCheck {
|
||||
checkSum += sum;
|
||||
}
|
||||
|
||||
|
||||
static Object kitTest(Map s, int size) {
|
||||
Object last = null;
|
||||
int sum = 0;
|
||||
@@ -561,7 +555,6 @@ public class MapCheck {
|
||||
reallyAssert(s.size() == size);
|
||||
}
|
||||
|
||||
|
||||
static void initializeKeys(Object[] key, Object[] absent, int size) {
|
||||
// Object cannot be used as it cannot be serialized.
|
||||
if (eclass == Object.class || eclass == Integer.class) {
|
||||
@@ -663,7 +656,6 @@ public class MapCheck {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void randomWords(Object[] ws, int origin, int size) {
|
||||
for (int i = origin; i < size; ++i) {
|
||||
int k = 0;
|
||||
|
||||
@@ -45,7 +45,6 @@ import static org.junit.Assert.*;
|
||||
* Pat Fisher, Mike Judd.
|
||||
*/
|
||||
|
||||
|
||||
public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
|
||||
public static final int SIZE = 1024;
|
||||
@@ -251,7 +250,6 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
.entries(SIZE)
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(port)).create();
|
||||
|
||||
|
||||
final ChronicleMap<CharSequence, CharSequence> statelessMap = ChronicleMapBuilder
|
||||
.of(CharSequence.class, CharSequence.class)
|
||||
.statelessClient(new InetSocketAddress("localhost", port))
|
||||
@@ -269,7 +267,6 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(port))
|
||||
.create();
|
||||
|
||||
|
||||
final ChronicleMap<byte[], byte[]> statelessMap = ChronicleMapBuilder
|
||||
.of(byte[].class, byte[].class)
|
||||
.putReturnsNull(true)
|
||||
@@ -541,7 +538,6 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
assertTrue(empty.containsKey(four));
|
||||
assertTrue(empty.containsKey(five));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -765,7 +761,6 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* replace(null, x) throws NPE
|
||||
*/
|
||||
@@ -790,7 +785,6 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* putIfAbsent(x, null) throws NPE
|
||||
*/
|
||||
@@ -961,6 +955,5 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -41,12 +41,10 @@ import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class SetForTCPSocketReplication3wayTest {
|
||||
|
||||
|
||||
private ChronicleSet<Integer> set1;
|
||||
private ChronicleSet<Integer> set2;
|
||||
private ChronicleSet<Integer> set3;
|
||||
|
||||
|
||||
private static <T extends ChronicleSet<Integer>> T newTcpSocketIntSet(
|
||||
final byte identifier,
|
||||
final int serverPort,
|
||||
@@ -57,7 +55,6 @@ public class SetForTCPSocketReplication3wayTest {
|
||||
.createPersistedTo(getPersistenceFile());
|
||||
}
|
||||
|
||||
|
||||
@Before
|
||||
public void setup() throws IOException {
|
||||
set1 = newTcpSocketIntSet((byte) 1, 18076, new InetSocketAddress("localhost", 18077),
|
||||
@@ -79,7 +76,6 @@ public class SetForTCPSocketReplication3wayTest {
|
||||
System.gc();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void test3() throws IOException, InterruptedException {
|
||||
|
||||
@@ -118,7 +114,6 @@ public class SetForTCPSocketReplication3wayTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testClear() throws IOException, InterruptedException {
|
||||
|
||||
@@ -144,7 +139,6 @@ public class SetForTCPSocketReplication3wayTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void waitTillEqual(final int timeOutMs) throws InterruptedException {
|
||||
int t = 0;
|
||||
for (; t < timeOutMs; t++) {
|
||||
@@ -158,5 +152,3 @@ public class SetForTCPSocketReplication3wayTest {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -29,11 +29,9 @@ import static net.openhft.lang.Compare.isEqual;
|
||||
public class IntValue$$Native implements IntValue, BytesMarshallable, Byteable, Copyable<net.openhft.lang.values.IntValue> {
|
||||
private static final int VALUE = 0;
|
||||
|
||||
|
||||
private Bytes _bytes;
|
||||
private long _offset;
|
||||
|
||||
|
||||
public void setValue(int $) {
|
||||
_bytes.writeInt(_offset + VALUE, $);
|
||||
}
|
||||
@@ -42,7 +40,6 @@ public class IntValue$$Native implements IntValue, BytesMarshallable, Byteable,
|
||||
return _bytes.readInt(_offset + VALUE);
|
||||
}
|
||||
|
||||
|
||||
public void setOrderedValue(int $) {
|
||||
_bytes.writeOrderedInt(_offset + VALUE, $);
|
||||
}
|
||||
|
||||
@@ -29,12 +29,9 @@ import static net.openhft.lang.Compare.isEqual;
|
||||
public class LongValue$$Native implements LongValue, BytesMarshallable, Byteable, Copyable<net.openhft.lang.values.LongValue> {
|
||||
private static final int VALUE = 0;
|
||||
|
||||
|
||||
private Bytes _bytes;
|
||||
private long _offset;
|
||||
|
||||
|
||||
|
||||
public void setValue(long $) {
|
||||
_bytes.writeLong(_offset + VALUE, $);
|
||||
}
|
||||
@@ -43,8 +40,6 @@ public class LongValue$$Native implements LongValue, BytesMarshallable, Byteable
|
||||
return _bytes.readLong(_offset + VALUE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setOrderedValue(long $) {
|
||||
_bytes.writeOrderedLong(_offset + VALUE, $);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user