Skip to content

Commit

Permalink
JENKINS-31238 fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
aquarellian committed Oct 31, 2015
1 parent 7ec80db commit 2660fe4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Expand Up @@ -23,17 +23,17 @@ public class CustomIssueFormatterTest {
@Test
public void testKnownUrl() throws IOException, InterruptedException, URISyntaxException {
Issue i = getIssue();
String text = "<severity> Sonar violation:\n\n\n<message>\n\n\nRead more: <rule_url>";
String expectedResult = "MINOR Sonar violation:\n\n\nRemove this unused import 'com.magenta.guice.property.PropertiesHandler'.\n\n\nRead more: http://localhost:9000/coding_rules#rule_key=squid%3AUselessImportCheck";
String text = "<severity> SonarQube violation:\n\n\n<message>\n\n\nRead more: <rule_url>";
String expectedResult = "MINOR SonarQube violation:\n\n\nRemove this unused import 'com.magenta.guice.property.PropertiesHandler'.\n\n\nRead more: http://localhost:9000/coding_rules#rule_key=squid%3AUselessImportCheck";
CustomIssueFormatter basicIssueConverter = new CustomIssueFormatter(i, text, "http://localhost:9000");
Assert.assertEquals(expectedResult, basicIssueConverter.getMessage());
}

@Test
public void testUnknownUrl() throws IOException, InterruptedException, URISyntaxException {
Issue i = getIssue();
String text = "<severity> Sonar violation:\n\n\n<message>\n\n\nRead more: <rule_url>";
String expectedResult = "MINOR Sonar violation:\n\n\nRemove this unused import 'com.magenta.guice.property.PropertiesHandler'.\n\n\nRead more: squid:UselessImportCheck";
String text = "<severity> SonarQube violation:\n\n\n<message>\n\n\nRead more: <rule_url>";
String expectedResult = "MINOR SonarQube violation:\n\n\nRemove this unused import 'com.magenta.guice.property.PropertiesHandler'.\n\n\nRead more: squid:UselessImportCheck";
CustomIssueFormatter basicIssueConverter = new CustomIssueFormatter(i, text, null);
Assert.assertEquals(expectedResult, basicIssueConverter.getMessage());
}
Expand Down
Expand Up @@ -22,8 +22,8 @@
* $Id$
*/
public class CustomReportFormatterTest {
private static String SUCCESS_TEXT = "Sonar violations have not been found.";
private static String FAIL_TEXT = "<total_count> Sonar violations have been found.\n" +
private static String SUCCESS_TEXT = "SonarQube violations have not been found.";
private static String FAIL_TEXT = "<total_count> SonarQube violations have been found.\n" +
"Info: <info_count>\n" +
"Minor: <minor_count>\n" +
"Major: <major_count>\n" +
Expand All @@ -36,15 +36,15 @@ public class CustomReportFormatterTest {
@Test
public void testSuccess() throws IOException, InterruptedException, URISyntaxException {
List<Issue> i = new ArrayList<Issue>();
String expectedResult = "Sonar violations have not been found.";
String expectedResult = "SonarQube violations have not been found.";
CustomReportFormatter basicIssueConverter = new CustomReportFormatter(i, FAIL_TEXT, SUCCESS_TEXT);
Assert.assertEquals(expectedResult, basicIssueConverter.getMessage());
}

@Test
public void testFail() throws IOException, InterruptedException, URISyntaxException {
List<Issue> i = getIssues();
String expectedResult = "19 Sonar violations have been found.\n" +
String expectedResult = "19 SonarQube violations have been found.\n" +
"Info: 1\n" +
"Minor: 6\n" +
"Major: 10\n" +
Expand All @@ -60,7 +60,7 @@ public void testFail() throws IOException, InterruptedException, URISyntaxExcept
@Test
public void testSuccessEmpty() throws IOException, InterruptedException, URISyntaxException {
List<Issue> i = new ArrayList<Issue>();
String expectedResult = "Sonar violations have not been found.";
String expectedResult = "SonarQube violations have not been found.";
CustomReportFormatter basicIssueConverter = new CustomReportFormatter(i, "", "");
Assert.assertEquals(expectedResult, basicIssueConverter.getMessage());
basicIssueConverter = new CustomReportFormatter(i, null, null);
Expand All @@ -70,7 +70,7 @@ public void testSuccessEmpty() throws IOException, InterruptedException, URISynt
@Test
public void testFailEmpty() throws IOException, InterruptedException, URISyntaxException {
List<Issue> i = getIssues();
String expectedResult = "19 Sonar violations have been found.";
String expectedResult = "19 SonarQube violations have been found.";
CustomReportFormatter basicIssueConverter = new CustomReportFormatter(i, "", "");
Assert.assertEquals(expectedResult, basicIssueConverter.getMessage());
basicIssueConverter = new CustomReportFormatter(i, null, null);
Expand Down

0 comments on commit 2660fe4

Please sign in to comment.