@Override
  public void define(Context context) {
    context.addExtensions(
      PropertyDefinition.builder(Xoo.FILE_SUFFIXES_KEY)
        .defaultValue(Xoo.DEFAULT_FILE_SUFFIXES)
        .name("File suffixes")
        .description("Comma-separated list of suffixes for files to analyze. To not filter, leave the list empty.")
        .subCategory("General")
        .onQualifiers(Qualifiers.PROJECT)
        .multiValues(true)
        .build(),
      PropertyDefinition.builder(Xoo2.FILE_SUFFIXES_KEY)
        .defaultValue(Xoo2.DEFAULT_FILE_SUFFIXES)
        .name("File suffixes")
        .description("Comma-separated list of suffixes for files to analyze. To not filter, leave the list empty.")
        .subCategory("General")
        .onQualifiers(Qualifiers.PROJECT)
        .build(),
      // Used by DuplicationsTest and IssueFilterOnCommonRulesTest. If not declared it is not returned by api/settings
      PropertyDefinition.builder("sonar.cpd.xoo.minimumTokens")
        .onQualifiers(Qualifiers.PROJECT)
        .type(PropertyType.INTEGER)
        .build(),
      PropertyDefinition.builder("sonar.cpd.xoo.minimumLines")
        .onQualifiers(Qualifiers.PROJECT)
        .type(PropertyType.INTEGER)
        .build(),
      Xoo.class,
      Xoo2.class,
      Xoo3NoAutoPublish.class,
      Xoo3QualityProfileDefinition.class,
      XooRulesDefinition.class,
      XooBuiltInQualityProfilesDefinition.class,
      XooSonarWayProfile.class,
      XooBasicProfile.class,
      Xoo2SonarWayProfile.class,
      Xoo2BasicProfile.class,
      XooEmptyProfile.class,

      XooFakeExporter.class,
      XooFakeImporter.class,
      XooFakeImporterWithMessages.class,

      // SCM
      XooScmProvider.class,
      XooBlameCommand.class,

      // sensors
      HasTagSensor.class,
      LineMeasureSensor.class,
      SyntaxHighlightingSensor.class,
      SymbolReferencesSensor.class,
      ChecksSensor.class,
      RandomAccessSensor.class,
      SaveDataTwiceSensor.class,
      NoSonarSensor.class,
      CpdTokenizerSensor.class,

      OneBlockerIssuePerFileSensor.class,
      OneIssuePerLineSensor.class,
      OneDayDebtPerFileSensor.class,
      OneIssuePerFileSensor.class,
      OneIssuePerTestFileSensor.class,
      OneBugIssuePerTestLineSensor.class,
      OneCodeSmellIssuePerTestLineSensor.class,
      OneIssuePerDirectorySensor.class,
      OneIssuePerProjectSensor.class,
      OneIssueOnDirPerFileSensor.class,
      OneIssuePerUnknownFileSensor.class,
      OneQuickFixPerLineSensor.class,

      OneExternalIssuePerFoobarSensor.class,
      OneExternalIssuePerLineSensor.class,
      OneExternalIssuePerLineWithoutMessageSensor.class,
      OneExternalIssueOnProjectSensor.class,
      OnePredefinedRuleExternalIssuePerLineSensor.class,
      OnePredefinedAndAdHocRuleExternalIssuePerLineSensor.class,

      CreateIssueByInternalKeySensor.class,
      MultilineIssuesSensor.class,
      MultilineHotspotSensor.class,
      CustomMessageSensor.class,

      OneBugIssuePerLineSensor.class,
      OneCodeSmellIssuePerLineSensor.class,
      OneVulnerabilityIssuePerProjectSensor.class,
      OneVulnerabilityPerSecurityStandardSensor.class,

      DeprecatedGlobalSensor.class,
      GlobalProjectSensor.class,

      HotspotWithoutContextSensor.class,
      HotspotWithContextsSensor.class,
      HotspotWithSingleContextSensor.class,
      HotspotWithCodeVariantsSensor.class,

      // Coverage
      UtCoverageSensor.class,
      ItCoverageSensor.class,
      OverallCoverageSensor.class,

      // Analysis errors
      AnalysisErrorSensor.class,

      // Other
      MarkAsUnchangedSensor.class,
      XooProjectBuilder.class,
      XooPostJob.class,
      XooIssueFilter.class,
      XooIgnoreCommand.class,
      SignificantCodeSensor.class,
      IssueWithCodeVariantsSensor.class,
      XooExcludeFileFilter.class);

    if (context.getRuntime().getProduct() != SonarProduct.SONARLINT) {
      context.addExtension(MeasureSensor.class);
    }
  }
@Test
  public void provide_extensions_for_sonar_qube() {
    SonarRuntime runtime = SonarRuntimeImpl.forSonarQube(Version.parse("8.4"), SonarQubeSide.SCANNER, SonarEdition.COMMUNITY);
    Plugin.Context context = new PluginContextImpl.Builder().setSonarRuntime(runtime).build();
    new XooPlugin().define(context);

    assertThat(getExtensions(context))
      .isNotEmpty()
      .contains(MeasureSensor.class)
      .contains(GlobalProjectSensor.class)
      .contains(XooIgnoreCommand.class);
  }