Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Rice Pastry API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## rice.p2p.multiring.testing
Class MultiringRegrTest

    java.lang.Object
      rice.p2p.multiring.testing.MultiringRegrTest

public class MultiringRegrTest
extends java.lang.Object

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.

Version:
  $Id: MultiringRegrTest.java 2896 2006-01-09 17:11:50Z jeffh $
Author:
  Alan Mislove

Nested Class Summary
`class` | `MultiringRegrTest.MultiringTestApp` DESCRIBE THE CLASS
`static class` | `MultiringRegrTest.MultiringTestMessage` DESCRIBE THE CLASS

Field Summary
`static java.lang.String` | `BOOTSTRAP_HOST` DESCRIBE THE FIELD
`static int` | `BOOTSTRAP_PORT` DESCRIBE THE FIELD
`Environment` | `environment` DESCRIBE THE FIELD
`protected PastryNodeFactory` | `factory` DESCRIBE THE FIELD
`static java.lang.String` | `FAILURE` DESCRIBE THE FIELD
`protected MultiringRegrTest.MultiringTestApp[]` | `globalApps` DESCRIBE THE FIELD
`protected MultiringNode[]` | `globalNodes` DESCRIBE THE FIELD
`protected Id` | `globalRingId` DESCRIBE THE FIELD
`protected IdFactory` | `idFactory` DESCRIBE THE FIELD
`static java.lang.String` | `INSTANCE_NAME` DESCRIBE THE FIELD
`static int` | `NUM_GATEWAY_NODES` DESCRIBE THE FIELD
`static int` | `NUM_GLOBAL_NODES` DESCRIBE THE FIELD
`static int` | `NUM_INTERNAL_NODES` DESCRIBE THE FIELD
`static int` | `NUM_ORGANIZATIONAL_NODES` DESCRIBE THE FIELD
`static int` | `NUM_ORGANIZATIONS` DESCRIBE THE FIELD
`protected MultiringRegrTest.MultiringTestApp[][]` | `organizationalApps` DESCRIBE THE FIELD
`protected MultiringNode[][]` | `organizationalNodes` DESCRIBE THE FIELD
`protected static int` | `PAD_SIZE` DESCRIBE THE FIELD
`static int` | `PORT` DESCRIBE THE FIELD
`static int` | `PROTOCOL` DESCRIBE THE FIELD
`static int` | `PROTOCOL_DIRECT` DESCRIBE THE FIELD
`protected Id[]` | `ringIds` DESCRIBE THE FIELD
`protected NetworkSimulator` | `simulator` DESCRIBE THE FIELD
`static int` | `SIMULATOR` DESCRIBE THE FIELD
`static int` | `SIMULATOR_EUCLIDEAN` DESCRIBE THE FIELD
`static int` | `SIMULATOR_SPHERE` DESCRIBE THE FIELD
`static java.lang.String` | `SUCCESS` DESCRIBE THE FIELD

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)` The main program for the MultiringRegrTest class
`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

### globalNodes

    protected MultiringNode[] globalNodes

  DESCRIBE THE FIELD

### organizationalNodes

    protected MultiringNode[][] organizationalNodes

  DESCRIBE THE FIELD

### globalApps

    protected MultiringRegrTest.MultiringTestApp[] globalApps

  DESCRIBE THE FIELD

### organizationalApps

    protected MultiringRegrTest.MultiringTestApp[][] organizationalApps

  DESCRIBE THE FIELD

### globalRingId

    protected Id globalRingId

  DESCRIBE THE FIELD

### ringIds

    protected Id[] ringIds

  DESCRIBE THE FIELD

### factory

    protected PastryNodeFactory factory

  DESCRIBE THE FIELD

### idFactory

    protected IdFactory idFactory

  DESCRIBE THE FIELD

### simulator

    protected NetworkSimulator simulator

  DESCRIBE THE FIELD

### environment

    public Environment environment

  DESCRIBE THE FIELD

### NUM_GLOBAL_NODES

    public static int NUM_GLOBAL_NODES

  DESCRIBE THE FIELD

### NUM_ORGANIZATIONS

    public static int NUM_ORGANIZATIONS

  DESCRIBE THE FIELD

### NUM_INTERNAL_NODES

    public static int NUM_INTERNAL_NODES

  DESCRIBE THE FIELD

### NUM_GATEWAY_NODES

    public static int NUM_GATEWAY_NODES

  DESCRIBE THE FIELD

### NUM_ORGANIZATIONAL_NODES

    public static int NUM_ORGANIZATIONAL_NODES

  DESCRIBE THE FIELD

### SUCCESS

    public static final java.lang.String SUCCESS

  DESCRIBE THE FIELD

  See Also:
    Constant Field Values

### FAILURE

    public static final java.lang.String FAILURE

  DESCRIBE THE FIELD

  See Also:
    Constant Field Values

### PAD_SIZE

    protected static final int PAD_SIZE

  DESCRIBE THE FIELD

  See Also:
    Constant Field Values

