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);
}
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);
}
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);
}
}
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();
}
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);
}
Aggregations