Search in sources :

Example 1 with Setup

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

the class MapTransactionTest method setup.

@Setup
public void setup() {
    map = targetInstance.getMap(name);
    resultList = targetInstance.getList(name + "results");
    transactionOptions = new TransactionOptions();
    transactionOptions.setTransactionType(transactionType).setDurability(durability);
}
Also used : TransactionOptions(com.hazelcast.transaction.TransactionOptions) Setup(com.hazelcast.simulator.test.annotations.Setup)

Example 2 with Setup

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

the class PagingPredicateTest method setUp.

@Setup
public void setUp() {
    map = targetInstance.getMap(name);
    innerPredicate = new SqlPredicate(innerPredicateQuery);
}
Also used : SqlPredicate(com.hazelcast.query.SqlPredicate) Setup(com.hazelcast.simulator.test.annotations.Setup)

Example 3 with Setup

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

the class MapMaxSizeTest method setUp.

@Setup
public void setUp() {
    map = targetInstance.getMap(name);
    operationCounterList = targetInstance.getList(name + "OperationCounter");
    if (isMemberNode(targetInstance)) {
        MaxSizeConfig maxSizeConfig = targetInstance.getConfig().getMapConfig(name).getMaxSizeConfig();
        maxSizePerNode = maxSizeConfig.getSize();
        assertEqualsStringFormat("Expected MaxSizePolicy %s, but was %s", PER_NODE, maxSizeConfig.getMaxSizePolicy());
        assertTrue("Expected MaxSizePolicy.getSize() < Integer.MAX_VALUE", maxSizePerNode < Integer.MAX_VALUE);
        logger.info("MapSizeConfig of " + name + ": " + maxSizeConfig);
    }
}
Also used : MaxSizeConfig(com.hazelcast.config.MaxSizeConfig) Setup(com.hazelcast.simulator.test.annotations.Setup)

Example 4 with Setup

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

the class QuorumCacheTest method setup.

@Setup
@SuppressWarnings("unchecked")
public void setup() {
    CacheManager cacheManager = createCacheManager(targetInstance);
    cache = cacheManager.getCache(name);
    this.lastClusterSizeChange = new LastClusterSizeChange(0L, getMemberCount());
    this.quorumCount = targetInstance.getConfig().getQuorumConfig("cache-quorum-ref").getSize();
}
Also used : CacheUtils.createCacheManager(com.hazelcast.simulator.tests.icache.helpers.CacheUtils.createCacheManager) CacheManager(javax.cache.CacheManager) Setup(com.hazelcast.simulator.test.annotations.Setup)

Example 5 with Setup

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

the class EvictionICacheTest method setup.

@Setup
public void setup() {
    value = new byte[valueSize];
    Random random = new Random();
    random.nextBytes(value);
    CacheManager cacheManager = createCacheManager(targetInstance);
    cache = (ICache<Object, Object>) cacheManager.getCache(name);
    CacheConfig<Object, Object> config = cache.getConfiguration(CacheConfig.class);
    logger.info(name + ": " + cache.getName() + " config: " + config);
    configuredMaxSize = config.getEvictionConfig().getSize();
    // the size of putAllMap is not guarantied to be configuredMaxSize / 2 as keys are random
    for (int i = 0; i < configuredMaxSize / 2; i++) {
        putAllMap.put(random.nextInt(), value);
    }
    if (configuredMaxSize < 1000) {
        toleranceFactor = TOLERANCE_FACTOR_SMALL;
    } else if (configuredMaxSize < 10000) {
        toleranceFactor = TOLERANCE_FACTOR_MEDIUM;
    } else {
        toleranceFactor = TOLERANCE_FACTOR_LARGE;
    }
    estimatedMaxSize = (int) (configuredMaxSize * toleranceFactor);
}
Also used : Random(java.util.Random) CacheUtils.createCacheManager(com.hazelcast.simulator.tests.icache.helpers.CacheUtils.createCacheManager) CacheManager(javax.cache.CacheManager) Setup(com.hazelcast.simulator.test.annotations.Setup)

Aggregations

Setup (com.hazelcast.simulator.test.annotations.Setup)25 CacheManager (javax.cache.CacheManager)16 CacheUtils.createCacheManager (com.hazelcast.simulator.tests.icache.helpers.CacheUtils.createCacheManager)14 Random (java.util.Random)3 RecordingCacheLoader (com.hazelcast.simulator.tests.icache.helpers.RecordingCacheLoader)2 BucketSettings (com.couchbase.client.java.cluster.BucketSettings)1 ClusterManager (com.couchbase.client.java.cluster.ClusterManager)1 CacheConfig (com.hazelcast.config.CacheConfig)1 Config (com.hazelcast.config.Config)1 MapConfig (com.hazelcast.config.MapConfig)1 MaxSizeConfig (com.hazelcast.config.MaxSizeConfig)1 Member (com.hazelcast.core.Member)1 Partition (com.hazelcast.core.Partition)1 PartitionService (com.hazelcast.core.PartitionService)1 HazelcastThreadGroup (com.hazelcast.instance.HazelcastThreadGroup)1 Node (com.hazelcast.instance.Node)1 MetricsRegistry (com.hazelcast.internal.metrics.MetricsRegistry)1 IOThreadingModel (com.hazelcast.internal.networking.IOThreadingModel)1 LoggingService (com.hazelcast.logging.LoggingService)1 Address (com.hazelcast.nio.Address)1