diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-09-26 10:22:14 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-09-26 10:22:14 +0200 |
commit | b99cd6861da25440322c4bd5ed15bd2e626851dc (patch) | |
tree | 3859097d3aa9f5a5943b7355c74c2adfb9171e1c /sonar-batch-protocol | |
parent | c9fbb6a04bc2001bd9fb8519cb127c6c1ed56d29 (diff) | |
download | sonarqube-b99cd6861da25440322c4bd5ed15bd2e626851dc.tar.gz sonarqube-b99cd6861da25440322c4bd5ed15bd2e626851dc.zip |
Revert "SONAR-5644, SONAR-5473 Create new SCM extension point and fetch SCM data using WS"
This reverts commit 78fbdc2a8445e9131a10d2210b88d0e4d9927a14.
Diffstat (limited to 'sonar-batch-protocol')
3 files changed, 5 insertions, 85 deletions
diff --git a/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/FileData.java b/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/FileData.java deleted file mode 100644 index fc7e7beca02..00000000000 --- a/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/FileData.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * SonarQube is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * 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.batch.protocol.input; - -import javax.annotation.CheckForNull; -import javax.annotation.Nullable; - -public class FileData { - - private final String hash; - private final String scmLastCommitDatetimesByLine; - private final String scmRevisionsByLine; - private final String scmAuthorsByLine; - - public FileData(@Nullable String hash, @Nullable String scmLastCommitDatetimesByLine, @Nullable String scmRevisionsByLine, @Nullable String scmAuthorsByLine) { - this.hash = hash; - this.scmLastCommitDatetimesByLine = scmLastCommitDatetimesByLine; - this.scmRevisionsByLine = scmRevisionsByLine; - this.scmAuthorsByLine = scmAuthorsByLine; - } - - @CheckForNull - public String hash() { - return hash; - } - - @CheckForNull - public String scmLastCommitDatetimesByLine() { - return scmLastCommitDatetimesByLine; - } - - @CheckForNull - public String scmRevisionsByLine() { - return scmRevisionsByLine; - } - - @CheckForNull - public String scmAuthorsByLine() { - return scmAuthorsByLine; - } - -} diff --git a/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/ProjectReferentials.java b/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/ProjectReferentials.java index 5e2bfafd59d..6a8d5c8691e 100644 --- a/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/ProjectReferentials.java +++ b/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/ProjectReferentials.java @@ -21,8 +21,6 @@ package org.sonar.batch.protocol.input; import com.google.gson.Gson; -import javax.annotation.CheckForNull; - import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -39,7 +37,6 @@ public class ProjectReferentials { private Map<String, QProfile> qprofilesByLanguage = new HashMap<String, QProfile>(); private Collection<ActiveRule> activeRules = new ArrayList<ActiveRule>(); private Map<String, Map<String, String>> settingsByModule = new HashMap<String, Map<String, String>>(); - private Map<String, FileData> fileDataPerPath = new HashMap<String, FileData>(); public Map<String, String> settings(String projectKey) { return settingsByModule.containsKey(projectKey) ? settingsByModule.get(projectKey) : Collections.<String, String>emptyMap(); @@ -73,15 +70,6 @@ public class ProjectReferentials { return this; } - public Map<String, FileData> fileDataPerPath() { - return fileDataPerPath; - } - - @CheckForNull - public FileData fileDataPerPath(String path) { - return fileDataPerPath.get(path); - } - public long timestamp() { return timestamp; } diff --git a/sonar-batch-protocol/src/test/java/org/sonar/batch/protocol/input/ProjectReferentialsTest.java b/sonar-batch-protocol/src/test/java/org/sonar/batch/protocol/input/ProjectReferentialsTest.java index ed98c51e46b..9196a831ec9 100644 --- a/sonar-batch-protocol/src/test/java/org/sonar/batch/protocol/input/ProjectReferentialsTest.java +++ b/sonar-batch-protocol/src/test/java/org/sonar/batch/protocol/input/ProjectReferentialsTest.java @@ -49,7 +49,6 @@ public class ProjectReferentialsTest { activeRule.addParam("param1", "value1"); ref.addActiveRule(activeRule); ref.setTimestamp(10); - ref.fileDataPerPath().put("src/main/java/Foo.java", new FileData("xyz", "1=12345,2=3456", "1=345,2=345", "1=henryju,2=gaudin")); System.out.println(ref.toJson()); JSONAssert @@ -57,19 +56,16 @@ public class ProjectReferentialsTest { "{timestamp:10," + "qprofilesByLanguage:{java:{key:\"squid-java\",name:Java,language:java,rulesUpdatedAt:\"Mar 14, 1984 12:00:00 AM\"}}," + "activeRules:[{repositoryKey:repo,ruleKey:rule,name:Rule,severity:MAJOR,internalKey:rule,language:java,params:{param1:value1}}]," - + "settingsByModule:{foo:{prop1:value1,prop2:value2,prop:value}}," - + "fileDataPerPath:{\"src/main/java/Foo.java\":{hash:xyz,scmLastCommitDatetimesByLine:\"1\u003d12345,2\u003d3456\",scmRevisionsByLine:\"1\u003d345,2\u003d345\",scmAuthorsByLine:\"1\u003dhenryju,2\u003dgaudin\"}}}", + + "settingsByModule:{foo:{prop1:value1,prop2:value2,prop:value}}}", ref.toJson(), true); } @Test public void testFromJson() throws JSONException, ParseException { - ProjectReferentials ref = ProjectReferentials - .fromJson("{timestamp:1," - + "qprofilesByLanguage:{java:{key:\"squid-java\",name:Java,language:java,rulesUpdatedAt:\"Mar 14, 1984 12:00:00 AM\"}}," - + "activeRules:[{repositoryKey:repo,ruleKey:rule,name:Rule,severity:MAJOR,internalKey:rule1,language:java,params:{param1:value1}}]," - + "settingsByModule:{foo:{prop:value}}," - + "fileDataPerPath:{\"src/main/java/Foo.java\":{hash:xyz,scmLastCommitDatetimesByLine:\"1\u003d12345,2\u003d3456\",scmRevisionsByLine:\"1\u003d345,2\u003d345\",scmAuthorsByLine:\"1\u003dhenryju,2\u003dgaudin\"}}}"); + ProjectReferentials ref = ProjectReferentials.fromJson("{timestamp:1," + + "qprofilesByLanguage:{java:{key:\"squid-java\",name:Java,language:java,rulesUpdatedAt:\"Mar 14, 1984 12:00:00 AM\"}}," + + "activeRules:[{repositoryKey:repo,ruleKey:rule,name:Rule,severity:MAJOR,internalKey:rule1,language:java,params:{param1:value1}}]," + + "settingsByModule:{foo:{prop:value}}}"); assertThat(ref.timestamp()).isEqualTo(1); @@ -87,10 +83,5 @@ public class ProjectReferentialsTest { assertThat(qProfile.name()).isEqualTo("Java"); assertThat(qProfile.rulesUpdatedAt()).isEqualTo(new SimpleDateFormat("dd/MM/yyyy").parse("14/03/1984")); assertThat(ref.settings("foo")).includes(MapAssert.entry("prop", "value")); - - assertThat(ref.fileDataPerPath("src/main/java/Foo.java").hash()).isEqualTo("xyz"); - assertThat(ref.fileDataPerPath("src/main/java/Foo.java").scmAuthorsByLine()).isEqualTo("1=henryju,2=gaudin"); - assertThat(ref.fileDataPerPath("src/main/java/Foo.java").scmLastCommitDatetimesByLine()).isEqualTo("1=12345,2=3456"); - assertThat(ref.fileDataPerPath("src/main/java/Foo.java").scmRevisionsByLine()).isEqualTo("1=345,2=345"); } } |