org.robotframework.remoteserver
Class RemoteServer

java.lang.Object
  extended by org.robotframework.remoteserver.RemoteServer

public class RemoteServer
extends Object

Remote server for Robot Framework implemented in Java. Takes one or more test libraries and exposes their methods via XML-RPC using an embedded web server.

See Also:
Remote Library wiki page, User Guide for Robot Framework, XML-RPC Specification

Field Summary
protected  Map<Integer,Class<?>> libraryMap
           
 
Constructor Summary
RemoteServer()
           
 
Method Summary
 void addLibrary(Class<?> clazz, int port)
          Map the given test library to the specified port.
 void addLibrary(String className, int port)
          Map the given test library to the specified port.
static void configureLogging()
          Configures logging systems used by RemoteServer and its dependencies.
protected  javax.servlet.Servlet createServlet()
           
 boolean getAllowStop()
           
 String getHost()
           
static void main(String[] args)
           
 void setAllowStop(boolean allowed)
           
 void setHost(String hostName)
          Set the hostname of the interface to bind to.
 void start()
          Starts the remote server.
 void stop()
          Stops the remote server immediately.
 void stop(int timeoutMS)
          A non-blocking method for stopping the remote server that allows requests to complete within the given timeout before shutting down the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

libraryMap

protected Map<Integer,Class<?>> libraryMap
Constructor Detail

RemoteServer

public RemoteServer()
Method Detail

getAllowStop

public boolean getAllowStop()
Returns:
whether this server allows remote stopping

setAllowStop

public void setAllowStop(boolean allowed)
Parameters:
allowed - whether to allow stopping the server remotely

getHost

public String getHost()
Returns:
the hostname set with setHost(String)

setHost

public void setHost(String hostName)
Set the hostname of the interface to bind to. Usually not needed and determined automatically. For exotic network configuration, network with VPN, specifying the host might be necessary.

Parameters:
hostName - the hostname or address representing the interface to which all connectors will bind, or null for all interfaces.

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception

addLibrary

public void addLibrary(String className,
                       int port)
Map the given test library to the specified port. The server must be stopped when calling this.

Parameters:
className - class name of the test library
port - port to map the test library to

addLibrary

public void addLibrary(Class<?> clazz,
                       int port)
Map the given test library to the specified port. The server must be stopped when calling this.

Parameters:
clazz - class of the test library
port - port to map the test library to

stop

public void stop(int timeoutMS)
          throws Exception
A non-blocking method for stopping the remote server that allows requests to complete within the given timeout before shutting down the server. This method exists to allow stopping the server remotely. New connections will not be accepted after calling this.

Parameters:
timeoutMS - the milliseconds to wait for existing request to complete before stopping the server
Throws:
Exception

stop

public void stop()
          throws Exception
Stops the remote server immediately.

Throws:
Exception

start

public void start()
           throws Exception
Starts the remote server. Add test libraries first before calling this.

Throws:
Exception

configureLogging

public static void configureLogging()
Configures logging systems used by RemoteServer and its dependencies. Specifically, This is convenient if you do not want to configure the logging yourself. This will only affect future instances of Logger and Log, so this should be called as early as possible.


createServlet

protected javax.servlet.Servlet createServlet()


Copyright © 2012. All Rights Reserved.