RiverRat  - An MIT iCampus project http://web.mit.edu/riverrat/

Main Page | Software Documentation | Hardware Documentation | People | Contact | Wiki

Main Page | Class Hierarchy | Class List | File List | Class Members

riverrat.testing.FakeServer Class Reference

Finished prototype - Provides a framework for building fake RiverRat servers for testing various components. More...

Inheritance diagram for riverrat.testing.FakeServer:

riverrat.BasicServer riverrat.testing.NMEAFakeServer riverrat.testing.XMLFakeServer List of all members.

Public Member Functions

 FakeServer ()
 Default constructor.

 FakeServer (int newport)
 Constructor.

void openFile (String name, boolean delay)
 Opens FileInputStream with appropriate filename.

void mainServer ()
 Main operation function.


Static Public Member Functions

void printUsage ()
 Prints help information for test case and exits.

void main (String args[])
 Test method.


Protected Attributes

InputStream fileInputStream = null
 fileInputStream to read data from.


Static Protected Attributes

String filename = "race.xml"
 File to read data from, defaults to "race.xml".


Detailed Description

Finished prototype - Provides a framework for building fake RiverRat servers for testing various components.

Definition at line 16 of file FakeServer.java.


Constructor & Destructor Documentation

riverrat.testing.FakeServer.FakeServer  ) 
 

Default constructor.

Calls super() to initialize server.

Definition at line 24 of file FakeServer.java.

Referenced by riverrat.testing.FakeServer.main().

riverrat.testing.FakeServer.FakeServer int  newport  ) 
 

Constructor.

Calls super(newport) to initialize server.

Parameters:
newport int specifying port to be used, if non-default

Definition at line 32 of file FakeServer.java.


Member Function Documentation

void riverrat.testing.FakeServer.main String  args[]  )  [static]
 

Test method.

Starts a new FakeServer, spawns a Thread with it, then just loops. Argument specifies (optional) filename.

Parameters:
args array of Strings with command-line arguments

Reimplemented from riverrat.BasicServer.

Reimplemented in riverrat.testing.NMEAFakeServer, and riverrat.testing.XMLFakeServer.

Definition at line 86 of file FakeServer.java.

References riverrat.testing.FakeServer.FakeServer(), riverrat.testing.FakeServer.filename, and riverrat.testing.FakeServer.printUsage().

void riverrat.testing.FakeServer.mainServer  ) 
 

Main operation function.

Overrides super.mainServer(). Initializes an XML parser and parses an input file while using callbacks to output data to TCP stream.

Reimplemented from riverrat.BasicServer.

Reimplemented in riverrat.testing.NMEAFakeServer, and riverrat.testing.XMLFakeServer.

Definition at line 57 of file FakeServer.java.

void riverrat.testing.FakeServer.openFile String  name,
boolean  delay
 

Opens FileInputStream with appropriate filename.

Definition at line 39 of file FakeServer.java.

References riverrat.testing.FakeServer.fileInputStream.

Referenced by riverrat.testing.XMLFakeServer.mainServer(), and riverrat.testing.NMEAFakeServer.mainServer().

void riverrat.testing.FakeServer.printUsage  )  [static]
 

Prints help information for test case and exits.

Definition at line 65 of file FakeServer.java.

Referenced by riverrat.testing.FakeServer.main().


The documentation for this class was generated from the following file:  

Brought to you by the RiverRat team.