diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-03-26 14:02:47 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-03-26 14:02:56 +0100 |
commit | d3cc1dae7f60510c75f4ce689d491012e21d6e62 (patch) | |
tree | be486857c40d44a5dffe727eeb1c96dc5bda3f23 /sonar-plugin-api/src/test | |
parent | bb7cd8ae7cfe14b8ed9e55a4bb954adc91326afb (diff) | |
download | sonarqube-d3cc1dae7f60510c75f4ce689d491012e21d6e62.tar.gz sonarqube-d3cc1dae7f60510c75f4ce689d491012e21d6e62.zip |
Replace factor by coefficient
Diffstat (limited to 'sonar-plugin-api/src/test')
4 files changed, 22 insertions, 22 deletions
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/batch/rule/DefaultDebtRemediationFunctionTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/batch/rule/DefaultDebtRemediationFunctionTest.java index d63bfea969f..4bcb659a5b2 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/batch/rule/DefaultDebtRemediationFunctionTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/batch/rule/DefaultDebtRemediationFunctionTest.java @@ -31,7 +31,7 @@ public class DefaultDebtRemediationFunctionTest { public void create_linear() throws Exception { DebtRemediationFunction function = DebtRemediationFunction.createLinear(Duration.create(10)); assertThat(function.type()).isEqualTo(DebtRemediationFunction.Type.LINEAR); - assertThat(function.factor()).isEqualTo(Duration.create(10)); + assertThat(function.coefficient()).isEqualTo(Duration.create(10)); assertThat(function.offset()).isNull(); } @@ -39,7 +39,7 @@ public class DefaultDebtRemediationFunctionTest { public void create_linear_with_offset() throws Exception { DebtRemediationFunction function = DebtRemediationFunction.createLinearWithOffset(Duration.create(10), Duration.create(5)); assertThat(function.type()).isEqualTo(DebtRemediationFunction.Type.LINEAR_OFFSET); - assertThat(function.factor()).isEqualTo(Duration.create(10)); + assertThat(function.coefficient()).isEqualTo(Duration.create(10)); assertThat(function.offset()).isEqualTo(Duration.create(5)); } @@ -47,7 +47,7 @@ public class DefaultDebtRemediationFunctionTest { public void create_constant_per_issue() throws Exception { DebtRemediationFunction function = DebtRemediationFunction.createConstantPerIssue(Duration.create(10)); assertThat(function.type()).isEqualTo(DebtRemediationFunction.Type.CONSTANT_ISSUE); - assertThat(function.factor()).isNull(); + assertThat(function.coefficient()).isNull(); assertThat(function.offset()).isEqualTo(Duration.create(10)); } diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/batch/rule/internal/RulesBuilderTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/batch/rule/internal/RulesBuilderTest.java index 881823e3cf6..e569d4e1db1 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/batch/rule/internal/RulesBuilderTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/batch/rule/internal/RulesBuilderTest.java @@ -73,7 +73,7 @@ public class RulesBuilderTest { assertThat(squid1.severity()).isEqualTo(Severity.CRITICAL); assertThat(squid1.debtCharacteristic()).isEqualTo("COMPILER"); assertThat(squid1.debtRemediationFunction().type()).isEqualTo(DebtRemediationFunction.Type.LINEAR_OFFSET); - assertThat(squid1.debtRemediationFunction().factor()).isEqualTo(Duration.create(10)); + assertThat(squid1.debtRemediationFunction().coefficient()).isEqualTo(Duration.create(10)); assertThat(squid1.debtRemediationFunction().offset()).isEqualTo(Duration.create(60)); assertThat(squid1.debtCharacteristic()).isEqualTo("COMPILER"); assertThat(squid1.params()).hasSize(2); diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/server/debt/DefaultDebtRemediationFunctionTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/server/debt/DefaultDebtRemediationFunctionTest.java index f4c28fe2737..8bdefe18651 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/server/debt/DefaultDebtRemediationFunctionTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/server/debt/DefaultDebtRemediationFunctionTest.java @@ -32,7 +32,7 @@ public class DefaultDebtRemediationFunctionTest { public void create_linear() { DebtRemediationFunction function = new DefaultDebtRemediationFunction(DebtRemediationFunction.Type.LINEAR, "10h", null); assertThat(function.type()).isEqualTo(DefaultDebtRemediationFunction.Type.LINEAR); - assertThat(function.factor()).isEqualTo("10h"); + assertThat(function.coefficient()).isEqualTo("10h"); assertThat(function.offset()).isNull(); } @@ -40,7 +40,7 @@ public class DefaultDebtRemediationFunctionTest { public void create_linear_with_offset() { DebtRemediationFunction function = new DefaultDebtRemediationFunction(DebtRemediationFunction.Type.LINEAR_OFFSET, "10h", "5min"); assertThat(function.type()).isEqualTo(DefaultDebtRemediationFunction.Type.LINEAR_OFFSET); - assertThat(function.factor()).isEqualTo("10h"); + assertThat(function.coefficient()).isEqualTo("10h"); assertThat(function.offset()).isEqualTo("5min"); } @@ -48,25 +48,25 @@ public class DefaultDebtRemediationFunctionTest { public void create_constant_per_issue() { DebtRemediationFunction function = new DefaultDebtRemediationFunction(DebtRemediationFunction.Type.CONSTANT_ISSUE, null, "10h"); assertThat(function.type()).isEqualTo(DefaultDebtRemediationFunction.Type.CONSTANT_ISSUE); - assertThat(function.factor()).isNull(); + assertThat(function.coefficient()).isNull(); assertThat(function.offset()).isEqualTo("10h"); } @Test - public void sanitize_remediation_factor_and_offset() { + public void sanitize_remediation_coefficient_and_offset() { DebtRemediationFunction function = new DefaultDebtRemediationFunction(DebtRemediationFunction.Type.LINEAR_OFFSET, " 1 h ", " 10 min"); - assertThat(function.factor()).isEqualTo("1h"); + assertThat(function.coefficient()).isEqualTo("1h"); assertThat(function.offset()).isEqualTo("10min"); } @Test - public void fail_to_create_linear_when_no_factor() { + public void fail_to_create_linear_when_no_coefficient() { try { new DefaultDebtRemediationFunction(DebtRemediationFunction.Type.LINEAR, null, "10h"); fail(); } catch (IllegalArgumentException e) { - assertThat(e).hasMessage("Only factor must be set on DebtRemediationFunction{type=LINEAR, factor=null, offset=10h}"); + assertThat(e).hasMessage("Only coefficient must be set on DebtRemediationFunction{type=LINEAR, coefficient=null, offset=10h}"); } } @@ -76,7 +76,7 @@ public class DefaultDebtRemediationFunctionTest { new DefaultDebtRemediationFunction(DebtRemediationFunction.Type.LINEAR, "5min", "10h"); fail(); } catch (IllegalArgumentException e) { - assertThat(e).hasMessage("Only factor must be set on DebtRemediationFunction{type=LINEAR, factor=5min, offset=10h}"); + assertThat(e).hasMessage("Only coefficient must be set on DebtRemediationFunction{type=LINEAR, coefficient=5min, offset=10h}"); } } @@ -86,27 +86,27 @@ public class DefaultDebtRemediationFunctionTest { new DefaultDebtRemediationFunction(DebtRemediationFunction.Type.CONSTANT_ISSUE, "10h", null); fail(); } catch (IllegalArgumentException e) { - assertThat(e).hasMessage("Only offset must be set on DebtRemediationFunction{type=CONSTANT_ISSUE, factor=10h, offset=null}"); + assertThat(e).hasMessage("Only offset must be set on DebtRemediationFunction{type=CONSTANT_ISSUE, coefficient=10h, offset=null}"); } } @Test - public void fail_to_create_constant_per_issue_when_factor() { + public void fail_to_create_constant_per_issue_when_coefficient() { try { new DefaultDebtRemediationFunction(DebtRemediationFunction.Type.CONSTANT_ISSUE, "5min", "10h"); fail(); } catch (IllegalArgumentException e) { - assertThat(e).hasMessage("Only offset must be set on DebtRemediationFunction{type=CONSTANT_ISSUE, factor=5min, offset=10h}"); + assertThat(e).hasMessage("Only offset must be set on DebtRemediationFunction{type=CONSTANT_ISSUE, coefficient=5min, offset=10h}"); } } @Test - public void fail_to_create_linear_with_offset_when_no_factor() { + public void fail_to_create_linear_with_offset_when_no_coefficient() { try { new DefaultDebtRemediationFunction(DebtRemediationFunction.Type.LINEAR_OFFSET, "", "10h"); fail(); } catch (IllegalArgumentException e) { - assertThat(e).hasMessage("Both factor and offset are required on DebtRemediationFunction{type=LINEAR_OFFSET, factor=null, offset=10h}"); + assertThat(e).hasMessage("Both coefficient and offset are required on DebtRemediationFunction{type=LINEAR_OFFSET, coefficient=null, offset=10h}"); } } @@ -116,7 +116,7 @@ public class DefaultDebtRemediationFunctionTest { new DefaultDebtRemediationFunction(DebtRemediationFunction.Type.LINEAR_OFFSET, "5min", ""); fail(); } catch (IllegalArgumentException e) { - assertThat(e).hasMessage("Both factor and offset are required on DebtRemediationFunction{type=LINEAR_OFFSET, factor=5min, offset=null}"); + assertThat(e).hasMessage("Both coefficient and offset are required on DebtRemediationFunction{type=LINEAR_OFFSET, coefficient=5min, offset=null}"); } } @@ -143,16 +143,16 @@ public class DefaultDebtRemediationFunctionTest { @Test public void test_to_string() { assertThat(new DefaultDebtRemediationFunction(DebtRemediationFunction.Type.LINEAR_OFFSET, "10h", "5min").toString()) - .isEqualTo("DebtRemediationFunction{type=LINEAR_OFFSET, factor=10h, offset=5min}"); + .isEqualTo("DebtRemediationFunction{type=LINEAR_OFFSET, coefficient=10h, offset=5min}"); } @Test - public void fail_if_bad_factor_format() { + public void fail_if_bad_coefficient_format() { try { new DefaultDebtRemediationFunction(DebtRemediationFunction.Type.LINEAR, "foo", null); fail(); } catch (IllegalArgumentException e) { - assertThat(e).hasMessage("Invalid factor: foo"); + assertThat(e).hasMessage("Invalid coefficient: foo"); } } diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/server/rule/RulesDefinitionTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/server/rule/RulesDefinitionTest.java index 186fe99dc22..3a028382d3c 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/server/rule/RulesDefinitionTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/server/rule/RulesDefinitionTest.java @@ -95,7 +95,7 @@ public class RulesDefinitionTest { assertThat(rule.status()).isEqualTo(RuleStatus.BETA); assertThat(rule.debtSubCharacteristic()).isEqualTo("COMPILER"); assertThat(rule.debtRemediationFunction().type()).isEqualTo(DebtRemediationFunction.Type.LINEAR_OFFSET); - assertThat(rule.debtRemediationFunction().factor()).isEqualTo("1h"); + assertThat(rule.debtRemediationFunction().coefficient()).isEqualTo("1h"); assertThat(rule.debtRemediationFunction().offset()).isEqualTo("10min"); assertThat(rule.effortToFixDescription()).isEqualTo("squid.S115.effortToFix"); assertThat(rule.toString()).isEqualTo("[repository=findbugs, key=NPE]"); |