Package org.sonar.server.debt.DebtModelXMLExporter

Examples of org.sonar.server.debt.DebtModelXMLExporter.RuleDebt


    String xml = getFileContent("replace_mn_by_min.xml");

    List<RuleDebt> results = importer.importXML(xml, validationMessages);
    assertThat(results).hasSize(1);

    RuleDebt ruleDebt = results.get(0);
    assertThat(ruleDebt.subCharacteristicKey()).isEqualTo("MEMORY_EFFICIENCY");
    assertThat(ruleDebt.function()).isEqualTo(DebtRemediationFunction.Type.LINEAR.name());
    assertThat(ruleDebt.coefficient()).isEqualTo("3min");
    assertThat(ruleDebt.offset()).isNull();
  }
View Full Code Here


    String xml = getFileContent("read_integer.xml");

    List<RuleDebt> results = importer.importXML(xml, validationMessages);
    assertThat(results).hasSize(1);

    RuleDebt ruleDebt = results.get(0);
    assertThat(ruleDebt.subCharacteristicKey()).isEqualTo("MEMORY_EFFICIENCY");
    assertThat(ruleDebt.ruleKey()).isEqualTo(RuleKey.of("checkstyle", "Regexp"));
    assertThat(ruleDebt.function()).isEqualTo(DebtRemediationFunction.Type.LINEAR.name());
    assertThat(ruleDebt.coefficient()).isEqualTo("3h");
    assertThat(ruleDebt.offset()).isNull();
  }
View Full Code Here

    String xml = getFileContent("convert_deprecated_linear_with_threshold_function_by_linear_function.xml");

    List<RuleDebt> results = importer.importXML(xml, validationMessages);
    assertThat(results).hasSize(1);

    RuleDebt ruleDebt = results.get(0);
    assertThat(ruleDebt.subCharacteristicKey()).isEqualTo("MEMORY_EFFICIENCY");
    assertThat(ruleDebt.function()).isEqualTo(DebtRemediationFunction.Type.LINEAR.name());
    assertThat(ruleDebt.coefficient()).isEqualTo("3h");
    assertThat(ruleDebt.offset()).isNull();

    assertThat(validationMessages.getWarnings()).isNotEmpty();
  }
View Full Code Here

    String xml = getFileContent("convert_constant_per_issue_with_coefficient_by_constant_per_issue_with_offset.xml");

    List<RuleDebt> results = importer.importXML(xml, validationMessages);
    assertThat(results).hasSize(1);

    RuleDebt ruleDebt = results.get(0);
    assertThat(ruleDebt.subCharacteristicKey()).isEqualTo("MEMORY_EFFICIENCY");
    assertThat(ruleDebt.function()).isEqualTo(DebtRemediationFunction.Type.CONSTANT_ISSUE.name());
    assertThat(ruleDebt.coefficient()).isNull();
    assertThat(ruleDebt.offset()).isEqualTo("3h");
  }
View Full Code Here

    String xml = getFileContent("import_badly_formatted_xml.xml");

    List<RuleDebt> results = importer.importXML(xml, validationMessages);
    assertThat(results).hasSize(1);

    RuleDebt ruleDebt = results.get(0);
    assertThat(ruleDebt.subCharacteristicKey()).isEqualTo("MEMORY_EFFICIENCY");
    assertThat(ruleDebt.ruleKey()).isEqualTo(RuleKey.of("checkstyle", "Regexp"));
    assertThat(ruleDebt.function()).isEqualTo(DebtRemediationFunction.Type.LINEAR.name());
    assertThat(ruleDebt.coefficient()).isEqualTo("3h");
    assertThat(ruleDebt.offset()).isNull();
  }
View Full Code Here

    String xml = getFileContent("convert_network_use_key.xml");

    List<RuleDebt> results = importer.importXML(xml, validationMessages);
    assertThat(results).hasSize(1);

    RuleDebt ruleDebt = results.get(0);
    assertThat(ruleDebt.subCharacteristicKey()).isEqualTo("NETWORK_USE");
  }
View Full Code Here

    String xml = getFileContent("import_linear.xml");

    List<RuleDebt> results = importer.importXML(xml, validationMessages);
    assertThat(results).hasSize(1);

    RuleDebt ruleDebt = results.get(0);
    assertThat(ruleDebt.subCharacteristicKey()).isEqualTo("MEMORY_EFFICIENCY");
    assertThat(ruleDebt.ruleKey()).isEqualTo(RuleKey.of("checkstyle", "Regexp"));
    assertThat(ruleDebt.function()).isEqualTo(DebtRemediationFunction.Type.LINEAR.name());
    assertThat(ruleDebt.coefficient()).isEqualTo("3h");
    assertThat(ruleDebt.offset()).isNull();
  }
View Full Code Here

    String xml = getFileContent("import_linear_having_offset_to_zero.xml");

    List<RuleDebt> results = importer.importXML(xml, validationMessages);
    assertThat(results).hasSize(1);

    RuleDebt ruleDebt = results.get(0);
    assertThat(ruleDebt.subCharacteristicKey()).isEqualTo("MEMORY_EFFICIENCY");
    assertThat(ruleDebt.ruleKey()).isEqualTo(RuleKey.of("checkstyle", "Regexp"));
    assertThat(ruleDebt.function()).isEqualTo(DebtRemediationFunction.Type.LINEAR.name());
    assertThat(ruleDebt.coefficient()).isEqualTo("3h");
    assertThat(ruleDebt.offset()).isNull();
  }
View Full Code Here

    String xml = getFileContent("import_linear_with_offset.xml");

    List<RuleDebt> results = importer.importXML(xml, validationMessages);
    assertThat(results).hasSize(1);

    RuleDebt ruleDebt = results.get(0);
    assertThat(ruleDebt.subCharacteristicKey()).isEqualTo("MEMORY_EFFICIENCY");
    assertThat(ruleDebt.function()).isEqualTo(DebtRemediationFunction.Type.LINEAR_OFFSET.name());
    assertThat(ruleDebt.coefficient()).isEqualTo("3h");
    assertThat(ruleDebt.offset()).isEqualTo("1min");
  }
View Full Code Here

    String xml = getFileContent("import_constant_issue.xml");

    List<RuleDebt> results = importer.importXML(xml, validationMessages);
    assertThat(results).hasSize(1);

    RuleDebt ruleDebt = results.get(0);
    assertThat(ruleDebt.subCharacteristicKey()).isEqualTo("MEMORY_EFFICIENCY");
    assertThat(ruleDebt.function()).isEqualTo(DebtRemediationFunction.Type.CONSTANT_ISSUE.name());
    assertThat(ruleDebt.coefficient()).isNull();
    assertThat(ruleDebt.offset()).isEqualTo("3d");
  }
View Full Code Here

TOP

Related Classes of org.sonar.server.debt.DebtModelXMLExporter.RuleDebt

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.