use of com.hazelcast.simulator.agent.Agent in project hazelcast-simulator by hazelcast.
the class CoordinatorTest method beforeClass.
@BeforeClass
public static void beforeClass() throws Exception {
setupFakeEnvironment();
hzConfig = FileUtils.fileAsText(new File(localResourceDirectory(), "hazelcast.xml"));
hzClientConfig = FileUtils.fileAsText(new File(localResourceDirectory(), "client-hazelcast.xml"));
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();
agentData = registry.addAgent(localIp(), localIp());
coordinator = new Coordinator(registry, coordinatorParameters);
coordinator.start();
}
use of com.hazelcast.simulator.agent.Agent 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