Search in sources :

Example 1 with DefaultNodeContext

use of com.hazelcast.instance.impl.DefaultNodeContext in project hazelcast by hazelcast.

the class CustomNodeExtensionTestInstanceFactory method newHazelcastInstance.

@Override
public HazelcastInstance newHazelcastInstance(Config config) {
    String instanceName = config != null ? config.getInstanceName() : null;
    NodeContext nodeContext;
    if (TestEnvironment.isMockNetwork()) {
        config = initOrCreateConfig(config);
        nodeContext = this.registry.createNodeContext(this.nextAddress(config.getNetworkConfig().getPort()));
    } else {
        nodeContext = new DefaultNodeContext();
    }
    return HazelcastInstanceFactory.newHazelcastInstance(config, instanceName, new WanServiceMockingNodeContext(nodeContext, nodeExtensionFn));
}
Also used : NodeContext(com.hazelcast.instance.impl.NodeContext) DefaultNodeContext(com.hazelcast.instance.impl.DefaultNodeContext) DefaultNodeContext(com.hazelcast.instance.impl.DefaultNodeContext)

Aggregations

DefaultNodeContext (com.hazelcast.instance.impl.DefaultNodeContext)1 NodeContext (com.hazelcast.instance.impl.NodeContext)1