*/
package org.sonarsource.sonarqube.upgrade;
+import static org.assertj.core.api.Assertions.assertThat;
+
import com.sonar.orchestrator.Orchestrator;
import com.sonar.orchestrator.OrchestratorBuilder;
import com.sonar.orchestrator.build.MavenBuild;
import org.junit.Test;
import org.sonar.wsclient.services.ResourceQuery;
-import static org.assertj.core.api.Assertions.assertThat;
-
public class UpgradeTest {
public static final String PROJECT_KEY = "org.apache.struts:struts-parent";
}
@Test
- public void test_upgrade_from_4_5_lts() {
+ public void test_upgrade_from_4_5() {
testDatabaseUpgrade(Version.create("4.5.1"));
}
testDatabaseUpgrade(Version.create("5.2"));
}
- private void testDatabaseUpgrade(Version fromVersion, BeforeUpgrade... tasks) {
+ private void testDatabaseUpgrade(Version fromVersion) {
startServer(fromVersion, false);
scanProject();
int files = countFiles(PROJECT_KEY);
assertThat(files).isGreaterThan(0);
- for (BeforeUpgrade task : tasks) {
- task.execute();
- }
-
stopServer();
// latest version
startServer(Version.create(Orchestrator.builderEnv().getSonarVersion()), true);
}
}
}
-
- private static interface BeforeUpgrade {
- void execute();
- }
}