Search in sources :

Example 26 with Verify

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

the class MapAsyncOpsTest method globalVerify.

@Verify(global = true)
public void globalVerify() {
    MapOperationCounter totalMapOperationsCount = new MapOperationCounter();
    for (MapOperationCounter mapOperationsCount : results) {
        totalMapOperationsCount.add(mapOperationsCount);
    }
    logger.info(name + ": " + totalMapOperationsCount + " total of " + results.size());
}
Also used : MapOperationCounter(com.hazelcast.simulator.tests.map.helpers.MapOperationCounter) Verify(com.hazelcast.simulator.test.annotations.Verify)

Example 27 with Verify

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

the class MapTransactionContextConflictTest method verify.

@Verify(global = false)
public void verify() {
    IList<TxnCounter> counts = targetInstance.getList(name + "count");
    TxnCounter total = new TxnCounter();
    for (TxnCounter c : counts) {
        total.add(c);
    }
    logger.info(name + ": " + total + " from " + counts.size() + " worker threads");
    IList<long[]> allIncrements = targetInstance.getList(name + "inc");
    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 28 with Verify

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

the class MapPredicateTest method globalVerify.

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

Example 29 with Verify

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

the class MapReduceTest method globalVerify.

@Verify(global = true)
public void globalVerify() {
    MapReduceOperationCounter total = new MapReduceOperationCounter();
    for (MapReduceOperationCounter operationCounter : operationCounterList) {
        total.add(operationCounter);
    }
    logger.info(name + ": " + total + " from " + operationCounterList.size() + " worker threads");
}
Also used : MapReduceOperationCounter(com.hazelcast.simulator.tests.map.helpers.MapReduceOperationCounter) Verify(com.hazelcast.simulator.test.annotations.Verify)

Example 30 with Verify

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

the class QueueTest method verify.

@Verify
public void verify() {
    long expected = totalCounter.get();
    long actual = 0;
    for (Queue<Long> queue : queues) {
        for (Long queueCounter : queue) {
            actual += queueCounter;
        }
    }
    assertEquals(expected, actual);
}
Also used : AtomicLong(java.util.concurrent.atomic.AtomicLong) 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