test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetMultiUserChat2.java
/**
         * Blocks until at least one event is received or until waitFor
         * miliseconds pass (whichever happens first).
         *
         * @param waitFor the number of miliseconds that we should be waiting
         * for an event before simply bailing out.
         */
Blocks until at least one event is received or until waitFor
miliseconds pass (whichever happens first).

@param waitFor the number of miliseconds that we should be waiting
for an event before simply bailing out.
Blocks until at least one event is received or until waitFor miliseconds pass ( whichever happens first ) . @param waitFor the number of miliseconds that we should be waiting for an event before simply bailing out .
public void waitForEvent(long waitFor)
        {
            logger.trace("Waiting for a MUC Event");
            synchronized (this)
            {
                if (collectedEvents.size() > waitCount)
                {
                    waitCount++;
                    logger.trace("Event already received. " + collectedEvents);
                    return;
                }
                try
                {
                    wait(waitFor);
                    if (collectedEvents.size() > waitCount)
                    {
                        logger.trace("Received a MUC event.");
                    }
                    else
                    {
                        logger.trace(
                            "MUC event missed after " + waitFor + "ms.");
                    }
                    waitCount++;
                }
                catch (InterruptedException ex)
                {
                    logger.debug(
                        "Interrupted while waiting for a MUC event", ex);
                }
            }
        }
public void waitForEvent ( long waitFor ) { logger . trace ( "Waiting for a MUC Event" ) ; synchronized ( this ) { if ( collectedEvents . size ( ) > waitCount ) { waitCount ++ ; logger . trace ( "Event already received. " + collectedEvents ) ; return ; } try { wait ( waitFor ) ; if ( collectedEvents . size ( ) > waitCount ) { logger . trace ( "Received a MUC event." ) ; } else { logger . trace ( "MUC event missed after " + waitFor + "ms." ) ; } waitCount ++ ; } catch ( InterruptedException ex ) { logger . debug ( "Interrupted while waiting for a MUC event" , ex ) ; } } }
Blocks until at least one event is received or until waitFor
 miliseconds pass (whichever happens first).
Blocks until at least one event is received or until waitFor miliseconds pass ( whichever happens first ) .