use of io.temporal.testing.TestEnvironmentOptions in project sdk-java by temporalio.
the class SideEffectRaceConditionTest method setUp.
@Before
public void setUp() {
TestEnvironmentOptions options = TestEnvironmentOptions.newBuilder().build();
testEnvironment = TestWorkflowEnvironment.newInstance(options);
worker = testEnvironment.newWorker(TASK_QUEUE);
}
use of io.temporal.testing.TestEnvironmentOptions in project sdk-java by temporalio.
the class WorkerIsNotGettingStartedTest method setUp.
@Before
public void setUp() throws Exception {
TestEnvironmentOptions options = TestEnvironmentOptions.newBuilder().setWorkerFactoryOptions(WorkerFactoryOptions.newBuilder().setWorkflowHostLocalPollThreadCount(HOST_LOCAL_THREAD_COUNT).build()).build();
env = TestWorkflowEnvironment.newInstance(options);
worker = env.newWorker(TASK_QUEUE, WorkerOptions.newBuilder().setMaxConcurrentWorkflowTaskPollers(WORKFLOW_POLL_COUNT).setMaxConcurrentActivityTaskPollers(ACTIVITY_POLL_COUNT).setLocalActivityWorkerOnly(true).build());
// Need to register something for workers to start
worker.registerActivitiesImplementations(new LocalActivityWorkerOnlyTest.TestActivityImpl());
worker.registerWorkflowImplementationTypes(LocalActivityWorkerOnlyTest.LocalActivityWorkflowImpl.class, LocalActivityWorkerOnlyTest.ActivityWorkflowImpl.class);
env.start();
}
use of io.temporal.testing.TestEnvironmentOptions in project sdk-java by temporalio.
the class WorkerPollerThreadCountTest method setUp.
@Before
public void setUp() throws Exception {
TestEnvironmentOptions options = TestEnvironmentOptions.newBuilder().setWorkerFactoryOptions(WorkerFactoryOptions.newBuilder().setWorkflowHostLocalPollThreadCount(HOST_LOCAL_THREAD_COUNT).build()).build();
env = TestWorkflowEnvironment.newInstance(options);
Worker worker = env.newWorker("tl1", WorkerOptions.newBuilder().setMaxConcurrentWorkflowTaskPollers(WORKFLOW_POLL_COUNT).setMaxConcurrentActivityTaskPollers(ACTIVITY_POLL_COUNT).build());
// Need to register something for workers to start
worker.registerActivitiesImplementations(new ActivityImpl());
worker.registerWorkflowImplementationTypes(WorkflowImpl.class);
env.start();
}
use of io.temporal.testing.TestEnvironmentOptions in project sdk-java by temporalio.
the class WorkflowTestingTest method setUp.
@Before
public void setUp() {
TestEnvironmentOptions options = TestEnvironmentOptions.newBuilder().build();
testEnvironment = TestWorkflowEnvironment.newInstance(options);
}
use of io.temporal.testing.TestEnvironmentOptions in project sdk-java by temporalio.
the class ContextPropagationTest method setUp.
@Before
public void setUp() {
TestEnvironmentOptions options = TestEnvironmentOptions.newBuilder().setWorkflowClientOptions(WorkflowClientOptions.newBuilder().setContextPropagators(Collections.singletonList(new TestContextPropagator())).build()).build();
testEnvironment = TestWorkflowEnvironment.newInstance(options);
}
Aggregations