diff --git a/sonar-jmeter-plugin/pom.xml b/sonar-jmeter-plugin/pom.xml index 7ad634d..59c057a 100644 --- a/sonar-jmeter-plugin/pom.xml +++ b/sonar-jmeter-plugin/pom.xml @@ -18,7 +18,7 @@ org.sonar.plugins.jmeter.JMeterPlugin JMeter - 5.1 + 4.5.1 diff --git a/sonar-jmeter-plugin/src/test/java/org/sonar/plugins/MockSensorContext.java b/sonar-jmeter-plugin/src/test/java/org/sonar/plugins/MockSensorContext.java index 0a85198..592d816 100644 --- a/sonar-jmeter-plugin/src/test/java/org/sonar/plugins/MockSensorContext.java +++ b/sonar-jmeter-plugin/src/test/java/org/sonar/plugins/MockSensorContext.java @@ -27,19 +27,9 @@ import java.util.Set; import org.apache.commons.lang.NotImplementedException; -import org.sonar.api.batch.AnalysisMode; import org.sonar.api.batch.Event; import org.sonar.api.batch.SensorContext; -import org.sonar.api.batch.fs.FileSystem; import org.sonar.api.batch.fs.InputFile; -import org.sonar.api.batch.fs.InputPath; -import org.sonar.api.batch.rule.ActiveRules; -import org.sonar.api.batch.sensor.dependency.NewDependency; -import org.sonar.api.batch.sensor.duplication.NewDuplication; -import org.sonar.api.batch.sensor.highlighting.NewHighlighting; -import org.sonar.api.batch.sensor.issue.NewIssue; -import org.sonar.api.batch.sensor.measure.NewMeasure; -import org.sonar.api.config.Settings; import org.sonar.api.design.Dependency; import org.sonar.api.measures.Measure; import org.sonar.api.measures.MeasuresFilter; @@ -52,52 +42,66 @@ @SuppressWarnings("rawtypes") public class MockSensorContext implements SensorContext { + @Override public Event createEvent(Resource arg0, String arg1, String arg2, String arg3, Date arg4) { throw new NotImplementedException(); } + @Override public void deleteEvent(Event arg0) { throw new NotImplementedException(); } + @Override public void deleteLink(String arg0) { throw new NotImplementedException(); } + @Override public Set getDependencies() { throw new NotImplementedException(); } + @Override public List getEvents(Resource arg0) { throw new NotImplementedException(); } + @Override public Collection getIncomingDependencies(Resource arg0) { throw new NotImplementedException(); } + @Override public M getMeasures(MeasuresFilter arg0) { throw new NotImplementedException(); } + @Override public M getMeasures(Resource arg0, MeasuresFilter arg1) { throw new NotImplementedException(); } + @Override public Collection getOutgoingDependencies(Resource arg0) { throw new NotImplementedException(); } + @Override public Dependency saveDependency(Dependency arg0) { throw new NotImplementedException(); } + @Override public void saveLink(ProjectLink arg0) { throw new NotImplementedException(); } + @Override public Measure saveMeasure(Measure measure) { - if (measure==null) throw new NullPointerException(); + if (measure==null) { + throw new NullPointerException(); + } if (measure.getMetric() == null) { throw new RuntimeException("Metric cannot be null"); } @@ -105,6 +109,7 @@ public Measure saveMeasure(Measure measure) { return measure; } + @Override public Measure saveMeasure(Metric metric, Double value) { if (value != null) { if (Double.isNaN(value)) { @@ -114,104 +119,73 @@ public Measure saveMeasure(Metric metric, Double value) { return new Measure(metric, value); } + @Override public Measure saveMeasure(Resource arg0, Measure arg1) { throw new NotImplementedException(); } + @Override public Measure saveMeasure(Resource arg0, Metric arg1, Double arg2) { throw new NotImplementedException(); } + @Override public String saveResource(Resource arg0) { throw new NotImplementedException(); } + @Override public void saveSource(Resource arg0, String arg1) { throw new NotImplementedException(); } + @Override public void saveViolation(Violation arg0) { throw new NotImplementedException(); } - public void saveViolations(Collection arg0) { - throw new NotImplementedException(); - } - - public boolean index(Resource resource) { - throw new NotImplementedException(); - } - - public boolean index(Resource resource, Resource parentReference) { - throw new NotImplementedException(); - } - - public boolean isExcluded(Resource reference) { - throw new NotImplementedException(); - } - - public boolean isIndexed(Resource reference, boolean acceptExcluded) { - throw new NotImplementedException(); - } - - public R getResource(R reference) { - throw new NotImplementedException(); - } - - public Resource getParent(Resource reference) { - throw new NotImplementedException(); - } - - public Collection getChildren(Resource reference) { - throw new NotImplementedException(); - } - - public void saveViolation(Violation violation, boolean force) { - throw new NotImplementedException(); - } - @Override - public Settings settings() { + public void saveViolations(Collection arg0) { throw new NotImplementedException(); } @Override - public FileSystem fileSystem() { + public boolean index(Resource resource) { throw new NotImplementedException(); } @Override - public ActiveRules activeRules() { + public boolean index(Resource resource, Resource parentReference) { throw new NotImplementedException(); } @Override - public AnalysisMode analysisMode() { + public boolean isExcluded(Resource reference) { throw new NotImplementedException(); } @Override - public NewMeasure newMeasure() { + public boolean isIndexed(Resource reference, boolean acceptExcluded) { throw new NotImplementedException(); } @Override - public NewIssue newIssue() { + public R getResource(R reference) { throw new NotImplementedException(); } @Override - public NewHighlighting newHighlighting() { + public Resource getParent(Resource reference) { throw new NotImplementedException(); } @Override - public NewDuplication newDuplication() { + public Collection getChildren(Resource reference) { throw new NotImplementedException(); } @Override - public NewDependency newDependency() { + public void saveViolation(Violation violation, boolean force) { throw new NotImplementedException(); } @@ -235,8 +209,4 @@ public Measure saveMeasure(InputFile inputFile, Measure measure) { throw new NotImplementedException(); } - @Override - public Resource getResource(InputPath inputPath) { - throw new NotImplementedException(); - } }