]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5338 Fix UT
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Wed, 16 Jul 2014 10:54:32 +0000 (12:54 +0200)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Wed, 16 Jul 2014 11:13:23 +0000 (13:13 +0200)
server/sonar-server/src/test/resources/org/sonar/server/test/ws/TestsShowActionTest/show_from_test_data.json [deleted file]
sonar-server/src/test/java/org/sonar/server/test/ws/TestsShowActionTest.java
sonar-server/src/test/resources/org/sonar/server/test/ws/TestsShowActionTest/show_from_test_data.json [new file with mode: 0644]

diff --git a/server/sonar-server/src/test/resources/org/sonar/server/test/ws/TestsShowActionTest/show_from_test_data.json b/server/sonar-server/src/test/resources/org/sonar/server/test/ws/TestsShowActionTest/show_from_test_data.json
deleted file mode 100644 (file)
index 97a9239..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-{
-  "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"
-    }
-  ]
-}
index 10f685adeded7e7bd587e58c88200120c541b6ce..49c28868be609a091920dfa2be71acae3180422d 100644 (file)
@@ -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:&lt;true&gt; but was:&lt;false&gt;\">" +
         "<![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 (file)
index 0000000..97a9239
--- /dev/null
@@ -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"
+    }
+  ]
+}