Search in sources :

Example 26 with TestHazelcastFactory

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

the class ClientClusterProxyTest method client.

private HazelcastInstance client() {
    factory = new TestHazelcastFactory();
    Config config = new Config();
    String groupAName = "HZ:GROUP";
    config.getGroupConfig().setName(groupAName);
    factory.newHazelcastInstance(config);
    ClientConfig clientConfig = new ClientConfig();
    clientConfig.setGroupConfig(new GroupConfig(config.getGroupConfig().getName()));
    return factory.newHazelcastClient(clientConfig);
}
Also used : GroupConfig(com.hazelcast.config.GroupConfig) Config(com.hazelcast.config.Config) GroupConfig(com.hazelcast.config.GroupConfig) ClientConfig(com.hazelcast.client.config.ClientConfig) TestHazelcastFactory(com.hazelcast.client.test.TestHazelcastFactory) ClientConfig(com.hazelcast.client.config.ClientConfig)

Example 27 with TestHazelcastFactory

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

the class ClientCacheReadQuorumTest method initialize.

@BeforeClass
public static void initialize() throws Exception {
    QuorumConfig quorumConfig = new QuorumConfig();
    quorumConfig.setName(QUORUM_ID);
    quorumConfig.setType(QuorumType.READ);
    quorumConfig.setEnabled(true);
    quorumConfig.setSize(3);
    CacheSimpleConfig cacheConfig = new CacheSimpleConfig();
    cacheConfig.setName(CACHE_NAME_PREFIX + "*");
    cacheConfig.setQuorumName(QUORUM_ID);
    factory = new TestHazelcastFactory();
    cluster = new PartitionedCluster(factory).createFiveMemberCluster(cacheConfig, quorumConfig);
    initializeClients();
    initializeCaches();
    cluster.splitFiveMembersThreeAndTwo();
    verifyClients();
}
Also used : QuorumConfig(com.hazelcast.config.QuorumConfig) CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) TestHazelcastFactory(com.hazelcast.client.test.TestHazelcastFactory) PartitionedCluster(com.hazelcast.quorum.PartitionedCluster) BeforeClass(org.junit.BeforeClass)

Example 28 with TestHazelcastFactory

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

the class ClientCacheReadWriteQuorumTest method initialize.

@BeforeClass
public static void initialize() throws Exception {
    QuorumConfig quorumConfig = new QuorumConfig();
    quorumConfig.setName(QUORUM_ID);
    quorumConfig.setType(QuorumType.READ_WRITE);
    quorumConfig.setEnabled(true);
    quorumConfig.setSize(3);
    CacheSimpleConfig cacheConfig = new CacheSimpleConfig();
    cacheConfig.setName(CACHE_NAME_PREFIX + "*");
    cacheConfig.setQuorumName(QUORUM_ID);
    factory = new TestHazelcastFactory();
    cluster = new PartitionedCluster(factory).createFiveMemberCluster(cacheConfig, quorumConfig);
    initializeClients();
    initializeCaches();
    cluster.splitFiveMembersThreeAndTwo();
    verifyClients();
}
Also used : QuorumConfig(com.hazelcast.config.QuorumConfig) CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) TestHazelcastFactory(com.hazelcast.client.test.TestHazelcastFactory) PartitionedCluster(com.hazelcast.quorum.PartitionedCluster) BeforeClass(org.junit.BeforeClass)

Example 29 with TestHazelcastFactory

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

the class ClientMapWriteQuorumTest method initialize.

@BeforeClass
public static void initialize() throws Exception {
    QuorumConfig quorumConfig = new QuorumConfig();
    quorumConfig.setName(QUORUM_ID);
    quorumConfig.setEnabled(true);
    quorumConfig.setSize(3);
    quorumConfig.setType(QuorumType.WRITE);
    MapConfig mapConfig = new MapConfig(MAP_NAME_PREFIX + "*");
    mapConfig.setQuorumName(QUORUM_ID);
    factory = new TestHazelcastFactory();
    cluster = new PartitionedCluster(factory).partitionFiveMembersThreeAndTwo(mapConfig, quorumConfig);
    initializeClients();
    verifyClients();
}
Also used : QuorumConfig(com.hazelcast.config.QuorumConfig) TestHazelcastFactory(com.hazelcast.client.test.TestHazelcastFactory) PartitionedCluster(com.hazelcast.quorum.PartitionedCluster) MapConfig(com.hazelcast.config.MapConfig) BeforeClass(org.junit.BeforeClass)

Example 30 with TestHazelcastFactory

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

the class ClientLoggingServiceTest method setUp.

@Before
public void setUp() {
    factory = new TestHazelcastFactory();
    HazelcastInstance member = factory.newHazelcastInstance();
    HazelcastInstance client = factory.newHazelcastClient();
    loggingService = client.getLoggingService();
    logListener = new LogListener() {

        @Override
        public void log(LogEvent logEvent) {
        }
    };
    logEvent = new LogEvent(null, member.getCluster().getLocalMember());
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) LogListener(com.hazelcast.logging.LogListener) LogEvent(com.hazelcast.logging.LogEvent) 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