public abstract class

RunStyle

extends Object
java.lang.Object
   ↳ com.google.gwt.junit.RunStyle
Known Direct Subclasses

Class Overview

An abstract class that handles the details of launching a browser.

Summary

Fields
protected final JUnitShell shell The containing shell.
Public Constructors
RunStyle(JUnitShell shell)
Constructor for RunStyle.
Public Methods
String[] getInterruptedHosts()
Tests whether the test was interrupted.
String getLocalHostName()
Get the host name of the local system to use in URLs.
int getTries()
Returns the number of times this test should be tried to run.
abstract int initialize(String args)
Initialize the runstyle with any supplied arguments, and return the number of clients this runstyle controls.
abstract void launchModule(String moduleName)
Requests initial launch of the browser.
void setTries(int tries)
Sets the number of times a test should be tried -- it succeeds if any attempt succeeds.
boolean setupMode(TreeLogger logger, boolean developmentMode)
Setup this RunStyle for the selected mode.
boolean shouldAutoGenerateResources()
Whether the embedded server should ever generate resources.
Protected Methods
TreeLogger getLogger()
Gets the shell logger.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected final JUnitShell shell

The containing shell.

Public Constructors

public RunStyle (JUnitShell shell)

Constructor for RunStyle. Any subclass must provide a constructor with the same signature since this will be how the RunStyle is created via reflection.

Parameters
shell the containing shell

Public Methods

public String[] getInterruptedHosts ()

Tests whether the test was interrupted.

Returns
  • the interrupted hosts, or null if not interrupted

public String getLocalHostName ()

Get the host name of the local system to use in URLs. This method returns the host address instead of the host name in case the test target cannot resolve the host name.

Returns
  • the host name of the local system

public int getTries ()

Returns the number of times this test should be tried to run. A test succeeds if it succeeds even once.

Returns
  • the number of attempts

public abstract int initialize (String args)

Initialize the runstyle with any supplied arguments, and return the number of clients this runstyle controls.

Parameters
args arguments passed in -runStyle option, null if none supplied
Returns
  • the number of clients, or -1 if initialization was unsuccessful

public abstract void launchModule (String moduleName)

Requests initial launch of the browser. This should only be called once per instance of RunStyle.

Parameters
moduleName the module to run
Throws
UnableToCompleteException

public void setTries (int tries)

Sets the number of times a test should be tried -- it succeeds if any attempt succeeds.

Parameters
tries number of attempts

public boolean setupMode (TreeLogger logger, boolean developmentMode)

Setup this RunStyle for the selected mode.

Parameters
logger TreeLogger to use for any messages
developmentMode true if we are running in development mode rather that web/production mode
Returns
  • false if we should abort processing due to an unsupported mode or an error setting up for that mode

public boolean shouldAutoGenerateResources ()

Whether the embedded server should ever generate resources. Development mode needs this, but not with -noserver.

Returns
  • true if resources should be automatically generated by the server.

Protected Methods

protected TreeLogger getLogger ()

Gets the shell logger.