Differences From Artifact [1d590d00a0]:
- File
tests/test.m
— part of check-in
[6a3b0a9988]
at
2011-02-21 03:09:39
on branch trunk
— Add SCRAM-SHA-1 support
This adds the new base class XMPPAuthenticator and the derived
classes XMPPSCRAMAuth and XMPPPLAINAuth.
They are now used for authentication from within XMPPConnection.Also adds XMPPAuthFailedException which is thrown in appropriate places. (user: florob@babelmonkeys.de, size: 3855) [annotate] [blame] [check-ins using]
To Artifact [a03f952d74]:
- File tests/test.m — part of check-in [8742a0f583] at 2011-03-17 20:36:04 on branch trunk — Improve stanza handling and call delegate for iq, message and presence. (user: js, size: 4338) [annotate] [blame] [check-ins using]
︙ | |||
28 29 30 31 32 33 34 | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | - + | #import "XMPPConnection.h" #import "XMPPJID.h" #import "XMPPStanza.h" #import "XMPPIQ.h" #import "XMPPMessage.h" #import "XMPPPresence.h" |
︙ | |||
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | + + + + + + + + + + + + + + + + + + + + + + + + | XMPPStanza *stanza = [XMPPStanza stanzaWithElement: elem]; assert([[elem stringValue] isEqual: [stanza stringValue]]); assert(([[OFString stringWithFormat: @"%@, %@, %@, %@", stanza.from.fullJID, stanza.to.fullJID, stanza.type, stanza.ID] isEqual: @"bob@localhost, alice@localhost, get, 42"])); conn = [[XMPPConnection alloc] init]; conn.delegate = self; if (arguments.count != 3) { of_log(@"Invalid count of command line arguments!"); [OFApplication terminateWithStatus: 1]; } [conn setServer: [arguments objectAtIndex: 0]]; [conn setUsername: [arguments objectAtIndex: 1]]; [conn setPassword: [arguments objectAtIndex: 2]]; [conn setResource: @"ObjXMPP"]; [conn setUseTLS: NO]; [conn connect]; @try { [conn handleConnection]; } @catch (id e) { of_log(@"%@", e); } } - (void)connectionWasClosed: (XMPPConnection*)conn { of_log(@"Connection was closed!"); } - (void)connection: (XMPPConnection*)conn didReceiveIQ: (XMPPIQ*)iq { of_log(@"IQ: %@", iq); } - (void)connection: (XMPPConnection*)conn didReceiveMessage: (XMPPMessage*)msg { of_log(@"Message: %@", msg); } - (void)connection: (XMPPConnection*)conn didReceivePresence: (XMPPPresence*)pres { of_log(@"Presence: %@", pres); } @end |