connection.js 727 B

1234567891011121314151617181920212223242526272829303132333435
  1. module("Stomp Connection");
  2. test("Connect to an invalid Stomp server", function() {
  3. var client = Stomp.client(TEST.badUrl);
  4. client.connect("foo", "bar",
  5. function() {},
  6. function() {
  7. start();
  8. });
  9. stop(TEST.timeout);
  10. });
  11. test("Connect to a valid Stomp server", function() {
  12. var client = Stomp.client(TEST.url);
  13. client.connect(TEST.login, TEST.password,
  14. function() {
  15. start();
  16. });
  17. stop(TEST.timeout);
  18. });
  19. test("Disconnect", function() {
  20. var client = Stomp.client(TEST.url);
  21. client.connect(TEST.login, TEST.password,
  22. function() {
  23. // once connected, we disconnect
  24. client.disconnect(function() {
  25. start();
  26. });
  27. });
  28. stop(TEST.timeout);
  29. });