use of org.eclipse.sirius.components.collaborative.diagrams.dto.DiagramEventInput 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.diagrams.dto.DiagramEventInput 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.diagrams.dto.DiagramEventInput 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.diagrams.dto.DiagramEventInput 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