[sip-comm-cvs] CVS update: /sip-communicator/test/net/java/sip/communicator/slick/protocol/yahoo/, /sip-communicator/test/net/java/sip/communicator/slick/protocol...

damencho at dev.java.net damencho at dev.java.net
Fri May 4 09:23:27 CEST 2007


User: damencho
Date: 2007-05-04 07:23:27+0000
Modified:
   sip-communicator/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetPresence.java
   sip-communicator/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetBasicInstantMessaging.java
   sip-communicator/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetPresence.java

Log:
 Some test improvements.

File Changes:

Directory: /sip-communicator/test/net/java/sip/communicator/slick/protocol/yahoo/
=================================================================================

File [changed]: TestOperationSetPresence.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetPresence.java?r1=1.14&r2=1.15
Delta lines:  +5 -1
-------------------
--- TestOperationSetPresence.java	2007-04-19 12:21:29+0000	1.14
+++ TestOperationSetPresence.java	2007-05-04 07:23:24+0000	1.15
@@ -443,7 +443,8 @@
                 newStatus = YahooStatusEnum.BUSY;
             
             // query it again for the status
-            contactPresEvtCollector.collectedEvents.clear();
+            contactPresEvtCollector = new ContactPresenceEventCollector(
+                    fixture.userID2, newStatus);
             operationSetPresence1.addContactPresenceStatusListener(
                 contactPresEvtCollector);
 
@@ -725,7 +726,10 @@
             synchronized(this)
             {
                 if(collectedEvents.size() > 0)
+                {
+                    logger.trace("Event already received. " + collectedEvents);
                     return;
+                }
 
                 try{
                     wait(waitFor);

File [changed]: TestOperationSetBasicInstantMessaging.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetBasicInstantMessaging.java?r1=1.1&r2=1.2
Delta lines:  +13 -0
--------------------
--- TestOperationSetBasicInstantMessaging.java	2007-01-12 17:56:50+0000	1.1
+++ TestOperationSetBasicInstantMessaging.java	2007-05-04 07:23:24+0000	1.2
@@ -199,6 +199,16 @@
      */
     public void firstTestReceiveMessage()
     {
+        ContactGroup rootGroup
+            = ((OperationSetPersistentPresence)opSetPresence2).getServerStoredContactListRoot();
+
+        logger.debug("=========== Server Stored Contact List =================");
+
+        logger.debug("rootGroup="+rootGroup.getGroupName()
+                     +" rootGroup.childContacts="+rootGroup.countContacts()
+                     + "rootGroup.childGroups="+rootGroup.countSubgroups()
+                     + "Printing rootGroupContents=\n"+rootGroup.toString());
+        
         String body = "This is an IM coming from the tester agent"
             + " on " + new Date().toString();
 
@@ -434,7 +444,10 @@
             {
 
                 if(collectedEvents.size() > 0)
+                {
+                    logger.trace("ImEvent already received. " + collectedEvents);
                     return;
+                }
 
                 try{
                     wait(waitFor);

Directory: /sip-communicator/test/net/java/sip/communicator/slick/protocol/msn/
===============================================================================

File [changed]: TestOperationSetPresence.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetPresence.java?r1=1.3&r2=1.4
Delta lines:  +15 -1
--------------------
--- TestOperationSetPresence.java	2007-04-25 06:48:09+0000	1.3
+++ TestOperationSetPresence.java	2007-05-04 07:23:24+0000	1.4
@@ -271,18 +271,29 @@
         //events have been generated.
         PresenceStatusEventCollector statusEventCollector
             = new PresenceStatusEventCollector();
+        ContactPresenceEventCollector contactStatusEventCollector
+            = new ContactPresenceEventCollector(fixture.userID1, newStatus);
         operationSetPresence1.addProviderPresenceStatusListener(
             statusEventCollector);
+        operationSetPresence2.addContactPresenceStatusListener(
+            contactStatusEventCollector);
 
         //change the status
         operationSetPresence1.publishPresenceStatus(newStatus, null);
         pauseAfterStateChanges();
 
-        //test event notification.
+        //test provider event notification.
         statusEventCollector.waitForPresEvent(10000);
 
+        // wait for status change in other provider
+        // as later its not actually queryed but the last received 
+        // status is returned
+        contactStatusEventCollector.waitForEvent(10000);
+
         operationSetPresence1.removeProviderPresenceStatusListener(
             statusEventCollector);
+        operationSetPresence2.removeContactPresenceStatusListener(
+            contactStatusEventCollector);
 
         assertEquals("Events dispatched during an event transition.",
                      1, statusEventCollector.collectedPresEvents.size());
@@ -743,7 +754,10 @@
             synchronized(this)
             {
                 if(collectedEvents.size() > 0)
+                {
+                    logger.trace("Change already received. " + collectedEvents);
                     return;
+                }
 
                 try{
                     wait(waitFor);




---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe at sip-communicator.dev.java.net
For additional commands, e-mail: cvs-help at sip-communicator.dev.java.net





More information about the commits mailing list