mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Test JAX-WS endpoints
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
import javax.jws.WebMethod;
|
||||
import javax.jws.WebService;
|
||||
import javax.xml.ws.WebEndpoint;
|
||||
import javax.xml.ws.WebServiceClient;
|
||||
import javax.xml.ws.WebServiceProvider;
|
||||
|
||||
@WebService
|
||||
class WebServiceClass { // $JaxWsEndpoint
|
||||
|
||||
@WebMethod
|
||||
void WebMethodMethod() { // $JaxWsEndpointRemoteMethod
|
||||
}
|
||||
|
||||
@WebEndpoint
|
||||
void WebEndpointMethod() { // $JaxWsEndpointRemoteMethod
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@WebServiceProvider
|
||||
class WebServiceProviderClass { // $JaxWsEndpoint
|
||||
|
||||
@WebMethod
|
||||
void WebMethodMethod() { // $JaxWsEndpointRemoteMethod
|
||||
}
|
||||
|
||||
@WebEndpoint
|
||||
void WebEndpointMethod() { // $JaxWsEndpointRemoteMethod
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@WebServiceClient
|
||||
class WebServiceClientClass { // $JaxWsEndpoint
|
||||
|
||||
@WebMethod
|
||||
void WebMethodMethod() { // $JaxWsEndpointRemoteMethod
|
||||
}
|
||||
|
||||
@WebEndpoint
|
||||
void WebEndpointMethod() { // $JaxWsEndpointRemoteMethod
|
||||
}
|
||||
|
||||
}
|
||||
27
java/ql/test/library-tests/frameworks/JaxWs/JaxWsEndpoint.ql
Normal file
27
java/ql/test/library-tests/frameworks/JaxWs/JaxWsEndpoint.ql
Normal file
@@ -0,0 +1,27 @@
|
||||
import java
|
||||
import semmle.code.java.frameworks.JaxWS
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
|
||||
class JaxWsEndpointTest extends InlineExpectationsTest {
|
||||
JaxWsEndpointTest() { this = "JaxWsEndpointTest" }
|
||||
|
||||
override string getARelevantTag() { result = ["JaxWsEndpoint", "JaxWsEndpointRemoteMethod"] }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "JaxWsEndpoint" and
|
||||
exists(JaxWsEndpoint jaxWsEndpoint |
|
||||
jaxWsEndpoint.getLocation() = location and
|
||||
element = jaxWsEndpoint.toString() and
|
||||
value = ""
|
||||
)
|
||||
or
|
||||
tag = "JaxWsEndpointRemoteMethod" and
|
||||
exists(Callable remoteMethod |
|
||||
remoteMethod = any(JaxWsEndpoint jaxWsEndpoint).getARemoteMethod()
|
||||
|
|
||||
remoteMethod.getLocation() = location and
|
||||
element = remoteMethod.toString() and
|
||||
value = ""
|
||||
)
|
||||
}
|
||||
}
|
||||
1
java/ql/test/library-tests/frameworks/JaxWs/options
Normal file
1
java/ql/test/library-tests/frameworks/JaxWs/options
Normal file
@@ -0,0 +1 @@
|
||||
//semmle-extractor-options: --javac-args -cp ${testdir}/../../../stubs/jsr311-api-1.1.1:${testdir}/../../../stubs/jsr181-api:${testdir}/../../../stubs/jaxws-api-2.0
|
||||
Reference in New Issue
Block a user