Search in sources :

Example 1 with Server

use of com.hazelcast.simulator.protocol.Server in project hazelcast-simulator by hazelcast.

the class WorkerProcessManager_LaunchTest method before.

@Before
public void before() {
    File simulatorHome = setupFakeEnvironment();
    workersHome = new File(simulatorHome, "workers");
    server = mock(Server.class);
    workerProcessManager = new WorkerProcessManager(server, SimulatorAddress.fromString("A1"), "127.0.0.1");
}
Also used : Server(com.hazelcast.simulator.protocol.Server) File(java.io.File) Before(org.junit.Before)

Example 2 with Server

use of com.hazelcast.simulator.protocol.Server in project hazelcast-simulator by hazelcast.

the class WorkerProcessFailureMonitorTest method before.

@Before
public void before() {
    File simulatorHome = setupFakeEnvironment();
    workersHome = new File(simulatorHome, "workers");
    failureHandler = mock(WorkerProcessFailureHandler.class);
    Server server = mock(Server.class);
    workerProcessManager = new WorkerProcessManager(server, SimulatorAddress.fromString("A1"), "127.0.0.1");
    workerProcessFailureMonitor = new WorkerProcessFailureMonitor(failureHandler, workerProcessManager, DEFAULT_LAST_SEEN_TIMEOUT_SECONDS, DEFAULT_CHECK_INTERVAL);
    workerProcessFailureMonitor.start();
}
Also used : Server(com.hazelcast.simulator.protocol.Server) File(java.io.File) FileUtils.ensureExistingFile(com.hazelcast.simulator.utils.FileUtils.ensureExistingFile) Before(org.junit.Before)

Example 3 with Server

use of com.hazelcast.simulator.protocol.Server in project hazelcast-simulator by hazelcast.

the class WorkerProcessManagerTest method before.

@Before
public void before() {
    workerAddress1 = workerAddress(1, 1);
    workerAddress2 = workerAddress(1, 2);
    workerProcess1 = new WorkerProcess(workerAddress1, workerAddress1.toString(), null);
    workerProcess1.setProcess(mock(Process.class));
    workerProcess2 = new WorkerProcess(workerAddress2, workerAddress2.toString(), null);
    workerProcess2.setProcess(mock(Process.class));
    Server server = mock(Server.class);
    workerProcessManager = new WorkerProcessManager(server, workerAddress1.getParent(), "127.0.0.1");
    workerProcessManager.add(workerAddress1, workerProcess1);
    workerProcessManager.add(workerAddress2, workerProcess2);
}
Also used : Server(com.hazelcast.simulator.protocol.Server) Before(org.junit.Before)

Aggregations

Server (com.hazelcast.simulator.protocol.Server)3 Before (org.junit.Before)3 File (java.io.File)2 FileUtils.ensureExistingFile (com.hazelcast.simulator.utils.FileUtils.ensureExistingFile)1