Package org.astrogrid.samp.test

# Class HubTester

java.lang.Object
org.astrogrid.samp.test.Tester
org.astrogrid.samp.test.HubTester

public class HubTester extends Tester
Tester for a running hub. Attempts to test as much of the SAMP standard as possible for an existing hub implementation.

Since:
  18 Jul 2008
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`HubTester(ClientProfile profile)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`Object`
`createRandomObject(int level, boolean ugly)`
Generates an object with random content for transmission using SAMP.
`String`
`createRandomString(boolean ugly)`
Creates a new random string for transmission using SAMP.
`static void`
`main(String[] args)`
Main method.
`void`
`run()`
Perform a wide variety of tests on a running hub.
`static int`
`runMain(String[] args)`
Does the work for the main method.

### Methods inherited from class org.astrogrid.samp.test.Tester

`assertEquals, assertEquals, assertTrue, fail`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### HubTester

public HubTester(ClientProfile profile) throws IOException
Constructor.

Parameters:
  `profile` - hub discovery object
Throws:
  `IOException`

## Method Details

### run

public void run() throws IOException
Perform a wide variety of tests on a running hub.

Throws:
  `IOException`

### createRandomObject

public Object createRandomObject(int level, boolean ugly)
Generates an object with random content for transmission using SAMP. This may be a structure containing strings, lists and maps with any legal values as defined by the SAMP data encoding rules.

Parameters:
  `level` - maximum level of nesting (how deeply lists/maps may appear within other lists/maps)
  `ugly` - if true, any legal SAMP content will be used; if false, the returned object should be reasonably human-readable if printed (toString)
Returns:
  random SAMP object

### createRandomString

public String createRandomString(boolean ugly)
Creates a new random string for transmission using SAMP. This may have any legal content according to the SAMP data encoding rules.

Parameters:
  `ugly` - if true, any legal SAMP content will be used; if false, the returned object should be reasonably human-readable if printed (toString)

### main

public static void main(String[] args) throws IOException
Main method. Tests a hub which is currently running.

Throws:
  `IOException`

### runMain

public static int runMain(String[] args) throws IOException
Does the work for the main method. Use -help flag.

Throws:
  `IOException`