WorkbenchConfigurationHelper { public ConfigGroup getWorkItemElementDefinitions() { final ConfigGroup group = configurationFactory.newConfigGroup(ConfigType.EDITOR, WorkItemsEditorService.WORK_ITEMS_EDITOR_SETTINGS, ""); group.addConfigItem(configurationFactory.newConfigItem(WorkItemsEditorService.WORK_ITEMS_EDITOR_SETTINGS_DEFINITION, "[\n" + " [\n" + " \"name\" : \"MyTask\", \n" + " \"parameters\" : [ \n" + " \"MyFirstParam\" : new StringDataType(), \n" + " \"MySecondParam\" : new StringDataType(), \n" + " \"MyThirdParam\" : new ObjectDataType() \n" + " ], \n" + " \"results\" : [ \n" + " \"Result\" : new ObjectDataType(\"java.util.Map\") \n" + " ], \n" + " \"displayName\" : \"My Task\", \n" + " \"icon\" : \"\" \n" + " ]\n" + "]")); group.addConfigItem(configurationFactory.newConfigItem(WorkItemsEditorService.WORK_ITEMS_EDITOR_SETTINGS_PARAMETER, "\"MyParam\" : new StringDataType()")); group.addConfigItem(configurationFactory.newConfigItem(WorkItemsEditorService.WORK_ITEMS_EDITOR_SETTINGS_RESULT, "\"Result\" : new ObjectDataType()")); group.addConfigItem(configurationFactory.newConfigItem(WorkItemsEditorService.WORK_ITEMS_EDITOR_SETTINGS_DISPLAY_NAME, "\"displayName\" : \"My Task\"")); group.addConfigItem(configurationFactory.newConfigItem(WorkItemsEditorService.WORK_ITEMS_EDITOR_SETTINGS_PARAMETER_VALUES, "\"parameterValues\" : [\n" + " \"MyFirstParam\" : \"A,B,C\", \n" + " \"MySecondParam\" : \"X,Y,Z\"\n" + "]")); group.addConfigItem(configurationFactory.newConfigItem(WorkItemsEditorService.WORK_ITEMS_EDITOR_SETTINGS_CUSTOM_EDITOR, "\"customEditor\" : \"true\"")); group.addConfigItem(configurationFactory.newConfigItem(WorkItemsEditorService.WORK_ITEMS_EDITOR_SETTINGS_DEFAULT_HANDLER, "\"defaultHandler\" : \"mvel: new DefaultHandler()\"")); return group; }  ConfigGroup getWorkItemElementDefinitions(); void setConfigurationFactory(ConfigurationFactory configurationFactory);  }
@Test public void testWorkitemDefinitions() throws Exception { ConfigGroup group = workbenchConfigurationHelper.getWorkItemElementDefinitions(); assertEquals(ConfigType.EDITOR, group.getType()); assertEquals(WorkItemsEditorService.WORK_ITEMS_EDITOR_SETTINGS, group.getName()); assertEquals("", group.getDescription()); assertEquals(7, group.getItems().size()); assertEquals("\"customEditor\" : \"true\"", group.getConfigItemValue(WorkItemsEditorService.WORK_ITEMS_EDITOR_SETTINGS_CUSTOM_EDITOR)); assertEquals("\"parameterValues\" : [\n" + " \"MyFirstParam\" : \"A,B,C\", \n" + " \"MySecondParam\" : \"X,Y,Z\"\n" + "]", group.getConfigItemValue(WorkItemsEditorService.WORK_ITEMS_EDITOR_SETTINGS_PARAMETER_VALUES)); assertEquals(group.getConfigItemValue(WorkItemsEditorService.WORK_ITEMS_EDITOR_SETTINGS_DEFAULT_HANDLER), "\"defaultHandler\" : \"mvel: new DefaultHandler()\""); }