@Test public void testGetMessagesForNonExistentProject() { String projectName = "nonexistent"; Project foo = new Project(projectName, "/doesnotexist"); HashMap<String, Project> projects = new HashMap<>(); projects.put(projectName, foo); env.setProjectsEnabled(true); env.setProjects(projects); String jsonString = MessagesUtils.messagesToJson(projectName); assertNotNull(jsonString); assertEquals("", jsonString); }
public static String messagesToJson(String... tags) { Set<TaggedMessagesContainer> messages = new HashSet<>(); for (String tag : tags) { SortedSet<MessagesContainer.AcceptedMessage> messagesWithTag = RuntimeEnvironment.getInstance().getMessages(tag); if (messagesWithTag.isEmpty()) { continue; } TaggedMessagesContainer container = new TaggedMessagesContainer(tag, messagesWithTag); messages.add(container); } return taggedMessagesToJson(messages); }
MessagesUtils { public static String messagesToJson(String... tags) { Set<TaggedMessagesContainer> messages = new HashSet<>(); for (String tag : tags) { SortedSet<MessagesContainer.AcceptedMessage> messagesWithTag = RuntimeEnvironment.getInstance().getMessages(tag); if (messagesWithTag.isEmpty()) { continue; } TaggedMessagesContainer container = new TaggedMessagesContainer(tag, messagesWithTag); messages.add(container); } return taggedMessagesToJson(messages); } }
MessagesUtils { public static String messagesToJson(String... tags) { Set<TaggedMessagesContainer> messages = new HashSet<>(); for (String tag : tags) { SortedSet<MessagesContainer.AcceptedMessage> messagesWithTag = RuntimeEnvironment.getInstance().getMessages(tag); if (messagesWithTag.isEmpty()) { continue; } TaggedMessagesContainer container = new TaggedMessagesContainer(tag, messagesWithTag); messages.add(container); } return taggedMessagesToJson(messages); }  }
MessagesUtils { public static String messagesToJson(String... tags) { Set<TaggedMessagesContainer> messages = new HashSet<>(); for (String tag : tags) { SortedSet<MessagesContainer.AcceptedMessage> messagesWithTag = RuntimeEnvironment.getInstance().getMessages(tag); if (messagesWithTag.isEmpty()) { continue; } TaggedMessagesContainer container = new TaggedMessagesContainer(tag, messagesWithTag); messages.add(container); } return taggedMessagesToJson(messages); }  static void printMessages(Writer out, SortedSet<MessagesContainer.AcceptedMessage> set); static String messagesToJson(String... tags); static String messagesToJson(Project project, String... additionalTags); static String messagesToJson(Project project); static String messagesToJson(Group group); static String getMessageLevel(String... tags); }
MessagesUtils { public static String messagesToJson(String... tags) { Set<TaggedMessagesContainer> messages = new HashSet<>(); for (String tag : tags) { SortedSet<MessagesContainer.AcceptedMessage> messagesWithTag = RuntimeEnvironment.getInstance().getMessages(tag); if (messagesWithTag.isEmpty()) { continue; } TaggedMessagesContainer container = new TaggedMessagesContainer(tag, messagesWithTag); messages.add(container); } return taggedMessagesToJson(messages); }  static void printMessages(Writer out, SortedSet<MessagesContainer.AcceptedMessage> set); static String messagesToJson(String... tags); static String messagesToJson(Project project, String... additionalTags); static String messagesToJson(Project project); static String messagesToJson(Group group); static String getMessageLevel(String... tags);  }