From 5061aeb3a45a63bdcfacb5940148d7d2a917eed2 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Fri, 28 Nov 2014 19:44:55 +0100 Subject: [PATCH] Remove ignored tests --- .../charts/deprecated/BarChartTest.java | 18 --- .../search/IndexSynchronizerMediumTest.java | 135 ------------------ 2 files changed, 153 deletions(-) delete mode 100644 server/sonar-server/src/test/java/org/sonar/server/search/IndexSynchronizerMediumTest.java diff --git a/server/sonar-server/src/test/java/org/sonar/server/charts/deprecated/BarChartTest.java b/server/sonar-server/src/test/java/org/sonar/server/charts/deprecated/BarChartTest.java index c6942abdbb5..0af54948357 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/charts/deprecated/BarChartTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/charts/deprecated/BarChartTest.java @@ -109,24 +109,6 @@ public class BarChartTest extends BaseChartWebTest { assertChartSizeGreaterThan(img, 100); } - @Test - @Ignore - public void testBarChartTitle2() throws IOException { - Map params = getDefaultParams(); - params.put(BaseChartWeb.CHART_PARAM_TITLE, "JFreeChart by Servlet"); - params.put(BaseChartWeb.CHART_PARAM_DIMENSIONS, "750x250"); - params.put(BaseChartWeb.CHART_PARAM_TYPE, BaseChartWeb.BAR_CHART_VERTICAL); - params.put(BaseChartWeb.CHART_PARAM_CATEGORIES, "0+,5+,10+,20+,30+,60+,90+"); - params.put(BaseChartWeb.CHART_PARAM_SERIES, "1,2,3"); - params.put(BaseChartWeb.CHART_PARAM_CATEGORIES_AXISMARGIN_VISIBLE, "y"); - params.put(BaseChartWeb.CHART_PARAM_RANGEAXIS_VISIBLE, "y"); - params.put(BaseChartWeb.CHART_PARAM_VALUES, "100,50,75,92,30,58"); - BarChart chart = new BarChart(params); - BufferedImage img = chart.getChartImage(); - saveChart(img, "bar-chart-vertical-multi-series.png"); - assertChartSizeGreaterThan(img, 100); - } - @Test public void testStackedBarCharteightyTwenty() throws IOException { Map params = new HashMap(); diff --git a/server/sonar-server/src/test/java/org/sonar/server/search/IndexSynchronizerMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/search/IndexSynchronizerMediumTest.java deleted file mode 100644 index 55fe2f49622..00000000000 --- a/server/sonar-server/src/test/java/org/sonar/server/search/IndexSynchronizerMediumTest.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * SonarQube is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.server.search; - -import org.junit.After; -import org.junit.Before; -import org.junit.ClassRule; -import org.junit.Ignore; -import org.junit.Test; -import org.sonar.api.rule.RuleKey; -import org.sonar.core.component.ComponentDto; -import org.sonar.core.persistence.BatchSession; -import org.sonar.core.persistence.DbSession; -import org.sonar.core.rule.RuleDto; -import org.sonar.server.component.ComponentTesting; -import org.sonar.server.db.DbClient; -import org.sonar.server.issue.index.IssueAuthorizationIndexer; -import org.sonar.server.issue.IssueTesting; -import org.sonar.server.issue.index.IssueIndex; -import org.sonar.server.rule.RuleTesting; -import org.sonar.server.rule.db.RuleDao; -import org.sonar.server.rule.index.RuleIndex; -import org.sonar.server.source.index.SourceLineIndexer; -import org.sonar.server.tester.ServerTester; - -import static org.fest.assertions.Assertions.assertThat; - -@Ignore -public class IndexSynchronizerMediumTest { - - @ClassRule - public static ServerTester tester = new ServerTester(); - - IndexSynchronizer synchronizer; - DbClient dbClient; - IndexClient indexClient; - DbSession dbSession; - - @Before - public void setUp() throws Exception { - dbClient = tester.get(DbClient.class); - indexClient = tester.get(IndexClient.class); - dbSession = dbClient.openSession(false); - synchronizer = new IndexSynchronizer(dbClient, indexClient, tester.get(SourceLineIndexer.class), tester.get(IssueAuthorizationIndexer.class)); - tester.clearDbAndIndexes(); - } - - @After - public void tearDown() throws Exception { - dbSession.close(); - } - - @Test - public void can_synchronize() throws Exception { - int numberOfRules = 1000; - int batchSize = BatchSession.MAX_BATCH_SIZE; - - int count = 0; - for (int step = 0; (step * batchSize) < numberOfRules; step++) { - for (int i = 0; i < batchSize; i++) { - dbClient.ruleDao().insert(dbSession, RuleTesting.newDto(RuleKey.of("test", "x" + (count++)))); - } - dbSession.commit(); - } - - assertThat(indexClient.get(RuleIndex.class).countAll()).isEqualTo(numberOfRules); - tester.clearIndexes(); - assertThat(indexClient.get(RuleIndex.class).countAll()).isEqualTo(0); - - synchronizer.execute(); - assertThat(indexClient.get(RuleIndex.class).countAll()).isEqualTo(numberOfRules); - } - - @Test - public void synchronize_issues_from_empty_index() throws Exception { - ComponentDto project = ComponentTesting.newProjectDto(); - ComponentDto file = ComponentTesting.newFileDto(project); - dbClient.componentDao().insert(dbSession, project, file); - - RuleDto rule = RuleTesting.newXooX1(); - tester.get(RuleDao.class).insert(dbSession, rule); - dbClient.issueDao().insert(dbSession, IssueTesting.newDto(rule, file, project)); - - dbSession.commit(); - - assertThat(indexClient.get(IssueIndex.class).countAll()).isEqualTo(1); - tester.clearIndexes(); - assertThat(indexClient.get(IssueIndex.class).countAll()).isEqualTo(0); - - synchronizer.execute(); - assertThat(indexClient.get(IssueIndex.class).countAll()).isEqualTo(1); - } - - @Test - public void synchronize_issues_from_not_empty_index() throws Exception { - RuleDto rule = RuleTesting.newXooX1(); - tester.get(RuleDao.class).insert(dbSession, rule); - - ComponentDto project1 = ComponentTesting.newProjectDto(); - ComponentDto file1 = ComponentTesting.newFileDto(project1); - dbClient.componentDao().insert(dbSession, project1, file1); - dbClient.issueDao().insert(dbSession, IssueTesting.newDto(rule, file1, project1)); - - ComponentDto project2 = ComponentTesting.newProjectDto(); - ComponentDto file2 = ComponentTesting.newFileDto(project2); - dbClient.componentDao().insert(dbSession, project2, file2); - dbClient.issueDao().insert(dbSession, IssueTesting.newDto(rule, file2, project2)); - - dbSession.commit(); - - // Remove second issue to simulate that this issue has not been synchronized - indexClient.get(IssueIndex.class).deleteByProjectUuid(project2.uuid()); - - assertThat(indexClient.get(IssueIndex.class).countAll()).isEqualTo(1); - synchronizer.execute(); - assertThat(indexClient.get(IssueIndex.class).countAll()).isEqualTo(2); - } -} -- 2.39.5