Search in sources :

Example 6 with ScriptTypeValue

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;
}
Also used : ScriptTypeValue(org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue)

Example 7 with ScriptTypeValue

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());
}
Also used : ScriptTypeValue(org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue) Test(org.junit.Test)

Example 8 with ScriptTypeValue

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));
}
Also used : ScriptTypeValue(org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue) Test(org.junit.Test) FieldEditorPresenterBaseTest(org.kie.workbench.common.stunner.bpmn.client.forms.util.FieldEditorPresenterBaseTest)

Example 9 with ScriptTypeValue

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);
}
Also used : ScriptTypeValue(org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue) Test(org.junit.Test) FieldEditorPresenterBaseTest(org.kie.workbench.common.stunner.bpmn.client.forms.util.FieldEditorPresenterBaseTest)

Example 10 with ScriptTypeValue

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);
}
Also used : ScriptTypeListValue(org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeListValue) ScriptTypeValue(org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue) Test(org.junit.Test)

Aggregations

ScriptTypeValue (org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue)23 ScriptTypeListValue (org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeListValue)9 Test (org.junit.Test)7 FormalExpression (org.eclipse.bpmn2.FormalExpression)6 ScriptTypeTypeSerializer (org.kie.workbench.common.stunner.bpmn.backend.marshall.json.oryx.property.ScriptTypeTypeSerializer)6 ExtensionAttributeValue (org.eclipse.bpmn2.ExtensionAttributeValue)4 FeatureMap (org.eclipse.emf.ecore.util.FeatureMap)4 OnEntryScriptType (org.jboss.drools.OnEntryScriptType)3 OnExitScriptType (org.jboss.drools.OnExitScriptType)3 FieldEditorPresenterBaseTest (org.kie.workbench.common.stunner.bpmn.client.forms.util.FieldEditorPresenterBaseTest)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 EList (org.eclipse.emf.common.util.EList)2 SimpleFeatureMapEntry (org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.SimpleFeatureMapEntry)2 ScriptTypeListTypeSerializer (org.kie.workbench.common.stunner.bpmn.backend.marshall.json.oryx.property.ScriptTypeListTypeSerializer)2 Before (org.junit.Before)1 Factories.bpmn2 (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.Factories.bpmn2)1 BasePropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.BasePropertyWriter)1 SequenceFlowPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.SequenceFlowPropertyWriter)1 SequenceFlow (org.kie.workbench.common.stunner.bpmn.definition.SequenceFlow)1