org.stjs.testing.driver.browser
Class AbstractBrowser

java.lang.Object
  extended by org.stjs.testing.driver.browser.AbstractBrowser
All Implemented Interfaces:
AsyncProcess, Browser
Direct Known Subclasses:
LongPollingBrowser

public abstract class AbstractBrowser
extends Object
implements Browser


Constructor Summary
AbstractBrowser(DriverConfiguration config)
           
 
Method Summary
protected  void appendScriptTag(StringBuilder builder, String script)
           
protected  ProcessBuilder buildProcess(org.openqa.selenium.browserlaunchers.locators.BrowserLocator locator, String binPropertyName, String url)
           
 TestResult buildResult(Map<String,String> queryStringParameters, com.sun.net.httpserver.HttpExchange exchange)
          Reads the result of the last unit test from the specified HTTP request.
 DriverConfiguration getConfig()
           
protected  boolean isRunningOnWindows()
           
protected static Set<Class<? extends AsyncProcess>> processSet(Class<? extends AsyncProcess>... clazz)
           
protected  void sendResponse(String content, com.sun.net.httpserver.HttpExchange exchange)
           
protected  void startProcess(org.openqa.selenium.browserlaunchers.locators.BrowserLocator locator, String binPropertyName, String url)
           
protected  Process startProcess(ProcessBuilder builder)
           
 void stop()
          Stops this browsers and performs cleanup operations, if any.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.stjs.testing.driver.browser.Browser
executeTest, getSharedDependencies, notifyNoMoreTests, start
 

Constructor Detail

AbstractBrowser

public AbstractBrowser(DriverConfiguration config)
Method Detail

startProcess

protected void startProcess(org.openqa.selenium.browserlaunchers.locators.BrowserLocator locator,
                            String binPropertyName,
                            String url)
                     throws org.junit.runners.model.InitializationError
Throws:
org.junit.runners.model.InitializationError

startProcess

protected Process startProcess(ProcessBuilder builder)
                        throws org.junit.runners.model.InitializationError
Throws:
org.junit.runners.model.InitializationError

buildProcess

protected ProcessBuilder buildProcess(org.openqa.selenium.browserlaunchers.locators.BrowserLocator locator,
                                      String binPropertyName,
                                      String url)

getConfig

public DriverConfiguration getConfig()
Specified by:
getConfig in interface Browser

isRunningOnWindows

protected boolean isRunningOnWindows()

appendScriptTag

protected void appendScriptTag(StringBuilder builder,
                               String script)
                        throws IOException
Throws:
IOException

sendResponse

protected void sendResponse(String content,
                            com.sun.net.httpserver.HttpExchange exchange)
                     throws IOException
Throws:
IOException

buildResult

public TestResult buildResult(Map<String,String> queryStringParameters,
                              com.sun.net.httpserver.HttpExchange exchange)
Reads the result of the last unit test from the specified HTTP request. The default implementation builds the test result by reading the "result" and "location" query string parameters


stop

public void stop()
Description copied from interface: Browser
Stops this browsers and performs cleanup operations, if any.

Specified by:
stop in interface AsyncProcess
Specified by:
stop in interface Browser

processSet

protected static Set<Class<? extends AsyncProcess>> processSet(Class<? extends AsyncProcess>... clazz)


Copyright © 2013. All Rights Reserved.