use of org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue in project kie-wb-common by kiegroup.
the class ScriptTypeFieldEditorPresenter method copy.
private ScriptTypeValue copy(ScriptTypeValue source, boolean createIfSourceNull) {
if (source == null) {
return createIfSourceNull ? new ScriptTypeValue() : null;
}
ScriptTypeValue copy = new ScriptTypeValue();
copy.setScript(source.getScript());
copy.setLanguage(source.getLanguage());
return copy;
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue in project kie-wb-common by kiegroup.
the class ScriptTypeTypeSerializerTest method testParse.
@Test
public void testParse() {
ScriptTypeValue result = serializer.parse(scriptTypeSerialized);
assertEquals(LANGUAGE, result.getLanguage());
assertEquals(SCRIPT, result.getScript());
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue in project kie-wb-common by kiegroup.
the class ScriptTypeFieldEditorPresenterTest method testOnLanguageChange.
@Test
public void testOnLanguageChange() {
ScriptTypeValue oldValue = new ScriptTypeValue();
editor.setValue(oldValue);
when(view.getLanguage()).thenReturn(LANGUAGE);
when(view.getScript()).thenReturn(SCRIPT);
editor.onLanguageChange();
verifyValueChange(oldValue, new ScriptTypeValue(LANGUAGE, SCRIPT));
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue in project kie-wb-common by kiegroup.
the class ScriptTypeFieldEditorPresenterTest method testSetValue.
@Test
public void testSetValue() {
ScriptTypeValue value = new ScriptTypeValue(LANGUAGE, SCRIPT);
editor.setValue(value);
verify(view, times(1)).setLanguage(LANGUAGE);
verify(view, times(1)).setScript(SCRIPT);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue in project kie-wb-common by kiegroup.
the class ScriptTypeListFieldEditorPresenterTest method testSetValueWhenNotEmpty.
@Test
public void testSetValueWhenNotEmpty() {
ScriptTypeValue value = mock(ScriptTypeValue.class);
editor.setValue(new ScriptTypeListValue().addValue(value));
verify(scriptTypePresenter, times(1)).setValue(value);
}
Aggregations