mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-24 17:29:28 +01:00
Convert tests to Fast XML
This commit is contained in:
parent
dfc29ea03c
commit
89dda473cf
@ -94,8 +94,8 @@ init_stream(Config) ->
|
||||
ok = send_text(Config, io_lib:format(?STREAM_HEADER,
|
||||
[?config(server, Config)])),
|
||||
{xmlstreamstart, <<"stream:stream">>, Attrs} = recv(),
|
||||
<<"jabber:client">> = xml:get_attr_s(<<"xmlns">>, Attrs),
|
||||
<<"1.0">> = xml:get_attr_s(<<"version">>, Attrs),
|
||||
<<"jabber:client">> = fxml:get_attr_s(<<"xmlns">>, Attrs),
|
||||
<<"1.0">> = fxml:get_attr_s(<<"version">>, Attrs),
|
||||
#stream_features{sub_els = Fs} = recv(),
|
||||
Mechs = lists:flatmap(
|
||||
fun(#sasl_mechanisms{list = Ms}) ->
|
||||
@ -182,8 +182,8 @@ wait_auth_SASL_result(Config) ->
|
||||
io_lib:format(?STREAM_HEADER,
|
||||
[?config(server, Config)])),
|
||||
{xmlstreamstart, <<"stream:stream">>, Attrs} = recv(),
|
||||
<<"jabber:client">> = xml:get_attr_s(<<"xmlns">>, Attrs),
|
||||
<<"1.0">> = xml:get_attr_s(<<"version">>, Attrs),
|
||||
<<"jabber:client">> = fxml:get_attr_s(<<"xmlns">>, Attrs),
|
||||
<<"1.0">> = fxml:get_attr_s(<<"version">>, Attrs),
|
||||
#stream_features{sub_els = Fs} = recv(),
|
||||
lists:foldl(
|
||||
fun(#feature_sm{}, ConfigAcc) ->
|
||||
@ -255,7 +255,7 @@ send(State, Pkt) ->
|
||||
end,
|
||||
El = xmpp_codec:encode(NewPkt),
|
||||
ct:pal("sent: ~p <-~n~s", [El, xmpp_codec:pp(NewPkt)]),
|
||||
ok = send_text(State, xml:element_to_binary(El)),
|
||||
ok = send_text(State, fxml:element_to_binary(El)),
|
||||
NewID.
|
||||
|
||||
send_recv(State, IQ) ->
|
||||
@ -271,7 +271,7 @@ sasl_new(<<"DIGEST-MD5">>, User, Server, Password) ->
|
||||
case cyrsasl_digest:parse(ServerIn) of
|
||||
bad -> {error, <<"Invalid SASL challenge">>};
|
||||
KeyVals ->
|
||||
Nonce = xml:get_attr_s(<<"nonce">>, KeyVals),
|
||||
Nonce = fxml:get_attr_s(<<"nonce">>, KeyVals),
|
||||
CNonce = id(),
|
||||
Realm = proplists:get_value(<<"realm">>, KeyVals, Server),
|
||||
DigestURI = <<"xmpp/", Realm/binary>>,
|
||||
|
@ -1,5 +1,5 @@
|
||||
-include_lib("common_test/include/ct.hrl").
|
||||
-include_lib("p1_xml/include/xml.hrl").
|
||||
-include_lib("fast_xml/include/fxml.hrl").
|
||||
-include("ns.hrl").
|
||||
-include("ejabberd.hrl").
|
||||
-include("mod_proxy65.hrl").
|
||||
|
Loading…
Reference in New Issue
Block a user