Skip to content
This repository was archived by the owner on Nov 28, 2018. It is now read-only.

Commit 2685333

Browse files
committed
Start testing. Increment version, add installation instructions to README
1 parent 29be9e9 commit 2685333

File tree

3 files changed

+72
-1
lines changed

3 files changed

+72
-1
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ An exercise with node.js to implement the STOMP protocol.
77

88
For documentation see doc/stomp.md and doc/frame.md
99

10+
## Installation
11+
12+
`npm install stomp`
13+
14+
`git clone https://[email protected]/benjaminws/stomp-js.git`
15+
1016
## Examples
1117

1218
### Consumer

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name" : "stomp",
33
"description": "Implementation of the STOMP protocol in node.js",
44
"keywords": [ "STOMP", "messaging", "queue", "protocol" ],
5-
"version": "v0.0.2",
5+
"version": "v0.0.3",
66
"homepage": "https://github.com/benjaminws/stomp-js",
77
"author": "Benjamin W. Smith <[email protected]>",
88
"main" : "lib/stomp",

test/test-frame.js

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
var stomp = require("stomp");
2+
var testCase = require("nodeunit/nodeunit").testCase;
3+
4+
module.exports['initialize'] = testCase({
5+
setUp: function (callback) {
6+
var stomp_args = {
7+
port: 61613,
8+
host: 'localhost',
9+
debug: false,
10+
login: 'guest',
11+
passcode: 'guest',
12+
};
13+
14+
this.client = new stomp.Stomp(stomp_args);
15+
callback();
16+
},
17+
tearDown: function (callback) {
18+
callback();
19+
},
20+
'port is 61613': function(test) {
21+
test.equal(this.client.port, 61613);
22+
test.done();
23+
},
24+
'host is localhost': function(test) {
25+
test.equal(this.client.host, 'localhost');
26+
test.done();
27+
},
28+
'debug is false': function(test) {
29+
test.equal(this.client.debug, false);
30+
test.done();
31+
},
32+
'login is guest': function(test) {
33+
test.equal(this.client.login, 'guest');
34+
test.done();
35+
},
36+
'passcode is guest': function(test) {
37+
test.equal(this.client.passcode, 'guest');
38+
test.done();
39+
}
40+
});
41+
module.exports['connect'] = testCase({
42+
setUp: function (callback) {
43+
var stomp_args = {
44+
port: 61613,
45+
host: 'localhost',
46+
debug: false,
47+
login: 'guest',
48+
passcode: 'guest',
49+
};
50+
this.client = new stomp.Stomp(stomp_args);
51+
this._connect = this.client.connect;
52+
this.client.connect = function() {
53+
return true;
54+
};
55+
callback();
56+
},
57+
tearDown: function (callback) {
58+
this.client.connect = this._connect;
59+
callback();
60+
},
61+
'should call connect': function(test) {
62+
test.ok(this.client.connect());
63+
test.done();
64+
}
65+
});

0 commit comments

Comments
 (0)