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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectcreateRandomObject(int level, boolean ugly)Generates an object with random content for transmission using SAMP.java.lang.StringcreateRandomString(boolean ugly)Creates a new random string for transmission using SAMP.static voidmain(java.lang.String[] args)Main method.voidrun()Perform a wide variety of tests on a running hub.static intrunMain(java.lang.String[] args)Does the work for the main method.-
Methods inherited from class org.astrogrid.samp.test.Tester
assertEquals, assertEquals, assertTrue, fail
-
-
-
-
Constructor Detail
-
HubTester
public HubTester(ClientProfile profile) throws java.io.IOException
Constructor.- Parameters:
profile- hub discovery object- Throws:
java.io.IOException
-
-
Method Detail
-
run
public void run() throws java.io.IOExceptionPerform a wide variety of tests on a running hub.- Throws:
java.io.IOException
-
createRandomObject
public java.lang.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 java.lang.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(java.lang.String[] args) throws java.io.IOExceptionMain method. Tests a hub which is currently running.- Throws:
java.io.IOException
-
runMain
public static int runMain(java.lang.String[] args) throws java.io.IOExceptionDoes the work for the main method. Use -help flag.- Throws:
java.io.IOException
-
-