diff options
author | David Gageot <david@gageot.net> | 2012-05-14 12:24:30 +0200 |
---|---|---|
committer | David Gageot <david@gageot.net> | 2012-05-14 13:01:11 +0200 |
commit | c5d1b2b0665adf51abf4a448df7d1555ffed8e20 (patch) | |
tree | c223cccf5c1af54b00007b00326c9648dad080d5 /sonar-colorizer | |
parent | d4176679d0944757b447ca0213cd9de0dfc413ab (diff) | |
download | sonarqube-c5d1b2b0665adf51abf4a448df7d1555ffed8e20.tar.gz sonarqube-c5d1b2b0665adf51abf4a448df7d1555ffed8e20.zip |
Fix warnings
Diffstat (limited to 'sonar-colorizer')
-rw-r--r-- | sonar-colorizer/src/test/java/org/sonar/colorizer/HtmlRendererTest.java | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/sonar-colorizer/src/test/java/org/sonar/colorizer/HtmlRendererTest.java b/sonar-colorizer/src/test/java/org/sonar/colorizer/HtmlRendererTest.java index c2f168efcad..237e5d2c48a 100644 --- a/sonar-colorizer/src/test/java/org/sonar/colorizer/HtmlRendererTest.java +++ b/sonar-colorizer/src/test/java/org/sonar/colorizer/HtmlRendererTest.java @@ -19,16 +19,15 @@ */ package org.sonar.colorizer; +import org.apache.commons.io.FileUtils; +import org.junit.Test; + import java.io.File; import java.io.FileReader; import java.io.IOException; import java.io.StringReader; import java.util.Arrays; -import org.apache.commons.io.FileUtils; -import org.junit.Test; -import org.sonar.channel.Channel; - import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; import static org.junit.internal.matchers.StringContains.containsString; @@ -39,16 +38,18 @@ public class HtmlRendererTest { @Test public void renderJavaSyntax() { - String html = new HtmlRenderer(HtmlOptions.ONLY_SYNTAX).render(new StringReader("public class Hello {"), Arrays - .<Channel<HtmlCodeBuilder>> asList(javaKeywordTokenizer)); + HtmlRenderer htmlRenderer = new HtmlRenderer(HtmlOptions.ONLY_SYNTAX); + + String html = htmlRenderer.render(new StringReader("public class Hello {"), Arrays.asList(javaKeywordTokenizer)); assertThat(html, is("<span class='k'>public</span> <span class='k'>class</span> Hello {")); } @Test public void supportHtmlSpecialCharacters() { - String html = new HtmlRenderer(HtmlOptions.ONLY_SYNTAX).render(new StringReader("foo(\"<html>\");"), Arrays - .<Channel<HtmlCodeBuilder>> asList(new LiteralTokenizer("<s>", "</s>"))); + HtmlRenderer htmlRenderer = new HtmlRenderer(HtmlOptions.ONLY_SYNTAX); + + String html = htmlRenderer.render(new StringReader("foo(\"<html>\");"), Arrays.asList(new LiteralTokenizer("<s>", "</s>"))); assertThat(html, is("foo(<s>\"<html>\"</s>);")); } @@ -57,7 +58,7 @@ public class HtmlRendererTest { public void renderJavaFile() throws IOException { File java = FileUtils.toFile(getClass().getResource("/org/sonar/colorizer/HtmlRendererTest/Sample.java")); - String html = new HtmlRenderer().render(new FileReader(java), Arrays.<Channel<HtmlCodeBuilder>> asList(javaKeywordTokenizer)); + String html = new HtmlRenderer().render(new FileReader(java), Arrays.asList(javaKeywordTokenizer)); assertThat(html, containsString("<html>")); assertThat(html, containsString("<style")); |