Search in sources :

Example 6 with TimerSettingsValue

use of org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettingsValue in project kie-wb-common by kiegroup.

the class TimerSettingsTypeSerializerTest method testParse.

@Test
public void testParse() {
    TimerSettingsValue result = serializer.parse(timerSettingsSerialized);
    assertEquals(TIME_DATE, result.getTimeDate());
    assertEquals(TIME_DURATION, result.getTimeDuration());
    assertEquals(TIME_CYCLE, result.getTimeCycle());
    assertEquals(TIME_CYCLE_LANGUAGE, result.getTimeCycleLanguage());
}
Also used : TimerSettingsValue(org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettingsValue) Test(org.junit.Test)

Example 7 with TimerSettingsValue

use of org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettingsValue in project kie-wb-common by kiegroup.

the class TimerSettingsFieldEditorPresenterTest method testSetTimeDateTimerValue.

@Test
public void testSetTimeDateTimerValue() {
    TimerSettingsValue value = new TimerSettingsValue();
    value.setTimeDate(VALUE_1);
    editor.setValue(value);
    verifyHideParams(3);
    verify(view, times(1)).clear();
    verifyDurationTimerDisplayMode(2, true);
    verifyTimeDateTimerDisplayMode(1, true);
    verify(view, times(1)).setTimeDate(VALUE_1);
}
Also used : TimerSettingsValue(org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettingsValue) Test(org.junit.Test) FieldEditorPresenterBaseTest(org.kie.workbench.common.stunner.bpmn.client.forms.util.FieldEditorPresenterBaseTest)

Example 8 with TimerSettingsValue

use of org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettingsValue in project kie-wb-common by kiegroup.

the class TimerSettingsFieldEditorPresenterTest method testOnTimerDurationChange.

@Test
public void testOnTimerDurationChange() {
    TimerSettingsValue value = new TimerSettingsValue();
    editor.setValue(value);
    when(view.getTimeDuration()).thenReturn(VALUE_1);
    editor.onTimerDurationChange();
    verify(changeHandler, times(1)).onValueChange(oldValueCaptor.capture(), newValueCaptor.capture());
    assertEquals(value, oldValueCaptor.getValue());
    value.setTimeDuration(VALUE_1);
    assertEquals(value, newValueCaptor.getValue());
}
Also used : TimerSettingsValue(org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettingsValue) Test(org.junit.Test) FieldEditorPresenterBaseTest(org.kie.workbench.common.stunner.bpmn.client.forms.util.FieldEditorPresenterBaseTest)

Example 9 with TimerSettingsValue

use of org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettingsValue in project kie-wb-common by kiegroup.

the class TimerSettingsFieldEditorPresenterTest method testSetDurationTimerValue.

@Test
public void testSetDurationTimerValue() {
    TimerSettingsValue value = new TimerSettingsValue();
    value.setTimeDuration(VALUE_1);
    editor.setValue(value);
    verify(view, times(1)).clear();
    verifyHideParams(3);
    verifyDurationTimerDisplayMode(3, true);
    verify(view, times(1)).setTimeDuration(VALUE_1);
}
Also used : TimerSettingsValue(org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettingsValue) Test(org.junit.Test) FieldEditorPresenterBaseTest(org.kie.workbench.common.stunner.bpmn.client.forms.util.FieldEditorPresenterBaseTest)

Example 10 with TimerSettingsValue

use of org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettingsValue in project kie-wb-common by kiegroup.

the class TimerSettingsFieldEditorPresenterTest method testOnTimeCycleChange.

@Test
public void testOnTimeCycleChange() {
    TimerSettingsValue value = new TimerSettingsValue();
    editor.setValue(value);
    when(view.getTimeCycle()).thenReturn(VALUE_1);
    when(view.getTimeCycleLanguage()).thenReturn(VALUE_2);
    editor.onTimeCycleChange();
    verifyMultipleTimerChange(value);
}
Also used : TimerSettingsValue(org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettingsValue) Test(org.junit.Test) FieldEditorPresenterBaseTest(org.kie.workbench.common.stunner.bpmn.client.forms.util.FieldEditorPresenterBaseTest)

Aggregations

TimerSettingsValue (org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettingsValue)18 Test (org.junit.Test)8 FieldEditorPresenterBaseTest (org.kie.workbench.common.stunner.bpmn.client.forms.util.FieldEditorPresenterBaseTest)7 TimerSettingsTypeSerializer (org.kie.workbench.common.stunner.bpmn.backend.marshall.json.oryx.property.TimerSettingsTypeSerializer)3 FormalExpression (org.eclipse.bpmn2.FormalExpression)2 ConstraintValidatorContext (javax.validation.ConstraintValidatorContext)1 TimerEventDefinition (org.eclipse.bpmn2.TimerEventDefinition)1 Before (org.junit.Before)1 TimerSettings (org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettings)1