Skip to content

Commit 2579852

Browse files
committed
Refactor jms test
1 parent 6cda285 commit 2579852

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

java/ql/test/library-tests/frameworks/jms/FlowTest.ql

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@ import java
22
import semmle.code.java.dataflow.FlowSources
33
import TestUtilities.InlineExpectationsTest
44

5-
class TestConfig extends TaintTracking::Configuration {
6-
TestConfig() { this = "TestConfig" }
5+
module TestConfig implements DataFlow::ConfigSig {
6+
predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource }
77

8-
override predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource }
9-
10-
override predicate isSink(DataFlow::Node sink) {
8+
predicate isSink(DataFlow::Node sink) {
119
exists(MethodAccess call |
1210
call.getMethod().hasName("sink") and call.getArgument(0) = sink.asExpr()
1311
)
1412
}
1513
}
1614

15+
module TestFlow = TaintTracking::Global<TestConfig>;
16+
1717
class JmsFlowTest extends InlineExpectationsTest {
1818
JmsFlowTest() { this = "JmsFlowTest" }
1919

2020
override string getARelevantTag() { result = "tainted" }
2121

2222
override predicate hasActualResult(Location location, string element, string tag, string value) {
2323
tag = "tainted" and
24-
exists(DataFlow::PathNode sink, TestConfig conf | conf.hasFlowPath(_, sink) |
24+
exists(TestFlow::PathNode sink | TestFlow::flowPath(_, sink) |
2525
location = sink.getNode().getLocation() and element = sink.getNode().toString() and value = ""
2626
)
2727
}

0 commit comments

Comments
 (0)