[jdev] [Fwd: [Interop] XSF Server Test Suite]

Peter Saint-Andre stpeter at stpeter.im
Tue Sep 29 12:12:26 CDT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

FYI. Subscribe to the interop at xmpp.org list if you're interested in
helping with this effort.

http://mail.jabber.org/mailman/listinfo/interop

/psa

- -------- Original Message --------
Subject: 	[Interop] XSF Server Test Suite
Date: 	Tue, 29 Sep 2009 09:20:34 -0700
From: 	Nathan Fritz <nathanfritz at gmail.com>
Reply-To: 	nathanfritz at gmail.com, XMPP Interop <interop at xmpp.org>
To: 	interop at xmpp.org, XMPP Extension Discussion List <standards at xmpp.org>



I'm double posting this to standards and interop, but generally this is
a conversation for interop that I thought you should all be aware of.
Peter, I notice the interop group is not on the discussions page.

For the past 6 months, we've been discussing on creating a standardized
test suite as a tool for XMPP Server developers, and perhaps in the
future for further purposes.  There was discussion of having a hosted
solution that can execute scripts from a list of supported language, but
this plan was scrapped at the last summit.  What we came up with instead
is a simple XPath-Expect script of our own design that we can easily
build an interpreter for.

There will be some basic commands: expect, get, send, assert,
foreach_sub, if_xpath, include, etc as well as built-in helper functions
to jump the script to the right state in the connection without having
to be explicit.  There also needs to be some functions for building out
stanzas and payload element trees.  Any xml argument could be a stanza
object or string.

stream = connect('user at xmpp.org/resource
<http://user@xmpp.org/resource>', 'password');
start_session(stream); # this command gets us through all of the stream
features, authenticated, and bound. This of course, could be done with
the send/expect commands as well. There may be other such commands that
get us to the state we need.

id = unique_id();
result = send(stream, ("<iq type='get' to='xmpp.org <http://xmpp.org>'
id='%s'><query xmlns='jabber:iq:roster' /></iq>", id), ("[xpath
statement with %s for id]", id));
#OR
iq_roster = makeIq('get', 'xmpp.org <http://xmpp.org>');
query = makeElement('{jabber:iq:roster}query');
append_xml(iq_roster, query);
id = get(iq_roster, '@id');
assert(result, ([xpath], [replacement values],));

foreach_sub(result, sub, ([xpath],)) {
    assert("Testing item structure", sub, ([xpath]));
    group = get(sub, ([xpath],));
    # do something with groups here
}

This is the direction things are heading.  The syntax is just something
that we came up with at the last summit but I've exptended it. Perhaps
is over complicated for the task.  Perhaps these test scripts should be
written in XML in order to avoid specialized parsers.  Are there any
decent C-syntax-style parsers out there already?  In any case, I'd like
to hear how people think this should be done.

Thanks,
Nathan Fritz

- --
Peter Saint-Andre
https://stpeter.im/


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkrCP/oACgkQNL8k5A2w/vzwQgCbBEID1jchrOjMHN5n/RYCdLzj
Gr4AoO11uqJvXOWcBYL5l1kfJ7GF/RJ7
=GDMQ
-----END PGP SIGNATURE-----


More information about the JDev mailing list