You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ScannerPerfTestSuite.java 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2016 SonarSource SA
  4. * mailto:contact AT sonarsource DOT com
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 3 of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with this program; if not, write to the Free Software Foundation,
  18. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. */
  20. package org.sonarsource.sonarqube.perf.scanner.suite;
  21. import com.sonar.orchestrator.Orchestrator;
  22. import com.sonar.orchestrator.locator.FileLocation;
  23. import org.sonarsource.sonarqube.perf.PerfTestCase;
  24. import java.io.File;
  25. import java.io.IOException;
  26. import org.junit.BeforeClass;
  27. import org.junit.ClassRule;
  28. import org.junit.runner.RunWith;
  29. import org.junit.runners.Suite;
  30. @RunWith(Suite.class)
  31. @Suite.SuiteClasses({
  32. BootstrappingTest.class,
  33. DuplicationTest.class,
  34. FileSystemTest.class,
  35. HighlightingTest.class,
  36. MemoryTest.class,
  37. IssuesModeTest.class
  38. })
  39. public class ScannerPerfTestSuite {
  40. @ClassRule
  41. public static final Orchestrator ORCHESTRATOR = Orchestrator
  42. .builderEnv()
  43. .addPlugin(FileLocation.byWildcardMavenFilename(new File("../../plugins/sonar-xoo-plugin/target"), "sonar-xoo-plugin-*.jar"))
  44. // should not be so high, but required as long embedded h2 is used -> requires more memory on server
  45. .setServerProperty("sonar.web.javaOpts", "-Xmx1G -XX:MaxPermSize=100m -XX:+HeapDumpOnOutOfMemoryError")
  46. // Needed by DuplicationTest::hugeJavaFile
  47. .setOrchestratorProperty("javaVersion", "LATEST_RELEASE").addPlugin("java")
  48. .restoreProfileAtStartup(FileLocation.ofClasspath("/one-xoo-issue-per-line.xml"))
  49. .build();
  50. @BeforeClass
  51. public static void setUp() throws IOException {
  52. // Execute a first analysis to prevent any side effects with cache of plugin JAR files
  53. ORCHESTRATOR.executeBuild(PerfTestCase.newScanner("-Xmx512m -server", "sonar.profile", "one-xoo-issue-per-line"));
  54. }
  55. }