|
ePOST API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.p2p.multiring.testing.MultiringRegrTest
public class MultiringRegrTest
Provides regression testing setup for applications written on top of the commonapi. Currently is written to use Pastry nodes, but this will be abstracted away.
Nested Class Summary | |
---|---|
class |
MultiringRegrTest.MultiringTestApp
|
static class |
MultiringRegrTest.MultiringTestMessage
|
Field Summary | |
---|---|
static java.lang.String |
BOOTSTRAP_HOST
|
static int |
BOOTSTRAP_PORT
|
Environment |
environment
|
protected PastryNodeFactory |
factory
|
static java.lang.String |
FAILURE
|
protected MultiringRegrTest.MultiringTestApp[] |
globalApps
|
protected MultiringNode[] |
globalNodes
|
protected Id |
globalRingId
|
protected IdFactory |
idFactory
|
static java.lang.String |
INSTANCE_NAME
|
static int |
NUM_GATEWAY_NODES
|
static int |
NUM_GLOBAL_NODES
|
static int |
NUM_INTERNAL_NODES
|
static int |
NUM_ORGANIZATIONAL_NODES
|
static int |
NUM_ORGANIZATIONS
|
protected MultiringRegrTest.MultiringTestApp[][] |
organizationalApps
|
protected MultiringNode[][] |
organizationalNodes
|
protected static int |
PAD_SIZE
|
static int |
PORT
|
static int |
PROTOCOL
|
static int |
PROTOCOL_DIRECT
|
protected Id[] |
ringIds
|
protected NetworkSimulator |
simulator
|
static int |
SIMULATOR
|
static int |
SIMULATOR_EUCLIDEAN
|
static int |
SIMULATOR_SPHERE
|
static java.lang.String |
SUCCESS
|
Constructor Summary | |
---|---|
MultiringRegrTest(Environment env)
Constructor, which takes no arguments and sets up the factories in preparation for node creation. |
Method Summary | |
---|---|
protected void |
assertEquals(java.lang.String description,
java.lang.Object expected,
java.lang.Object actual)
Thows an exception if expected is not equal to actual. |
protected void |
assertTrue(java.lang.String intention,
boolean test)
Throws an exception if the test condition is not met. |
protected MultiringNode |
createNode(Id ringId,
MultiringNode bootstrap)
Method which creates a single node, given it's node number |
protected MultiringNode |
createNode(MultiringNode existing,
Id ringId,
MultiringNode bootstrap)
Method which creates a single node, given it's node number |
void |
createNodes()
Method which creates the nodes |
protected NodeHandle |
getBootstrap(Node bootstrap)
Gets a handle to a bootstrap node. |
protected void |
kill(int n)
Method which kills the specified node |
static void |
main(java.lang.String[] args)
|
protected static void |
parseArgs(java.lang.String[] args)
process command line args |
protected void |
pause(int ms)
Method which pauses for the provided number of milliseconds |
protected void |
runTest()
Method which should run the test - this is called once all of the nodes have been created and are ready. |
protected void |
sectionDone()
Method which prints the end of a test section. |
protected void |
sectionStart(java.lang.String name)
Method which prints the beginning of a test section. |
protected void |
simulate()
In case we're using the direct simulator, this method simulates the message passing. |
void |
start()
Method which starts the creation of nodes |
protected void |
stepDone()
Method which prints the end of a test section step, with an assumed success. |
protected void |
stepDone(java.lang.String status)
Method which prints the end of a test section step. |
protected void |
stepDone(java.lang.String status,
java.lang.String message)
Method which prints the end of a test section step, as well as a message. |
protected void |
stepException(java.lang.Exception e)
Method which prints an exception which occured during testing. |
protected void |
stepStart(java.lang.String name)
Method which prints the beginning of a test section step. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected MultiringNode[] globalNodes
protected MultiringNode[][] organizationalNodes
protected MultiringRegrTest.MultiringTestApp[] globalApps
protected MultiringRegrTest.MultiringTestApp[][] organizationalApps
protected Id globalRingId
protected Id[] ringIds
protected PastryNodeFactory factory
protected IdFactory idFactory
protected NetworkSimulator simulator
public static int NUM_GLOBAL_NODES
public static int NUM_ORGANIZATIONS
public static int NUM_INTERNAL_NODES
public static int NUM_GATEWAY_NODES
public static int NUM_ORGANIZATIONAL_NODES
public static final java.lang.String SUCCESS
public static final java.lang.String FAILURE
protected static final int PAD_SIZE
public static final int PROTOCOL_DIRECT
public static final int SIMULATOR_SPHERE
public static final int SIMULATOR_EUCLIDEAN
public static int PORT
public static java.lang.String BOOTSTRAP_HOST
public static int BOOTSTRAP_PORT
public static int PROTOCOL
public static int SIMULATOR
public static java.lang.String INSTANCE_NAME
public Environment environment
Constructor Detail |
---|
public MultiringRegrTest(Environment env) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public void createNodes()
public void start()
protected void simulate()
protected MultiringNode createNode(Id ringId, MultiringNode bootstrap)
num
- The number of creation order
protected MultiringNode createNode(MultiringNode existing, Id ringId, MultiringNode bootstrap)
num
- The number of creation order
protected NodeHandle getBootstrap(Node bootstrap)
protected void pause(int ms)
ms
- The number of milliseconds to pauseprotected void kill(int n)
n
- The node to killprotected void runTest()
protected final void sectionStart(java.lang.String name)
name
- The name of sectionprotected final void sectionDone()
protected final void stepStart(java.lang.String name)
name
- The name of stepprotected final void stepDone()
protected final void stepDone(java.lang.String status)
status
- The status of stepprotected final void stepDone(java.lang.String status, java.lang.String message)
status
- The status of sectionmessage
- The messageprotected final void stepException(java.lang.Exception e)
e
- The exception which was thrownprotected final void assertTrue(java.lang.String intention, boolean test)
protected final void assertEquals(java.lang.String description, java.lang.Object expected, java.lang.Object actual)
protected static void parseArgs(java.lang.String[] args)
public static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException
|
ePOST API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |