From 6e7bec3c465d167c144236b046982354e9901ce9 Mon Sep 17 00:00:00 2001 From: Stephane Gamard Date: Mon, 1 Sep 2014 15:58:36 +0200 Subject: [PATCH] fix Ignored test and removed another one --- .../org/sonar/search/SearchServerTest.java | 9 +++------ .../issue/db/IssueBackendMediumTest.java | 20 +------------------ 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/server/sonar-search/src/test/java/org/sonar/search/SearchServerTest.java b/server/sonar-search/src/test/java/org/sonar/search/SearchServerTest.java index e430aa4f97f..bdf54bb5187 100644 --- a/server/sonar-search/src/test/java/org/sonar/search/SearchServerTest.java +++ b/server/sonar-search/src/test/java/org/sonar/search/SearchServerTest.java @@ -26,7 +26,6 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.InetSocketTransportAddress; import org.junit.After; import org.junit.Before; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; @@ -80,12 +79,10 @@ public class SearchServerTest { } @Test - @Ignore public void server_fail_to_start() throws Exception { Properties properties = new Properties(); properties.setProperty(MonitoredProcess.NAME_PROPERTY, "ES"); - searchServer = new SearchServer(new Props(properties)); new Thread(new Runnable() { @Override @@ -96,15 +93,15 @@ public class SearchServerTest { assertThat(searchServer.isReady()).isFalse(); int count = 0; - while (!searchServer.isReady() && count < 100) { + while (!searchServer.isReady() && count < 5) { try { - Thread.sleep(500); + Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } count++; } - assertThat(count).isEqualTo(100); + assertThat(count).isEqualTo(5); } @Test diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/db/IssueBackendMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/db/IssueBackendMediumTest.java index 8443f958525..ae4dbb0e1e7 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/db/IssueBackendMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/db/IssueBackendMediumTest.java @@ -22,20 +22,14 @@ package org.sonar.server.issue.db; import org.junit.After; import org.junit.Before; import org.junit.ClassRule; -import org.junit.Ignore; -import org.junit.Test; -import org.sonar.api.resources.Project; import org.sonar.core.persistence.DbSession; -import org.sonar.core.rule.RuleDto; import org.sonar.server.db.DbClient; import org.sonar.server.platform.Platform; -import org.sonar.server.rule.RuleTesting; import org.sonar.server.search.IndexClient; import org.sonar.server.tester.ServerTester; public class IssueBackendMediumTest { - @ClassRule public static ServerTester tester = new ServerTester(); @@ -59,16 +53,4 @@ public class IssueBackendMediumTest { dbSession.close(); } } - - @Test - @Ignore("work in progress") - public void insert_select_issue() throws Exception { - Project project = new Project("my:project"); - RuleDto rule = RuleTesting.newXooX1(); -// //IssueDto issue = IssueDto.createFor(project, rule); -// System.out.println("issue.getKey() = " + issue.getKey()); -// dbClient.issueDao().insert(dbSession, issue); -// -// assertThat(issue.getId()).isNotNull(); - } -} \ No newline at end of file +} -- 2.39.5