diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2013-11-06 14:38:40 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2013-11-06 14:38:40 +0100 |
commit | b5116218aebe1ae7ca6f3abcd77b507ae3cb5131 (patch) | |
tree | 9b256ca26109b39a236ae5cb7e199b021588eafb /sonar-plugin-api/src/test | |
parent | 373924bdca4f3ac6fb21948625678c4238e6e664 (diff) | |
download | sonarqube-b5116218aebe1ae7ca6f3abcd77b507ae3cb5131.tar.gz sonarqube-b5116218aebe1ae7ca6f3abcd77b507ae3cb5131.zip |
Rename TechnicalDebt class name to WorkDayDuration and move it to issue internal package
Diffstat (limited to 'sonar-plugin-api/src/test')
-rw-r--r-- | sonar-plugin-api/src/test/java/org/sonar/api/issue/internal/DefaultIssueTest.java | 5 | ||||
-rw-r--r-- | sonar-plugin-api/src/test/java/org/sonar/api/issue/internal/WorkDayDurationTest.java (renamed from sonar-plugin-api/src/test/java/org/sonar/api/technicaldebt/TechnicalDebtTest.java) | 36 |
2 files changed, 20 insertions, 21 deletions
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/issue/internal/DefaultIssueTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/issue/internal/DefaultIssueTest.java index 93fba1ecc52..2cd8cdbdfda 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/issue/internal/DefaultIssueTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/issue/internal/DefaultIssueTest.java @@ -25,7 +25,6 @@ import org.junit.Test; import org.sonar.api.issue.Issue; import org.sonar.api.issue.IssueComment; import org.sonar.api.rule.RuleKey; -import org.sonar.api.technicaldebt.TechnicalDebt; import java.text.SimpleDateFormat; import java.util.List; @@ -49,7 +48,7 @@ public class DefaultIssueTest { .setMessage("a message") .setLine(7) .setEffortToFix(1.2d) - .setTechnicalDebt(TechnicalDebt.of(1, 0, 0)) + .setTechnicalDebt(WorkDayDuration.of(1, 0, 0)) .setActionPlanKey("BCDE") .setStatus(Issue.STATUS_CLOSED) .setResolution(Issue.RESOLUTION_FIXED) @@ -77,7 +76,7 @@ public class DefaultIssueTest { assertThat(issue.message()).isEqualTo("a message"); assertThat(issue.line()).isEqualTo(7); assertThat(issue.effortToFix()).isEqualTo(1.2d); - assertThat(issue.technicalDebt()).isEqualTo(TechnicalDebt.of(1, 0, 0)); + assertThat(issue.technicalDebt()).isEqualTo(WorkDayDuration.of(1, 0, 0)); assertThat(issue.actionPlanKey()).isEqualTo("BCDE"); assertThat(issue.status()).isEqualTo(Issue.STATUS_CLOSED); assertThat(issue.resolution()).isEqualTo(Issue.RESOLUTION_FIXED); diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/technicaldebt/TechnicalDebtTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/issue/internal/WorkDayDurationTest.java index 5a51722c98e..ccff88c8624 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/technicaldebt/TechnicalDebtTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/issue/internal/WorkDayDurationTest.java @@ -17,46 +17,46 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.api.technicaldebt; +package org.sonar.api.issue.internal; import org.junit.Test; import static org.fest.assertions.Assertions.assertThat; -public class TechnicalDebtTest { +public class WorkDayDurationTest { @Test public void from_long_on_simple_values(){ - checkTimes(TechnicalDebt.fromLong(1L), 0, 0, 1); - checkTimes(TechnicalDebt.fromLong(100L), 0, 1, 0); - checkTimes(TechnicalDebt.fromLong(10000L), 1, 0, 0); + checkTimes(WorkDayDuration.fromLong(1L), 0, 0, 1); + checkTimes(WorkDayDuration.fromLong(100L), 0, 1, 0); + checkTimes(WorkDayDuration.fromLong(10000L), 1, 0, 0); } @Test public void from_long_on_complex_values(){ - checkTimes(TechnicalDebt.fromLong(10101L), 1, 1, 1); - checkTimes(TechnicalDebt.fromLong(101L), 0, 1, 1); - checkTimes(TechnicalDebt.fromLong(10001L), 1, 0, 1); - checkTimes(TechnicalDebt.fromLong(10100L), 1, 1, 0); + checkTimes(WorkDayDuration.fromLong(10101L), 1, 1, 1); + checkTimes(WorkDayDuration.fromLong(101L), 0, 1, 1); + checkTimes(WorkDayDuration.fromLong(10001L), 1, 0, 1); + checkTimes(WorkDayDuration.fromLong(10100L), 1, 1, 0); - checkTimes(TechnicalDebt.fromLong(112233L), 11, 22, 33); + checkTimes(WorkDayDuration.fromLong(112233L), 11, 22, 33); } @Test public void to_long(){ - assertThat(TechnicalDebt.of(1, 1, 1).toLong()).isEqualTo(10101L); + assertThat(WorkDayDuration.of(1, 1, 1).toLong()).isEqualTo(10101L); } @Test public void test_equals_and_hashCode() throws Exception { - TechnicalDebt oneMinute = TechnicalDebt.fromLong(1L); - TechnicalDebt oneHours = TechnicalDebt.fromLong(100L); - TechnicalDebt oneDay = TechnicalDebt.fromLong(10000L); + WorkDayDuration oneMinute = WorkDayDuration.fromLong(1L); + WorkDayDuration oneHours = WorkDayDuration.fromLong(100L); + WorkDayDuration oneDay = WorkDayDuration.fromLong(10000L); assertThat(oneMinute).isEqualTo(oneMinute); - assertThat(oneMinute).isEqualTo(TechnicalDebt.fromLong(1L)); - assertThat(oneHours).isEqualTo(TechnicalDebt.fromLong(100L)); - assertThat(oneDay).isEqualTo(TechnicalDebt.fromLong(10000L)); + assertThat(oneMinute).isEqualTo(WorkDayDuration.fromLong(1L)); + assertThat(oneHours).isEqualTo(WorkDayDuration.fromLong(100L)); + assertThat(oneDay).isEqualTo(WorkDayDuration.fromLong(10000L)); assertThat(oneMinute).isNotEqualTo(oneHours); assertThat(oneHours).isNotEqualTo(oneDay); @@ -64,7 +64,7 @@ public class TechnicalDebtTest { assertThat(oneMinute.hashCode()).isEqualTo(oneMinute.hashCode()); } - private void checkTimes(TechnicalDebt technicalDebt, int expectedDays, int expectedHours, int expectedMinutes){ + private void checkTimes(WorkDayDuration technicalDebt, int expectedDays, int expectedHours, int expectedMinutes){ assertThat(technicalDebt.days()).isEqualTo(expectedDays); assertThat(technicalDebt.hours()).isEqualTo(expectedHours); assertThat(technicalDebt.minutes()).isEqualTo(expectedMinutes); |