Class TestServerWebServices
java.lang.Object
org.eclipse.microprofile.opentracing.tck.application.TestServerWebServices
Test JAXRS web services.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe key of a simulated span tag.static final StringThe value of a simulated span tag.static final StringQuery parameter whether to use async requests.static final StringQuery parameter whether to fail the nested call.static final StringQuery parameter for the breadth of nesting.static final StringQuery parameter for the number of nested calls.static final StringQuery parameter that's a unique ID propagated down nested calls.static final StringWeb service endpoint to test a Traced annotation with an exception.static final StringWeb service endpoint to test Traced annotations.static final StringAsync web service endpoint that creates local span.static final StringWeb service endpoint that will return HTTP 500.static final StringWeb service that throws an unhandled exception and return HTTP 500.static final StringWeb service endpoint that creates local span.static final StringWeb service endpoint that will call itself some number of times.static final StringWeb service endpoint that's not traced.static final StringWeb service endpoint with an explicit operation name.static final StringWeb service endpoint for the simpleTest call.static final StringWeb service endpoint which should not be tracedstatic final StringThe path to this set of web services. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.ResponseWeb service endpoint to test a Traced annotation with an exception.jakarta.ws.rs.core.ResponseWeb service endpoint to test Traced annotations.voidasyncLocalSpan(jakarta.ws.rs.container.AsyncResponse asyncResponse) Async endpoint which creates local span.jakarta.ws.rs.core.Responseerror()Returns HTTP 500 error.jakarta.ws.rs.core.ResponseReturns HTTP 500 error.Create the full URL for the web service request.jakarta.ws.rs.core.ResponseEndpoint which creates local span.jakarta.ws.rs.core.ResponseWeb service call that calls itselfnestDepth- 1 times.jakarta.ws.rs.core.ResponseShouldn't create a span.jakarta.ws.rs.core.ResponseTraced with an explicit operation name.jakarta.ws.rs.core.ResponseSimple JAXRS endpoint.jakarta.ws.rs.core.ResponseEndpoint which creates local span.
-
Field Details
-
REST_TEST_SERVICE_PATH
The path to this set of web services.- See Also:
-
REST_SIMPLE_TEST
Web service endpoint for the simpleTest call.- See Also:
-
REST_LOCAL_SPAN
Web service endpoint that creates local span.- See Also:
-
REST_SKIP_SIMPLE
Web service endpoint which should not be traced- See Also:
-
REST_ASYNC_LOCAL_SPAN
Async web service endpoint that creates local span.- See Also:
-
REST_ERROR
Web service endpoint that will return HTTP 500.- See Also:
-
REST_EXCEPTION
Web service that throws an unhandled exception and return HTTP 500.- See Also:
-
REST_ANNOTATIONS
Web service endpoint to test Traced annotations.- See Also:
-
REST_ANNOTATION_EXCEPTION
Web service endpoint to test a Traced annotation with an exception.- See Also:
-
PARAM_UNIQUE_ID
Query parameter that's a unique ID propagated down nested calls.- See Also:
-
PARAM_FAIL_NEST
Query parameter whether to fail the nested call.- See Also:
-
PARAM_ASYNC
Query parameter whether to use async requests.- See Also:
-
REST_NESTED
Web service endpoint that will call itself some number of times.- See Also:
-
PARAM_NEST_DEPTH
Query parameter for the number of nested calls.- See Also:
-
PARAM_NEST_BREADTH
Query parameter for the breadth of nesting.- See Also:
-
LOCAL_SPAN_TAG_KEY
The key of a simulated span tag.- See Also:
-
LOCAL_SPAN_TAG_VALUE
The value of a simulated span tag.- See Also:
-
REST_NOT_TRACED
Web service endpoint that's not traced.- See Also:
-
REST_OPERATION_NAME
Web service endpoint with an explicit operation name.- See Also:
-
-
Constructor Details
-
TestServerWebServices
public TestServerWebServices()
-
-
Method Details
-
simpleTest
@GET @Path("simpleTest") @Produces("text/plain") public jakarta.ws.rs.core.Response simpleTest()Simple JAXRS endpoint.- Returns:
- OK response
-
localSpan
@GET @Path("localSpan") @Produces("text/plain") public jakarta.ws.rs.core.Response localSpan()Endpoint which creates local span.- Returns:
- OK response
-
asyncLocalSpan
@GET @Path("asyncLocalSpan") @Produces("text/plain") public void asyncLocalSpan(@Suspended jakarta.ws.rs.container.AsyncResponse asyncResponse) Async endpoint which creates local span.- Parameters:
asyncResponse- holds state of the asynchronous processing
-
error
@GET @Path("error") @Produces("text/plain") public jakarta.ws.rs.core.Response error()Returns HTTP 500 error.- Returns:
- error response
-
exception
@GET @Path("exception") @Produces("text/plain") public jakarta.ws.rs.core.Response exception()Returns HTTP 500 error.- Returns:
- Response Never returned because an exception is thrown.
-
annotations
@GET @Path("annotations") @Produces("text/plain") public jakarta.ws.rs.core.Response annotations()Web service endpoint to test Traced annotations.- Returns:
- HTTP 200 OK.
-
annotationException
@GET @Path("annotationException") @Produces("text/plain") public jakarta.ws.rs.core.Response annotationException()Web service endpoint to test a Traced annotation with an exception.- Returns:
- HTTP 200 OK.
-
notTraced
@Traced(false) @GET @Path("notTraced") @Produces("text/plain") public jakarta.ws.rs.core.Response notTraced()Shouldn't create a span.- Returns:
- OK response
-
operationName
@Traced(operationName="operationName") @GET @Path("operationName") @Produces("text/plain") public jakarta.ws.rs.core.Response operationName()Traced with an explicit operation name.- Returns:
- OK response
-
nested
@GET @Path("nested") @Produces("text/plain") public jakarta.ws.rs.core.Response nested(@QueryParam("nestDepth") int nestDepth, @QueryParam("nestBreadth") int nestBreadth, @QueryParam("data") String uniqueID, @QueryParam("failNest") boolean failNest, @QueryParam("async") boolean async) throws InterruptedException, ExecutionException Web service call that calls itselfnestDepth- 1 times. A nesting depth of zero (0) causes an immediate return. A nesting depth greater than zero causes a call to the nesting service with the depth reduced by one (1). ThenestBreadthcontrols how many concurrent, nested calls are made on the first level of nesting.- Parameters:
nestDepth- The depth of nesting to use when implementing the request.nestBreadth- The breadth of nested calls.uniqueID- Unique ID propagated down nested calls.failNest- True if nested response should be an errorasync- Whether the nested request is executed asynchronously.- Returns:
- OK response
- Throws:
ExecutionException- Error executing nested web service.InterruptedException- Error executing nested web service.
-
skipSimple
@GET @Path("skipSimple") @Produces("text/plain") public jakarta.ws.rs.core.Response skipSimple()Endpoint which creates local span.- Returns:
- OK response
-
getRequestPath
public String getRequestPath(String servicePath, String endpointPath, Map<String, Object> requestParameters) Create the full URL for the web service request.- Parameters:
servicePath- Service path component.endpointPath- The final component of the path.requestParameters- Query parameters.- Returns:
- Full URL for the web service request.
-