Search in sources :

Example 16 with WorkerParameters

use of com.hazelcast.simulator.agent.workerprocess.WorkerParameters in project hazelcast-simulator by hazelcast.

the class AgentOperationProcessorTest method testCreateWorkerOperation.

@Test
public void testCreateWorkerOperation() throws Exception {
    CreateWorkerOperation op = new CreateWorkerOperation(new WorkerParameters(), 1);
    processor.process(op, source, promise);
    verify(processManager).launch(op, promise);
}
Also used : CreateWorkerOperation(com.hazelcast.simulator.agent.operations.CreateWorkerOperation) WorkerParameters(com.hazelcast.simulator.agent.workerprocess.WorkerParameters) Test(org.junit.Test)

Example 17 with WorkerParameters

use of com.hazelcast.simulator.agent.workerprocess.WorkerParameters in project hazelcast-simulator by hazelcast.

the class RegistryTest method testRemoveWorker_viaSimulatorAddress.

@Test
public void testRemoveWorker_viaSimulatorAddress() {
    SimulatorAddress agentAddress = addAgent();
    List<WorkerParameters> parametersList = newWorkerParametersList(agentAddress, 5);
    registry.addWorkers(parametersList);
    assertEquals(5, registry.workerCount());
    registry.removeWorker(workerAddress(1, 3));
    assertEquals(4, registry.workerCount());
}
Also used : WorkerParameters(com.hazelcast.simulator.agent.workerprocess.WorkerParameters) SimulatorAddress(com.hazelcast.simulator.protocol.core.SimulatorAddress) Test(org.junit.Test)

Example 18 with WorkerParameters

use of com.hazelcast.simulator.agent.workerprocess.WorkerParameters in project hazelcast-simulator by hazelcast.

the class RegistryTest method testHasClientWorkers_withClientWorkers.

@Test
public void testHasClientWorkers_withClientWorkers() {
    SimulatorAddress agentAddress = addAgent();
    List<WorkerParameters> parametersList = newWorkerParametersList(agentAddress, 2);
    registry.addWorkers(parametersList);
    parametersList = newWorkerParametersList(agentAddress, 2, "javaclient");
    registry.addWorkers(parametersList);
    assertTrue(registry.hasClientWorkers());
}
Also used : WorkerParameters(com.hazelcast.simulator.agent.workerprocess.WorkerParameters) SimulatorAddress(com.hazelcast.simulator.protocol.core.SimulatorAddress) Test(org.junit.Test)

Aggregations

WorkerParameters (com.hazelcast.simulator.agent.workerprocess.WorkerParameters)18 Test (org.junit.Test)9 SimulatorAddress (com.hazelcast.simulator.protocol.core.SimulatorAddress)8 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)3 Map (java.util.Map)3 AgentData (com.hazelcast.simulator.coordinator.registry.AgentData)2 File (java.io.File)2 List (java.util.List)2 HazelcastInstance (com.hazelcast.core.HazelcastInstance)1 CreateWorkerOperation (com.hazelcast.simulator.agent.operations.CreateWorkerOperation)1 FailureOperation (com.hazelcast.simulator.coordinator.operations.FailureOperation)1 Registry (com.hazelcast.simulator.coordinator.registry.Registry)1 ThreadSpawner (com.hazelcast.simulator.utils.ThreadSpawner)1 Arrays.asList (java.util.Arrays.asList)1 LinkedList (java.util.LinkedList)1 Ignite (org.apache.ignite.Ignite)1 Before (org.junit.Before)1