mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
HCOLL-200 fixed - testBootstrapAndHeartbeat
This commit is contained in:
@@ -50,13 +50,13 @@ public class StatelessClientTest {
|
||||
{
|
||||
statelessMap = ChronicleMapBuilder.of(Integer
|
||||
.class, CharSequence.class)
|
||||
.statelessClient(new InetSocketAddress("localhost", 8086)).create();
|
||||
.statelessClient(new InetSocketAddress("localhost", 8056)).create();
|
||||
}
|
||||
|
||||
// server
|
||||
{
|
||||
serverMap = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8086)).create();
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8056)).create();
|
||||
}
|
||||
|
||||
|
||||
@@ -93,13 +93,13 @@ public class StatelessClientTest {
|
||||
{
|
||||
statelessMap = ChronicleMapBuilder.of(Integer
|
||||
.class, CharSequence.class)
|
||||
.statelessClient(new InetSocketAddress("localhost", 8086)).create();
|
||||
.statelessClient(new InetSocketAddress("localhost", 8056)).create();
|
||||
}
|
||||
|
||||
// server
|
||||
{
|
||||
serverMap = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8086)).create();
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8056)).create();
|
||||
}
|
||||
|
||||
|
||||
@@ -134,13 +134,13 @@ public class StatelessClientTest {
|
||||
{
|
||||
statelessMap = ChronicleMapBuilder.of(Integer
|
||||
.class, CharSequence.class)
|
||||
.statelessClient(new InetSocketAddress("localhost", 8086)).create();
|
||||
.statelessClient(new InetSocketAddress("localhost", 8056)).create();
|
||||
}
|
||||
|
||||
// server
|
||||
{
|
||||
serverMap = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8086)).create();
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8056)).create();
|
||||
}
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ public class StatelessClientTest {
|
||||
// server
|
||||
{
|
||||
serverMap = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8086)).create();
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8056)).create();
|
||||
|
||||
serverMap.put(10, "EXAMPLE-10");
|
||||
}
|
||||
@@ -183,7 +183,7 @@ public class StatelessClientTest {
|
||||
{
|
||||
statelessMap = ChronicleMapBuilder.of(Integer
|
||||
.class, CharSequence.class)
|
||||
.statelessClient(new InetSocketAddress("localhost", 8086)).create();
|
||||
.statelessClient(new InetSocketAddress("localhost", 8056)).create();
|
||||
|
||||
Assert.assertEquals("EXAMPLE-10", statelessMap.get(10));
|
||||
Assert.assertEquals(1, statelessMap.size());
|
||||
@@ -206,13 +206,13 @@ public class StatelessClientTest {
|
||||
{
|
||||
statelessMap = ChronicleMapBuilder.of(Integer
|
||||
.class, CharSequence.class)
|
||||
.statelessClient(new InetSocketAddress("localhost", 8086)).create();
|
||||
.statelessClient(new InetSocketAddress("localhost", 8056)).create();
|
||||
}
|
||||
|
||||
// server
|
||||
{
|
||||
serverMap = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8086)).create();
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8056)).create();
|
||||
|
||||
serverMap.put(10, "EXAMPLE-10");
|
||||
}
|
||||
@@ -238,13 +238,13 @@ public class StatelessClientTest {
|
||||
{
|
||||
statelessMap = ChronicleMapBuilder.of(Integer
|
||||
.class, CharSequence.class)
|
||||
.statelessClient(new InetSocketAddress("localhost", 8086)).create();
|
||||
.statelessClient(new InetSocketAddress("localhost", 8056)).create();
|
||||
}
|
||||
|
||||
// server
|
||||
{
|
||||
serverMap = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8086)).create();
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8056)).create();
|
||||
}
|
||||
|
||||
|
||||
@@ -281,13 +281,13 @@ public class StatelessClientTest {
|
||||
statelessMap = ChronicleMapBuilder.of(Integer
|
||||
.class, CharSequence.class)
|
||||
.putReturnsNull(true)
|
||||
.statelessClient(new InetSocketAddress("localhost", 8086)).create();
|
||||
.statelessClient(new InetSocketAddress("localhost", 8056)).create();
|
||||
}
|
||||
|
||||
// server
|
||||
{
|
||||
serverMap = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8086))
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8056))
|
||||
.putReturnsNull(true)
|
||||
.create();
|
||||
}
|
||||
@@ -327,13 +327,13 @@ public class StatelessClientTest {
|
||||
.class, CharSequence.class)
|
||||
.putReturnsNull(true)
|
||||
.removeReturnsNull(true)
|
||||
.statelessClient(new InetSocketAddress("localhost", 8086)).create();
|
||||
.statelessClient(new InetSocketAddress("localhost", 8056)).create();
|
||||
}
|
||||
|
||||
// server
|
||||
{
|
||||
serverMap = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8086))
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8056))
|
||||
.putReturnsNull(true)
|
||||
.removeReturnsNull(true)
|
||||
.create();
|
||||
@@ -366,13 +366,13 @@ public class StatelessClientTest {
|
||||
.class, CharSequence.class)
|
||||
.putReturnsNull(true)
|
||||
.removeReturnsNull(true)
|
||||
.statelessClient(new InetSocketAddress("localhost", 8086)).create();
|
||||
.statelessClient(new InetSocketAddress("localhost", 8056)).create();
|
||||
}
|
||||
|
||||
// server
|
||||
{
|
||||
serverMap = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8086))
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8056))
|
||||
.putReturnsNull(true)
|
||||
.removeReturnsNull(true)
|
||||
.create();
|
||||
@@ -406,7 +406,7 @@ public class StatelessClientTest {
|
||||
{
|
||||
statelessMap1 = ChronicleMapBuilder.of(Integer
|
||||
.class, CharSequence.class)
|
||||
.statelessClient(new InetSocketAddress("localhost", 8086)).create();
|
||||
.statelessClient(new InetSocketAddress("localhost", 8056)).create();
|
||||
statelessMap2 = ChronicleMapBuilder.of(Integer
|
||||
.class, CharSequence.class)
|
||||
.statelessClient(new InetSocketAddress("localhost", 8077)).create();
|
||||
@@ -415,7 +415,7 @@ public class StatelessClientTest {
|
||||
// server
|
||||
{
|
||||
serverMap1 = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8086)).create();
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8056)).create();
|
||||
serverMap2 = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8077)).create();
|
||||
|
||||
|
||||
@@ -86,16 +86,15 @@ public class TCPSocketReplicationBootStrapTest {
|
||||
|
||||
@Test
|
||||
public void testBootstrapAndHeartbeat() throws IOException, InterruptedException {
|
||||
map1 = newTcpSocketShmIntString((byte) 1, 8068, new InetSocketAddress("localhost", 8067));
|
||||
ChronicleMapBuilder<Integer, CharSequence> map2aBuilder =
|
||||
newTcpSocketShmBuilder(Integer.class, CharSequence.class, (byte) 2, 8067);
|
||||
|
||||
map1 = newTcpSocketShmIntString((byte) 1, 8068, new InetSocketAddress("localhost", 8067));
|
||||
|
||||
Thread.sleep(1);
|
||||
|
||||
File persistenceFile = getPersistenceFile();
|
||||
final ReplicatedChronicleMap<Integer, ?, ?, CharSequence, ?, ?> map2a =
|
||||
(ReplicatedChronicleMap<Integer, ?, ?, CharSequence, ?, ?>)
|
||||
map2aBuilder.createPersistedTo(persistenceFile);
|
||||
newTcpSocketShmBuilder(Integer.class, CharSequence.class, (byte) 2, 8067).createPersistedTo(persistenceFile);
|
||||
|
||||
map2a.put(10, "EXAMPLE-10"); // this will be the last time that map1 go an update from map2
|
||||
|
||||
@@ -107,20 +106,22 @@ public class TCPSocketReplicationBootStrapTest {
|
||||
Thread.yield();
|
||||
} while (lastModificationTime == 0);
|
||||
|
||||
final File map2File = persistenceFile;
|
||||
map2a.close();
|
||||
// Thread.sleep(1);
|
||||
|
||||
{
|
||||
// restart map 2 but don't doConnect it to map one
|
||||
final ChronicleMap<Integer, CharSequence> map2b =
|
||||
map2aBuilder.createPersistedTo(map2File);
|
||||
// restart map 2 but does not connect it to map1
|
||||
final ChronicleMap<Integer, CharSequence> map2b = ChronicleMapBuilder.of(Integer.class,
|
||||
CharSequence.class).replication((byte) 2).createPersistedTo(persistenceFile);
|
||||
// add data into it
|
||||
map2b.put(11, "ADDED WHEN DISCONNECTED TO MAP1");
|
||||
map2b.close();
|
||||
}
|
||||
|
||||
// Thread.sleep(1);
|
||||
|
||||
// now restart map2a and doConnect it to map1, map1 should bootstrap the missing entry
|
||||
map2 = map2aBuilder.createPersistedTo(map2File);
|
||||
map2 = newTcpSocketShmBuilder(Integer.class, CharSequence.class, (byte) 2, 8067).createPersistedTo(persistenceFile);
|
||||
|
||||
// add data into it
|
||||
waitTillEqual(20000);
|
||||
|
||||
@@ -241,7 +241,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
*/
|
||||
@Test(timeout = 5000)
|
||||
public void testClear() throws IOException {
|
||||
try (ChronicleMap<Integer, String> map = map5(8076)) {
|
||||
try (ChronicleMap<Integer, String> map = map5(8056)) {
|
||||
|
||||
map.clear();
|
||||
assertEquals(0, map.size());
|
||||
@@ -254,7 +254,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
*/
|
||||
@Test(timeout = 5000)
|
||||
public void testContains() throws IOException {
|
||||
try (ChronicleMap map = map5(8076)) {
|
||||
try (ChronicleMap map = map5(8056)) {
|
||||
assertTrue(map.containsValue("A"));
|
||||
assertFalse(map.containsValue("Z"));
|
||||
}
|
||||
@@ -266,7 +266,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
*/
|
||||
@Test(timeout = 5000)
|
||||
public void testContainsKey() throws IOException {
|
||||
try (ChronicleMap map = map5(8076)) {
|
||||
try (ChronicleMap map = map5(8056)) {
|
||||
assertTrue(map.containsKey(one));
|
||||
assertFalse(map.containsKey(zero));
|
||||
}
|
||||
@@ -277,7 +277,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
*/
|
||||
@Test(timeout = 5000)
|
||||
public void testContainsValue() throws IOException {
|
||||
try (ChronicleMap map = map5(8076)) {
|
||||
try (ChronicleMap map = map5(8056)) {
|
||||
assertTrue(map.containsValue("A"));
|
||||
assertFalse(map.containsValue("Z"));
|
||||
}
|
||||
@@ -288,9 +288,9 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
*/
|
||||
@Test(timeout = 5000)
|
||||
public void testGet() throws IOException {
|
||||
try (ChronicleMap map = map5(8076)) {
|
||||
try (ChronicleMap map = map5(8056)) {
|
||||
assertEquals("A", (String) map.get(one));
|
||||
try (ChronicleMap empty = newStrStrMap(8078)) {
|
||||
try (ChronicleMap empty = newStrStrMap(8058)) {
|
||||
assertNull(map.get(notPresent));
|
||||
}
|
||||
}
|
||||
@@ -301,7 +301,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
*/
|
||||
@Test(timeout = 5000)
|
||||
public void testIsEmpty() throws IOException {
|
||||
try (ChronicleMap empty = newShmIntString(8078)) {
|
||||
try (ChronicleMap empty = newShmIntString(8058)) {
|
||||
try (ChronicleMap map = map5(8079)) {
|
||||
|
||||
if (!empty.isEmpty()) {
|
||||
@@ -318,7 +318,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
*/
|
||||
@Test(timeout = 5000)
|
||||
public void testKeySet() throws IOException {
|
||||
try (ChronicleMap map = map5(8076)) {
|
||||
try (ChronicleMap map = map5(8056)) {
|
||||
Set s = map.keySet();
|
||||
assertEquals(5, s.size());
|
||||
assertTrue(s.contains(one));
|
||||
@@ -334,7 +334,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
*/
|
||||
@Test(timeout = 5000)
|
||||
public void testKeySetToArray() throws IOException {
|
||||
try (ChronicleMap map = map5(8076)) {
|
||||
try (ChronicleMap map = map5(8056)) {
|
||||
Set s = map.keySet();
|
||||
Object[] ar = s.toArray();
|
||||
assertTrue(s.containsAll(Arrays.asList(ar)));
|
||||
@@ -349,7 +349,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
*/
|
||||
@Test(timeout = 5000)
|
||||
public void testValuesToArray() throws IOException {
|
||||
try (ChronicleMap map = map5(8076)) {
|
||||
try (ChronicleMap map = map5(8056)) {
|
||||
Collection v = map.values();
|
||||
Object[] ar = v.toArray();
|
||||
ArrayList s = new ArrayList(Arrays.asList(ar));
|
||||
@@ -368,7 +368,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
*/
|
||||
@Test(timeout = 5000)
|
||||
public void testEntrySetToArray() throws IOException {
|
||||
try (ChronicleMap map = map5(8076)) {
|
||||
try (ChronicleMap map = map5(8056)) {
|
||||
Set s = map.entrySet();
|
||||
Object[] ar = s.toArray();
|
||||
assertEquals(5, ar.length);
|
||||
@@ -385,7 +385,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
*/
|
||||
@Test(timeout = 5000)
|
||||
public void testValues() throws IOException {
|
||||
try (ChronicleMap map = map5(8076)) {
|
||||
try (ChronicleMap map = map5(8056)) {
|
||||
Collection s = map.values();
|
||||
assertEquals(5, s.size());
|
||||
assertTrue(s.contains("A"));
|
||||
@@ -401,7 +401,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
*/
|
||||
@Test(timeout = 5000)
|
||||
public void testEntrySet() throws IOException {
|
||||
try (ChronicleMap map = map5(8076)) {
|
||||
try (ChronicleMap map = map5(8056)) {
|
||||
Set s = map.entrySet();
|
||||
assertEquals(5, s.size());
|
||||
Iterator it = s.iterator();
|
||||
@@ -425,8 +425,8 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
@Test(timeout = 5000)
|
||||
public void testPutAll() throws IOException {
|
||||
|
||||
try (ChronicleMap empty = newShmIntString(8076)) {
|
||||
try (ChronicleMap map = map5(8076)) {
|
||||
try (ChronicleMap empty = newShmIntString(8056)) {
|
||||
try (ChronicleMap map = map5(8056)) {
|
||||
empty.putAll(map);
|
||||
assertEquals(5, empty.size());
|
||||
assertTrue(empty.containsKey(one));
|
||||
@@ -445,7 +445,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
*/
|
||||
@Test(timeout = 5000)
|
||||
public void testPutIfAbsent() throws IOException {
|
||||
try (ChronicleMap map = map5(8076)) {
|
||||
try (ChronicleMap map = map5(8056)) {
|
||||
map.putIfAbsent(six, "Z");
|
||||
assertTrue(map.containsKey(six));
|
||||
|
||||
@@ -457,7 +457,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
*/
|
||||
@Test(timeout = 5000)
|
||||
public void testPutIfAbsent2() throws IOException {
|
||||
try (ChronicleMap map = map5(8076)) {
|
||||
try (ChronicleMap map = map5(8056)) {
|
||||
assertEquals("A", map.putIfAbsent(one, "Z"));
|
||||
}
|
||||
}
|
||||
@@ -467,7 +467,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
*/
|
||||
@Test(timeout = 5000)
|
||||
public void testReplace() throws IOException {
|
||||
try (ChronicleMap map = map5(8076)) {
|
||||
try (ChronicleMap map = map5(8056)) {
|
||||
assertNull(map.replace(six, "Z"));
|
||||
assertFalse(map.containsKey(six));
|
||||
|
||||
@@ -480,7 +480,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
@Test(timeout = 5000)
|
||||
public void testReplace2() throws
|
||||
IOException {
|
||||
try (ChronicleMap map = map5(8076)) {
|
||||
try (ChronicleMap map = map5(8056)) {
|
||||
assertNotNull(map.replace(one, "Z"));
|
||||
assertEquals("Z", map.get(one));
|
||||
}
|
||||
@@ -492,7 +492,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
@Test(timeout = 5000)
|
||||
public void testReplaceValue() throws
|
||||
IOException {
|
||||
try (ChronicleMap map = map5(8076)) {
|
||||
try (ChronicleMap map = map5(8056)) {
|
||||
assertEquals("A", map.get(one));
|
||||
assertFalse(map.replace(one, "Z", "Z"));
|
||||
assertEquals("A", map.get(one));
|
||||
@@ -506,7 +506,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
@Test(timeout = 5000)
|
||||
public void testReplaceValue2
|
||||
() throws IOException {
|
||||
try (ChronicleMap map = map5(8076)) {
|
||||
try (ChronicleMap map = map5(8056)) {
|
||||
assertEquals("A", map.get(one));
|
||||
assertTrue(map.replace(one, "A", "Z"));
|
||||
assertEquals("Z", map.get(one));
|
||||
@@ -520,7 +520,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
@Test(timeout = 5000)
|
||||
public void testRemove() throws
|
||||
IOException {
|
||||
try (ChronicleMap map = map5(8076)) {
|
||||
try (ChronicleMap map = map5(8056)) {
|
||||
map.remove(five);
|
||||
assertEquals(4, map.size());
|
||||
assertFalse(map.containsKey(five));
|
||||
@@ -534,7 +534,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
@Test(timeout = 5000)
|
||||
public void testRemove2
|
||||
() throws IOException {
|
||||
/* try( ChronicleMap map = map5(8076)) {
|
||||
/* try( ChronicleMap map = map5(8056)) {
|
||||
map.remove(five, "E");
|
||||
assertEquals(4, map.size());
|
||||
assertFalse(map.containsKey(five));
|
||||
@@ -549,9 +549,9 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
*/
|
||||
@Test(timeout = 5000)
|
||||
public void testSize() throws IOException {
|
||||
try (ChronicleMap map = map5(8076)) {
|
||||
try (ChronicleMap map = map5(8056)) {
|
||||
|
||||
try (ChronicleMap empty = newShmIntString(8078)) {
|
||||
try (ChronicleMap empty = newShmIntString(8058)) {
|
||||
assertEquals(0, empty.size());
|
||||
assertEquals(5, map.size());
|
||||
}
|
||||
@@ -563,9 +563,9 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
*/
|
||||
@Test(timeout = 5000)
|
||||
public void testSize2() throws IOException {
|
||||
try (ChronicleMap map = map5(8076)) {
|
||||
try (ChronicleMap map = map5(8056)) {
|
||||
|
||||
try (ChronicleMap empty = newShmIntString(8078)) {
|
||||
try (ChronicleMap empty = newShmIntString(8058)) {
|
||||
assertEquals(0, empty.size());
|
||||
assertEquals(5, map.size());
|
||||
}
|
||||
@@ -577,9 +577,9 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
*/
|
||||
@Test(timeout = 5000)
|
||||
public void testSize3() throws IOException {
|
||||
try (ChronicleMap map = map5(8076)) {
|
||||
try (ChronicleMap map = map5(8056)) {
|
||||
|
||||
try (ChronicleMap empty = newShmIntString(8078)) {
|
||||
try (ChronicleMap empty = newShmIntString(8058)) {
|
||||
assertEquals(0, empty.size());
|
||||
assertEquals(5, map.size());
|
||||
}
|
||||
@@ -591,7 +591,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
*/
|
||||
@Test(timeout = 5000)
|
||||
public void testToString() throws IOException {
|
||||
try (ChronicleMap map = map5(8076)) {
|
||||
try (ChronicleMap map = map5(8056)) {
|
||||
String s = map.toString();
|
||||
for (int i = 1; i <= 5; ++i) {
|
||||
assertTrue(s.contains(String.valueOf(i)));
|
||||
@@ -606,7 +606,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
@Test(timeout = 5000)
|
||||
public void testGet_NullPointerException() throws IOException {
|
||||
|
||||
try (ChronicleMap c = newShmIntString(8076)) {
|
||||
try (ChronicleMap c = newShmIntString(8056)) {
|
||||
c.get(null);
|
||||
shouldThrow();
|
||||
} catch (NullPointerException success) {
|
||||
@@ -631,7 +631,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
*/
|
||||
@Test(timeout = 5000)
|
||||
public void testPut1_NullPointerException() throws IOException {
|
||||
try (ChronicleMap c = newShmIntString(8076)) {
|
||||
try (ChronicleMap c = newShmIntString(8056)) {
|
||||
c.put(null, "whatever");
|
||||
shouldThrow();
|
||||
} catch (NullPointerException success) {
|
||||
@@ -644,7 +644,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
@Test(timeout = 5000)
|
||||
public void testPut2_NullPointerException
|
||||
() throws IOException {
|
||||
try (ChronicleMap c = newShmIntString(8076)) {
|
||||
try (ChronicleMap c = newShmIntString(8056)) {
|
||||
c.put(notPresent, null);
|
||||
shouldThrow();
|
||||
} catch (NullPointerException success) {
|
||||
@@ -657,7 +657,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
@Test(timeout = 5000)
|
||||
public void testPutIfAbsent1_NullPointerException
|
||||
() throws IOException {
|
||||
try (ChronicleMap c = newShmIntString(8076)) {
|
||||
try (ChronicleMap c = newShmIntString(8056)) {
|
||||
c.putIfAbsent(null, "whatever");
|
||||
shouldThrow();
|
||||
} catch (NullPointerException success) {
|
||||
@@ -671,7 +671,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
@Test(timeout = 5000)
|
||||
public void testReplace_NullPointerException
|
||||
() throws IOException {
|
||||
try (ChronicleMap c = newShmIntString(8076)) {
|
||||
try (ChronicleMap c = newShmIntString(8056)) {
|
||||
c.replace(null, "whatever");
|
||||
shouldThrow();
|
||||
} catch (NullPointerException success) {
|
||||
@@ -684,7 +684,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
@Test(timeout = 5000)
|
||||
public void testReplaceValue_NullPointerException
|
||||
() throws IOException {
|
||||
try (ChronicleMap c = newShmIntString(8076)) {
|
||||
try (ChronicleMap c = newShmIntString(8056)) {
|
||||
c.replace(null, "A", "whatever");
|
||||
shouldThrow();
|
||||
} catch (NullPointerException success) {
|
||||
@@ -697,7 +697,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
*/
|
||||
@Test(timeout = 5000)
|
||||
public void testPutIfAbsent2_NullPointerException() throws IOException {
|
||||
try (ChronicleMap c = newShmIntString(8076)) {
|
||||
try (ChronicleMap c = newShmIntString(8056)) {
|
||||
c.putIfAbsent(notPresent, null);
|
||||
shouldThrow();
|
||||
} catch (NullPointerException success) {
|
||||
@@ -709,7 +709,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
*/
|
||||
@Test(timeout = 5000)
|
||||
public void testReplace2_NullPointerException() throws IOException {
|
||||
try (ChronicleMap c = newShmIntString(8076)) {
|
||||
try (ChronicleMap c = newShmIntString(8056)) {
|
||||
c.replace(notPresent, null);
|
||||
shouldThrow();
|
||||
} catch (NullPointerException success) {
|
||||
@@ -722,7 +722,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
@Test(timeout = 5000)
|
||||
public void testReplaceValue2_NullPointerException
|
||||
() throws IOException {
|
||||
try (ChronicleMap c = newShmIntString(8076)) {
|
||||
try (ChronicleMap c = newShmIntString(8056)) {
|
||||
c.replace(notPresent, null, "A");
|
||||
shouldThrow();
|
||||
} catch (NullPointerException success) {
|
||||
@@ -734,7 +734,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
*/
|
||||
@Test(timeout = 5000)
|
||||
public void testReplaceValue3_NullPointerException() throws IOException {
|
||||
try (ChronicleMap c = newShmIntString(8076)) {
|
||||
try (ChronicleMap c = newShmIntString(8056)) {
|
||||
c.replace(notPresent, "A", null);
|
||||
shouldThrow();
|
||||
} catch (NullPointerException success) {
|
||||
@@ -746,7 +746,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
*/
|
||||
@Test(timeout = 5000)
|
||||
public void testRemove1_NullPointerException() throws IOException {
|
||||
try (ChronicleMap c = newStrStrMap(8076)) {
|
||||
try (ChronicleMap c = newStrStrMap(8056)) {
|
||||
c.put("sadsdf", "asdads");
|
||||
c.remove(null);
|
||||
shouldThrow();
|
||||
@@ -774,7 +774,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
@Test(timeout = 5000)
|
||||
public void testRemove3() throws IOException {
|
||||
|
||||
try (ChronicleMap c = newStrStrMap(8076)) {
|
||||
try (ChronicleMap c = newStrStrMap(8056)) {
|
||||
c.put("sadsdf", "asdads");
|
||||
assertFalse(c.remove("sadsdf", null));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user