use of com.hazelcast.simulator.vendors.HazelcastDriver in project hazelcast-simulator by hazelcast.
the class WorkerTest method before.
@Before
public void before() {
setupFakeEnvironment();
Registry registry = new Registry();
AgentData agent = registry.addAgent(PUBLIC_ADDRESS, PUBLIC_ADDRESS);
SimulatorProperties properties = new SimulatorProperties().set("MANAGEMENT_CENTER_URL", "none");
VendorDriver driver = new HazelcastDriver().setAgents(registry.getAgents()).setAll(properties.asPublicMap()).set("CONFIG", fileAsText(localResourceDirectory() + "/hazelcast.xml"));
workerAddress = workerAddress(AGENT_INDEX, WORKER_INDEX);
parameters = driver.loadWorkerParameters("member", agent.getAddressIndex()).set("WORKER_ADDRESS", workerAddress).set("PUBLIC_ADDRESS", PUBLIC_ADDRESS);
for (Map.Entry<String, String> entry : parameters.entrySet()) {
String key = entry.getKey();
if (key.startsWith("file:")) {
FileUtils.writeText(entry.getValue(), new File(getUserDir(), key.substring(5, key.length())));
}
}
}
use of com.hazelcast.simulator.vendors.HazelcastDriver in project hazelcast-simulator by hazelcast.
the class CoordinatorRunMonolithTest method setUp.
@Before
public void setUp() throws Exception {
setupFakeEnvironment();
File simulatorPropertiesFile = new File(getUserDir(), "simulator.properties");
appendText("CLOUD_PROVIDER=embedded\n", simulatorPropertiesFile);
SimulatorProperties simulatorProperties = loadSimulatorProperties();
CoordinatorParameters coordinatorParameters = new CoordinatorParameters().setSimulatorProperties(simulatorProperties).setSkipShutdownHook(true);
agent = new Agent(1, "127.0.0.1", simulatorProperties.getAgentPort(), 60, null);
agent.start();
registry = new Registry();
registry.addAgent(localIp(), localIp());
copy(new File(localResourceDirectory(), "hazelcast.xml"), new File(getUserDir(), "hazelcast.xml"));
hazelcastDriver = new HazelcastDriver().setAgents(registry.getAgents()).setAll(simulatorProperties.asPublicMap()).set("SESSION_ID", coordinatorParameters.getSessionId());
coordinator = new Coordinator(registry, coordinatorParameters);
coordinator.start();
run = new CoordinatorRunMonolith(coordinator, coordinatorParameters);
}
Aggregations