### PROTOCOL_DIRECT

    public static final int PROTOCOL_DIRECT

  DESCRIBE THE FIELD

  See Also:
    Constant Field Values

### SIMULATOR_SPHERE

    public static final int SIMULATOR_SPHERE

  DESCRIBE THE FIELD

  See Also:
    Constant Field Values

### SIMULATOR_EUCLIDEAN

    public static final int SIMULATOR_EUCLIDEAN

  DESCRIBE THE FIELD

  See Also:
    Constant Field Values

### PORT

    public static int PORT

  DESCRIBE THE FIELD

### BOOTSTRAP_HOST

    public static java.lang.String BOOTSTRAP_HOST

  DESCRIBE THE FIELD

### BOOTSTRAP_PORT

    public static int BOOTSTRAP_PORT

  DESCRIBE THE FIELD

### PROTOCOL

    public static int PROTOCOL

  DESCRIBE THE FIELD

### SIMULATOR

    public static int SIMULATOR

  DESCRIBE THE FIELD

### INSTANCE_NAME

    public static java.lang.String INSTANCE_NAME

  DESCRIBE THE FIELD

Constructor Detail

### MultiringRegrTest

    public MultiringRegrTest(Environment env)
                      throws java.io.IOException

  Constructor, which takes no arguments and sets up the factories in preparation for node creation.

Parameters:
  `env` - DESCRIBE THE PARAMETER
Throws:
  `java.io.IOException` - DESCRIBE THE EXCEPTION

Method Detail

### getBootstrap

    protected NodeHandle getBootstrap(Node bootstrap)

  Gets a handle to a bootstrap node.

  Parameters:
    `bootstrap` - DESCRIBE THE PARAMETER
  Returns:
    handle to bootstrap node, or null.

### createNodes

    public void createNodes()

  Method which creates the nodes

### start

    public void start()

  Method which starts the creation of nodes

### simulate

    protected void simulate()

  In case we're using the direct simulator, this method simulates the message passing.

### createNode

    protected MultiringNode createNode(Id ringId,
                                       MultiringNode bootstrap)

  Method which creates a single node, given it's node number

  Parameters:
    `ringId` - DESCRIBE THE PARAMETER
    `bootstrap` - DESCRIBE THE PARAMETER
  Returns:
    The created node

### createNode

    protected MultiringNode createNode(MultiringNode existing,
                                       Id ringId,
                                       MultiringNode bootstrap)

  Method which creates a single node, given it's node number

  Parameters:
    `existing` - DESCRIBE THE PARAMETER
    `ringId` - DESCRIBE THE PARAMETER
    `bootstrap` - DESCRIBE THE PARAMETER
  Returns:
    The created node

### pause

    protected void pause(int ms)

  Method which pauses for the provided number of milliseconds

  Parameters:
    `ms` - The number of milliseconds to pause

### kill

    protected void kill(int n)

  Method which kills the specified node

  Parameters:
    `n` - The node to kill

### runTest

    protected void runTest()

  Method which should run the test - this is called once all of the nodes have been created and are ready.

### sectionStart

    protected final void sectionStart(java.lang.String name)

  Method which prints the beginning of a test section.

  Parameters:
    `name` - The name of section

### sectionDone

    protected final void sectionDone()

  Method which prints the end of a test section.

### stepStart

    protected final void stepStart(java.lang.String name)

  Method which prints the beginning of a test section step.

  Parameters:
    `name` - The name of step

### stepDone

    protected final void stepDone()

  Method which prints the end of a test section step, with an assumed success.

### stepDone

    protected final void stepDone(java.lang.String status)

  Method which prints the end of a test section step.

  Parameters:
    `status` - The status of step

### stepDone

    protected final 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.

  Parameters:
    `status` - The status of section
    `message` - The message

### stepException

    protected final void stepException(java.lang.Exception e)

  Method which prints an exception which occured during testing.

  Parameters:
    `e` - The exception which was thrown

### assertTrue

    protected final void assertTrue(java.lang.String intention,
                                    boolean test)

  Throws an exception if the test condition is not met.

  Parameters:
    `intention` - DESCRIBE THE PARAMETER
    `test` - DESCRIBE THE PARAMETER

### assertEquals

    protected final void assertEquals(java.lang.String description,
                                      java.lang.Object expected,
                                      java.lang.Object actual)

  Thows an exception if expected is not equal to actual.

  Parameters:
    `description` - DESCRIBE THE PARAMETER
    `expected` - DESCRIBE THE PARAMETER
    `actual` - DESCRIBE THE PARAMETER

### parseArgs

    protected static void parseArgs(java.lang.String[] args)

  process command line args

  Parameters:
    `args` - DESCRIBE THE PARAMETER

### main

    public static void main(java.lang.String[] args)
                     throws java.io.IOException

  The main program for the MultiringRegrTest class

  Parameters:
    `args` - The command line arguments
  Throws:
    `java.io.IOException` - DESCRIBE THE EXCEPTION

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Rice Pastry API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2005 - Rice Pastry.