Search in sources :

Example 1 with TestEnvironmentOptions

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);
}
Also used : TestEnvironmentOptions(io.temporal.testing.TestEnvironmentOptions) Before(org.junit.Before)

Example 2 with TestEnvironmentOptions

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();
}
Also used : TestEnvironmentOptions(io.temporal.testing.TestEnvironmentOptions) Before(org.junit.Before)

Example 3 with TestEnvironmentOptions

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();
}
Also used : TestEnvironmentOptions(io.temporal.testing.TestEnvironmentOptions) Before(org.junit.Before)

Example 4 with TestEnvironmentOptions

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);
}
Also used : TestEnvironmentOptions(io.temporal.testing.TestEnvironmentOptions) Before(org.junit.Before)

Example 5 with TestEnvironmentOptions

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);
}
Also used : TestEnvironmentOptions(io.temporal.testing.TestEnvironmentOptions) Before(org.junit.Before)

Aggregations

TestEnvironmentOptions (io.temporal.testing.TestEnvironmentOptions)7 Before (org.junit.Before)6 RootScopeBuilder (com.uber.m3.tally.RootScopeBuilder)1 Scope (com.uber.m3.tally.Scope)1 TestStatsReporter (io.temporal.common.reporter.TestStatsReporter)1 WorkflowServiceStubsOptions (io.temporal.serviceclient.WorkflowServiceStubsOptions)1