use of org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettingsValue in project kie-wb-common by kiegroup.
the class TimerSettingsFieldEditorPresenterTest method testTimeCycleTimerValue.
@Test
public void testTimeCycleTimerValue() {
TimerSettingsValue value = new TimerSettingsValue();
value.setTimeCycleLanguage(TIME_CYCLE_LANGUAGE.ISO.value());
value.setTimeCycle(VALUE_1);
editor.setValue(value);
verifyHideParams(3);
verify(view, times(1)).clear();
verifyDurationTimerDisplayMode(2, true);
verifyMultipleTimerDisplayMode(1, true);
verify(view, times(1)).setTimeCycleLanguage(TIME_CYCLE_LANGUAGE.ISO.value());
verify(view, times(1)).setTimeCycle(VALUE_1);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettingsValue in project kie-wb-common by kiegroup.
the class TimerSettingsFieldEditorPresenterTest method testOnTimeDateChange.
@Test
public void testOnTimeDateChange() {
TimerSettingsValue value = new TimerSettingsValue();
editor.setValue(value);
when(view.getTimeDate()).thenReturn(VALUE_1);
editor.onTimeDateChange();
verify(changeHandler, times(1)).onValueChange(oldValueCaptor.capture(), newValueCaptor.capture());
assertEquals(value, oldValueCaptor.getValue());
value.setTimeDate(VALUE_1);
assertEquals(value, newValueCaptor.getValue());
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettingsValue in project kie-wb-common by kiegroup.
the class Bpmn2JsonMarshaller method setTimerEventProperties.
private void setTimerEventProperties(TimerEventDefinition timerEventDef, Map<String, Object> properties) {
final TimerSettingsValue timerSettings = new TimerSettingsValue();
if (timerEventDef.getTimeDate() != null) {
timerSettings.setTimeDate(((FormalExpression) timerEventDef.getTimeDate()).getBody());
}
if (timerEventDef.getTimeDuration() != null) {
timerSettings.setTimeDuration(((FormalExpression) timerEventDef.getTimeDuration()).getBody());
}
if (timerEventDef.getTimeCycle() != null) {
timerSettings.setTimeCycle(((FormalExpression) timerEventDef.getTimeCycle()).getBody());
if (((FormalExpression) timerEventDef.getTimeCycle()).getLanguage() != null) {
timerSettings.setTimeCycleLanguage(((FormalExpression) timerEventDef.getTimeCycle()).getLanguage());
}
}
properties.put(TIMERSETTINGS, new TimerSettingsTypeSerializer().serialize(timerSettings));
}
Aggregations