Search in sources :

Example 6 with Setup

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

the class CacheLoaderTest method setup.

@Setup
public void setup() {
    loaderList = targetInstance.getList(name + "loaders");
    config = new MutableConfiguration<Integer, Integer>();
    config.setReadThrough(true);
    RecordingCacheLoader<Integer> recordingCacheLoader = new RecordingCacheLoader<Integer>();
    recordingCacheLoader.loadAllDelayMs = loadAllDelayMs;
    config.setCacheLoaderFactory(FactoryBuilder.factoryOf(recordingCacheLoader));
    CacheManager cacheManager = createCacheManager(targetInstance);
    cacheManager.createCache(name, config);
    cache = cacheManager.getCache(name);
}
Also used : CacheUtils.createCacheManager(com.hazelcast.simulator.tests.icache.helpers.CacheUtils.createCacheManager) CacheManager(javax.cache.CacheManager) RecordingCacheLoader(com.hazelcast.simulator.tests.icache.helpers.RecordingCacheLoader) Setup(com.hazelcast.simulator.test.annotations.Setup)

Example 7 with Setup

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

the class ConcurrentCreateICacheTest method setup.

@Setup
public void setup() {
    counterList = targetInstance.getList(name);
    CacheConfig config = new CacheConfig();
    config.setName(name);
    Counter counter = new Counter();
    try {
        CacheManager cacheManager = createCacheManager(targetInstance);
        cacheManager.createCache(name, config);
        counter.create++;
    } catch (CacheException e) {
        logger.fatal(name + ": createCache exception " + e, e);
        counter.createException++;
    }
    counterList.add(counter);
}
Also used : CacheException(javax.cache.CacheException) CacheUtils.createCacheManager(com.hazelcast.simulator.tests.icache.helpers.CacheUtils.createCacheManager) CacheManager(javax.cache.CacheManager) CacheConfig(com.hazelcast.config.CacheConfig) Setup(com.hazelcast.simulator.test.annotations.Setup)

Example 8 with Setup

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

the class EntryProcessorICacheTest method setup.

@Setup
public void setup() {
    resultsPerWorker = targetInstance.getList(name + ":ResultMap");
    CacheManager cacheManager = createCacheManager(targetInstance);
    cache = cacheManager.getCache(name);
}
Also used : CacheUtils.createCacheManager(com.hazelcast.simulator.tests.icache.helpers.CacheUtils.createCacheManager) CacheManager(javax.cache.CacheManager) Setup(com.hazelcast.simulator.test.annotations.Setup)

Example 9 with Setup

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

the class BucketReadWriteTest method setup.

@Setup
public void setup() {
    // ClusterManager clusterManager = cluster.clusterManager("Administrator", "password");
    // BucketSettings bucketSettings = new DefaultBucketSettings.Builder()
    // .type(BucketType.COUCHBASE)
    // .name(name)
    // .replicas(0)
    // .quota(120)
    // .build();
    // 
    // clusterManager.insertBucket(bucketSettings);
    values = generateStrings(valueCount, minValueLength, maxValueLength);
    ClusterManager clusterManager = cluster.clusterManager("Administrator", "password");
    for (BucketSettings b : clusterManager.getBuckets()) {
        logger.info(b);
    }
    bucket = cluster.openBucket(name);
}
Also used : ClusterManager(com.couchbase.client.java.cluster.ClusterManager) BucketSettings(com.couchbase.client.java.cluster.BucketSettings) Setup(com.hazelcast.simulator.test.annotations.Setup)

Example 10 with Setup

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

the class LongExternalizableCacheTest method setUp.

@Setup
public void setUp() {
    CacheManager cacheManager = createCacheManager(targetInstance);
    cache = cacheManager.getCache(name);
}
Also used : 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