com.saucelabs.ci
Class BrowserFactory
java.lang.Object
com.saucelabs.ci.BrowserFactory
public class BrowserFactory
- extends Object
Handles invoking the Sauce REST API to retrieve the list of valid Browsers. The list of browser is cached for
an hour.
- Author:
- Ross Rowe
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BROWSER_URL
public static final String BROWSER_URL
- See Also:
- Constant Field Values
lastLookup
protected Timestamp lastLookup
BrowserFactory
public BrowserFactory()
values
public List<Browser> values()
throws IOException,
org.json.JSONException
- Throws:
IOException
org.json.JSONException
shouldRetrieveBrowsers
public boolean shouldRetrieveBrowsers()
getSauceAPIFactory
public SauceFactory getSauceAPIFactory()
getBrowserListFromJson
public List<Browser> getBrowserListFromJson(String browserListJson)
throws org.json.JSONException
- Parses the JSON response and constructs a List of
Browser instances.
- Parameters:
browserListJson -
- Returns:
-
- Throws:
org.json.JSONException
forKey
public Browser forKey(String key)
getInstance
public static BrowserFactory getInstance()
- Returns a singleton instance of SauceFactory. This is required because
remote agents don't have the Bamboo component plugin available, so the Spring
auto-wiring doesn't work.
- Returns:
Copyright © 2004-2011. All Rights Reserved.