From 181d406af1d62e16fa367371ebb0923ae499f373 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Wed, 16 Jul 2014 12:54:32 +0200 Subject: SONAR-5338 Fix UT --- .../org/sonar/server/test/ws/TestsShowActionTest.java | 4 +--- .../test/ws/TestsShowActionTest/show_from_test_data.json | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 sonar-server/src/test/resources/org/sonar/server/test/ws/TestsShowActionTest/show_from_test_data.json (limited to 'sonar-server/src') 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("" + "" + "" + - " but was:\">" + + "" + " but was:\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: but was:", + "stackTrace": "java.lang.AssertionError: expected: but was:\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" + } + ] +} -- cgit v1.2.3