[JBoss JIRA] Updated: (JBMESSAGING-361) WireFormatTest.testNullResponse(), testDeactivateResponse() fragments invalid
by Ovidiu Feodorov (JIRA)
[ http://jira.jboss.com/jira/browse/JBMESSAGING-361?page=all ]
Ovidiu Feodorov updated JBMESSAGING-361:
----------------------------------------
Assignee: Clebert Suconic (was: Ovidiu Feodorov)
> 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: Clebert Suconic
> 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
19 years, 10 months
[JBoss JIRA] Created: (JBREM-596) Lease doesn't work if client has two connections opened when using callbacks
by Clebert Suconic (JIRA)
Lease doesn't work if client has two connections opened when using callbacks
----------------------------------------------------------------------------
Key: JBREM-596
URL: http://jira.jboss.com/jira/browse/JBREM-596
Project: JBoss Remoting
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: callbacks
Reporter: Clebert Suconic
Assigned To: Tom Elrod
If you have two connections, one of them is using CallBack the Lease is just stopped.
I don't know how to reproduce this with a pure JBossRemoting testcase, but there is a testcase @ JBossMEssaging (Branch_1_0) which reproduces this really easily.
Download JBossMessaging SVN @ Branch_1, and execute ant crash-tests within /testsuite.
You can look at cruisecontrol results at this URL:
http://cruisecontrol.jboss.com/cc/artifacts/jms-1.0-testsuite/20060907220...
and
http://cruisecontrol.jboss.com/cc/artifacts/jms-1.0-testsuite/20060907220...
I have added a couple of messages on JBossRemoting code and I could see that with the code bellow, the lease is stopped. During addCallBAck the client copy calls disconnect and the lease thread never comes back.
Here is the code:
public void testSimplestDurableSubscription() throws Exception
{
ConnectionFactory cf = (ConnectionFactory)ic.lookup("ConnectionFactory");
Topic topic = (Topic)ic.lookup("/topic/TopicCrash");
Connection conn = cf.createConnection();
conn.setClientID("client1");
conn.start();
Connection conn2 = cf.createConnection();
conn2.setClientID("client2");
conn2.start();
Session s = conn.createSession(true, Session.AUTO_ACKNOWLEDGE);
Session s2 = conn2.createSession(true, Session.AUTO_ACKNOWLEDGE);
MessageProducer prod = s.createProducer(topic);
prod.setDeliveryMode(DeliveryMode.PERSISTENT);
MessageConsumer durable = s.createDurableSubscriber(topic, "subs1");
MessageConsumer durable2 = s2.createDurableSubscriber(topic, "subs2");
//conn2.close(); -- do not remote this comment. It was meant to not close the connection
for (int i=0;i<10;i++)
{
prod.send(s.createTextMessage("k"+i));
}
s.commit();
conn.close();
conn = cf.createConnection();
conn.setClientID("client1");
conn.start();
s = conn.createSession(true, Session.AUTO_ACKNOWLEDGE);
durable = s.createDurableSubscriber(topic, "subs1");
for (int i=0;i<2;i++)
{
TextMessage tm = (TextMessage)durable.receive(1000);
assertNotNull(tm);
s.commit();
System.out.println(tm.getText());
assertEquals("k" + i, tm.getText());
}
//conn.close();-- do not remote this comment. It was meant to not close the connection
//System.exit(0); -- this is not needed as there is not tearDown, the client VM will simply be finished the same way an exit would do, and this is better since it will keep proper JUNIT report outputs
}
--
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
19 years, 10 months