Package com.hazelcast.test

Examples of com.hazelcast.test.AssertTask


        List<Integer> expectedOrder = new ArrayList<Integer>();
        for (int i = 0; i < maxTasks; i++) {
            expectedOrder.add(i);
        }

        assertTrueEventually(new AssertTask() {
            public void run() throws Exception {
                List<Integer> actualOrder = processorMap.get(key);
                assertEquals("failed to execute all entry processor tasks", maxTasks, actualOrder.size());
            }
        });
View Full Code Here


    private void assertNoLitterInOpService(HazelcastInstance hz) {
        final BasicOperationService operationService = (BasicOperationService) getNode(hz).nodeEngine.getOperationService();

        //we need to do this with an assertTrueEventually because it can happen that system calls are being send
        //and this leads to the maps not being empty. But eventually they will be empty at some moment in time.
        assertTrueEventually(new AssertTask() {
            @Override
            public void run() {
                assertEquals("invocations should be empty", 0, operationService.invocations.size());
             }
        });
View Full Code Here

        lock.lock();
        condition0.signalAll();
        lock.unlock();

        assertTrueDelayed5sec(new AssertTask() {
            @Override
            public void run() throws Exception {
                assertEquals(latch.getCount(), 9);
            }
        });
View Full Code Here

        lock.lock();
        condition.signal();
        lock.unlock();

        assertTrueDelayed5sec(new AssertTask() {
            @Override
            public void run() throws Exception {
                assertEquals(9, latch.getCount());
            }
        });
View Full Code Here

        final AtomicInteger addCounter = new AtomicInteger(0);
        TestListener listener = new TestListener(addCounter);
        String registrationId = queue.addItemListener(listener, false);
        queue.add("item1");
        queue.add("item2");
        assertTrueEventually(new AssertTask() {
            @Override
            public void run() throws Exception {
                assertEquals(2, addCounter.get());
            }
        });
View Full Code Here

        for (int i = 0; i < 4; i++) {
            assertEquals(expectedResults[i], (int) result.get(String.valueOf(i)));
        }

        assertTrueEventually(new AssertTask() {
            @Override
            public void run() {
                if (processInformation.getProcessedRecords() < 10000) {
                    System.err.println(processInformation.getProcessedRecords());
                }
View Full Code Here

        for (int i = 0; i < ENTRIES; ++i) {
            final int id = i;
            new Thread(new Runnable() {
                @Override
                public void run() {
                    assertTrueEventually(new AssertTask() {
                        @Override
                        public void run() throws Exception {
                            assertTrue(expected.size() <= map.get(id).size());
                        }
                    });
View Full Code Here

        }
        map1.evictAll();

        assertOpenEventually(countDownLatch);
        assertEquals(0, countDownLatch.getCount());
        assertTrueEventually(new AssertTask() {
            @Override
            public void run() throws Exception {
                assertEquals(0, map1.getLocalMapStats().getHeapCost());
            }
        });
        assertTrueEventually(new AssertTask() {
            @Override
            public void run() throws Exception {
                assertEquals(0, map2.getLocalMapStats().getHeapCost());
            }
        });
View Full Code Here

        map1.lock(KEY);
        boolean putResult = map2.tryPut(KEY, VAL_2, 2, TimeUnit.SECONDS);

        Assert.assertFalse("the result of try put should be false as the absent key is locked", putResult);
        assertTrueEventually(new AssertTask() {
            public void run() {
                Assert.assertEquals("the key should be absent ", null, map1.get(KEY));
                Assert.assertEquals("the key should be absent ", null, map2.get(KEY));
            }
        });
View Full Code Here

                    // get map
                    // this will trigger loading the data
                    final IMap<String, String> map = hcInstance.getMap(mapName);
                    mapSize.set(map.size());
                    node1FinishedLoading.countDown();
                    assertTrueEventually(new AssertTask() {
                        @Override
                        public void run() throws Exception {
                            assertEquals(preloadSize, map.size());
                        }
                    }, 5);
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.