Search in sources :

Example 31 with TestHazelcastFactory

use of com.hazelcast.client.test.TestHazelcastFactory in project hazelcast by hazelcast.

the class ClientCacheHazelcastInstanceAwareTest method createInstance.

@Override
protected HazelcastInstance createInstance() {
    if (instanceFactory != null) {
        throw new IllegalStateException("There should not be multiple creation of TestHazelcastFactory!");
    }
    instanceFactory = new TestHazelcastFactory();
    Config config = createConfig();
    instanceFactory.newHazelcastInstance(config);
    return instanceFactory.newHazelcastClient();
}
Also used : Config(com.hazelcast.config.Config) TestHazelcastFactory(com.hazelcast.client.test.TestHazelcastFactory)

Example 32 with TestHazelcastFactory

use of com.hazelcast.client.test.TestHazelcastFactory in project hazelcast by hazelcast.

the class MultiMapAggregationLiteMemberTest method before.

@Before
public void before() {
    factory = new TestHazelcastFactory();
    final HazelcastInstance lite = factory.newHazelcastInstance(new Config().setLiteMember(true));
    final HazelcastInstance instance1 = factory.newHazelcastInstance();
    final HazelcastInstance instance2 = factory.newHazelcastInstance();
    assertClusterSizeEventually(3, lite);
    assertClusterSizeEventually(3, instance1);
    assertClusterSizeEventually(3, instance2);
    client = factory.newHazelcastClient();
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) Config(com.hazelcast.config.Config) TestHazelcastFactory(com.hazelcast.client.test.TestHazelcastFactory) Before(org.junit.Before)

Example 33 with TestHazelcastFactory

use of com.hazelcast.client.test.TestHazelcastFactory in project hazelcast by hazelcast.

the class MapNearCacheInvalidationFromClientTest method init.

@Before
public void init() {
    mapName = randomMapName();
    factory = new TestHazelcastFactory();
    factory.newHazelcastInstance(createServerConfig(mapName, false));
    lite = factory.newHazelcastInstance(createServerConfig(mapName, true));
    client = factory.newHazelcastClient();
}
Also used : TestHazelcastFactory(com.hazelcast.client.test.TestHazelcastFactory) Before(org.junit.Before)

Example 34 with TestHazelcastFactory

use of com.hazelcast.client.test.TestHazelcastFactory in project hazelcast by hazelcast.

the class ClientQueryCacheBasicTest method setup.

// setup a map with 2 query caches, same predicate, one includes values, the other excludes values
@Before
public void setup() {
    Config config = new Config();
    ClientConfig clientConfig = new ClientConfig();
    clientConfig.addQueryCacheConfig(TEST_MAP_NAME, new QueryCacheConfig(QUERY_CACHE_NAME).setPredicateConfig(new PredicateConfig(predicate)).setIncludeValue(includeValues));
    if (useNearCache) {
        clientConfig.addNearCacheConfig(new NearCacheConfig().setName(TEST_MAP_NAME).setInvalidateOnChange(true));
    }
    clientConfig.setProperty(MapEventPublisherImpl.LISTENER_WITH_PREDICATE_PRODUCES_NATURAL_EVENT_TYPES.getName(), Boolean.toString(useQueryCacheNaturalFilteringStrategy));
    factory = new TestHazelcastFactory();
    factory.newHazelcastInstance(config);
    HazelcastInstance client = factory.newHazelcastClient(clientConfig);
    map = client.getMap(TEST_MAP_NAME);
    queryCache = map.getQueryCache(QUERY_CACHE_NAME);
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) QueryCacheConfig(com.hazelcast.config.QueryCacheConfig) PredicateConfig(com.hazelcast.config.PredicateConfig) ClientConfig(com.hazelcast.client.config.ClientConfig) QueryCacheConfig(com.hazelcast.config.QueryCacheConfig) Config(com.hazelcast.config.Config) NearCacheConfig(com.hazelcast.config.NearCacheConfig) PredicateConfig(com.hazelcast.config.PredicateConfig) TestHazelcastFactory(com.hazelcast.client.test.TestHazelcastFactory) NearCacheConfig(com.hazelcast.config.NearCacheConfig) ClientConfig(com.hazelcast.client.config.ClientConfig) Before(org.junit.Before)

Example 35 with TestHazelcastFactory

use of com.hazelcast.client.test.TestHazelcastFactory in project hazelcast by hazelcast.

the class ClientClusterServiceMemberListTest method before.

@Before
public void before() {
    factory = new TestHazelcastFactory();
    liteInstance = factory.newHazelcastInstance(liteConfig);
    dataInstance = factory.newHazelcastInstance();
    dataInstance2 = factory.newHazelcastInstance();
    client = factory.newHazelcastClient();
}
Also used : TestHazelcastFactory(com.hazelcast.client.test.TestHazelcastFactory) Before(org.junit.Before)

Aggregations

TestHazelcastFactory (com.hazelcast.client.test.TestHazelcastFactory)48 Before (org.junit.Before)30 Config (com.hazelcast.config.Config)24 HazelcastInstance (com.hazelcast.core.HazelcastInstance)18 ClientConfig (com.hazelcast.client.config.ClientConfig)12 MapConfig (com.hazelcast.config.MapConfig)9 QuorumConfig (com.hazelcast.config.QuorumConfig)7 PartitionedCluster (com.hazelcast.quorum.PartitionedCluster)7 BeforeClass (org.junit.BeforeClass)7 CacheSimpleConfig (com.hazelcast.config.CacheSimpleConfig)3 NearCacheConfig (com.hazelcast.config.NearCacheConfig)3 HazelcastClientCacheManager (com.hazelcast.client.cache.impl.HazelcastClientCacheManager)2 HazelcastClientCachingProvider (com.hazelcast.client.cache.impl.HazelcastClientCachingProvider)2 ClientNetworkConfig (com.hazelcast.client.config.ClientNetworkConfig)2 MapStoreConfig (com.hazelcast.config.MapStoreConfig)2 QueryCacheConfig (com.hazelcast.config.QueryCacheConfig)2 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 CachingProvider (javax.cache.spi.CachingProvider)2 HazelcastServerCacheManager (com.hazelcast.cache.impl.HazelcastServerCacheManager)1