|
1 # A script testing basic message routing and delivery |
|
2 |
1 [Client] Romeo |
3 [Client] Romeo |
2 jid: user@localhost |
4 jid: user@localhost |
3 password: password |
5 password: password |
4 |
6 |
5 [Client] Juliet |
7 [Client] Juliet |
6 jid: juliet@localhost |
8 jid: juliet@localhost |
7 password: password |
9 password: password |
8 |
10 |
|
11 [Client] Juliet's phone |
|
12 jid: juliet@localhost |
|
13 password: password |
|
14 resource: mobile |
|
15 |
9 --------- |
16 --------- |
|
17 |
|
18 # Act 1, scene 1 |
|
19 # The clients connect |
10 |
20 |
11 Romeo connects |
21 Romeo connects |
12 |
22 |
13 Juliet connects |
23 Juliet connects |
|
24 |
|
25 Juliet's phone connects |
|
26 |
|
27 # Romeo publishes his presence. Juliet has not, and so does not receive presence. |
14 |
28 |
15 Romeo sends: |
29 Romeo sends: |
16 <presence/> |
30 <presence/> |
17 |
31 |
18 Romeo receives: |
32 Romeo receives: |
19 <presence from="${Romeo's full JID}" /> |
33 <presence from="${Romeo's full JID}" /> |
|
34 |
|
35 # Romeo sends a message to Juliet's full JID |
20 |
36 |
21 Romeo sends: |
37 Romeo sends: |
22 <message to="${Juliet's full JID}" type="chat"> |
38 <message to="${Juliet's full JID}" type="chat"> |
23 <body>Hello Juliet!</body> |
39 <body>Hello Juliet!</body> |
24 </message> |
40 </message> |
26 Juliet receives: |
42 Juliet receives: |
27 <message to="${Juliet's full JID}" from="${Romeo's full JID}" type="chat"> |
43 <message to="${Juliet's full JID}" from="${Romeo's full JID}" type="chat"> |
28 <body>Hello Juliet!</body> |
44 <body>Hello Juliet!</body> |
29 </message> |
45 </message> |
30 |
46 |
|
47 # Romeo sends a message to Juliet's phone |
|
48 |
|
49 Romeo sends: |
|
50 <message to="${Juliet's phone's full JID}" type="chat"> |
|
51 <body>Hello Juliet, on your phone.</body> |
|
52 </message> |
|
53 |
|
54 Juliet's phone receives: |
|
55 <message to="${Juliet's phone's full JID}" from="${Romeo's full JID}" type="chat"> |
|
56 <body>Hello Juliet, on your phone.</body> |
|
57 </message> |
|
58 |
|
59 # Scene 2 |
|
60 # This requires the server to support offline messages (which is optional). |
|
61 |
|
62 # Romeo sends a message to Juliet's bare JID. This is not immediately delivered, as she |
|
63 # has not published presence on either of her resources. |
|
64 |
|
65 Romeo sends: |
|
66 <message to="juliet@localhost" type="chat"> |
|
67 <body>Hello Juliet, are you there?</body> |
|
68 </message> |
|
69 |
|
70 # Juliet sends presence on her phone, and should receive the message there |
|
71 |
|
72 Juliet's phone sends: |
|
73 <presence/> |
|
74 |
|
75 Juliet's phone receives: |
|
76 <presence/> |
|
77 |
|
78 Juliet's phone receives: |
|
79 <message from="${Romeo's full JID}" type="chat"> |
|
80 <body>Hello Juliet, are you there?</body> |
|
81 <delay xmlns='urn:xmpp:delay' from='localhost' /> |
|
82 </message> |
|
83 |
|
84 # Romeo sends another bare-JID message, it should be delivered |
|
85 # instantly to Juliet's phone |
|
86 |
|
87 Romeo sends: |
|
88 <message to="juliet@localhost" type="chat"> |
|
89 <body>Oh, hi!</body> |
|
90 </message> |
|
91 |
|
92 Juliet's phone receives: |
|
93 <message from="${Romeo's full JID}" type="chat"> |
|
94 <body>Oh, hi!</body> |
|
95 </message> |
|
96 |
|
97 # Juliet's laptop goes online, but with a negative priority |
|
98 |
|
99 Juliet sends: |
|
100 <presence> |
|
101 <priority>-1</priority> |
|
102 </presence> |
|
103 |
|
104 # Again, Romeo sends a message to her bare JID, but it should |
|
105 # only get delivered to her phone: |
|
106 |
|
107 Romeo sends: |
|
108 <message to="juliet@localhost" type="chat"> |
|
109 <body>How are you?</body> |
|
110 </message> |
|
111 |
|
112 Juliet's phone receives: |
|
113 <message from="${Romeo's full JID}" type="chat"> |
|
114 <body>How are you?</body> |
|
115 </message> |
|
116 |
|
117 # Romeo sends direct to Juliet's full JID, and she should receive it |
|
118 |
|
119 Romeo sends: |
|
120 <message to="${Juliet's full JID}" type="chat"> |
|
121 <body>Are you hiding?</body> |
|
122 </message> |
|
123 |
|
124 Juliet receives: |
|
125 <message from="${Romeo's full JID}" type="chat"> |
|
126 <body>Are you hiding?</body> |
|
127 </message> |
|
128 |
|
129 # Juliet publishes non-negative presence |
|
130 |
|
131 Juliet sends: |
|
132 <presence/> |
|
133 |
|
134 # And now Romeo's bare JID messages get delivered to both resources |
|
135 # (server behaviour may vary here) |
|
136 |
|
137 Romeo sends: |
|
138 <message to="juliet@localhost" type="chat"> |
|
139 <body>There!</body> |
|
140 </message> |
|
141 |
|
142 Juliet receives: |
|
143 <message from="${Romeo's full JID}" type="chat"> |
|
144 <body>There!</body> |
|
145 </message> |
|
146 |
|
147 Juliet's phone receives: |
|
148 <message from="${Romeo's full JID}" type="chat"> |
|
149 <body>There!</body> |
|
150 </message> |
|
151 |
|
152 # The End |
|
153 |
31 Romeo disconnects |
154 Romeo disconnects |
32 |
155 |
33 Juliet disconnects |
156 Juliet disconnects |
|
157 |
|
158 Juliet's phone disconnects |