Hi Mark,
I'll pass this one alone too.
On 3/25/13 6:26 AM, Mark Thomas wrote:
> Continuing from my previous numbering...
>
> 4)
> websocketmessage.WSClient.java#byteBufferToBinaryTest_from_standalone
> This test sends four messages with the same ByteBuffer as the payload.
> For the first message the ByteBuffer is:
> java.nio.HeapByteBuffer[pos=0 lim=42 cap=42]
> For the second it is:
> java.nio.HeapByteBuffer[pos=42 lim=42 cap=42]
> at which point the test fails.
> Clearly the ByteBuffer is read when the first message is sent so there
> is no content left when the second message is sent. Is this a bug in the
> TCK or should WebSocket client implementations be taking steps to ensure
> ByteBuffers (and particularly pos and lim) are unchanged? Personally, I
> am leaning towards a TCK bug.
My guess is that the TCK test has an issue in any case.
Since the spec does not say anything about re-using ByteBuffers and they
are mutable objects, I would expect the conventional developer practice
to be to use a new one each time.
>
> 5)
> WSClient.java#pongToPongTest_from_standalone appears to have the same
> problem as 4)
>
> 6)
> What are the allowed values of T for implementations of
> MessageHandler.Whole<T> and MessageHandler.Partial<T>. My assumption
> (based on OnMessage) is:
> Whole:
> String, Java primitive or class equivalent, Reader, any class with a
> decoder, byte[], ByteBuffer, InputStream
> Partial:
> String, byte[], ByteBuffer
Yes. Is there a test that does not follow the rules here ?
>
> 7) WSClient.java#addMessageHandlersTest_from_standalone
> addMessageHandlersTest() contains the following lines (182-183)
> data.put(("BasicByteBufferMessageHandler added").getBytes());
> session.getBasicRemote().sendBinary(data);
> There is a data.flip() missing between those.
>
> 8)
> WSClient.java#addMessageHandlerBasicByteBufferTest_from_standalone
> Same issue as 7. There is a missing SENT_BYTE_MESSAGE.flip() in the
> client for this test.
>
>
> Thanks again for early access to the TCK. It has been very useful as it
> has highlighted a handful of small bugs and a couple areas where I still
> have some work to do. I hope my feedback is equally useful and I look
> forward to the next draft of the TCK.
Great. And thanks for helping to improve it for everyone by sending the
commentary.
- Danny
>
> Cheers,
>
> Mark
--
<http://www.oracle.com> *Danny Coward *
Java EE
Oracle Corporation