com.opera.core.systems.runner.launcher
Class OperaLauncherRunner

java.lang.Object
  extended by com.opera.core.systems.runner.OperaRunner
      extended by com.opera.core.systems.runner.launcher.OperaLauncherRunner
All Implemented Interfaces:
OperaRunner

public class OperaLauncherRunner
extends OperaRunner
implements OperaRunner

OperaLauncherRunner implements an interface in C++ with a Java API for controlling the Opera binary.


Field Summary
 
Fields inherited from class com.opera.core.systems.runner.OperaRunner
settings
 
Constructor Summary
OperaLauncherRunner()
           
OperaLauncherRunner(OperaLauncherRunnerSettings settings)
           
 
Method Summary
 String getOperaCrashlog()
          If Opera crashed there should be a crashlog.
 boolean hasOperaCrashed()
          Did Opera crash? This is reset on next call, so if you don't check you won't know.
 boolean isOperaRunning()
          Is Opera running?
 boolean isOperaRunning(int processId)
           
 ScreenShotReply saveScreenshot(long timeout, String... hashes)
          Take screenshots!
 void shutdown()
          Handles safe shutdown of the OperaRunner class.
 void startOpera()
          Start Opera, does nothing if Opera is already started.
 void stopOpera()
          Stops Opera, does nothing if Opera isn't running.
static Level toLauncherLoggingLevel(Level level)
          The launcher allows for the following logging levels: "FINEST", "FINE", "INFO", "WARNING", "SEVERE".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperaLauncherRunner

public OperaLauncherRunner()

OperaLauncherRunner

public OperaLauncherRunner(OperaLauncherRunnerSettings settings)
Method Detail

startOpera

public void startOpera()
Description copied from interface: OperaRunner
Start Opera, does nothing if Opera is already started.

Specified by:
startOpera in interface OperaRunner
Overrides:
startOpera in class OperaRunner

stopOpera

public void stopOpera()
Description copied from interface: OperaRunner
Stops Opera, does nothing if Opera isn't running. Typically we'll use the exec service to stop Opera, but this method will _ensure_ that Opera is quit from an external process controller.

Specified by:
stopOpera in interface OperaRunner
Overrides:
stopOpera in class OperaRunner

isOperaRunning

public boolean isOperaRunning()
Description copied from interface: OperaRunner
Is Opera running?

Specified by:
isOperaRunning in interface OperaRunner
Overrides:
isOperaRunning in class OperaRunner
Returns:
true if running, false if not running or crashed

isOperaRunning

public boolean isOperaRunning(int processId)
Specified by:
isOperaRunning in interface OperaRunner
Overrides:
isOperaRunning in class OperaRunner

hasOperaCrashed

public boolean hasOperaCrashed()
Description copied from interface: OperaRunner
Did Opera crash? This is reset on next call, so if you don't check you won't know.

Specified by:
hasOperaCrashed in interface OperaRunner
Overrides:
hasOperaCrashed in class OperaRunner
Returns:
true if opera has crashed

getOperaCrashlog

public String getOperaCrashlog()
Description copied from interface: OperaRunner
If Opera crashed there should be a crashlog.

Specified by:
getOperaCrashlog in interface OperaRunner
Overrides:
getOperaCrashlog in class OperaRunner
Returns:
the crashlog, or null if it does not exist

shutdown

public void shutdown()
Description copied from class: OperaRunner
Handles safe shutdown of the OperaRunner class.

Specified by:
shutdown in interface OperaRunner
Overrides:
shutdown in class OperaRunner

saveScreenshot

public ScreenShotReply saveScreenshot(long timeout,
                                      String... hashes)
Take screenshots!

Specified by:
saveScreenshot in interface OperaRunner
Overrides:
saveScreenshot in class OperaRunner
Parameters:
timeout - attempt to take the screenshot until the timeout is reached
hashes - an arbitrary list of hashes to compare with
Returns:
a ScreenshotReply object containing MD5 hash sums and bytes

toLauncherLoggingLevel

public static Level toLauncherLoggingLevel(Level level)
The launcher allows for the following logging levels: "FINEST", "FINE", "INFO", "WARNING", "SEVERE". Since the launcher is unusually chatty, we don't want it to use the same logging level as OperaDriver. Besides, it doesn't have the same logging levels as Java. This method accepts a Java logging level and converts it to something sensible to pass on to the launcher.

Parameters:
level - the Java logging level
Returns:
a sensible, non-chatty logging level


Copyright © 2011. All Rights Reserved.