Arquillian GWT Testing extension 1.0.0.Alpha2

com.google.gwt.junit
Class JUnitShell

java.lang.Object
  extended by com.google.gwt.dev.DevModeBase
      extended by com.google.gwt.dev.DevMode
          extended by com.google.gwt.junit.JUnitShell
All Implemented Interfaces:
com.google.gwt.dev.ui.DoneCallback, com.google.gwt.dev.ui.RestartServerCallback, com.google.gwt.dev.ui.UiCallback

public class JUnitShell
extends com.google.gwt.dev.DevMode

This class is responsible for hosting JUnit test case execution. There are three main pieces to the JUnit system.

The test environment consists of this class and the non-translatable version of GWTTestCase. These two classes integrate directly into the real JUnit test process.

The client classes consist of the translatable version of GWTTestCase, translatable JUnit classes, and the user's own GWTTestCase-derived class. The client communicates to the server via RPC.

The server consists of ArquillianJunitHostImpl, an RPC servlet which communicates back to the test environment through a ArquillianJunitMessageQueue, thus closing the loop.


Nested Class Summary
static interface JUnitShell.Strategy
          A strategy for running the test.
 
Nested classes/interfaces inherited from class com.google.gwt.dev.DevMode
com.google.gwt.dev.DevMode.ArgHandlerServer, com.google.gwt.dev.DevMode.ArgHandlerStartupURLs, com.google.gwt.dev.DevMode.HostedModeOptions, com.google.gwt.dev.DevMode.HostedModeOptionsImpl
 
Nested classes/interfaces inherited from class com.google.gwt.dev.DevModeBase
com.google.gwt.dev.DevModeBase.ArgHandlerBindAddress, com.google.gwt.dev.DevModeBase.ArgHandlerBlacklist, com.google.gwt.dev.DevModeBase.ArgHandlerCodeServerPort, com.google.gwt.dev.DevModeBase.ArgHandlerLogDir, com.google.gwt.dev.DevModeBase.ArgHandlerNoServerFlag, com.google.gwt.dev.DevModeBase.ArgHandlerPort, com.google.gwt.dev.DevModeBase.ArgHandlerRemoteUI, com.google.gwt.dev.DevModeBase.ArgHandlerWhitelist, com.google.gwt.dev.DevModeBase.HostedModeBaseOptions, com.google.gwt.dev.DevModeBase.HostedModeBaseOptionsImpl, com.google.gwt.dev.DevModeBase.OptionBindAddress, com.google.gwt.dev.DevModeBase.OptionCodeServerPort, com.google.gwt.dev.DevModeBase.OptionLogDir, com.google.gwt.dev.DevModeBase.OptionNoServer, com.google.gwt.dev.DevModeBase.OptionPort, com.google.gwt.dev.DevModeBase.OptionRemoteUI, com.google.gwt.dev.DevModeBase.OptionStartupURLs, com.google.gwt.dev.DevModeBase.UiBrowserWidgetHostImpl
 
Field Summary
 
Fields inherited from class com.google.gwt.dev.DevMode
options
 
Fields inherited from class com.google.gwt.dev.DevModeBase
baseLogLevelForUI, bindAddress, codeServerPort, connectAddress, isHttps, listener, ui
 
Method Summary
 void _setPort(int port)
           
protected  long checkForUpdatesInterval()
          Check for updates once a minute.
protected  boolean doStartup()
           
protected  void ensureCodeServerListener()
           
static ArquillianJunitMessageQueue getMessageQueue()
          Called by ArquillianJunitHostImpl to get an interface into the test process.
 com.google.gwt.dev.cfg.ModuleDef getModuleDef()
           
 String getModuleUrl(String moduleName)
           
static String[] getRemoteUserAgents()
          Get the list of remote user agents to compile.
 com.google.gwt.junit.RunStyle getRunStyle()
           
static JUnitShell getUnitTestShell()
          Retrieves the JUnitShell.
protected  void inferStartupUrls()
           
protected  com.google.gwt.dev.cfg.ModuleDef loadModule(com.google.gwt.core.ext.TreeLogger logger, String moduleName, boolean refresh)
           
static boolean mustNotExecuteTest(com.google.gwt.junit.client.impl.JUnitHost.TestInfo testInfo)
          Checks if a testCase should not be executed.
protected  boolean notDone()
          Checks to see if this test run is complete.
static void runTest(com.google.gwt.junit.client.GWTTestCase testCase, Class<?> testClass, junit.framework.TestResult testResult)
           
static void runTest(com.google.gwt.junit.client.GWTTestCase testCase, junit.framework.TestResult testResult)
          Entry point for GWTTestCase.
static void runTest(String moduleName, junit.framework.TestCase testCase, junit.framework.TestResult testResult)
          Deprecated. use runTest(GWTTestCase, TestResult) instead
static void runTest(String moduleName, junit.framework.TestCase testCase, junit.framework.TestResult testResult, JUnitShell.Strategy strategy)
          Deprecated. use runTest(GWTTestCase, TestResult) instead
 void setContextPath(String contextPath)
           
