Search in sources :

Example 1 with DiagramEventInput

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
}
Also used : DiagramEventInput(org.eclipse.sirius.components.collaborative.diagrams.dto.DiagramEventInput) IEditingContext(org.eclipse.sirius.components.core.api.IEditingContext) IRepresentationRefreshPolicyRegistry(org.eclipse.sirius.components.collaborative.api.IRepresentationRefreshPolicyRegistry) ChangeDescription(org.eclipse.sirius.components.collaborative.api.ChangeDescription) SubscriptionManager(org.eclipse.sirius.components.collaborative.representations.SubscriptionManager) IRepresentationDescriptionSearchService(org.eclipse.sirius.components.core.api.IRepresentationDescriptionSearchService) Test(org.junit.jupiter.api.Test)

Example 2 with DiagramEventInput

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
}
Also used : DiagramEventInput(org.eclipse.sirius.components.collaborative.diagrams.dto.DiagramEventInput) IEditingContext(org.eclipse.sirius.components.core.api.IEditingContext) IRepresentationRefreshPolicyRegistry(org.eclipse.sirius.components.collaborative.api.IRepresentationRefreshPolicyRegistry) SubscriptionManager(org.eclipse.sirius.components.collaborative.representations.SubscriptionManager) IRepresentationDescriptionSearchService(org.eclipse.sirius.components.core.api.IRepresentationDescriptionSearchService) Test(org.junit.jupiter.api.Test)

Example 3 with DiagramEventInput

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
}
Also used : DiagramEventInput(org.eclipse.sirius.components.collaborative.diagrams.dto.DiagramEventInput) IEditingContext(org.eclipse.sirius.components.core.api.IEditingContext) IRepresentationRefreshPolicyRegistry(org.eclipse.sirius.components.collaborative.api.IRepresentationRefreshPolicyRegistry) ChangeDescription(org.eclipse.sirius.components.collaborative.api.ChangeDescription) SubscriptionManager(org.eclipse.sirius.components.collaborative.representations.SubscriptionManager) IRepresentationDescriptionSearchService(org.eclipse.sirius.components.core.api.IRepresentationDescriptionSearchService) Test(org.junit.jupiter.api.Test)

Example 4 with DiagramEventInput

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
}
Also used : DiagramEventInput(org.eclipse.sirius.components.collaborative.diagrams.dto.DiagramEventInput) IEditingContext(org.eclipse.sirius.components.core.api.IEditingContext) IRepresentationRefreshPolicyRegistry(org.eclipse.sirius.components.collaborative.api.IRepresentationRefreshPolicyRegistry) IInput(org.eclipse.sirius.components.core.api.IInput) SubscriptionManager(org.eclipse.sirius.components.collaborative.representations.SubscriptionManager) IRepresentationDescriptionSearchService(org.eclipse.sirius.components.core.api.IRepresentationDescriptionSearchService) Test(org.junit.jupiter.api.Test)

Aggregations

IRepresentationRefreshPolicyRegistry (org.eclipse.sirius.components.collaborative.api.IRepresentationRefreshPolicyRegistry)4 DiagramEventInput (org.eclipse.sirius.components.collaborative.diagrams.dto.DiagramEventInput)4 SubscriptionManager (org.eclipse.sirius.components.collaborative.representations.SubscriptionManager)4 IEditingContext (org.eclipse.sirius.components.core.api.IEditingContext)4 IRepresentationDescriptionSearchService (org.eclipse.sirius.components.core.api.IRepresentationDescriptionSearchService)4 Test (org.junit.jupiter.api.Test)4 ChangeDescription (org.eclipse.sirius.components.collaborative.api.ChangeDescription)2 IInput (org.eclipse.sirius.components.core.api.IInput)1