Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CTS: EE8: JAX-RS bucket: SseEventSink.send does not throw IllegalStateException when SseEventSink is closed #2086

Closed
jkoehler22 opened this issue Feb 8, 2018 · 3 comments · Fixed by #2097

Comments

@jkoehler22
Copy link
Contributor

Spec:
void close()

Close the SseEventSink instance and release all associated resources.

Subsequent calls have no effect and are ignored. Once the SseEventSink is closed, invoking any method other than this one and isClosed() would result in an IllegalStateException being thrown.

@jkoehler22
Copy link
Contributor Author

[javatest.batch] 02-08-2018 10:05:04: ERROR: check unsuccessful: No IllegalStateException is thrown
[javatest.batch] 02-08-2018 10:05:04: ERROR: Test case throws exception: check unsuccessful: No IllegalStateException is thrown
[javatest.batch] 02-08-2018 10:05:04: ERROR: Exception at:
[javatest.batch] 02-08-2018 10:05:04: ERROR: com.sun.ts.lib.harness.EETest$Fault: check unsuccessful: No IllegalStateException is thrown
[javatest.batch] at com.sun.ts.tests.jaxrs.common.JAXRSCommonClient.fault(JAXRSCommonClient.java:730)
[javatest.batch] at com.sun.ts.tests.jaxrs.common.JAXRSCommonClient.assertTrue(JAXRSCommonClient.java:625)
[javatest.batch] at com.sun.ts.tests.jaxrs.common.JAXRSCommonClient.assertEquals(JAXRSCommonClient.java:666)
[javatest.batch] at com.sun.ts.tests.jaxrs.jaxrs21.ee.sse.sseeventsink.JAXRSClient.closeTest(JAXRSClient.java:284)
[javatest.batch] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[javatest.batch] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
[javatest.batch] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
[javatest.batch] at java.lang.reflect.Method.invoke(Method.java:508)
[javatest.batch] at com.sun.ts.lib.harness.EETest.run(EETest.java:550)
[javatest.batch] at com.sun.ts.lib.harness.ServiceEETest.run(ServiceEETest.java:113)
[javatest.batch] at com.sun.ts.tests.common.vehicle.EmptyVehicleRunner.run(EmptyVehicleRunner.java:30)
[javatest.batch] at com.sun.ts.lib.harness.ServiceEETest.run(ServiceEETest.java:102)
[javatest.batch] at com.sun.ts.lib.harness.EETest.getPropsReady(EETest.java:446)
[javatest.batch] at com.sun.ts.lib.harness.ServiceEETest.run(ServiceEETest.java:210)
[javatest.batch] at com.sun.ts.lib.harness.EETest.run(EETest.java:257)
[javatest.batch] at com.sun.ts.tests.common.vehicle.VehicleClient.main(VehicleClient.java:27)

@jkoehler22
Copy link
Contributor Author

trace:

[2/8/18 10:05:02:518 EST] 00000067 id=16a960bb com.ibm.ws.jaxrs21.sse.LibertySseEventSinkImpl < close Exit
[2/8/18 10:05:02:518 EST] 00000067 id=16a960bb com.ibm.ws.jaxrs21.sse.LibertySseEventSinkImpl > isClosed Entry
[2/8/18 10:05:02:518 EST] 00000067 id=16a960bb com.ibm.ws.jaxrs21.sse.LibertySseEventSinkImpl < isClosed Exit
true
[2/8/18 10:05:02:518 EST] 00000067 id=16a960bb com.ibm.ws.jaxrs21.sse.LibertySseEventSinkImpl > close Entry
[2/8/18 10:05:02:518 EST] 00000067 id=16a960bb com.ibm.ws.jaxrs21.sse.LibertySseEventSinkImpl < close Exit
[2/8/18 10:05:02:518 EST] 00000067 id=16a960bb com.ibm.ws.jaxrs21.sse.LibertySseEventSinkImpl > isClosed Entry
[2/8/18 10:05:02:518 EST] 00000067 id=16a960bb com.ibm.ws.jaxrs21.sse.LibertySseEventSinkImpl < isClosed Exit
true
[2/8/18 10:05:02:518 EST] 00000067 id=16a960bb com.ibm.ws.jaxrs21.sse.LibertySseEventSinkImpl > close Entry
[2/8/18 10:05:02:518 EST] 00000067 id=16a960bb com.ibm.ws.jaxrs21.sse.LibertySseEventSinkImpl < close Exit
[2/8/18 10:05:02:518 EST] 00000067 id=16a960bb com.ibm.ws.jaxrs21.sse.LibertySseEventSinkImpl > isClosed Entry
[2/8/18 10:05:02:518 EST] 00000067 id=16a960bb com.ibm.ws.jaxrs21.sse.LibertySseEventSinkImpl < isClosed Exit
true
[2/8/18 10:05:02:518 EST] 00000067 id=16a960bb com.ibm.ws.jaxrs21.sse.LibertySseEventSinkImpl > send Entry
org.apache.cxf.jaxrs.sse.OutboundSseEventImpl@14f09763
[2/8/18 10:05:02:518 EST] 00000067 id=16a960bb com.ibm.ws.jaxrs21.sse.LibertySseEventSinkImpl < send Exit
java.util.concurrent.CompletableFuture@5230d2ea[Completed normally]

@jkoehler22
Copy link
Contributor Author

LibertySseEventSinkImpl code:
public CompletionStage send(OutboundSseEvent event) { final CompletableFuture future = new CompletableFuture<>();

    if (!closed && writer != null) {
        ...
    } else {
        future.complete(null);
    }

    return future;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants