01: /**
02: * $Revision$
03: * $Date$
04: *
05: * Copyright (C) 2006-2007 Jive Software. All rights reserved.
06: *
07: * This software is published under the terms of the GNU Public License (GPL),
08: * a copy of which is included in this distribution.
09: */package org.jivesoftware.util;
10:
11: import org.jivesoftware.openfire.gateway.type.PresenceType;
12: import org.jivesoftware.openfire.gateway.registration.Registration;
13: import org.jivesoftware.openfire.gateway.session.TransportSession;
14: import org.jivesoftware.openfire.gateway.type.TransportType;
15: import org.xmpp.packet.JID;
16: import org.jivesoftware.openfire.gateway.protocols.msn.MSNTransport;
17:
18: public class MSNTransportTest {
19:
20: /**
21: * @param args Arguments passed to program.
22: */
23: public static void main(String[] args) {
24: if (args.length != 4) {
25: System.out
26: .println("Syntax: java MSNTransportTest user password nickname jid");
27: System.exit(0);
28: }
29: Log.setDebugEnabled(true);
30: JID jid = new JID(args[3]);
31: Registration registration = new Registration(jid,
32: TransportType.msn, args[0], args[1], args[2], true);
33: MSNTransport transport = new MSNTransport();
34: transport.jid = jid;
35: transport.setup(TransportType.msn, "MSN");
36: TransportSession session = transport.registrationLoggedIn(
37: registration, jid, PresenceType.available, "online",
38: new Integer(1));
39: transport.registrationLoggedOut(session);
40: }
41:
42: }
|