Search in sources :

Example 21 with ProjectReactor

use of org.sonar.api.batch.bootstrap.ProjectReactor in project sonarqube by SonarSource.

the class ProjectReactorValidatorTest method fail_with_only_digits.

@Test
public void fail_with_only_digits() {
    ProjectReactor reactor = createProjectReactor("12345");
    thrown.expect(MessageException.class);
    thrown.expectMessage("\"12345\" is not a valid project or module key");
    validator.validate(reactor);
}
Also used : ProjectReactor(org.sonar.api.batch.bootstrap.ProjectReactor) Test(org.junit.Test)

Example 22 with ProjectReactor

use of org.sonar.api.batch.bootstrap.ProjectReactor in project sonarqube by SonarSource.

the class ProjectReactorValidatorTest method createProjectReactor.

private ProjectReactor createProjectReactor(String projectKey, String branch) {
    ProjectDefinition def = ProjectDefinition.create().setProperty(CoreProperties.PROJECT_KEY_PROPERTY, projectKey).setProperty(CoreProperties.PROJECT_BRANCH_PROPERTY, branch);
    ProjectReactor reactor = new ProjectReactor(def);
    settings.setProperty(CoreProperties.PROJECT_BRANCH_PROPERTY, branch);
    return reactor;
}
Also used : ProjectReactor(org.sonar.api.batch.bootstrap.ProjectReactor) ProjectDefinition(org.sonar.api.batch.bootstrap.ProjectDefinition)

Aggregations

ProjectReactor (org.sonar.api.batch.bootstrap.ProjectReactor)22 Test (org.junit.Test)16 ProjectDefinition (org.sonar.api.batch.bootstrap.ProjectDefinition)5 ProjectRepositories (org.sonar.scanner.repository.ProjectRepositories)5 Before (org.junit.Before)2 ImmutableMap (com.google.common.collect.ImmutableMap)1 File (java.io.File)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Profiler (org.sonar.api.utils.log.Profiler)1 AnalysisProperties (org.sonar.scanner.analysis.AnalysisProperties)1 AnalysisTempFolderProvider (org.sonar.scanner.analysis.AnalysisTempFolderProvider)1 DroppedPropertyChecker (org.sonar.scanner.bootstrap.DroppedPropertyChecker)1 ProjectLock (org.sonar.scanner.scan.ProjectLock)1 WorkDirectoryCleaner (org.sonar.scanner.scan.WorkDirectoryCleaner)1