use of org.eclipse.sirius.components.collaborative.forms.dto.FormEventInput in project sirius-components by eclipse-sirius.
the class FormEventProcessorTests method testCompleteOnDispose.
@Test
public void testCompleteOnDispose() {
FormEventInput input = new FormEventInput(UUID.randomUUID(), UUID.randomUUID().toString(), UUID.randomUUID().toString());
// @formatter:off
FormCreationParameters formCreationParameters = FormCreationParameters.newFormCreationParameters(FORM_ID).formDescription(this.getFormDescription()).editingContext(new IEditingContext.NoOp()).objects(List.of(new Object())).build();
// @formatter:on
FormEventProcessor formEventProcessor = new FormEventProcessor(formCreationParameters, List.of(), new SubscriptionManager(), new WidgetSubscriptionManager(), new RepresentationRefreshPolicyRegistry());
Runnable disposeFormEventProcessor = () -> formEventProcessor.dispose();
// @formatter:off
StepVerifier.create(formEventProcessor.getOutputEvents(input)).expectNextMatches(this.getRefreshFormEventPayloadPredicate()).then(disposeFormEventProcessor).expectComplete().verify();
// @formatter:on
}
use of org.eclipse.sirius.components.collaborative.forms.dto.FormEventInput in project sirius-components by eclipse-sirius.
the class FormEventProcessorTests method testEmitFormOnSubscription.
@Test
public void testEmitFormOnSubscription() {
IInput input = new FormEventInput(UUID.randomUUID(), UUID.randomUUID().toString(), UUID.randomUUID().toString());
// @formatter:off
FormCreationParameters formCreationParameters = FormCreationParameters.newFormCreationParameters(FORM_ID).formDescription(this.getFormDescription()).editingContext(new IEditingContext.NoOp()).objects(List.of(new Object())).build();
// @formatter:on
FormEventProcessor formEventProcessor = new FormEventProcessor(formCreationParameters, List.of(), new SubscriptionManager(), new WidgetSubscriptionManager(), new RepresentationRefreshPolicyRegistry());
// @formatter:off
StepVerifier.create(formEventProcessor.getOutputEvents(input)).expectNextMatches(this.getRefreshFormEventPayloadPredicate()).thenCancel().verify();
// @formatter:on
}
use of org.eclipse.sirius.components.collaborative.forms.dto.FormEventInput in project sirius-components by eclipse-sirius.
the class FormEventProcessorTests method testEmitFormOnRefresh.
@Test
public void testEmitFormOnRefresh() {
FormEventInput input = new FormEventInput(UUID.randomUUID(), UUID.randomUUID().toString(), UUID.randomUUID().toString());
// @formatter:off
FormCreationParameters formCreationParameters = FormCreationParameters.newFormCreationParameters(FORM_ID).formDescription(this.getFormDescription()).editingContext(new IEditingContext.NoOp()).objects(List.of(new Object())).build();
// @formatter:on
FormEventProcessor formEventProcessor = new FormEventProcessor(formCreationParameters, List.of(), new SubscriptionManager(), new WidgetSubscriptionManager(), new RepresentationRefreshPolicyRegistry());
Runnable performRefresh = () -> formEventProcessor.refresh(new ChangeDescription(ChangeKind.SEMANTIC_CHANGE, input.getFormId(), input));
// @formatter:off
StepVerifier.create(formEventProcessor.getOutputEvents(input)).expectNextMatches(this.getRefreshFormEventPayloadPredicate()).then(performRefresh).expectNextMatches(this.getRefreshFormEventPayloadPredicate()).thenCancel().verify();
// @formatter:on
}
Aggregations