protected  void warnAboutNoStartupUrls()
           
 
Methods inherited from class com.google.gwt.dev.DevMode
createOptions, doShutDownServer, doSlowStartup, doStartUpServer, getWebServerName, main, onRestartServer, produceOutput
 
Methods inherited from class com.google.gwt.dev.DevModeBase
addStartupURL, doCreateShellModuleSpaceHost, doStartup, getBaseLogLevelForUI, getHost, getPort, getTopLogger, isHeadless, link, normalizeURL, onDone, processUrl, randomString, run, setDone, setHeadless, setPort, setRunTomcat, shutDown, startUp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMessageQueue

public static ArquillianJunitMessageQueue getMessageQueue()
Called by ArquillianJunitHostImpl to get an interface into the test process.

Returns:
The ArquillianJunitMessageQueue interface that belongs to the singleton JUnitShell, or null if no such singleton exists.

getRemoteUserAgents

public static String[] getRemoteUserAgents()
Get the list of remote user agents to compile. This method returns null until all clients have connected.

Returns:
the list of remote user agents

mustNotExecuteTest

public static boolean mustNotExecuteTest(com.google.gwt.junit.client.impl.JUnitHost.TestInfo testInfo)
Checks if a testCase should not be executed. Currently, a test is either executed on all clients (mentioned in this test) or on no clients.

Parameters:
testInfo - the test info to check
Returns:
true iff the test should not be executed on any of the specified clients.

runTest

public static void runTest(com.google.gwt.junit.client.GWTTestCase testCase,
                           Class<?> testClass,
                           junit.framework.TestResult testResult)
                    throws com.google.gwt.core.ext.UnableToCompleteException
Throws:
com.google.gwt.core.ext.UnableToCompleteException

runTest

public static void runTest(com.google.gwt.junit.client.GWTTestCase testCase,
                           junit.framework.TestResult testResult)
                    throws com.google.gwt.core.ext.UnableToCompleteException
Entry point for GWTTestCase. Gets or creates the singleton JUnitShell and invokes its #runTestImpl(GWTTestCase, TestResult).

Throws:
com.google.gwt.core.ext.UnableToCompleteException

runTest

@Deprecated
public static void runTest(String moduleName,
                                      junit.framework.TestCase testCase,
                                      junit.framework.TestResult testResult)
                    throws com.google.gwt.core.ext.UnableToCompleteException
Deprecated. use runTest(GWTTestCase, TestResult) instead

Entry point for GWTTestCase. Gets or creates the singleton JUnitShell and invokes its #runTestImpl(GWTTestCase, TestResult).

Throws:
com.google.gwt.core.ext.UnableToCompleteException

runTest

@Deprecated
public static void runTest(String moduleName,
                                      junit.framework.TestCase testCase,
                                      junit.framework.TestResult testResult,
                                      JUnitShell.Strategy strategy)
                    throws com.google.gwt.core.ext.UnableToCompleteException
Deprecated. use runTest(GWTTestCase, TestResult) instead

Throws:
com.google.gwt.core.ext.UnableToCompleteException

getUnitTestShell

public static JUnitShell getUnitTestShell()
Retrieves the JUnitShell. This should only be invoked during TestRunner execution of JUnit tests.


getModuleUrl

public String getModuleUrl(String moduleName)

checkForUpdatesInterval

protected long checkForUpdatesInterval()
Check for updates once a minute.

Overrides:
checkForUpdatesInterval in class com.google.gwt.dev.DevModeBase

getRunStyle

public com.google.gwt.junit.RunStyle getRunStyle()

doStartup

protected boolean doStartup()
Overrides:
doStartup in class com.google.gwt.dev.DevMode

ensureCodeServerListener

protected void ensureCodeServerListener()
Overrides:
ensureCodeServerListener in class com.google.gwt.dev.DevModeBase

inferStartupUrls

protected void inferStartupUrls()
Overrides:
inferStartupUrls in class com.google.gwt.dev.DevMode

loadModule

protected com.google.gwt.dev.cfg.ModuleDef loadModule(com.google.gwt.core.ext.TreeLogger logger,
                                                      String moduleName,
                                                      boolean refresh)
                                               throws com.google.gwt.core.ext.UnableToCompleteException
Overrides:
loadModule in class com.google.gwt.dev.DevMode
Throws:
com.google.gwt.core.ext.UnableToCompleteException

notDone

protected boolean notDone()
Checks to see if this test run is complete.


warnAboutNoStartupUrls

protected void warnAboutNoStartupUrls()
Overrides:
warnAboutNoStartupUrls in class com.google.gwt.dev.DevMode

getModuleDef

public com.google.gwt.dev.cfg.ModuleDef getModuleDef()

_setPort

public void _setPort(int port)

setContextPath

public void setContextPath(String contextPath)

Arquillian GWT Testing extension 1.0.0.Alpha2

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.