use of org.sonar.wsclient.services.PropertyCreateQuery in project sonarlint-core by SonarSource.
the class LicenseTest method prepare.
@BeforeClass
public static void prepare() throws Exception {
OrchestratorBuilder builder = Orchestrator.builderEnv().restoreProfileAtStartup(FileLocation.ofClasspath("/cobol-sonarlint.xml"));
if (Version.create(builder.getSonarVersion().get()).isGreaterThanOrEquals("6.7")) {
builder.addPlugin(MavenLocation.of("com.sonarsource.license", "sonar-dev-license-plugin", "3.2.0.1163"));
}
builder.addPlugin("cobol");
ORCHESTRATOR = builder.build();
ORCHESTRATOR.start();
adminWsClient = ConnectedModeTest.newAdminWsClient(ORCHESTRATOR);
ORCHESTRATOR.getServer().getAdminWsClient().create(new PropertyCreateQuery("sonar.forceAuthentication", "true"));
sonarUserHome = temp.newFolder().toPath();
removeGroupPermission("anyone", "scan");
ORCHESTRATOR.getServer().adminWsClient().userClient().create(UserParameters.create().login(SONARLINT_USER).password(SONARLINT_PWD).passwordConfirmation(SONARLINT_PWD).name("SonarLint"));
// addUserPermission("sonarlint", "dryRunScan");
ORCHESTRATOR.getServer().provisionProject(PROJECT_KEY_COBOL, "Sample Cobol");
ORCHESTRATOR.getServer().associateProjectToQualityProfile(PROJECT_KEY_COBOL, "cobol", "SonarLint IT Cobol");
}
use of org.sonar.wsclient.services.PropertyCreateQuery in project sonarlint-core by SonarSource.
the class ConnectedDaemonTest method prepare.
@BeforeClass
public static void prepare() throws Exception {
adminWsClient = ConnectedModeTest.newAdminWsClient(ORCHESTRATOR);
ORCHESTRATOR.getServer().getAdminWsClient().create(new PropertyCreateQuery("sonar.forceAuthentication", "true"));
sonarUserHome = temp.newFolder().toPath();
removeGroupPermission("anyone", "scan");
ORCHESTRATOR.getServer().adminWsClient().userClient().create(UserParameters.create().login(SONARLINT_USER).password(SONARLINT_PWD).passwordConfirmation(SONARLINT_PWD).name("SonarLint"));
// addUserPermission("sonarlint", "dryRunScan");
ORCHESTRATOR.getServer().provisionProject(PROJECT_KEY_JAVA, "Sample Java");
ORCHESTRATOR.getServer().associateProjectToQualityProfile(PROJECT_KEY_JAVA, "java", "SonarLint IT Java");
// Build project to have bytecode
ORCHESTRATOR.executeBuild(MavenBuild.create(new File("projects/sample-java/pom.xml")).setGoals("clean package"));
}
use of org.sonar.wsclient.services.PropertyCreateQuery in project sonarqube by SonarSource.
the class MemoryTest method analyzeProjectWithManyModulesAndBigProperties.
// Property on root module is duplicated in each module so it may be big
@Test
public void analyzeProjectWithManyModulesAndBigProperties() throws IOException {
File baseDir = temp.newFolder();
prepareModule(baseDir, "moduleA", 1);
prepareModule(baseDir, "moduleB", 1);
prepareModule(baseDir, "moduleC", 1);
FileUtils.write(new File(baseDir, "sonar-project.properties"), "sonar.modules=moduleA,moduleB,moduleC\n", true);
FileUtils.write(new File(baseDir, "sonar-project.properties"), "sonar.myBigProp=" + Strings.repeat("A", 10000), true);
SonarScanner scanner = SonarScanner.create().setProperties("sonar.projectKey", "big-module-tree", "sonar.projectName", "Big Module Tree", "sonar.projectVersion", "1.0", "sonar.sources", "", "sonar.showProfiling", "true");
scanner.setEnvironmentVariable("SONAR_RUNNER_OPTS", "-Xmx512m -server").setProjectDir(baseDir);
BuildResult result = orchestrator.executeBuild(scanner);
perfRule.assertDurationAround(MavenLogs.extractTotalTime(result.getLogs()), 4847L);
// Second execution with a property on server side
orchestrator.getServer().getAdminWsClient().create(new PropertyCreateQuery("sonar.anotherBigProp", Strings.repeat("B", 1000), "big-module-tree"));
result = orchestrator.executeBuild(scanner);
perfRule.assertDurationAround(MavenLogs.extractTotalTime(result.getLogs()), 4620L);
}
Aggregations