You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Michael Justin (JIRA)" <ji...@apache.org> on 2011/09/04 10:24:09 UTC

[jira] [Created] (AMQ-3484) Stomp 1.1 - add a testcase for sending messages after expired heartbeat

Stomp 1.1 - add a testcase for sending messages after expired heartbeat
-----------------------------------------------------------------------

                 Key: AMQ-3484
                 URL: https://issues.apache.org/jira/browse/AMQ-3484
             Project: ActiveMQ
          Issue Type: Improvement
          Components: Connector
    Affects Versions: 5.6.0
            Reporter: Michael Justin
            Priority: Minor


The testcase below waits for five seconds after connecting and then tries to write a SEND frame. The test fails if a frame can be sent to the broker after missing heartbeat signals. 

public void testSendAfterMissingHeartbeat() throws Exception {

String connectFrame = "STOMP\n" +
"login: system\n" +
"passcode: manager\n" +
"accept-version:1.1\n" +
"heart-beat:1000,0\n" +
"host:localhost\n" +
"\n" + Stomp.NULL;

stompConnection.sendFrame(connectFrame);
String f = stompConnection.receiveFrame();
assertTrue(f.startsWith("CONNECTED"));
assertTrue(f.indexOf("version:1.1") >= 0);
assertTrue(f.indexOf("heart-beat:") >= 0);
assertTrue(f.indexOf("session:") >= 0);
LOG.debug("Broker sent: " + f);

Thread.sleep(5000);

try { String message = "SEND\n" + "destination:/queue/" + getQueueName() + "\n\n" + "Hello World" + Stomp.NULL; stompConnection.sendFrame(message); fail("SEND frame has been accepted after missing heart beat"); } catch (Exception ex) { System.out.println(ex.getMessage()); }
}


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (AMQ-3484) Stomp 1.1 - add a testcase for sending messages after expired heartbeat

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3484?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timothy Bish resolved AMQ-3484.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 5.6.0

Added a new test that covers this.

> Stomp 1.1 - add a testcase for sending messages after expired heartbeat
> -----------------------------------------------------------------------
>
>                 Key: AMQ-3484
>                 URL: https://issues.apache.org/jira/browse/AMQ-3484
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Connector
>    Affects Versions: 5.6.0
>            Reporter: Michael Justin
>            Priority: Minor
>              Labels: stomp, test
>             Fix For: 5.6.0
>
>
> The testcase below waits for five seconds after connecting and then tries to write a SEND frame. The test fails if a frame can be sent to the broker after missing heartbeat signals. 
> public void testSendAfterMissingHeartbeat() throws Exception {
> String connectFrame = "STOMP\n" +
> "login: system\n" +
> "passcode: manager\n" +
> "accept-version:1.1\n" +
> "heart-beat:1000,0\n" +
> "host:localhost\n" +
> "\n" + Stomp.NULL;
> stompConnection.sendFrame(connectFrame);
> String f = stompConnection.receiveFrame();
> assertTrue(f.startsWith("CONNECTED"));
> assertTrue(f.indexOf("version:1.1") >= 0);
> assertTrue(f.indexOf("heart-beat:") >= 0);
> assertTrue(f.indexOf("session:") >= 0);
> LOG.debug("Broker sent: " + f);
> Thread.sleep(5000);
> try { String message = "SEND\n" + "destination:/queue/" + getQueueName() + "\n\n" + "Hello World" + Stomp.NULL; stompConnection.sendFrame(message); fail("SEND frame has been accepted after missing heart beat"); } catch (Exception ex) { System.out.println(ex.getMessage()); }
> }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira