@Test public void testGetRoot() { final JSONArray expectedRoot = mock(JSONArray.class); final JSONArray row1 = mock(JSONArray.class); final JSONArray row2 = mock(JSONArray.class); final JSONArray row3 = mock(JSONArray.class); final JSONArray row4 = mock(JSONArray.class); final JSONArray row5 = mock(JSONArray.class); doReturn(expectedRoot).when(factory).makeJSONArray(); doReturn(row1).when(factory).row("(?:(\\btrue\\b)|(\\bfalse\\b))", "feel-boolean"); doReturn(row2).when(factory).row("[0-9]+", "feel-numeric"); doReturn(row3).when(factory).row("(?:\\\"(?:.*?)\\\")", "feel-string"); doReturn(row4).when(factory).row("(?:(?:[a-z ]+\\()|(?:\\()|(?:\\)))", "feel-function"); doReturn(row5).when(factory).row("(?:(\\bfor\\b)|(\\breturn\\b)|(\\bif\\b)|(\\bthen\\b)|(\\belse\\b)" + "|(\\bsome\\b)|(\\bevery\\b)|(\\bsatisfies\\b)|(\\binstance\\b)" + "|(\\bof\\b)|(\\bin\\b)|(\\bfunction\\b)|(\\bexternal\\b)|(\\bor\\b)" + "|(\\band\\b)|(\\bbetween\\b)|(\\bnot\\b)|(\\bnull\\b)|(\\btrue\\b)" + "|(\\bfalse\\b))", "feel-keyword"); final JSONArray actualRoot = factory.getRoot(); verify(factory).push(expectedRoot, row1); verify(factory).push(expectedRoot, row2); verify(factory).push(expectedRoot, row3); verify(factory).push(expectedRoot, row4); verify(factory).push(expectedRoot, row5); assertEquals(expectedRoot, actualRoot); }
public JSONArray getRoot() { final JSONArray root = makeJSONArray(); push(root, row("(?:(\\btrue\\b)|(\\bfalse\\b))", "feel-boolean")); push(root, row("[0-9]+", "feel-numeric")); push(root, row("(?:\\\"(?:.*?)\\\")", "feel-string")); push(root, row("(?:(?:[a-z ]+\\()|(?:\\()|(?:\\)))", "feel-function")); push(root, row("(?:(\\b" + String.join("\\b)|(\\b", FEEL_RESERVED_KEYWORDS) + "\\b))", "feel-keyword")); return root; }
MonacoPropertiesFactory { public JSONArray getRoot() { final JSONArray root = makeJSONArray(); push(root, row("(?:(\\btrue\\b)|(\\bfalse\\b))", "feel-boolean")); push(root, row("[0-9]+", "feel-numeric")); push(root, row("(?:\\\"(?:.*?)\\\")", "feel-string")); push(root, row("(?:(?:[a-z ]+\\()|(?:\\()|(?:\\)))", "feel-function")); push(root, row("(?:(\\b" + String.join("\\b)|(\\b", FEEL_RESERVED_KEYWORDS) + "\\b))", "feel-keyword")); return root; } }
MonacoPropertiesFactory { public JSONArray getRoot() { final JSONArray root = makeJSONArray(); push(root, row("(?:(\\btrue\\b)|(\\bfalse\\b))", "feel-boolean")); push(root, row("[0-9]+", "feel-numeric")); push(root, row("(?:\\\"(?:.*?)\\\")", "feel-string")); push(root, row("(?:(?:[a-z ]+\\()|(?:\\()|(?:\\)))", "feel-function")); push(root, row("(?:(\\b" + String.join("\\b)|(\\b", FEEL_RESERVED_KEYWORDS) + "\\b))", "feel-keyword")); return root; }  }
MonacoPropertiesFactory { public JSONArray getRoot() { final JSONArray root = makeJSONArray(); push(root, row("(?:(\\btrue\\b)|(\\bfalse\\b))", "feel-boolean")); push(root, row("[0-9]+", "feel-numeric")); push(root, row("(?:\\\"(?:.*?)\\\")", "feel-string")); push(root, row("(?:(?:[a-z ]+\\()|(?:\\()|(?:\\)))", "feel-function")); push(root, row("(?:(\\b" + String.join("\\b)|(\\b", FEEL_RESERVED_KEYWORDS) + "\\b))", "feel-keyword")); return root; }  JavaScriptObject getConstructionOptions(); JavaScriptObject getThemeData(); JSONArray getRules(); JavaScriptObject getCompletionItemProvider(final MonacoFEELVariableSuggestions variableSuggestions); JavaScriptObject getLanguageDefinition(); JSONValue getTokenizer(); JSONArray getRoot(); JSONArray row(final String pattern,
                         final String name); JavaScriptObject getLanguage(); }
MonacoPropertiesFactory { public JSONArray getRoot() { final JSONArray root = makeJSONArray(); push(root, row("(?:(\\btrue\\b)|(\\bfalse\\b))", "feel-boolean")); push(root, row("[0-9]+", "feel-numeric")); push(root, row("(?:\\\"(?:.*?)\\\")", "feel-string")); push(root, row("(?:(?:[a-z ]+\\()|(?:\\()|(?:\\)))", "feel-function")); push(root, row("(?:(\\b" + String.join("\\b)|(\\b", FEEL_RESERVED_KEYWORDS) + "\\b))", "feel-keyword")); return root; }  JavaScriptObject getConstructionOptions(); JavaScriptObject getThemeData(); JSONArray getRules(); JavaScriptObject getCompletionItemProvider(final MonacoFEELVariableSuggestions variableSuggestions); JavaScriptObject getLanguageDefinition(); JSONValue getTokenizer(); JSONArray getRoot(); JSONArray row(final String pattern,
                         final String name); JavaScriptObject getLanguage(); static final String FEEL_LANGUAGE_ID; static final String FEEL_THEME_ID; }