[jboss-jira] [JBoss JIRA] Updated: (JBMESSAGING-361) WireFormatTest.testNullResponse(), testDeactivateResponse() fragments invalid
Ovidiu Feodorov (JIRA)
jira-events at jboss.com
Wed Sep 13 10:48:34 EDT 2006
[ http://jira.jboss.com/jira/browse/JBMESSAGING-361?page=all ]
Ovidiu Feodorov updated JBMESSAGING-361:
----------------------------------------
Fix Version/s: (was: 1.2.0.Alpha1)
1.0.1.CR5
> WireFormatTest.testNullResponse(), testDeactivateResponse() fragments invalid
> -----------------------------------------------------------------------------
>
> Key: JBMESSAGING-361
> URL: http://jira.jboss.com/jira/browse/JBMESSAGING-361
> Project: JBoss Messaging
> Issue Type: Sub-task
> Components: JMS Facade
> Affects Versions: 1.0.0
> Reporter: Ovidiu Feodorov
> Assigned To: Ovidiu Feodorov
> Fix For: 1.0.1.CR5
>
> Original Estimate: 4 hours
> Remaining Estimate: 4 hours
>
> Switching to jboss-serialization 1.0.0.CR7 uncovered what apparently seems to be an invalid test section in WireFormatTest
> public void testNullResponse() throws Exception
> {
> MessagingMarshallable mm = new MessagingMarshallable((byte)77, null);
> InvocationResponse resp = new InvocationResponse(null, mm, false, null);
> ByteArrayOutputStream bos = new ByteArrayOutputStream();
> JBossObjectOutputStream oos = new JBossObjectOutputStream(bos);
>
> wf.write(resp, oos);
> oos.flush();
>
> ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
> DataInputStream dis = new DataInputStream(bis);
>
> // First byte should be version
> assertEquals(77, dis.readByte());
> ...........
> }
> It doesn't make sense to me to write stuff to a JBossObjectOutputStream and then try to read the serialized content using a DataInputStream, and yet this is what this test section does. JBoss Serialization doesn't guarantee this in its public contract.
> Excerpt form a conversation with Clebert:
> flanker707: Does JBossSerialization guarantee that something written with on a JBossObjectOutuptStream can be read with DataInputStream?
> Clebert Suconic: no... I didn't mean to
> flanker707: is this in the public contract?
> Clebert Suconic: If you use the same thing with ObjectInputStream.. you would have the same problem
> testNullResponse(), testDeactivateResponse() sections commented out until clarified.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list