@Test public void testGetRules() { final JSONObject rule1 = mock(JSONObject.class); final JSONObject rule2 = mock(JSONObject.class); final JSONObject rule3 = mock(JSONObject.class); final JSONObject rule4 = mock(JSONObject.class); final JSONObject rule5 = mock(JSONObject.class); final JSONString token1 = mock(JSONString.class); final JSONString foreground1 = mock(JSONString.class); final JSONString token2 = mock(JSONString.class); final JSONString foreground2 = mock(JSONString.class); final JSONString token3 = mock(JSONString.class); final JSONString foreground3 = mock(JSONString.class); final JSONString token4 = mock(JSONString.class); final JSONString foreground4 = mock(JSONString.class); final JSONString token5 = mock(JSONString.class); final JSONString foreground5 = mock(JSONString.class); final JSONArray expectedRules = mock(JSONArray.class); final JSONString bold = mock(JSONString.class); doReturn(token1).when(factory).makeJSONString("feel-keyword"); doReturn(token2).when(factory).makeJSONString("feel-numeric"); doReturn(token3).when(factory).makeJSONString("feel-boolean"); doReturn(token4).when(factory).makeJSONString("feel-string"); doReturn(token5).when(factory).makeJSONString("feel-function"); doReturn(foreground1).when(factory).makeJSONString("26268C"); doReturn(foreground2).when(factory).makeJSONString("3232E7"); doReturn(foreground3).when(factory).makeJSONString("26268D"); doReturn(foreground4).when(factory).makeJSONString("2A9343"); doReturn(foreground5).when(factory).makeJSONString("3232E8"); doReturn(expectedRules).when(factory).makeJSONArray(); doReturn(bold).when(factory).makeJSONString("bold"); when(factory.makeJSONObject()).thenReturn(rule1, rule2, rule3, rule4, rule5); final JSONArray actualRules = factory.getRules(); verify(rule1).put("token", token1); verify(rule2).put("token", token2); verify(rule3).put("token", token3); verify(rule4).put("token", token4); verify(rule5).put("token", token5); verify(rule1).put("foreground", foreground1); verify(rule2).put("foreground", foreground2); verify(rule3).put("foreground", foreground3); verify(rule4).put("foreground", foreground4); verify(rule5).put("foreground", foreground5); verify(rule1).put("fontStyle", bold); verify(rule4).put("fontStyle", bold); verify(rule3).put("fontStyle", bold); verify(factory).push(expectedRules, rule1); verify(factory).push(expectedRules, rule2); verify(factory).push(expectedRules, rule3); verify(factory).push(expectedRules, rule4); verify(factory).push(expectedRules, rule5); assertEquals(expectedRules, actualRules); }
public JSONArray getRules() { final JSONObject rule1 = makeJSONObject(); final JSONObject rule2 = makeJSONObject(); final JSONObject rule3 = makeJSONObject(); final JSONObject rule4 = makeJSONObject(); final JSONObject rule5 = makeJSONObject(); final JSONArray rules = makeJSONArray(); rule1.put("token", makeJSONString("feel-keyword")); rule1.put("foreground", makeJSONString("26268C")); rule1.put("fontStyle", makeJSONString("bold")); rule2.put("token", makeJSONString("feel-numeric")); rule2.put("foreground", makeJSONString("3232E7")); rule3.put("token", makeJSONString("feel-boolean")); rule3.put("foreground", makeJSONString("26268D")); rule3.put("fontStyle", makeJSONString("bold")); rule4.put("token", makeJSONString("feel-string")); rule4.put("foreground", makeJSONString("2A9343")); rule4.put("fontStyle", makeJSONString("bold")); rule5.put("token", makeJSONString("feel-function")); rule5.put("foreground", makeJSONString("3232E8")); push(rules, rule1); push(rules, rule2); push(rules, rule3); push(rules, rule4); push(rules, rule5); return rules; }
MonacoPropertiesFactory { public JSONArray getRules() { final JSONObject rule1 = makeJSONObject(); final JSONObject rule2 = makeJSONObject(); final JSONObject rule3 = makeJSONObject(); final JSONObject rule4 = makeJSONObject(); final JSONObject rule5 = makeJSONObject(); final JSONArray rules = makeJSONArray(); rule1.put("token", makeJSONString("feel-keyword")); rule1.put("foreground", makeJSONString("26268C")); rule1.put("fontStyle", makeJSONString("bold")); rule2.put("token", makeJSONString("feel-numeric")); rule2.put("foreground", makeJSONString("3232E7")); rule3.put("token", makeJSONString("feel-boolean")); rule3.put("foreground", makeJSONString("26268D")); rule3.put("fontStyle", makeJSONString("bold")); rule4.put("token", makeJSONString("feel-string")); rule4.put("foreground", makeJSONString("2A9343")); rule4.put("fontStyle", makeJSONString("bold")); rule5.put("token", makeJSONString("feel-function")); rule5.put("foreground", makeJSONString("3232E8")); push(rules, rule1); push(rules, rule2); push(rules, rule3); push(rules, rule4); push(rules, rule5); return rules; } }
MonacoPropertiesFactory { public JSONArray getRules() { final JSONObject rule1 = makeJSONObject(); final JSONObject rule2 = makeJSONObject(); final JSONObject rule3 = makeJSONObject(); final JSONObject rule4 = makeJSONObject(); final JSONObject rule5 = makeJSONObject(); final JSONArray rules = makeJSONArray(); rule1.put("token", makeJSONString("feel-keyword")); rule1.put("foreground", makeJSONString("26268C")); rule1.put("fontStyle", makeJSONString("bold")); rule2.put("token", makeJSONString("feel-numeric")); rule2.put("foreground", makeJSONString("3232E7")); rule3.put("token", makeJSONString("feel-boolean")); rule3.put("foreground", makeJSONString("26268D")); rule3.put("fontStyle", makeJSONString("bold")); rule4.put("token", makeJSONString("feel-string")); rule4.put("foreground", makeJSONString("2A9343")); rule4.put("fontStyle", makeJSONString("bold")); rule5.put("token", makeJSONString("feel-function")); rule5.put("foreground", makeJSONString("3232E8")); push(rules, rule1); push(rules, rule2); push(rules, rule3); push(rules, rule4); push(rules, rule5); return rules; }  }
MonacoPropertiesFactory { public JSONArray getRules() { final JSONObject rule1 = makeJSONObject(); final JSONObject rule2 = makeJSONObject(); final JSONObject rule3 = makeJSONObject(); final JSONObject rule4 = makeJSONObject(); final JSONObject rule5 = makeJSONObject(); final JSONArray rules = makeJSONArray(); rule1.put("token", makeJSONString("feel-keyword")); rule1.put("foreground", makeJSONString("26268C")); rule1.put("fontStyle", makeJSONString("bold")); rule2.put("token", makeJSONString("feel-numeric")); rule2.put("foreground", makeJSONString("3232E7")); rule3.put("token", makeJSONString("feel-boolean")); rule3.put("foreground", makeJSONString("26268D")); rule3.put("fontStyle", makeJSONString("bold")); rule4.put("token", makeJSONString("feel-string")); rule4.put("foreground", makeJSONString("2A9343")); rule4.put("fontStyle", makeJSONString("bold")); rule5.put("token", makeJSONString("feel-function")); rule5.put("foreground", makeJSONString("3232E8")); push(rules, rule1); push(rules, rule2); push(rules, rule3); push(rules, rule4); push(rules, rule5); return rules; }  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 getRules() { final JSONObject rule1 = makeJSONObject(); final JSONObject rule2 = makeJSONObject(); final JSONObject rule3 = makeJSONObject(); final JSONObject rule4 = makeJSONObject(); final JSONObject rule5 = makeJSONObject(); final JSONArray rules = makeJSONArray(); rule1.put("token", makeJSONString("feel-keyword")); rule1.put("foreground", makeJSONString("26268C")); rule1.put("fontStyle", makeJSONString("bold")); rule2.put("token", makeJSONString("feel-numeric")); rule2.put("foreground", makeJSONString("3232E7")); rule3.put("token", makeJSONString("feel-boolean")); rule3.put("foreground", makeJSONString("26268D")); rule3.put("fontStyle", makeJSONString("bold")); rule4.put("token", makeJSONString("feel-string")); rule4.put("foreground", makeJSONString("2A9343")); rule4.put("fontStyle", makeJSONString("bold")); rule5.put("token", makeJSONString("feel-function")); rule5.put("foreground", makeJSONString("3232E8")); push(rules, rule1); push(rules, rule2); push(rules, rule3); push(rules, rule4); push(rules, rule5); return rules; }  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; }