aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-engine/src
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2022-04-08 14:11:59 -0400
committersonartech <sonartech@sonarsource.com>2022-04-21 20:02:50 +0000
commitb2b5d2819ab9d8bc1804641762d6f397c605a582 (patch)
tree6dcdc30e7b22bba8a907e16c5b222366789760df /sonar-scanner-engine/src
parent3b7e8d87a77c1d116cfb7ad09d2ece9d8c3d76f5 (diff)
downloadsonarqube-b2b5d2819ab9d8bc1804641762d6f397c605a582.tar.gz
sonarqube-b2b5d2819ab9d8bc1804641762d6f397c605a582.zip
SONAR-16232 Add dependencies to new sonar-plugin-api
- fix tests - use plugin api from artifactory
Diffstat (limited to 'sonar-scanner-engine/src')
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/genericcoverage/StaxParserTest.java4
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/mediumtest/tasks/TasksMediumTest.java19
-rw-r--r--sonar-scanner-engine/src/test/resources/org/sonar/scanner/genericcoverage/xml-dtd-test.xml5
-rw-r--r--sonar-scanner-engine/src/test/resources/org/sonar/scanner/genericcoverage/xml-xsd-test.xml6
4 files changed, 15 insertions, 19 deletions
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/genericcoverage/StaxParserTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/genericcoverage/StaxParserTest.java
index 53057d5bfbe..199c74043bb 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/genericcoverage/StaxParserTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/genericcoverage/StaxParserTest.java
@@ -29,13 +29,13 @@ public class StaxParserTest {
@Test
public void testXMLWithDTD() throws XMLStreamException {
StaxParser parser = new StaxParser(getTestHandler());
- parser.parse(getClass().getClassLoader().getResourceAsStream("org/sonar/api/utils/StaxParserTest/xml-dtd-test.xml"));
+ parser.parse(getClass().getClassLoader().getResourceAsStream("org/sonar/scanner/genericcoverage/xml-dtd-test.xml"));
}
@Test
public void testXMLWithXSD() throws XMLStreamException {
StaxParser parser = new StaxParser(getTestHandler());
- parser.parse(getClass().getClassLoader().getResourceAsStream("org/sonar/api/utils/StaxParserTest/xml-xsd-test.xml"));
+ parser.parse(getClass().getClassLoader().getResourceAsStream("org/sonar/scanner/genericcoverage/xml-xsd-test.xml"));
}
private StaxParser.XmlStreamHandler getTestHandler() {
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/mediumtest/tasks/TasksMediumTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/mediumtest/tasks/TasksMediumTest.java
index a566fb7b0d0..a40045a33a7 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/mediumtest/tasks/TasksMediumTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/mediumtest/tasks/TasksMediumTest.java
@@ -23,8 +23,6 @@ import com.google.common.collect.ImmutableMap;
import org.junit.Rule;
import org.junit.Test;
import org.sonar.api.Plugin;
-import org.sonar.api.task.Task;
-import org.sonar.api.task.TaskDefinition;
import org.sonar.api.utils.MessageException;
import org.sonar.api.utils.log.LogTester;
import org.sonar.scanner.mediumtest.ScannerMediumTester;
@@ -39,7 +37,7 @@ public class TasksMediumTest {
@Rule
public ScannerMediumTester tester = new ScannerMediumTester()
- .registerPlugin("faketask", new FakeTaskPlugin());
+ .registerPlugin("faketask", new FakePlugin());
@Test
public void failWhenCallingTask() {
@@ -67,24 +65,11 @@ public class TasksMediumTest {
}
}
- private static class FakeTaskPlugin implements Plugin {
+ private static class FakePlugin implements Plugin {
@Override
public void define(Context context) {
- context.addExtensions(FakeTask.DEF, FakeTask.class);
}
}
- private static class FakeTask implements Task {
-
- public static final TaskDefinition DEF = TaskDefinition.builder().key("fake").description("Fake description").taskClass(FakeTask.class).build();
-
- @Override
- public void execute() {
- // TODO Auto-generated method stub
-
- }
-
- }
-
}
diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/scanner/genericcoverage/xml-dtd-test.xml b/sonar-scanner-engine/src/test/resources/org/sonar/scanner/genericcoverage/xml-dtd-test.xml
new file mode 100644
index 00000000000..7e643b8b6fe
--- /dev/null
+++ b/sonar-scanner-engine/src/test/resources/org/sonar/scanner/genericcoverage/xml-dtd-test.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<!DOCTYPE test SYSTEM "http://com.foo.bar/fake.dtd">
+<test>
+ <another-test/>
+</test> \ No newline at end of file
diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/scanner/genericcoverage/xml-xsd-test.xml b/sonar-scanner-engine/src/test/resources/org/sonar/scanner/genericcoverage/xml-xsd-test.xml
new file mode 100644
index 00000000000..69f7f0e1ac1
--- /dev/null
+++ b/sonar-scanner-engine/src/test/resources/org/sonar/scanner/genericcoverage/xml-xsd-test.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<test xmlns="http://www.test.org"
+ xmlns:xsi="http://www.w3.org/1999/XMLSchema/instance"
+ xsi:schemaLocation="http://www.test.org http://foo.bar.org/test.xsd">
+ <another-test/>
+</test>