Class TestSuite

java.lang.Object
i5.las2peer.testing.TestSuite

public class TestSuite extends Object
This class provides methods for developers to simplify JUnit test creation.
  • Field Details

  • Constructor Details

    • TestSuite

      public TestSuite()
  • Method Details

    • launchNetwork

      public static ArrayList<PastryNodeImpl> launchNetwork(int numOfNodes) throws Exception
      This method starts a network consisting of the given number of nodes. The nodes should be used for testing only, because they are listening only on the loopback address and their ports are choosen by the operating system. Furthermore this method uses a non persistent storage mode for each node.
      Parameters:
      numOfNodes - The number of nodes that should be in the network.
      Returns:
      Returns a list with all nodes from the network.
      Throws:
      Exception - If an error occurs.
    • launchNetwork

      public static ArrayList<PastryNodeImpl> launchNetwork(int numOfNodes, SharedStorage.STORAGE_MODE storageMode, boolean wipeData) throws Exception
      This method starts a network consisting of the given number of nodes. The nodes should be used for testing only, because they are listening only on the loopback address and their ports are choosen by the operating system.
      Parameters:
      numOfNodes - The number of nodes that should be in the network.
      storageMode - A storage mode used by the nodes in the network.
      wipeData - If true the test storage directory is wiped before launching the network.
      Returns:
      Returns a list with all nodes from the network.
      Throws:
      Exception - If an error occurs.
    • addNode

      public static PastryNodeImpl addNode(int bootstrapPort, SharedStorage.STORAGE_MODE storageMode, Long nodeIdSeed) throws Exception
      Throws:
      Exception
    • wipeTestStorage

      public static void wipeTestStorage() throws IOException
      Throws:
      IOException
    • main

      public static void main(String[] args)
      self test
      Parameters:
      args - ignored