com.google.gwt.junit
Class JUnitMessageQueue

java.lang.Object
  extended by com.google.gwt.junit.JUnitMessageQueue

public class JUnitMessageQueue
extends java.lang.Object

A message queue to pass data between JUnitShell and JUnitHostImpl in a thread-safe manner.

The public methods are called by the servlet to find out what test to execute next, and to report the results of the last test to run.

The protected methods are called by the shell to fetch test results and drive the next test the client should run.


Nested Class Summary
static class JUnitMessageQueue.ClientInfoExt
          Server-side client info that includes a description.
static class JUnitMessageQueue.ClientStatus
          Holds the state of an individual client.
 
Method Summary
 JUnitHost.TestBlock getTestBlock(JUnitMessageQueue.ClientInfoExt clientInfo, int blockIndex, long timeout)
          Called by the servlet to query for for the next block to test.
 void reportFatalLaunch(JUnitMessageQueue.ClientInfoExt clientInfo, JUnitResult result)
          Reports a failure from a client that cannot startup.
 void reportResults(JUnitMessageQueue.ClientInfoExt clientInfo, java.util.Map<JUnitHost.TestInfo,JUnitResult> results)
          Called by the servlet to report the results of the last test to run.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getTestBlock

public JUnitHost.TestBlock getTestBlock(JUnitMessageQueue.ClientInfoExt clientInfo,
                                        int blockIndex,
                                        long timeout)
                                 throws TimeoutException
Called by the servlet to query for for the next block to test.

Parameters:
clientInfo - information about the client
blockIndex - the index of the test block to get
timeout - how long to wait for an answer
Returns:
the next test to run, or null if timeout is exceeded or the next test does not match testClassName
Throws:
TimeoutException

reportFatalLaunch

public void reportFatalLaunch(JUnitMessageQueue.ClientInfoExt clientInfo,
                              JUnitResult result)
Reports a failure from a client that cannot startup.

Parameters:
clientInfo - information about the client
result - the failure result

reportResults

public void reportResults(JUnitMessageQueue.ClientInfoExt clientInfo,
                          java.util.Map<JUnitHost.TestInfo,JUnitResult> results)
Called by the servlet to report the results of the last test to run.

Parameters:
clientInfo - information about the client
results - the result of running the test block