From 9cfe492e51f519fee5435375b360033f39332da2 Mon Sep 17 00:00:00 2001 From: Damian Minkov Date: Tue, 6 Jun 2006 19:58:26 +0000 Subject: [PATCH] Now using family SSI version 4. Added authorization tests. --- lib/joscar-0.9.4-cvs-bin.jar | Bin 430974 -> 430982 bytes ...OperationSetPersistentPresenceIcqImpl.java | 7 +- .../icq/message/auth/AbstractAuthCommand.java | 13 + .../icq/message/auth/AuthCmdFactory.java | 23 +- .../icq/message/auth/AuthReplyCmd.java | 40 +++ .../icq/message/auth/RequestAuthCmd.java | 33 ++ .../icq/message/auth/SsiCmdFactory.java | 172 ++++++++++ .../icq/IcqProtocolProviderSlick.java | 2 + .../slick/protocol/icq/IcqTesterAgent.java | 270 ++++++++------- .../icq/TestOperationSetPresence.java | 317 ++++++++++-------- 10 files changed, 605 insertions(+), 272 deletions(-) create mode 100644 src/net/java/sip/communicator/impl/protocol/icq/message/auth/SsiCmdFactory.java diff --git a/lib/joscar-0.9.4-cvs-bin.jar b/lib/joscar-0.9.4-cvs-bin.jar index 71ecdd1b97ebb35bc0b345227b86320fa53e86ec..4d70443e91ab94516cdf9b8b3e10d331ea7fe396 100644 GIT binary patch delta 21960 zcmZu32UrzH^IcndN4hixX(Gmoh+tPh1xsu}#9k4*0THn`6nx4mqGE|AcE$MYSfamO zi81yTV@y;;qcL{>+49Og!}k%+ow~C#v$K11`Lw}n)<&<`#3@3N-CJ_~s&d3tL( zz(&p?PwB4LL2#YM4ozr3SERzUR}(KXCYzG3A@($@OB)LY zywvLiQ+;{wKSipNO-90~a8SwC67Se9x@n*HvMJlqr@h29|CsJ)!+7|Q{E-PLyFTh` z(T-TcH|KuwZZO(2{5e{7$33i&y*7Q!VVRf>`*#!lwf^%J54|}pHIsp6!R)O32ZBa( zL&5>mWj7pejaK0QD|AG=8%v6KL6pNzM|*8(ul6%^2Vk zENWAJa>LK9kz3i`?8yQ}(>BgI#_&Jo%wt1k3v#0sHg zkX>2sfjGgQpnV8FwtXTj#LtShVz&Xyv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BP!jGXwJz8hT@*JRWmj!rKbJ*{~?hDKtnH6oO=} zIS;I$ULqqc$Wt)aqqf_YZ?#z^1J2-PlcFWIm~IPFmRY-qYu z7X@F$&!IH3PFc?Z{%0vhKCB=6NC@|s19gZh$R+@fUiAS#&Vh8Ifb#@k+eZm-!S4+x z>s+$cgE=r{L122EBBx>pnh9mkg>5v=1X4^nm*rm~U&X9S^3(WH5TuiGj!6Z4YnsCw zmy0p6!0!r+31w~RpGMmA!LzgC6j17g#Jg3D%A-+CB5@w_ zqsmkK#c*=+{NFph!DAS-bRO&oiE_LTp7?i}j2tswk|%50kDoUrR>CaS5bRXGmGQ}9 z_`z9{9S$SAYJ&eb1r?B&g#mz9u2Ma77=G(lhU1*mUqQ2;6B&8HLn}fHE~Z7J{0?Uo$d%K;=Lqm+`ENfTvo;c<>Ds zoAwxQJmJB?B#o$!rIIsV)ZcV!Mz3Aim*M2a$iwU|v-}~3{UVU<$hf%UA~^Mi!&A*N=P-~1#cxhFZ^bayc)`}z5K;eh>HU7e~_Z1uW-_0`PGcejtskv z;EgfxVkKAsI8|PLQP+O)%SlvHG^(1HdN~K#n9r2Q;ZDXf5|Nphj_b2tH^=y@c*1bb-KXt1D1gA zsNs1_K+X0`jJ*1?WQh+gfxDZ8=X7D*;n`sDQTS0V8JGNK#M@xk5{MpxH+@@Hza$U4 zY{a|ckaS2+g3sU3wf94aTpw6@D-$O83d5f)fpZU9+sG|;e(){KErXBCeV4-M(wnCd zOMzT0laJkkKnq_6+6ix3XR8H=LHk-*Vkk?VXDw5+cPT^zf!hDFaR&K1=@`tS$|@1M zd>Py(rcEU-gQmtjVWK(9U;-xOkXt$SI#{1ffMYvv#o*@Q9m@<~V%#CJDR1%4W$^!N fbJoFY4XQFy2jtuD7SnacCommand. + * + * @param packet the packet to use for generation of a + * SnacCommand + * @return an appropriate SnacCommand for representing the + * given SnacPacket, or null if no such + * object can be created + */ + public SnacCommand genSnacCommand(SnacPacket packet) + { + int command = packet.getCommand(); + + if(command == AbstractAuthCommand.CMD_AUTH_REPLY_RECV) + { + logger.trace("Received Authorization Replay!"); + + AuthReplyCmd cmd = new AuthReplyCmd(packet); + + Contact srcContact = getContact(cmd.getSender()); + + AuthorizationResponseCode authResponseCode = null; + + if(cmd.isAccepted()) + authResponseCode = AuthorizationResponse.ACCEPT; + else + authResponseCode = AuthorizationResponse.REJECT; + + AuthorizationResponse authResponse = + new AuthorizationResponse(authResponseCode, cmd.getReason()); + +// try +// { +// // the contact must be subscribed again so the 0x66 - +// // awaiting authorization is removed +// if (cmd.isAccepted()) +// { +// operationSetPresence.subscribe(cmd.getSender()); +// } +// } +// catch (OperationFailedException ex) +// {} + + authorizationHandler.processAuthorizationResponse( + authResponse, srcContact); + + return cmd; + } + else + if(command == AbstractAuthCommand.CMD_AUTH_REQUEST_RECV) + { + logger.trace("Received Authorization Request!"); + + RequestAuthCmd cmd = new RequestAuthCmd(packet); + + AuthorizationRequest authRequest = new AuthorizationRequest(); + authRequest.setReason(cmd.getReason()); + + Contact srcContact = getContact(cmd.getSender()); + + AuthorizationResponse authResponse = + authorizationHandler.processAuthorisationRequest( + authRequest,srcContact); + + if (authResponse.getResponseCode() == + AuthorizationResponse.ACCEPT) + { + aimConnection.getInfoService().sendSnac( + new AuthReplyCmd( + String.valueOf(icqProvider.getAccountID(). + getAccountUserID()), + authResponse.getReason(), + true)); + } + else if (authResponse.getResponseCode() == + AuthorizationResponse.REJECT) + { + aimConnection.getInfoService().sendSnac( + new AuthReplyCmd( + String.valueOf(icqProvider.getAccountID(). + getAccountUserID()), + authResponse.getReason(), + false)); + } + + + return cmd; + } + + return super.genSnacCommand(packet); + } + + /** + * Returns a list of the SNAC command types this factory can possibly + * convert to SnacCommands. + * + * @return a list of command types that can be passed to + * genSnacCommand + */ + public List getSupportedTypes() + { + return SUPPORTED_TYPES; + } + + private Contact getContact(String uin) + { + Contact contact = + operationSetPresence.findContactByID(uin); + + if(contact == null) + contact = operationSetPresence.createVolatileContact(uin); + + return contact; + } + +} diff --git a/test/net/java/sip/communicator/slick/protocol/icq/IcqProtocolProviderSlick.java b/test/net/java/sip/communicator/slick/protocol/icq/IcqProtocolProviderSlick.java index 6a6f02b5f..c4aed8137 100644 --- a/test/net/java/sip/communicator/slick/protocol/icq/IcqProtocolProviderSlick.java +++ b/test/net/java/sip/communicator/slick/protocol/icq/IcqProtocolProviderSlick.java @@ -75,6 +75,7 @@ public void start(BundleContext bundleContext) throws Exception "Registering the IcqTesterAgent on icq has failed.(Possible " +"reasons: authetification failed, or Connection rate limit " +"exceeded.)"); + IcqSlickFixture.testerAgent.setAuthorizationRequired(); //initialize the tested account's contact list so that it could be ready //when testing starts. @@ -196,6 +197,7 @@ private void initializeTestedContactList() cListInitTesterAgent.register( System.getProperty(TESTED_IMPL_PWD_PROP_NAME, null) ); + cListInitTesterAgent.setAuthorizationRequired(); cListInitTesterAgent.initializeBuddyList(contactListToCreate); diff --git a/test/net/java/sip/communicator/slick/protocol/icq/IcqTesterAgent.java b/test/net/java/sip/communicator/slick/protocol/icq/IcqTesterAgent.java index 7ed14c0b0..72e8e8443 100644 --- a/test/net/java/sip/communicator/slick/protocol/icq/IcqTesterAgent.java +++ b/test/net/java/sip/communicator/slick/protocol/icq/IcqTesterAgent.java @@ -1135,36 +1135,6 @@ protected void writeChannelData(OutputStream out) } } -/* - private class AuthRequiredListener - implements SnacResponseListener - { - public void handleResponse(SnacResponseEvent snacResponseEvent) - { - if (snacResponseEvent.getSnacCommand() instanceof SsiDataModResponse) - { - SsiDataModResponse dataModResponse = - (SsiDataModResponse) snacResponseEvent.getSnacCommand(); - - int[] results = dataModResponse.getResults(); - List items = ( (ItemsCmd) snacResponseEvent.getRequest().getCommand()). - getItems(); - items = new LinkedList(items); - - for (int i = 0; i < results.length; i++) - { - int result = results[i]; - if (result == - SsiDataModResponse.RESULT_ICQ_AUTH_REQUIRED) - { - conn.sendSnac(new AuthReplyCmd("", "First Test - Not Accepted!", false)); - } - } - } - } - } - */ - private class AuthReplyCmd extends SsiCommand { @@ -1175,6 +1145,25 @@ private class AuthReplyCmd private String reason = null; private boolean accepted = false; + public AuthReplyCmd(SnacPacket packet) + { + super(0x001b); + + ByteBlock messageData = packet.getData(); + // parse data + int offset = 0; + short uinLen = BinaryTools.getUByte(messageData, offset++); + uin = OscarTools.getString(messageData.subBlock(offset, uinLen), "US-ASCII"); + offset += uinLen; + + accepted = BinaryTools.getUByte(messageData, offset++) == 1; + + int reasonLen = BinaryTools.getUShort(messageData, offset); + offset += 2; + reason = OscarTools.getString(messageData.subBlock(offset, reasonLen), "US-ASCII"); + } + + public AuthReplyCmd(String uin, String reason, boolean accepted) { super(0x001a); @@ -1210,12 +1199,10 @@ public void writeData(OutputStream out) } public class AuthCmdFactory - extends ClientIcbmCmdFactory + extends ServerSsiCmdFactory { List SUPPORTED_TYPES = null; - public static final int CHANNEL_AUTH = 0x0004; - public String responseReasonStr = null; public String requestReasonStr = null; public boolean ACCEPT = false; @@ -1224,140 +1211,173 @@ public AuthCmdFactory() { List types = super.getSupportedTypes(); ArrayList tempTypes = new ArrayList(types); - tempTypes.add(new CmdType(4, 7)); + tempTypes.add(new CmdType(SsiCommand.FAMILY_SSI, 0x001b)); // 1b auth request reply + tempTypes.add(new CmdType(SsiCommand.FAMILY_SSI, 0x0019)); // 19 auth request this.SUPPORTED_TYPES = DefensiveTools.getUnmodifiable(tempTypes); } + public List getSupportedTypes() + {return SUPPORTED_TYPES;} + public SnacCommand genSnacCommand(SnacPacket packet) { - if (AbstractIcbm.getIcbmChannel(packet) == CHANNEL_AUTH) - { - AuthOldMsgCmd messageCommand = new AuthOldMsgCmd(packet); - - int messageType = messageCommand.messageType; + int command = packet.getCommand(); - if (messageType == AuthOldMsgCmd.MTYPE_AUTHREQ) - { - requestReasonStr = messageCommand.reason; - - logger.trace("sending authorization " + ACCEPT); + // auth reply +// if (command == 0x001b) + // auth request + if (command == 25) + { + RequestAuthCmd cmd = new RequestAuthCmd(packet); + requestReasonStr = cmd.reason; + System.out.println("sending authorization " + ACCEPT); + logger.trace("sending authorization " + ACCEPT); + conn.sendSnac( + new AuthReplyCmd( + String.valueOf(cmd.uin), + responseReasonStr, + ACCEPT)); + return cmd; + } + else if (command == 26) // auth reply + { + AuthReplyCmd cmd = new AuthReplyCmd(packet); - conn.sendSnac( - new AuthReplyCmd( - String.valueOf(messageCommand.sender), - responseReasonStr, - ACCEPT)); - } - else - if (messageType == AuthOldMsgCmd.MTYPE_AUTHDENY) - { - // - } - else - if (messageType == AuthOldMsgCmd.MTYPE_AUTHOK) - { - // - } - else + System.out.println("cmd " + cmd); + System.out.println("is accepted " + cmd.accepted); + System.out.println("reason " + cmd.reason); - return messageCommand; + return cmd; } return super.genSnacCommand(packet); } - - public List getSupportedTypes() - { - return SUPPORTED_TYPES; - } } - private class AuthOldMsgCmd - extends AbstractImIcbm + public class RequestAuthCmd + extends SsiCommand { - private static final int TYPE_MESSAGE_DATA = 0x0005; - - public static final int MTYPE_AUTHREQ = 0x06; - public static final int MTYPE_AUTHDENY = 0x07; - public static final int MTYPE_AUTHOK = 0x08; - public static final int MTYPE_ADDED = 0x0c; - - private int messageType = -1; + String uin; + String reason; - private long sender; - private String reason; + public RequestAuthCmd(String uin, String reason) + { + super(0x0018); + this.uin = uin; + this.reason = reason; + } - public AuthOldMsgCmd(SnacPacket packet) + public RequestAuthCmd(SnacPacket packet) { - super(IcbmCommand.CMD_ICBM, packet); + super(0x0019); - DefensiveTools.checkNull(packet, "packet"); + ByteBlock messageData = packet.getData(); + // parse data + int offset = 0; + short uinLen = BinaryTools.getUByte(messageData, offset); + offset++; - ByteBlock snacData = getChannelData(); + uin = OscarTools.getString(messageData.subBlock(offset, uinLen),"US-ASCII"); - FullUserInfo userInfo = FullUserInfo.readUserInfo(snacData); + offset += uinLen; - ByteBlock tlvBlock = snacData.subBlock(userInfo.getTotalSize()); + int reasonLen = BinaryTools.getUShort(messageData, offset); + offset+=2; - TlvChain chain = TlvTools.readChain(tlvBlock); + reason = + OscarTools.getString(messageData.subBlock(offset, reasonLen), "US-ASCII"); + } - Tlv messageDataTlv = chain.getLastTlv(TYPE_MESSAGE_DATA); - ByteBlock messageData = messageDataTlv.getData(); + public void writeData(OutputStream out) throws IOException + { + byte[] uinBytes = BinaryTools.getAsciiBytes(uin); + BinaryTools.writeUByte(out, uinBytes.length); + out.write(uinBytes); - sender = LEBinaryTools.getUInt(messageData, 0); - messageType = LEBinaryTools.getUByte(messageData, 4); - int msgFlags = LEBinaryTools.getUByte(messageData, 5); - int textlen = LEBinaryTools.getUShort(messageData, 6); + if (reason == null) + { + reason = ""; + } - ByteBlock field = messageData.subBlock(8, textlen); - reason = OscarTools.getString(field, "US-ASCII"); + byte[] reasonBytes = BinaryTools.getAsciiBytes(reason); + BinaryTools.writeUShort(out, reasonBytes.length); + out.write(reasonBytes); } - - protected void writeChannelData(OutputStream out) - throws IOException - {} } - private static class LEBinaryTools + public void setAuthorizationRequired() { - public static final long UINT_MAX = 4294967295L; - public static final int USHORT_MAX = 65535; - public static final short UBYTE_MAX = 255; + logger.debug("sending auth required"); + conn.getSsiService().sendSnac(new SaveInfoRequest()); + } - public static long getUInt(final ByteBlock data, final int pos) + private class SaveInfoRequest + extends SnacCommand + { + public SaveInfoRequest() { - if (data.getLength() - pos < 4) - { - return -1; - } - - return ( ( (long) data.get(pos + 3) & 0xffL) << 24) - | ( ( (long) data.get(pos + 2) & 0xffL) << 16) - | ( ( (long) data.get(pos + 1) & 0xffL) << 8) - | ( (long) data.get(pos) & 0xffL); + super(21,2); } - public static short getUByte(final ByteBlock data, final int pos) + public void writeData(OutputStream out) + throws IOException { - if (data.getLength() - pos < 1) - { - return -1; - } + ByteArrayOutputStream icqout = new ByteArrayOutputStream(); + + ByteArrayOutputStream icqDataOut = new ByteArrayOutputStream(); + byte b[] = new byte[]{ + (byte)0xf8, (byte)0x02, // 0x02F8 User 'show web status' permissions + (byte)0x01, (byte)0x00, (byte)0x00, + (byte)0x0c, (byte)0x03, // 0x030C User authorization permissions + (byte)0x01, (byte)0x00, (byte)0x00 + }; + icqDataOut.write(b); + +// new Tlv(0x030C, ByteBlock.wrap(b)).write(icqDataOut); + + int hdrlen = 10; // The expected header length, not counting the length field itself. + int primary = 0x07D0; + int secondary = 0x0c3a; + + long icqUINlong = Long.parseLong(icqUIN.getFormatted()); + + int length = hdrlen + icqDataOut.size(); - return (short) (data.get(pos) & 0xff); + writeUShort(icqout, length); + writeUInt(icqout, icqUINlong); + writeUShort(icqout, primary); + writeUShort(icqout, 0); // the sequence + + writeUShort(icqout, secondary); + + icqDataOut.writeTo(icqout); + + logger.debug("now we will write data!"); + System.out.println("now we will write data!"); + new Tlv(0x0001, ByteBlock.wrap(icqout.toByteArray())).write(out); } - public static int getUShort(final ByteBlock data, final int pos) + public void writeUInt(final OutputStream out, final long number) + throws IOException { - if (data.getLength() - pos < 2) - { - return -1; - } + out.write(new byte[] { + (byte)((number) & 0xff), + (byte)((number >> 8) & 0xff), + (byte)((number >> 16) & 0xff), + (byte)((number >> 24) & 0xff) + }); + } - return ( (data.get(pos + 1) & 0xff) << 8) | (data.get(pos) & 0xff); + public void writeUShort(OutputStream out, int number) + throws IOException + { + out.write(new byte[] + { + (byte)(number & 0xff), + (byte)((number >> 8) & 0xff) + }); } } - } diff --git a/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPresence.java b/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPresence.java index 3f65a657c..6aad6d587 100644 --- a/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPresence.java +++ b/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPresence.java @@ -39,10 +39,6 @@ public class TestOperationSetPresence private OperationSetPresence operationSetPresence = null; private String statusMessageRoot = new String("Our status is now: "); - private AuthEventCollector authEventCollector = new AuthEventCollector(); -// private AuthCmdFactory authCmdFactory = new AuthCmdFactory(); - private Object authorizationLock = new Object(); - public TestOperationSetPresence(String name) { super(name); @@ -417,130 +413,137 @@ public void postTestSubscribe() // First create a subscription and verify that it really gets created. SubscriptionEventCollector subEvtCollector = new SubscriptionEventCollector(); - operationSetPresence.addSubsciptionListener(subEvtCollector); + AuthEventCollector authEventCollector = new AuthEventCollector(); -// operationSetPresence.setAuthorizationHandler(authEventCollector); + logger.trace("set Auth Handler"); + operationSetPresence.setAuthorizationHandler(authEventCollector); - synchronized(subEvtCollector){ + synchronized(authEventCollector) + { + authEventCollector.authorizationRequestReason = + "Please deny my request!"; + fixture.testerAgent.getAuthCmdFactory().responseReasonStr = + "First authorization I will Deny!!!"; + fixture.testerAgent.getAuthCmdFactory().ACCEPT = false; + operationSetPresence.subscribe(fixture.testerAgent.getIcqUIN()); + + // this one collects event that the buddy has been added + // to the list as awaiting + SubscriptionEventCollector moveEvtCollector + = new SubscriptionEventCollector(); + operationSetPresence.addSubsciptionListener(moveEvtCollector); + + logger.debug("Waiting for authorization error and authorization response..."); + authEventCollector.waitForAuthResponse(15000); + assertTrue("Error adding buddy not recieved or the buddy(" + + fixture.testerAgent.getIcqUIN() + + ") doesn't require authorization", + authEventCollector.isAuthorizationRequestSent); + + assertNotNull("Agent haven't received any reason for authorization", + fixture.testerAgent.getAuthCmdFactory().requestReasonStr); + assertEquals("Error sent request reason is not as the received one", + authEventCollector.authorizationRequestReason, + fixture.testerAgent.getAuthCmdFactory().requestReasonStr + ); + + logger.debug("authEventCollector.isAuthorizationResponseReceived " + + authEventCollector.isAuthorizationResponseReceived); + + assertTrue("Response not received!", + authEventCollector.isAuthorizationResponseReceived); + + boolean isAcceptedAuthReuest = + authEventCollector.response.getResponseCode().equals(AuthorizationResponse.ACCEPT); + assertEquals("Response is not as the sent one", + fixture.testerAgent.getAuthCmdFactory().ACCEPT, + isAcceptedAuthReuest); + assertNotNull("We didn't receive any reason! ", + authEventCollector.authorizationResponseString); + + assertEquals("The sent response reason is not as the received one", + fixture.testerAgent.getAuthCmdFactory().responseReasonStr, + authEventCollector.authorizationResponseString); + + // here we must wait for server to move the awaiting buddy + // to the first specified group + synchronized(moveEvtCollector){ + moveEvtCollector.waitForEvent(20000); + //don't want any more events + operationSetPresence.removeSubscriptionListener(moveEvtCollector); + } + + Contact c = operationSetPresence.findContactByID( + fixture.testerAgent.getIcqUIN()); + logger.debug("I will remove " + c + + " from group : " + c.getParentContactGroup()); + + UnsubscribeWait unsubscribeEvtCollector + = new UnsubscribeWait(); + operationSetPresence.addSubsciptionListener(unsubscribeEvtCollector); + synchronized(unsubscribeEvtCollector){ + operationSetPresence.unsubscribe(c); + logger.debug("Waiting to be removed..."); + unsubscribeEvtCollector.waitForUnsubscribre(20000); -// try -// { -// synchronized(authorizationLock) -// { -// authEventCollector.authorizationRequestReason = -// "Please deny my request!"; -// fixture.testerAgent.getAuthCmdFactory().responseReasonStr = -// "First authorization I will Deny!!!"; -// fixture.testerAgent.getAuthCmdFactory().ACCEPT = false; -// -// logger.trace("is contact there 1 = " + -// operationSetPresence.findContactByID(fixture.testerAgent.getIcqUIN())); -// - - operationSetPresence.subscribe(fixture.testerAgent.getIcqUIN()); - -// logger.debug("Waiting for authorization error and authorization response..."); -// authorizationLock.wait(5000); -// -// assertTrue("Error adding buddy not recieved or the buddy(" + -// fixture.testerAgent.getIcqUIN() + -// ") doesn't require authorization", -// authEventCollector.isAuthorizationRequestSent); -// -// assertNotNull("Agent haven't received any reason for authorization", -// fixture.testerAgent.getAuthCmdFactory().requestReasonStr); - -// not working for now -// assertEquals("Error sent request reason is not as the received one", -// authEventCollector.authorizationRequestReason, -// fixture.testerAgent.getAuthCmdFactory().requestReasonStr -// ); - -// assertTrue("Response not received!", -// authEventCollector.isAuthorizationResponseReceived); -// -// boolean isAcceptedAuthReuest = -// authEventCollector.response.getResponseCode().equals(AuthorizationResponse.ACCEPT); -// -// assertEquals("Response is not as the sent one", -// fixture.testerAgent.getAuthCmdFactory().ACCEPT, -// isAcceptedAuthReuest); -// assertNotNull("We didn't receive any reason! ", -// authEventCollector.authorizationResponseString); - -// the same as request reason -// assertEquals("The sent response reason is not as the received one", -// fixture.testerAgent.getAuthCmdFactory().responseReasonStr, -// authEventCollector.authorizationResponseString); - -// logger.trace("is contact there 2 = " + -// operationSetPresence.findContactByID(fixture.testerAgent.getIcqUIN())); - -// operationSetPresence.unsubscribe( -// operationSetPresence.findContactByID( -// fixture.testerAgent.getIcqUIN())); - - // so we haven't asserted so everithing is fine lets try to be authorized -// authEventCollector.authorizationRequestReason = -// "Please accept my request!"; -// fixture.testerAgent.getAuthCmdFactory().responseReasonStr = -// "Second authorization I will Accept!!!"; -// fixture.testerAgent.getAuthCmdFactory().ACCEPT = true; -// -// // clear some things -// authEventCollector.isAuthorizationRequestSent = false; -// authEventCollector.authorizationRequestReason = null; -// authEventCollector.isAuthorizationResponseReceived = false; -// authEventCollector.authorizationResponseString = null; - - // subscribe again so we can trigger again the authorization procedure -// operationSetPresence.subscribe(fixture.testerAgent.getIcqUIN()); - -// logger.debug("Waiting for response..."); -// authorizationLock.wait(5000); -// -// assertTrue("Error adding buddy not recieved or the buddy(" + -// fixture.testerAgent.getIcqUIN() + -// ") doesn't require authorization", -// authEventCollector.isAuthorizationRequestSent); -// -// assertNotNull("Agent haven't received any reason for authorization", -// fixture.testerAgent.getAuthCmdFactory().requestReasonStr); - - // not working for now -// assertEquals("Error sent request reason", -// authEventCollector.authorizationRequestReason, -// fixture.testerAgent.getAuthCmdFactory().requestReasonStr -// ); - - -// suspect that response is never received just the buddy is added -// assertTrue("Response not received!", -// authEventCollector.isAuthorizationResponseReceived); -// -// isAcceptedAuthReuest = -// authEventCollector.response.getResponseCode().equals(AuthorizationResponse.ACCEPT); -// -// assertEquals("Response is not as the sent one", -// fixture.testerAgent.getAuthCmdFactory().ACCEPT, -// isAcceptedAuthReuest); -// -// assertNotNull("We didn't receive any reason! ", -// authEventCollector.authorizationResponseString); - -// the same as request reason -// assertEquals("The sent response reason", -// fixture.testerAgent.getAuthCmdFactory().responseReasonStr, -// authEventCollector.authorizationResponseString); -// } -// } -// catch (InterruptedException ex) -// { -// logger.debug("Interrupted while waiting ... ", ex); -// } + logger.debug("Received unsubscribed ok or we lost patients!"); + //don't want any more events + operationSetPresence.removeSubscriptionListener(unsubscribeEvtCollector); + } + + // so we haven't asserted so everithing is fine lets try to be authorized + authEventCollector.authorizationRequestReason = + "Please accept my request!"; + fixture.testerAgent.getAuthCmdFactory().responseReasonStr = + "Second authorization I will Accept!!!"; + fixture.testerAgent.getAuthCmdFactory().ACCEPT = true; + + // clear some things + authEventCollector.isAuthorizationRequestSent = false; + authEventCollector.isAuthorizationResponseReceived = false; + authEventCollector.authorizationResponseString = null; + + + logger.debug("I will add buddy does it exists ? " + + (operationSetPresence.findContactByID(fixture.testerAgent.getIcqUIN()) != null)); + // add the listener beacuse now our authorization will be accepted + // and so the buddy will be finally added to the list + operationSetPresence.addSubsciptionListener(subEvtCollector); + // subscribe again so we can trigger again the authorization procedure + operationSetPresence.subscribe(fixture.testerAgent.getIcqUIN()); + + logger.debug("Waiting ... Subscribe must fail and the authorization process " + + "to be trigered again so waiting for auth response ..."); + authEventCollector.waitForAuthResponse(15000); + + assertTrue("Error adding buddy not recieved or the buddy(" + + fixture.testerAgent.getIcqUIN() + + ") doesn't require authorization", + authEventCollector.isAuthorizationRequestSent); + + assertNotNull("Agent haven't received any reason for authorization", + fixture.testerAgent.getAuthCmdFactory().requestReasonStr); + + // not working for now + assertEquals("Error sent request reason", + authEventCollector.authorizationRequestReason, + fixture.testerAgent.getAuthCmdFactory().requestReasonStr + ); + + + // wait for authorization process to be finnished + // the modification of buddy (server will inform us + // that he removed - awaiting authorization flag) + Object obj = new Object(); + synchronized(obj) + { + logger.debug("wait for authorization process to be finnished"); + obj.wait(10000); + logger.debug("Stop waiting!"); + } subEvtCollector.waitForEvent(10000); //don't want any more events @@ -620,7 +623,7 @@ public void postTestSubscribe() + testerAgentNewStatus.getStatusName() + " state."); } //we may already have the event, but it won't hurt to check. - contactPresEvtCollector.waitForEvent(10000); + contactPresEvtCollector.waitForEvent(12000); operationSetPresence .removeContactPresenceStatusListener(contactPresEvtCollector); } @@ -1047,19 +1050,69 @@ public AuthorizationRequest createAuthorizationRequest(Contact contact) public void processAuthorizationResponse(AuthorizationResponse response, Contact sourceContact) { - isAuthorizationResponseReceived = true; - this.response = response; - authorizationResponseString = response.getReason(); + synchronized(this) + { + isAuthorizationResponseReceived = true; + this.response = response; + authorizationResponseString = response.getReason(); - logger.trace("processAuthorizationResponse '" + - authorizationResponseString + "' " + - response.getResponseCode() + " " + - sourceContact); + logger.trace("processAuthorizationResponse '" + + authorizationResponseString + "' " + + response.getResponseCode() + " " + + sourceContact); - synchronized(authorizationLock) + notifyAll(); + } + } + + public void waitForAuthResponse(long waitFor) + { + synchronized(this){ + if(isAuthorizationResponseReceived) return; + try{ + wait(waitFor); + } + catch (InterruptedException ex){ + logger.debug( + "Interrupted while waiting for a subscription evt", ex); + } + } + } + + } + + private class UnsubscribeWait implements SubscriptionListener + { + public void waitForUnsubscribre(long waitFor) + { + synchronized(this){ + try{ + wait(waitFor); + } + catch (InterruptedException ex){ + logger.debug( + "Interrupted while waiting for a subscription evt", ex); + } + } + } + + public void subscriptionRemoved(SubscriptionEvent evt) + { + synchronized(this) { - authorizationLock.notifyAll(); + logger.debug("Got subscriptionRemoved " + evt); + notifyAll(); } } + + public void subscriptionCreated(SubscriptionEvent evt) + {} + public void subscriptionFailed(SubscriptionEvent evt) + {} + public void subscriptionMoved(SubscriptionMovedEvent evt) + {} + public void subscriptionResolved(SubscriptionEvent evt) + {} } + }