Search in sources :

Example 1 with RcWorkerScriptOperation

use of com.hazelcast.simulator.coordinator.operations.RcWorkerScriptOperation in project hazelcast-simulator by hazelcast.

the class CoordinatorRemoteImplTest method test_RcWorkerScriptOperation.

@Test
public void test_RcWorkerScriptOperation() throws Exception {
    RcWorkerScriptOperation op = new RcWorkerScriptOperation("bla");
    String expected = "ok";
    when(coordinator.workerScript(op)).thenReturn(expected);
    String result = remote.execute(op);
    assertSame(expected, result);
}
Also used : RcWorkerScriptOperation(com.hazelcast.simulator.coordinator.operations.RcWorkerScriptOperation) Test(org.junit.Test)

Example 2 with RcWorkerScriptOperation

use of com.hazelcast.simulator.coordinator.operations.RcWorkerScriptOperation in project hazelcast-simulator by hazelcast.

the class CoordinatorTest method workerScript.

@Test
public void workerScript() throws Exception {
    coordinator.workerStart(new RcWorkerStartOperation().setHzConfig(hzConfig));
    String result = coordinator.workerScript(new RcWorkerScriptOperation("js:'a'"));
    assertEquals(format("A1_W%s=a", (initialWorkerIndex + 1)), result.replace("\n", ""));
}
Also used : RcWorkerScriptOperation(com.hazelcast.simulator.coordinator.operations.RcWorkerScriptOperation) RcWorkerStartOperation(com.hazelcast.simulator.coordinator.operations.RcWorkerStartOperation) SuccessTest(com.hazelcast.simulator.tests.SuccessTest) Test(org.junit.Test)

Aggregations

RcWorkerScriptOperation (com.hazelcast.simulator.coordinator.operations.RcWorkerScriptOperation)2 Test (org.junit.Test)2 RcWorkerStartOperation (com.hazelcast.simulator.coordinator.operations.RcWorkerStartOperation)1 SuccessTest (com.hazelcast.simulator.tests.SuccessTest)1