diff options
author | Matteo Mara <matteo.mara@sonarsource.com> | 2022-03-04 14:25:57 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-03-09 20:02:59 +0000 |
commit | 07bfdaa5256a44787aa15cf16155eaceaec9a452 (patch) | |
tree | fb4af39d93b44a610d50456597e3121911d03eda /server/sonar-db-dao | |
parent | cc3c0c7119ed51be19435872903f5090b092d415 (diff) | |
download | sonarqube-07bfdaa5256a44787aa15cf16155eaceaec9a452.tar.gz sonarqube-07bfdaa5256a44787aa15cf16155eaceaec9a452.zip |
SONAR-16013 export database results to CSV
Diffstat (limited to 'server/sonar-db-dao')
3 files changed, 2 insertions, 25 deletions
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/measure/LargestBranchNclocDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/measure/LargestBranchNclocDto.java index ae9728f0359..579fe18f344 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/measure/LargestBranchNclocDto.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/measure/LargestBranchNclocDto.java @@ -91,17 +91,4 @@ public class LargestBranchNclocDto { this.lastAnalysisDate = lastAnalysisDate; return this; } - - @Override - public String toString() { - return new StringBuilder("ProjectMaxNclocDto{") - .append("projectUuid='").append(projectUuid).append('\'') - .append(", projectName='").append(projectName).append('\'') - .append(", projectKey='").append(projectKey).append('\'') - .append(", loc=").append(loc) - .append(", branchName='").append(branchName).append('\'') - .append(", branchType='").append(branchType).append('\'') - .append(", lastAnalysisDate=").append(lastAnalysisDate) - .append('}').toString(); - } } diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/measure/LargestBranchNclocDtoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/measure/LargestBranchNclocDtoTest.java index f3d8d9a7d2f..e5b2f71e2fb 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/measure/LargestBranchNclocDtoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/measure/LargestBranchNclocDtoTest.java @@ -40,16 +40,6 @@ public class LargestBranchNclocDtoTest { assertThat(underTest.getLastAnalysisDate()).isEqualTo(1L); } - @Test - public void test_ToString() { - assertThat(new LargestBranchNclocDto()) - .hasToString("ProjectMaxNclocDto{projectUuid='null', projectName='null', projectKey='null', loc=0, branchName='null', branchType='null', lastAnalysisDate=0}"); - setUnderTest(); - assertThat(underTest) - .hasToString( - "ProjectMaxNclocDto{projectUuid='projectUuid', projectName='projectName', projectKey='projectKey', loc=123, branchName='branchName', branchType='branchType', lastAnalysisDate=1}"); - } - private void setUnderTest() { underTest .setProjectUuid("projectUuid") diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/measure/LiveMeasureDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/measure/LiveMeasureDaoTest.java index 36bbb9a8b6d..cfb9d3c6d13 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/measure/LiveMeasureDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/measure/LiveMeasureDaoTest.java @@ -327,7 +327,7 @@ public class LiveMeasureDaoTest { @Test public void get_branch_with_max_ncloc_per_project() { - SetupProjectsWithLoc(); + setupProjectsWithLoc(); List<LargestBranchNclocDto> results = underTest.getLargestBranchNclocPerProject(db.getSession()); @@ -700,7 +700,7 @@ public class LiveMeasureDaoTest { "componentUuid", "projectUuid", "metricUuid", "value", "textValue", "data", "variation"); } - private void SetupProjectsWithLoc() { + private void setupProjectsWithLoc() { MetricDto ncloc = db.measures().insertMetric(m -> m.setKey("ncloc").setValueType(INT.toString())); MetricDto lines = db.measures().insertMetric(m -> m.setKey("lines").setValueType(INT.toString())); |