Package com.hazelcast.test

Examples of com.hazelcast.test.AssertTask


                }
            }
        };
        thread.start();

        assertTrueAllTheTime(new AssertTask() {
            @Override
            public void run() throws Exception {
                assertTrue(thread.isAlive());
                assertEquals(5, semaphore.availablePermits());
            }
View Full Code Here


        }
        return true;
    }

    private void assertDataSizeEventually(final HazelcastInstance[] cluster, final String mapName, final int size) {
        assertTrueEventually(new AssertTask() {
            @Override
            public void run() throws Exception {
                HazelcastInstance node = getNode(cluster);
                IMap m = node.getMap(mapName);
                assertEquals(size, m.size());
View Full Code Here

        });
    }


    private void assertKeysIn(final HazelcastInstance[] cluster, final String mapName, final int start, final int end) {
        assertTrueEventually(new AssertTask() {
            public void run() {
                assertTrue(checkKeysIn(cluster, mapName, start, end));
            }
        }, ASSERT_TRUE_EVENTUALLY_TIMEOUT_VALUE);
    }
View Full Code Here

            }
        }, ASSERT_TRUE_EVENTUALLY_TIMEOUT_VALUE);
    }

    private void assertDataInFrom(final HazelcastInstance[] cluster, final String mapName, final int start, final int end, final HazelcastInstance[] sourceCluster) {
        assertTrueEventually(new AssertTask() {
            public void run() {
                assertTrue(checkDataInFrom(cluster, mapName, start, end, sourceCluster));
            }
        }, ASSERT_TRUE_EVENTUALLY_TIMEOUT_VALUE);
    }
View Full Code Here

            }
        }, ASSERT_TRUE_EVENTUALLY_TIMEOUT_VALUE);
    }

    private void assertKeysNotIn(final HazelcastInstance[] cluster, final String mapName, final int start, final int end) {
        assertTrueEventually(new AssertTask() {
            public void run() {
                assertTrue(checkKeysNotIn(cluster, mapName, start, end));
            }
        }, ASSERT_TRUE_EVENTUALLY_TIMEOUT_VALUE);
    }
View Full Code Here

        assertNotEquals(id1, id2);

        // an now we make sure that if a member joins the cluster, the same interface gets invoked twice.
        HazelcastInstance hz2 = factory.newHazelcastInstance();

        assertTrueEventually(new AssertTask() {
            @Override
            public void run() throws Exception {
                //now we verify that the memberAdded method is called twice.
                verify(membershipListener, times(2)).memberAdded(any(MembershipEvent.class));
            }
View Full Code Here

        for (int i = 0; i < 10; i++) {
            queue.put("item" + i);
        }

        final LocalQueueStats stats = queue.getLocalQueueStats();
        AssertTask task = new AssertTask() {
            @Override
            public void run() throws Exception {
                assertEquals(30, stats.getOfferOperationCount());
            }
        };
View Full Code Here

        for (int i = 0; i < 10; i++) {
            queue.offer("item" + i);
        }

        final LocalQueueStats stats = queue.getLocalQueueStats();
        AssertTask task = new AssertTask() {
            @Override
            public void run() throws Exception {
                assertEquals(10, stats.getRejectedOfferOperationCount());
            }
        };
View Full Code Here

            queue.poll();
        }


        final LocalQueueStats stats = queue.getLocalQueueStats();
        AssertTask task = new AssertTask() {
            @Override
            public void run() throws Exception {
                assertEquals(30, stats.getPollOperationCount());
            }
        };
View Full Code Here

        for (int i = 0; i < 10; i++) {
            queue.poll();
        }

        final LocalQueueStats stats = queue.getLocalQueueStats();
        AssertTask task = new AssertTask() {
            @Override
            public void run() throws Exception {
                assertEquals(10, stats.getEmptyPollOperationCount());
            }
        };
View Full Code Here

TOP

Related Classes of com.hazelcast.test.AssertTask

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.