/** Set up the stress testing environment. */
  protected void setUp() {
    // create the properties map of BaseNode.
    properties = StressTestHelper.getProperties();

    // get the graphNode here.
    graphNode = StressTestHelper.getGraphNode(2);

    // create the structure of the Subsystem here.
    nameNode = new GraphNode();
    stereotypeNode = new GraphNode();
    namespaceNode = new GraphNode();

    // set the initializing size and position.
    nameNode.setPosition(StressTestHelper.createPoint(0, 0));
    nameNode.setSize(StressTestHelper.createDimension(10, 10));
    stereotypeNode.setPosition(StressTestHelper.createPoint(0, 0));
    stereotypeNode.setSize(StressTestHelper.createDimension(10, 10));
    namespaceNode.setPosition(StressTestHelper.createPoint(0, 0));
    namespaceNode.setSize(StressTestHelper.createDimension(10, 10));

    // create the NameCompartment here.
    GraphNode nameCompartment = new GraphNode();

    nameCompartment.addContained(stereotypeNode);
    nameCompartment.addContained(nameNode);
    nameCompartment.addContained(namespaceNode);

    graphNode.addContained(nameCompartment);
  }
  /**
   * Basic stress test of <code>notifyGraphNodeChange()</code> method.
   *
   * @throws Exception if if any exception occurs when testing.
   */
  public void testUseCaseNode_notifyGraphNodeChange_AbsolutePosition() throws Exception {
    GraphNode dv = new GraphNode();
    dv.setPosition(StressTestHelper.createPoint(0, 0));
    GraphNode ssNode = StressTestHelper.getGraphNode(1);
    ssNode.setSize(StressTestHelper.createDimension(400, 800));
    ssNode.setPosition(StressTestHelper.createPoint(100, 200));
    ssNode.setContainer(dv);
    graphNode.setContainer(ssNode);
    ssNode.addContained(graphNode);

    // create a use case node here.
    node = new UseCaseNode(graphNode, properties);

    // change the node and test it.
    for (int i = 0; i < LOOPTIMES; i++) {
      int width = 40 + i;
      int height = 80 + i;
      graphNode.setSize(StressTestHelper.createDimension(width, height));

      int x = 10 + i;
      int y = 20 + i;
      graphNode.setPosition(StressTestHelper.createPoint(x, y));

      // notify the node change here.
      node.notifyGraphNodeChange("node changed.");

      // check the Node here.

      // get the location to test.
      assertEquals("The notifyGraphNodeChange method is incorrect.", 105 + i, node.getLocation().x);
      assertEquals("The notifyGraphNodeChange method is incorrect.", 215 + i, node.getLocation().y);
    }
  }