Java Code Examples for se.bjurr.violations.lib.util.Utils

The following examples show how to use se.bjurr.violations.lib.util.Utils. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: violations-lib   Source File: FindbugsParser.java    License: Apache License 2.0 6 votes vote down vote up
private Map<String, String> getMessagesPerType() {
  final Map<String, String> messagesPerType = new HashMap<>();
  try {
    if (isNullOrEmpty(findbugsMessagesXml)) {
      final String messagesResourceFilename = "/findbugs/messages.xml";
      final URL resource = FindbugsParser.class.getResource(messagesResourceFilename);
      if (resource == null) {
        throw new RuntimeException("Unable to find resource " + messagesResourceFilename);
      }
      findbugsMessagesXml = Utils.toString(resource);
    }
    final List<String> bugPatterns =
        getChunks(findbugsMessagesXml, "<BugPattern", "</BugPattern>");
    for (final String bugPattern : bugPatterns) {
      final String type = getAttribute(bugPattern, "type");
      final String shortDescription = getContent(bugPattern, "ShortDescription");
      final String details = getContent(bugPattern, "Details");
      messagesPerType.put(type, shortDescription + "\n\n" + details);
    }
  } catch (final IOException e) {
    LOG.log(SEVERE, e.getMessage(), e);
  }
  return messagesPerType;
}
 
Example 2
@Test
public void doUpdateReadmeWithReporters() throws IOException {
  Utils.updateReadmeWithReporters();
}
 
Example 3
Source Project: violations-lib   Source File: ReporterTest.java    License: Apache License 2.0 4 votes vote down vote up
@Test
public void test() throws IOException {
  Utils.updateReadmeWithReporters();
}
 
Example 4
@Test
public void doUpdateReadmeWithReporters() throws IOException {
  Utils.updateReadmeWithReporters();
}