Search in sources :

Example 51 with ProjectDefinition

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

the class ProjectReactorBuilderTest method shouldAcceptNoProjectName.

@Test
public void shouldAcceptNoProjectName() {
    ProjectDefinition rootProject = loadProjectDefinition("simple-project-with-missing-project-name");
    assertThat(rootProject.getOriginalName()).isNull();
    assertThat(rootProject.getName()).isEqualTo("com.foo.project");
}
Also used : ProjectDefinition(org.sonar.api.batch.bootstrap.ProjectDefinition) Test(org.junit.Test)

Example 52 with ProjectDefinition

use of org.sonar.api.batch.bootstrap.ProjectDefinition 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

ProjectDefinition (org.sonar.api.batch.bootstrap.ProjectDefinition)52 Test (org.junit.Test)29 File (java.io.File)10 DefaultInputModule (org.sonar.api.batch.fs.internal.DefaultInputModule)8 ProjectReactor (org.sonar.api.batch.bootstrap.ProjectReactor)5 DefaultInputDir (org.sonar.api.batch.fs.internal.DefaultInputDir)4 DefaultInputFile (org.sonar.api.batch.fs.internal.DefaultInputFile)4 InputModuleHierarchy (org.sonar.api.batch.fs.internal.InputModuleHierarchy)4 TestInputFileBuilder (org.sonar.api.batch.fs.internal.TestInputFileBuilder)4 ProjectAnalysisInfo (org.sonar.scanner.ProjectAnalysisInfo)4 GlobalSettings (org.sonar.scanner.bootstrap.GlobalSettings)4 AnalysisContextReportPublisher (org.sonar.scanner.report.AnalysisContextReportPublisher)4 ComponentsPublisher (org.sonar.scanner.report.ComponentsPublisher)4 ProjectRepositories (org.sonar.scanner.repository.ProjectRepositories)4 HashMap (java.util.HashMap)3 Before (org.junit.Before)3 Component (org.sonar.scanner.protocol.output.ScannerReport.Component)3 ScannerReportReader (org.sonar.scanner.protocol.output.ScannerReportReader)3 ArrayList (java.util.ArrayList)2 Map (java.util.Map)2