3 * Copyright (C) 2009-2016 SonarSource SA
4 * mailto:contact AT sonarsource DOT com
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 3 of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 package org.sonar.server.computation.analysis;
23 import javax.annotation.CheckForNull;
24 import javax.annotation.Nullable;
25 import org.junit.rules.ExternalResource;
26 import org.sonar.server.computation.qualityprofile.QualityProfile;
27 import org.sonar.server.computation.snapshot.Snapshot;
29 public class MutableAnalysisMetadataHolderRule extends ExternalResource implements MutableAnalysisMetadataHolder {
31 private AnalysisMetadataHolderImpl delegate = new AnalysisMetadataHolderImpl();
34 protected void after() {
35 delegate = new AnalysisMetadataHolderImpl();
39 public long getAnalysisDate() {
40 return delegate.getAnalysisDate();
43 public MutableAnalysisMetadataHolderRule setAnalysisDate(long date) {
44 delegate.setAnalysisDate(date);
49 public boolean isFirstAnalysis() {
50 return delegate.isFirstAnalysis();
54 public MutableAnalysisMetadataHolderRule setBaseProjectSnapshot(@Nullable Snapshot baseProjectSnapshot) {
55 delegate.setBaseProjectSnapshot(baseProjectSnapshot);
61 public Snapshot getBaseProjectSnapshot() {
62 return delegate.getBaseProjectSnapshot();
66 public boolean isCrossProjectDuplicationEnabled() {
67 return delegate.isCrossProjectDuplicationEnabled();
71 public MutableAnalysisMetadataHolderRule setCrossProjectDuplicationEnabled(boolean isCrossProjectDuplicationEnabled) {
72 delegate.setCrossProjectDuplicationEnabled(isCrossProjectDuplicationEnabled);
77 public String getBranch() {
78 return delegate.getBranch();
82 public MutableAnalysisMetadataHolderRule setBranch(@Nullable String branch) {
83 delegate.setBranch(branch);
88 public MutableAnalysisMetadataHolderRule setRootComponentRef(int rootComponentRef) {
89 delegate.setRootComponentRef(rootComponentRef);
94 public int getRootComponentRef() {
95 return delegate.getRootComponentRef();
99 public MutableAnalysisMetadataHolder setQProfilesByLanguage(Map<String, QualityProfile> qprofilesByLanguage) {
100 delegate.setQProfilesByLanguage(qprofilesByLanguage);
105 public Map<String, QualityProfile> getQProfilesByLanguage() {
106 return delegate.getQProfilesByLanguage();