comparison mod_bookmarks2/tests/bookmarks2.scs @ 3744:1cfc8012a76f

mod_bookmarks2: Add tests.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 13 Nov 2019 16:57:35 +0100
parents
children d835cb7d2b47
comparison
equal deleted inserted replaced
3743:5eab799b5fa4 3744:1cfc8012a76f
1 # Pubsub: Bookmarks 2.0
2
3 [Client] Juliet
4 jid: admin@localhost
5 password: password
6
7 // admin@localhost is assumed to have node creation privileges
8
9 ---------
10
11 Juliet connects
12
13 -- Generated with https://gitlab.com/xmpp-rs/xmpp-parsers:
14 -- cargo run --example=generate-caps https://code.matthewwild.co.uk/scansion/ <<< "<query xmlns='http://jabber.org/protocol/disco#info'><identity category='client' name='scansion' type='bot'/><feature var='http://jabber.org/protocol/disco#info'/><feature var='urn:xmpp:bookmarks:0+notify'/></query>"
15 Juliet sends:
16 <presence id='presence0'>
17 <c xmlns='http://jabber.org/protocol/caps'
18 hash='sha-1'
19 node='https://code.matthewwild.co.uk/scansion/'
20 ver='Tg9qGTn5+LdKR6TTdjCUMVohBMc='/>
21 <c xmlns='urn:xmpp:caps'>
22 <hash xmlns='urn:xmpp:hashes:2' algo='sha-256'>5a5oTk21S9EmWQGIyuMwPKuSkPwqmXv6aKO5ftqCw/Q=</hash>
23 <hash xmlns='urn:xmpp:hashes:2' algo='sha3-256'>f3ziwT4vDK+VxuWrhhPEEgI3HJcEw7Zg4MggYE6vjZ0=</hash>
24 </c>
25 </presence>
26
27 Juliet receives:
28 <iq from="${Juliet's JID}" id='disco' type='get'>
29 <query xmlns='http://jabber.org/protocol/disco#info' node='https://code.matthewwild.co.uk/scansion/#Tg9qGTn5+LdKR6TTdjCUMVohBMc='/>
30 </iq>
31
32 Juliet sends:
33 <iq to="${Juliet's JID}" id='disco' type='result'>
34 <query xmlns='http://jabber.org/protocol/disco#info' node='https://code.matthewwild.co.uk/scansion/#Tg9qGTn5+LdKR6TTdjCUMVohBMc='>
35 <identity category='client' name='scansion' type='bot'/>
36 <feature var='http://jabber.org/protocol/disco#info'/>
37 <feature var='urn:xmpp:bookmarks:0+notify'/>
38 </query>
39 </iq>
40
41 Juliet sends:
42 <iq type='set' id='pub0'>
43 <pubsub xmlns='http://jabber.org/protocol/pubsub'>
44 <publish node='urn:xmpp:bookmarks:0'>
45 <item id='theplay@conference.shakespeare.lit'>
46 <conference xmlns='urn:xmpp:bookmarks:0'
47 name='The Play&apos;s the Thing'
48 autojoin='true'>
49 <nick>JC</nick>
50 </conference>
51 </item>
52 </publish>
53 <publish-options>
54 <x xmlns='jabber:x:data' type='submit'>
55 <field var='FORM_TYPE' type='hidden'>
56 <value>http://jabber.org/protocol/pubsub#publish-options</value>
57 </field>
58 <field var='pubsub#persist_items'>
59 <value>true</value>
60 </field>
61 <field var='pubsub#max_items'>
62 <value>255</value>
63 </field>
64 <field var='pubsub#send_last_published_item'>
65 <value>never</value>
66 </field>
67 <field var='pubsub#access_model'>
68 <value>whitelist</value>
69 </field>
70 </x>
71 </publish-options>
72 </pubsub>
73 </iq>
74
75 Juliet receives:
76 <message type='headline' from="${Juliet's JID}">
77 <event xmlns='http://jabber.org/protocol/pubsub#event'>
78 <items node='urn:xmpp:bookmarks:0'>
79 <item id='theplay@conference.shakespeare.lit'>
80 <conference xmlns='urn:xmpp:bookmarks:0'
81 name='The Play&apos;s the Thing'
82 autojoin='true'>
83 <nick>JC</nick>
84 </conference>
85 </item>
86 </items>
87 </event>
88 </message>
89
90 Juliet receives:
91 <iq type='result' id='pub0'>
92 <pubsub xmlns='http://jabber.org/protocol/pubsub'>
93 <publish node='urn:xmpp:bookmarks:0'>
94 <item id='theplay@conference.shakespeare.lit'/>
95 </publish>
96 </pubsub>
97 </iq>
98
99 Juliet sends:
100 <iq type='set' id='pub1'>
101 <pubsub xmlns='http://jabber.org/protocol/pubsub'>
102 <publish node='urn:xmpp:bookmarks:0'>
103 <item id='orchard@conference.shakespeare.lit'>
104 <conference xmlns='urn:xmpp:bookmarks:0'
105 name='The Orchard'
106 autojoin='true'>
107 <nick>JC</nick>
108 </conference>
109 </item>
110 </publish>
111 <publish-options>
112 <x xmlns='jabber:x:data' type='submit'>
113 <field var='FORM_TYPE' type='hidden'>
114 <value>http://jabber.org/protocol/pubsub#publish-options</value>
115 </field>
116 <field var='pubsub#persist_items'>
117 <value>true</value>
118 </field>
119 <field var='pubsub#max_items'>
120 <value>255</value>
121 </field>
122 <field var='pubsub#send_last_published_item'>
123 <value>never</value>
124 </field>
125 <field var='pubsub#access_model'>
126 <value>whitelist</value>
127 </field>
128 </x>
129 </publish-options>
130 </pubsub>
131 </iq>
132
133 Juliet receives:
134 <message type='headline' from="${Juliet's JID}">
135 <event xmlns='http://jabber.org/protocol/pubsub#event'>
136 <items node='urn:xmpp:bookmarks:0'>
137 <item id='orchard@conference.shakespeare.lit'>
138 <conference xmlns='urn:xmpp:bookmarks:0'
139 name='The Orchard'
140 autojoin='true'>
141 <nick>JC</nick>
142 </conference>
143 </item>
144 </items>
145 </event>
146 </message>
147
148 Juliet receives:
149 <iq type='result' id='pub1'>
150 <pubsub xmlns='http://jabber.org/protocol/pubsub'>
151 <publish node='urn:xmpp:bookmarks:0'>
152 <item id='orchard@conference.shakespeare.lit'/>
153 </publish>
154 </pubsub>
155 </iq>
156
157 Juliet sends:
158 <iq type='set' id='retract0'>
159 <pubsub xmlns='http://jabber.org/protocol/pubsub'>
160 <retract node='urn:xmpp:bookmarks:0' notify='1'>
161 <item id='theplay@conference.shakespeare.lit'/>
162 </retract>
163 </pubsub>
164 </iq>
165
166 Juliet receives:
167 <message type='headline' from="${Juliet's JID}">
168 <event xmlns='http://jabber.org/protocol/pubsub#event'>
169 <items node='urn:xmpp:bookmarks:0'>
170 <retract id='theplay@conference.shakespeare.lit'/>
171 </items>
172 </event>
173 </message>
174
175 Juliet receives:
176 <iq type='result' id='retract0'/>
177
178 Juliet disconnects
179
180 // vim: syntax=xml: