org.stjs.testing.driver.browser
Class PhantomjsBrowser

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

public class PhantomjsBrowser
extends LongPollingBrowser


Field Summary
static String PROP_PHANTOMJS_BIN
           
 
Constructor Summary
PhantomjsBrowser(DriverConfiguration config)
           
 
Method Summary
 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.
 void doStart()
           
 Set<Class<? extends AsyncProcess>> getSharedDependencies()
          Returns a list of AsyncProcess that the JUnit session must start before attempting to start this browser.
 void sendNoMoreTestFixture(com.sun.net.httpserver.HttpExchange exchange)
          Writes to the HTTP response the HTML and/or javascript code that is necessary for the browser understand that there will be no more tests.
 void stop()
          Stops this browsers and performs cleanup operations, if any.
 
Methods inherited from class org.stjs.testing.driver.browser.LongPollingBrowser
awaitNextTest, executeTest, getId, getMethodUnderExecution, getStartPageUri, getStartPageUrl, markAsDead, markAsDead, notifyNoMoreTests, registerWithLongPollingServer, sendTestFixture, start
 
Methods inherited from class org.stjs.testing.driver.browser.AbstractBrowser
appendScriptTag, buildProcess, getConfig, isRunningOnWindows, processSet, sendResponse, startProcess, startProcess
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_PHANTOMJS_BIN

public static final String PROP_PHANTOMJS_BIN
See Also:
Constant Field Values
Constructor Detail

PhantomjsBrowser

public PhantomjsBrowser(DriverConfiguration config)
Method Detail

doStart

public void doStart()
             throws org.junit.runners.model.InitializationError
Specified by:
doStart in class LongPollingBrowser
Throws:
org.junit.runners.model.InitializationError

sendNoMoreTestFixture

public void sendNoMoreTestFixture(com.sun.net.httpserver.HttpExchange exchange)
                           throws IOException
Description copied from class: LongPollingBrowser
Writes to the HTTP response the HTML and/or javascript code that is necessary for the browser understand that there will be no more tests.

Overrides:
sendNoMoreTestFixture in class LongPollingBrowser
Parameters:
exchange - contains the HTTP response that must be written to
Throws:
IOException

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
Overrides:
stop in class AbstractBrowser

buildResult

public TestResult buildResult(Map<String,String> queryStringParameters,
                              com.sun.net.httpserver.HttpExchange exchange)
Description copied from class: AbstractBrowser
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

Overrides:
buildResult in class AbstractBrowser

getSharedDependencies

public Set<Class<? extends AsyncProcess>> getSharedDependencies()
Description copied from interface: Browser
Returns a list of AsyncProcess that the JUnit session must start before attempting to start this browser. If any of the dependencies fails to start, the JUnit session fails.

Specified by:
getSharedDependencies in interface Browser
Overrides:
getSharedDependencies in class LongPollingBrowser


Copyright © 2013. All Rights Reserved.