use of io.qameta.allure.Description in project mule by mulesoft.
the class ProactorStreamProcessingStrategyTestCase method blockingRejectedExecution.
@Test
@Description("If IO pool is busy OVERLOAD error is thrown")
public void blockingRejectedExecution() throws Exception {
Scheduler blockingSchedulerSpy = spy(blocking);
Scheduler rejectingSchedulerSpy = spy(new RejectingScheduler(blockingSchedulerSpy));
flow = flowBuilder.get().processors(blockingProcessor).processingStrategyFactory((context, prefix) -> new ProactorStreamProcessingStrategy(() -> ringBuffer, DEFAULT_BUFFER_SIZE, 1, DEFAULT_WAIT_STRATEGY, () -> cpuLight, () -> rejectingSchedulerSpy, () -> cpuIntensive, 1, 2)).build();
flow.initialise();
flow.start();
processFlow(testEvent());
verify(rejectingSchedulerSpy, times(11)).submit(any(Callable.class));
verify(blockingSchedulerSpy, times(1)).submit(any(Callable.class));
assertThat(threads, hasSize(1));
assertThat(threads.stream().filter(name -> name.startsWith(IO)).count(), equalTo(1l));
assertThat(threads, not(hasItem(startsWith(CPU_LIGHT))));
assertThat(threads, not(hasItem(startsWith(CPU_INTENSIVE))));
assertThat(threads, not(hasItem(startsWith(CUSTOM))));
}
use of io.qameta.allure.Description in project mule by mulesoft.
the class ReactorProcessingStrategyTestCase method tx.
@Override
@Description("When the ReactorProcessingStrategy is configured and a transaction is active processing fails with an error")
public void tx() throws Exception {
flow = flowBuilder.get().processors(cpuLightProcessor, cpuIntensiveProcessor, blockingProcessor).build();
flow.initialise();
flow.start();
TransactionCoordination.getInstance().bindTransaction(new TestTransaction(muleContext));
expectedException.expect(MessagingException.class);
expectedException.expectCause(instanceOf(DefaultMuleException.class));
expectedException.expectCause(hasMessage(equalTo(TRANSACTIONAL_ERROR_MESSAGE)));
processFlow(testEvent());
}
use of io.qameta.allure.Description in project mule by mulesoft.
the class ReactorProcessingStrategyTestCase method cpuLightRejectedExecution.
@Test
@Description("If CPU LITE pool is busy OVERLOAD error is thrown")
public void cpuLightRejectedExecution() throws Exception {
flow = flowBuilder.get().processors(blockingProcessor).processingStrategyFactory((context, prefix) -> new ReactorProcessingStrategy(() -> new RejectingScheduler(cpuLight))).build();
flow.initialise();
flow.start();
expectRejected();
processFlow(testEvent());
}
use of io.qameta.allure.Description in project mule by mulesoft.
the class TransactionAwareProactorStreamProcessingStrategyTestCase method tx.
@Override
@Description("Unlike with the MultiReactorProcessingStrategy, the TransactionAwareWorkQueueProcessingStrategy does not fail if a transaction " + "is active, but rather executes these events synchronously in the caller thread transparently.")
public void tx() throws Exception {
flow = flowBuilder.get().processors(cpuLightProcessor, cpuIntensiveProcessor, blockingProcessor).build();
flow.initialise();
flow.start();
TransactionCoordination.getInstance().bindTransaction(new TestTransaction(muleContext));
processFlow(testEvent());
assertThat(threads, hasSize(equalTo(1)));
assertThat(threads, not(hasItem(startsWith(CPU_LIGHT))));
assertThat(threads, not(hasItem(startsWith(IO))));
assertThat(threads, not(hasItem(startsWith(CPU_INTENSIVE))));
assertThat(threads, not(hasItem(startsWith(CUSTOM))));
}
use of io.qameta.allure.Description in project mule by mulesoft.
the class DefaultEventContextTestCase method childSuccessWithResult.
@Test
@Description("Parent EventContext only completes once response publisher completes with a value and all child contexts are complete.")
public void childSuccessWithResult() throws Exception {
child = addChild(parent);
CoreEvent event = testEvent();
child.success(event);
assertChild(is(event), is(nullValue()), true);
assertParent(is(nullValue()), is(nullValue()), false, false);
parent.success(event);
assertParent(is(event), is(nullValue()), true, true);
}
Aggregations