use of org.eclipse.sirius.components.collaborative.representations.SubscriptionManager in project sirius-components by eclipse-sirius.
the class DiagramEventProcessorTests method testUpdateInitialDiagramForNewSubscription.
@Test
public void testUpdateInitialDiagramForNewSubscription() {
DiagramEventInput input = new DiagramEventInput(UUID.randomUUID(), UUID.randomUUID().toString(), UUID.randomUUID().toString());
DiagramEventProcessor diagramEventProcessor = new DiagramEventProcessor(new IEditingContext.NoOp(), this.diagramContext, List.of(), new SubscriptionManager(), new IRepresentationDescriptionSearchService.NoOp(), new IRepresentationRefreshPolicyRegistry.NoOp(), this.diagramCreationService);
Runnable performRefresh = () -> diagramEventProcessor.refresh(new ChangeDescription(ChangeKind.SEMANTIC_CHANGE, input.getDiagramId(), input));
// @formatter:off
StepVerifier.create(diagramEventProcessor.getOutputEvents(input)).expectNextMatches(this.getRefreshDiagramEventPayloadPredicate(1)).then(performRefresh).expectNextMatches(this.getRefreshDiagramEventPayloadPredicate(2)).thenCancel().verify();
// @formatter:on
// @formatter:off
StepVerifier.create(diagramEventProcessor.getOutputEvents(input)).expectNextMatches(this.getRefreshDiagramEventPayloadPredicate(2)).thenCancel().verify();
// @formatter:on
}
use of org.eclipse.sirius.components.collaborative.representations.SubscriptionManager in project sirius-components by eclipse-sirius.
the class DiagramEventProcessorTests method testCompleteOnDispose.
@Test
public void testCompleteOnDispose() {
DiagramEventInput input = new DiagramEventInput(UUID.randomUUID(), UUID.randomUUID().toString(), UUID.randomUUID().toString());
DiagramEventProcessor diagramEventProcessor = new DiagramEventProcessor(new IEditingContext.NoOp(), this.diagramContext, List.of(), new SubscriptionManager(), new IRepresentationDescriptionSearchService.NoOp(), new IRepresentationRefreshPolicyRegistry.NoOp(), this.diagramCreationService);
Runnable disposeDiagramEventProcessor = () -> diagramEventProcessor.dispose();
// @formatter:off
StepVerifier.create(diagramEventProcessor.getOutputEvents(input)).expectNextMatches(this.getRefreshDiagramEventPayloadPredicate(1)).then(disposeDiagramEventProcessor).expectComplete().verify();
// @formatter:on
}
use of org.eclipse.sirius.components.collaborative.representations.SubscriptionManager in project sirius-components by eclipse-sirius.
the class DiagramEventProcessorTests method testEmitDiagramOnRefresh.
@Test
public void testEmitDiagramOnRefresh() {
DiagramEventInput input = new DiagramEventInput(UUID.randomUUID(), UUID.randomUUID().toString(), UUID.randomUUID().toString());
DiagramEventProcessor diagramEventProcessor = new DiagramEventProcessor(new IEditingContext.NoOp(), this.diagramContext, List.of(), new SubscriptionManager(), new IRepresentationDescriptionSearchService.NoOp(), new IRepresentationRefreshPolicyRegistry.NoOp(), this.diagramCreationService);
Runnable performRefresh = () -> diagramEventProcessor.refresh(new ChangeDescription(ChangeKind.SEMANTIC_CHANGE, input.getDiagramId(), input));
// @formatter:off
StepVerifier.create(diagramEventProcessor.getOutputEvents(input)).expectNextMatches(this.getRefreshDiagramEventPayloadPredicate(1)).then(performRefresh).expectNextMatches(this.getRefreshDiagramEventPayloadPredicate(2)).thenCancel().verify();
// @formatter:on
}
use of org.eclipse.sirius.components.collaborative.representations.SubscriptionManager 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.representations.SubscriptionManager in project sirius-components by eclipse-sirius.
the class DiagramEventProcessorTests method testEmitDiagramOnSubscription.
@Test
public void testEmitDiagramOnSubscription() {
IInput input = new DiagramEventInput(UUID.randomUUID(), UUID.randomUUID().toString(), UUID.randomUUID().toString());
DiagramEventProcessor diagramEventProcessor = new DiagramEventProcessor(new IEditingContext.NoOp(), this.diagramContext, List.of(), new SubscriptionManager(), new IRepresentationDescriptionSearchService.NoOp(), new IRepresentationRefreshPolicyRegistry.NoOp(), this.diagramCreationService);
// @formatter:off
StepVerifier.create(diagramEventProcessor.getOutputEvents(input)).expectNextMatches(this.getRefreshDiagramEventPayloadPredicate(1)).thenCancel().verify();
// @formatter:on
}
Aggregations