// it's tolerant on white space
String content = "// some comment" //
+ "\n//@ExecutionModes (\t{\n ExecutionMode.ON_selECTED_NODE=\"/menu_bar/help[icon_button_ok]\"" //
+ ",\n \tON_SelECTED_NODE_RECURSIVELY = \"/menu_bar/help[Test_Script]\" } )" //
+ "\n def test() {}\n";
ScriptMetaData metaData = new ScriptingConfiguration().analyseScriptContent(content, scriptName);
assertEquals("expected only modes set in the script", 2, metaData.getExecutionModes().size());
assertTrue("ON_SELECTED_NODE was set", metaData.getExecutionModes().contains(ExecutionMode.ON_SELECTED_NODE));
assertEquals("wrong menu location", "/menu_bar/help",
metaData.getMenuLocation(ExecutionMode.ON_SELECTED_NODE));
assertEquals("wrong title key", "icon_button_ok", metaData.getTitleKey(ExecutionMode.ON_SELECTED_NODE));
assertTrue("ON_SELECTED_NODE_RECURSIVELY was set",
metaData.getExecutionModes().contains(ExecutionMode.ON_SELECTED_NODE_RECURSIVELY));
assertEquals("wrong menu location", "/menu_bar/help",
metaData.getMenuLocation(ExecutionMode.ON_SELECTED_NODE_RECURSIVELY));
assertEquals("wrong title key", "Test_Script", metaData.getTitleKey(ExecutionMode.ON_SELECTED_NODE_RECURSIVELY));
}