Java: Rewrite inline expectation tests to use parameterized module

This commit is contained in:
Jeroen Ketema
2023-06-05 16:54:08 +02:00
parent 97c4f497bc
commit 49993b023e
132 changed files with 466 additions and 336 deletions

View File

@@ -3,12 +3,10 @@ import semmle.code.java.dataflow.DataFlow
import semmle.code.java.security.XPathInjectionQuery
import TestUtilities.InlineExpectationsTest
class HasXPathInjectionTest extends InlineExpectationsTest {
HasXPathInjectionTest() { this = "HasXPathInjectionTest" }
module HasXPathInjectionTest implements TestSig {
string getARelevantTag() { result = "hasXPathInjection" }
override string getARelevantTag() { result = "hasXPathInjection" }
override predicate hasActualResult(Location location, string element, string tag, string value) {
predicate hasActualResult(Location location, string element, string tag, string value) {
tag = "hasXPathInjection" and
exists(DataFlow::Node sink | XPathInjectionFlow::flowTo(sink) |
sink.getLocation() = location and
@@ -17,3 +15,5 @@ class HasXPathInjectionTest extends InlineExpectationsTest {
)
}
}
import MakeTest<HasXPathInjectionTest>