use of io.qameta.allure.Description in project mule by mulesoft.
the class DefaultEventContextTestCase method multipleLevelsGrandchildFirst.
@Test
@Description("Parent EventContext only completes once response publisher completes with a value and all child and grandchild contexts are complete.")
public void multipleLevelsGrandchildFirst() throws Exception {
child = addChild(parent);
BaseEventContext grandchild = child(child, empty());
grandchild.success(testEvent());
assertChild(is(nullValue()), is(nullValue()), false);
assertParent(is(nullValue()), is(nullValue()), false, false);
child.success(testEvent());
assertChild(is(testEvent()), is(nullValue()), true);
assertParent(is(nullValue()), is(nullValue()), false, false);
parent.success(testEvent());
assertChild(is(testEvent()), is(nullValue()), true);
assertParent(is(testEvent()), is(nullValue()), true, true);
}
use of io.qameta.allure.Description in project mule by mulesoft.
the class DefaultEventContextTestCase method successWithResult.
@Test
@Description("EventContext response publisher completes with value of result. Also given response publisher completed and there there are no child contexts the completion publisher also completes.")
public void successWithResult() throws Exception {
CoreEvent event = testEvent();
parent.success(event);
assertParent(is(event), is(nullValue()), true, true);
}
use of io.qameta.allure.Description in project mule by mulesoft.
the class DefaultEventContextTestCase method error.
@Test
@Description("EventContext response publisher completes with error. Also given response publisher completed and there there are no child contexts the completion publisher also completes.")
public void error() throws Exception {
Exception exception = new Exception();
parent.error(exception);
assertParent(nullValue(), is(exception), true, true);
}
use of io.qameta.allure.Description in project mule by mulesoft.
the class DefaultEventContextTestCase method componentDataFromSingleComponent.
@Test
@Description("Verify that a single component location produces connector and source data.")
public void componentDataFromSingleComponent() throws Exception {
BaseEventContext context = this.context.get();
assertThat(context.getOriginatingLocation().getComponentIdentifier().getIdentifier().getNamespace(), is(CORE_PREFIX));
assertThat(context.getOriginatingLocation().getComponentIdentifier().getIdentifier().getName(), is("test"));
}
use of io.qameta.allure.Description in project mule by mulesoft.
the class DefaultEventContextTestCase method childSuccessWithResultFreesChild.
@Test
@Description("Once a child context is completed, its event is not kept in memory.")
public void childSuccessWithResultFreesChild() throws Exception {
child = addChild(parent);
CoreEvent eventChild = getEventBuilder().message(Message.of(TEST_PAYLOAD)).build();
CoreEvent eventParent = getEventBuilder().message(Message.of(TEST_PAYLOAD)).build();
PhantomReference<CoreEvent> childRef = new PhantomReference<>(eventChild, new ReferenceQueue<>());
child.success(eventChild);
eventChild = null;
childResultValue.set(null);
new PollingProber(GC_POLLING_TIMEOUT, DEFAULT_POLLING_INTERVAL).check(new JUnitLambdaProbe(() -> {
System.gc();
assertThat(childRef.isEnqueued(), is(true));
return true;
}, "A hard reference is being mantained to the child event."));
parent.success(eventParent);
}
Aggregations