Search in sources :

Example 6 with Verify

use of com.hazelcast.simulator.test.annotations.Verify in project hazelcast-simulator by hazelcast.

the class MapTTLTest method globalVerify.

@Verify
public void globalVerify() {
    MapOperationCounter total = new MapOperationCounter();
    for (MapOperationCounter counter : results) {
        total.add(counter);
    }
    logger.info(name + ": " + total + " total of " + results.size());
    assertTrueEventually(new AssertTask() {

        @Override
        public void run() throws Exception {
            assertEquals(name + ": Map should be empty, some TTL events are not processed", 0, map.size());
        }
    });
}
Also used : AssertTask(com.hazelcast.simulator.utils.AssertTask) MapOperationCounter(com.hazelcast.simulator.tests.map.helpers.MapOperationCounter) DistributedObjectDestroyedException(com.hazelcast.spi.exception.DistributedObjectDestroyedException) Verify(com.hazelcast.simulator.test.annotations.Verify)

Example 7 with Verify

use of com.hazelcast.simulator.test.annotations.Verify in project hazelcast-simulator by hazelcast.

the class MapTransactionGetForUpdateTest method verify.

@Verify(global = false)
public void verify() {
    IList<TxnCounter> counts = targetInstance.getList(name + "report");
    TxnCounter total = new TxnCounter();
    for (TxnCounter c : counts) {
        total.add(c);
    }
    logger.info(name + ": " + total + " from " + counts.size() + " workers");
    IList<long[]> allIncrements = targetInstance.getList(name + "res");
    long[] expected = new long[keyCount];
    for (long[] incs : allIncrements) {
        for (int i = 0; i < incs.length; i++) {
            expected[i] += incs[i];
        }
    }
    IMap<Integer, Long> map = targetInstance.getMap(name);
    int failures = 0;
    for (int i = 0; i < keyCount; i++) {
        if (expected[i] != map.get(i)) {
            failures++;
            logger.info(name + ": key=" + i + " expected " + expected[i] + " != " + "actual " + map.get(i));
        }
    }
    assertEquals(name + ": " + failures + " key=>values have been incremented unExpected", 0, failures);
}
Also used : TxnCounter(com.hazelcast.simulator.tests.helpers.TxnCounter) Verify(com.hazelcast.simulator.test.annotations.Verify)

Example 8 with Verify

use of com.hazelcast.simulator.test.annotations.Verify in project hazelcast-simulator by hazelcast.

the class MapMaxSizeTest method globalVerify.

@Verify
public void globalVerify() {
    MapMaxSizeOperationCounter total = new MapMaxSizeOperationCounter();
    for (MapMaxSizeOperationCounter operationCounter : operationCounterList) {
        total.add(operationCounter);
    }
    logger.info(format("Operation counters from %s: %s", name, total));
    assertMapMaxSize();
}
Also used : MapMaxSizeOperationCounter(com.hazelcast.simulator.tests.map.helpers.MapMaxSizeOperationCounter) Verify(com.hazelcast.simulator.test.annotations.Verify)

Example 9 with Verify

use of com.hazelcast.simulator.test.annotations.Verify in project hazelcast-simulator by hazelcast.

the class ReplicatedTTL method localVerify.

@Verify(global = false)
public void localVerify() {
    MapOperationCounter total = new MapOperationCounter();
    for (MapOperationCounter counter : results) {
        total.add(counter);
    }
    logger.info(name + ": " + total + " total of " + results.size());
    assertTrueEventually(new AssertTask() {

        @Override
        public void run() throws Exception {
            logger.info(name + ": " + "assert map Size = " + map.size());
            assertEquals(name + ": Replicated Map should be empty, some TTL events are not processed", 0, map.size());
        }
    });
}
Also used : AssertTask(com.hazelcast.simulator.utils.AssertTask) MapOperationCounter(com.hazelcast.simulator.tests.map.helpers.MapOperationCounter) DistributedObjectDestroyedException(com.hazelcast.spi.exception.DistributedObjectDestroyedException) Verify(com.hazelcast.simulator.test.annotations.Verify)

Example 10 with Verify

use of com.hazelcast.simulator.test.annotations.Verify in project hazelcast-simulator by hazelcast.

the class ReliableTopicTest method verify.

@Verify(global = true)
public void verify() {
    final long expectedCount = listenersPerTopic * totalMessagesSend.get();
    assertTrueEventually(new AssertTask() {

        @Override
        public void run() throws Exception {
            long actualCount = 0;
            for (MessageListenerImpl topicListener : listeners) {
                actualCount += topicListener.received.get();
            }
            assertEquals("published messages don't match received messages", expectedCount, actualCount);
        }
    });
    assertEquals("Failures found", 0, failures.get());
}
Also used : AssertTask(com.hazelcast.simulator.utils.AssertTask) IOException(java.io.IOException) TestException(com.hazelcast.simulator.test.TestException) Verify(com.hazelcast.simulator.test.annotations.Verify)

Aggregations

Verify (com.hazelcast.simulator.test.annotations.Verify)31 AssertTask (com.hazelcast.simulator.utils.AssertTask)7 ILock (com.hazelcast.core.ILock)4 MapOperationCounter (com.hazelcast.simulator.tests.map.helpers.MapOperationCounter)4 TxnCounter (com.hazelcast.simulator.tests.helpers.TxnCounter)3 MapStoreConfig (com.hazelcast.config.MapStoreConfig)2 DistributedObject (com.hazelcast.core.DistributedObject)2 DistributedObjectDestroyedException (com.hazelcast.spi.exception.DistributedObjectDestroyedException)2 CardinalityEstimator (com.hazelcast.cardinality.CardinalityEstimator)1 MapConfig (com.hazelcast.config.MapConfig)1 IAtomicLong (com.hazelcast.core.IAtomicLong)1 IQueue (com.hazelcast.core.IQueue)1 BaseThreadState (com.hazelcast.simulator.test.BaseThreadState)1 StopException (com.hazelcast.simulator.test.StopException)1 TestException (com.hazelcast.simulator.test.TestException)1 ICacheCreateDestroyCounter (com.hazelcast.simulator.tests.icache.helpers.ICacheCreateDestroyCounter)1 ICacheEntryListener (com.hazelcast.simulator.tests.icache.helpers.ICacheEntryListener)1 ICacheListenerOperationCounter (com.hazelcast.simulator.tests.icache.helpers.ICacheListenerOperationCounter)1 ICacheOperationCounter (com.hazelcast.simulator.tests.icache.helpers.ICacheOperationCounter)1 ICacheReadWriteCounter (com.hazelcast.simulator.tests.icache.helpers.ICacheReadWriteCounter)1