diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-07-16 12:54:32 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-07-16 13:13:23 +0200 |
commit | 181d406af1d62e16fa367371ebb0923ae499f373 (patch) | |
tree | 53195121e688f7a9824025c30c78c3fbd49e2135 /sonar-server/src | |
parent | 00552fc8c611333fd0d0276d31e8d61c6c4f95ff (diff) | |
download | sonarqube-181d406af1d62e16fa367371ebb0923ae499f373.tar.gz sonarqube-181d406af1d62e16fa367371ebb0923ae499f373.zip |
SONAR-5338 Fix UT
Diffstat (limited to 'sonar-server/src')
2 files changed, 17 insertions, 3 deletions
diff --git a/sonar-server/src/test/java/org/sonar/server/test/ws/TestsShowActionTest.java b/sonar-server/src/test/java/org/sonar/server/test/ws/TestsShowActionTest.java index 10f685adede..49c28868be6 100644 --- a/sonar-server/src/test/java/org/sonar/server/test/ws/TestsShowActionTest.java +++ b/sonar-server/src/test/java/org/sonar/server/test/ws/TestsShowActionTest.java @@ -21,7 +21,6 @@ package org.sonar.server.test.ws; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; @@ -94,7 +93,6 @@ public class TestsShowActionTest { } @Test - @Ignore public void show_from_test_data() throws Exception { MockUserSession.set().addComponentPermission(UserRole.CODEVIEWER, "SonarQube", TEST_PLAN_KEY); @@ -102,7 +100,7 @@ public class TestsShowActionTest { .setTextValue("<tests-details>" + "<testcase status=\"ok\" time=\"10\" name=\"test1\"/>" + "<testcase status=\"error\" time=\"97\" name=\"test2\">" + - "<error message=\"expected:<true> but was:<false>\">" + + "<error message=\"expected:<true> but was:<false>\">" + "<![CDATA[" + "java.lang.AssertionError: expected:<true> but was:<false>\n\t" + "at org.junit.Assert.fail(Assert.java:91)\n\t" + diff --git a/sonar-server/src/test/resources/org/sonar/server/test/ws/TestsShowActionTest/show_from_test_data.json b/sonar-server/src/test/resources/org/sonar/server/test/ws/TestsShowActionTest/show_from_test_data.json new file mode 100644 index 00000000000..97a9239999b --- /dev/null +++ b/sonar-server/src/test/resources/org/sonar/server/test/ws/TestsShowActionTest/show_from_test_data.json @@ -0,0 +1,16 @@ +{ + "tests": [ + { + "name": "test1", + "status": "OK", + "durationInMs": 10 + }, + { + "name": "test2", + "status": "ERROR", + "durationInMs": 97, + "message": "expected:<true> but was:<false>", + "stackTrace": "java.lang.AssertionError: expected:<true> but was:<false>\n\tat org.junit.Assert.fail(Assert.java:91)\n\tat org.junit.Assert.failNotEquals(Assert.java:645)\n\tat org.junit.Assert.assertEquals(Assert.java:126)\n\tat org.junit.Assert.assertEquals(Assert.java:145)\n" + } + ] +} |