Package com.hazelcast.test

Examples of com.hazelcast.test.AssertTask


        config.addMapConfig(mapConfig);
        HazelcastInstance hz = createHazelcastInstance(config);
        Map map = hz.getMap(mapConfig.getName());

        assertTrueAllTheTime(new AssertTask() {
            @Override
            public void run() {
                assertFalse("LoadAll should not have been called", loadAllCalled.get());
            }
        }, 10);
View Full Code Here


        return builder.build();
    }

    private void assertAllSubscriptionsInStore(MapStore mapStore, final int numberOfSubscriptions) {
        final DataStore store = (DataStore) mapStore;
        assertTrueEventually(new AssertTask() {
            @Override
            public void run() throws Exception {
                assertEquals(numberOfSubscriptions, store.subscriptionCount());
            }
        }, 20);
View Full Code Here

            map.put(i, i);
        }
    }

    private void assertFinalValueEquals(final int expected, final int actual) {
        assertTrueEventually(new AssertTask() {
            @Override
            public void run() throws Exception {
                assertEquals(expected, actual);
            }
        }, 5);
View Full Code Here

        assertEquals(100, map.get(1));
    }

    private void assertFinalValueEquals(final int expected, final int actual) {
        assertTrueEventually(new AssertTask() {
            @Override
            public void run() throws Exception {
                assertEquals(expected, actual);
            }
        }, 20);
View Full Code Here

    private void assertWriteBehindQueuesEmptyOnOwnerAndOnBackups(final String mapName,
                                                                 final long numberOfItems,
                                                                 final MapStoreWithCounter mapStore,
                                                                 final HazelcastInstance[] nodes) {
        AssertTask assertTask = new AssertTask() {
            @Override
            public void run() throws Exception {
                assertEquals(0, writeBehindQueueSize(nodes[0], mapName));
                assertEquals(0, writeBehindQueueSize(nodes[1], mapName));
View Full Code Here

        Config config = newConfig(testMapStore, 0);
        HazelcastInstance instance = createHazelcastInstance(config);
        final IMap map = instance.getMap("default");


        assertTrueEventually(new AssertTask() {
            @Override
            public void run() throws Exception {
                Set expected = map.keySet(Predicates.greaterThan("value", 1));
                assertEquals(3, expected.size());
                assertTrue(expected.contains("key1"));
View Full Code Here

        Config config = newConfig(testMapStore, 0);
        HazelcastInstance instance = createHazelcastInstance(config);
        final IMap map = instance.getMap("default");

        assertTrueEventually(new AssertTask() {
            @Override
            public void run() throws Exception {
                final Collection values = map.values(Predicates.greaterThan("value", 1));
                assertEquals(3, values.size());
                assertTrue(values.contains(17));
View Full Code Here

        Config config = newConfig(testMapStore, 0);
        HazelcastInstance instance = createHazelcastInstance(config);
        final IMap map = instance.getMap("default");

        assertTrueEventually(new AssertTask() {
            @Override
            public void run() throws Exception {
                final Set<Map.Entry> entrySet = map.entrySet(Predicates.greaterThan("value", 1));
                assertEquals(3, entrySet.size());
            }
View Full Code Here

                .withWriteBatchSize(writeBatchSize)
                .build();

        final int numberOfItems = 1024;
        populateMap(map, numberOfItems);
        assertTrueEventually(new AssertTask() {
            @Override
            public void run() throws Exception {
                // expecting more than half of operations should have the write batch size.
                // takes this a lower bound.
                final int expectedBatchOpCount = (numberOfItems / writeBatchSize) / 2;
View Full Code Here

        //start a second server and verify that the listener receives it.
        final HazelcastInstance server2 = Hazelcast.newHazelcastInstance();

        //verify that the listener receives member added event.
        assertTrueEventually(new AssertTask() {
            @Override
            public void run() {
                assertEquals(1, listener.events.size());
                MembershipEvent event = listener.events.get(0);
                assertEquals(MembershipEvent.MEMBER_ADDED, event.getEventType());
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.