Search in sources :

Example 1 with FormEventInput

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
}
Also used : FormEventInput(org.eclipse.sirius.components.collaborative.forms.dto.FormEventInput) IEditingContext(org.eclipse.sirius.components.core.api.IEditingContext) RepresentationRefreshPolicyRegistry(org.eclipse.sirius.components.collaborative.representations.RepresentationRefreshPolicyRegistry) FormCreationParameters(org.eclipse.sirius.components.collaborative.forms.api.FormCreationParameters) SubscriptionManager(org.eclipse.sirius.components.collaborative.representations.SubscriptionManager) Test(org.junit.jupiter.api.Test)

Example 2 with FormEventInput

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
}
Also used : FormEventInput(org.eclipse.sirius.components.collaborative.forms.dto.FormEventInput) IEditingContext(org.eclipse.sirius.components.core.api.IEditingContext) RepresentationRefreshPolicyRegistry(org.eclipse.sirius.components.collaborative.representations.RepresentationRefreshPolicyRegistry) FormCreationParameters(org.eclipse.sirius.components.collaborative.forms.api.FormCreationParameters) IInput(org.eclipse.sirius.components.core.api.IInput) SubscriptionManager(org.eclipse.sirius.components.collaborative.representations.SubscriptionManager) Test(org.junit.jupiter.api.Test)

Example 3 with FormEventInput

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
}
Also used : FormEventInput(org.eclipse.sirius.components.collaborative.forms.dto.FormEventInput) IEditingContext(org.eclipse.sirius.components.core.api.IEditingContext) RepresentationRefreshPolicyRegistry(org.eclipse.sirius.components.collaborative.representations.RepresentationRefreshPolicyRegistry) FormCreationParameters(org.eclipse.sirius.components.collaborative.forms.api.FormCreationParameters) ChangeDescription(org.eclipse.sirius.components.collaborative.api.ChangeDescription) SubscriptionManager(org.eclipse.sirius.components.collaborative.representations.SubscriptionManager) Test(org.junit.jupiter.api.Test)

Aggregations

FormCreationParameters (org.eclipse.sirius.components.collaborative.forms.api.FormCreationParameters)3 FormEventInput (org.eclipse.sirius.components.collaborative.forms.dto.FormEventInput)3 RepresentationRefreshPolicyRegistry (org.eclipse.sirius.components.collaborative.representations.RepresentationRefreshPolicyRegistry)3 SubscriptionManager (org.eclipse.sirius.components.collaborative.representations.SubscriptionManager)3 IEditingContext (org.eclipse.sirius.components.core.api.IEditingContext)3 Test (org.junit.jupiter.api.Test)3 ChangeDescription (org.eclipse.sirius.components.collaborative.api.ChangeDescription)1 IInput (org.eclipse.sirius.components.core.api.IInput)1