aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src/test/java
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2011-12-29 16:50:37 +0100
committerSimon Brandhof <simon.brandhof@gmail.com>2011-12-29 16:50:37 +0100
commit5750cd738ffe93225fb5619a6a2cba2d2ddb4ec2 (patch)
tree6eebd440f2a4c7681c52ddd1ac240f64d2dc76b5 /sonar-server/src/test/java
parent2cfa11d0aefa61202e4f04d2eb453649080d8bf7 (diff)
downloadsonarqube-5750cd738ffe93225fb5619a6a2cba2d2ddb4ec2.tar.gz
sonarqube-5750cd738ffe93225fb5619a6a2cba2d2ddb4ec2.zip
Indexation of resources during migration must be reentrant
Diffstat (limited to 'sonar-server/src/test/java')
-rw-r--r--sonar-server/src/test/java/org/sonar/server/startup/IndexProjectsTest.java68
1 files changed, 0 insertions, 68 deletions
diff --git a/sonar-server/src/test/java/org/sonar/server/startup/IndexProjectsTest.java b/sonar-server/src/test/java/org/sonar/server/startup/IndexProjectsTest.java
deleted file mode 100644
index b3d1f4692a4..00000000000
--- a/sonar-server/src/test/java/org/sonar/server/startup/IndexProjectsTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2011 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar 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.
- *
- * Sonar 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 Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-package org.sonar.server.startup;
-
-import org.junit.Test;
-import org.sonar.api.platform.ServerUpgradeStatus;
-import org.sonar.core.resource.ResourceIndexer;
-import org.sonar.jpa.entity.SchemaMigration;
-
-import static org.mockito.Mockito.*;
-
-public class IndexProjectsTest {
-
- @Test
- public void doNotIndexOnFreshInstalls() {
- ResourceIndexer indexer = mock(ResourceIndexer.class);
- ServerUpgradeStatus status = mock(ServerUpgradeStatus.class);
- when(status.isUpgraded()).thenReturn(false);
- when(status.isFreshInstall()).thenReturn(true);
-
- new IndexProjects(status, indexer).start();
-
- verifyZeroInteractions(indexer);
- }
-
- @Test
- public void doNotIndexOnUpgradesSince213() {
- ResourceIndexer indexer = mock(ResourceIndexer.class);
- ServerUpgradeStatus status = mock(ServerUpgradeStatus.class);
- when(status.isUpgraded()).thenReturn(true);
- when(status.isFreshInstall()).thenReturn(false);
- when(status.getInitialDbVersion()).thenReturn(SchemaMigration.VERSION_2_13 + 10);
-
- new IndexProjects(status, indexer).start();
-
- verifyZeroInteractions(indexer);
- }
-
- @Test
- public void doIndexOnUpgradeBefore213() {
- ResourceIndexer indexer = mock(ResourceIndexer.class);
- ServerUpgradeStatus status = mock(ServerUpgradeStatus.class);
- when(status.isUpgraded()).thenReturn(true);
- when(status.isFreshInstall()).thenReturn(false);
- when(status.getInitialDbVersion()).thenReturn(SchemaMigration.VERSION_2_13 - 10);
-
- new IndexProjects(status, indexer).start();
-
- verify(indexer).indexAll();
- }
-}