/**
   * Test constructor ClassElementsTransfer(Class), with correct Excpetion instance.
   *
   * @throws Exception if an unexpected exception occurs
   */
  public void testCtorException() throws Exception {
    // create a Exception
    com.topcoder.uml.model.core.classifiers.Class classElement = new ClassImpl();
    Stereotype stereoType = new StereotypeImpl();
    stereoType.setName("Exception");
    classElement.addStereotype(stereoType);

    ClassElementsTransfer classElementsTransfer = new ClassElementsTransfer(classElement);

    assertEquals(
        "Constructor failed, supportedFlavor is not correctly set.",
        ClassElementsTransfer.EXCEPTION_FLAVOR,
        classElementsTransfer.getTransferDataFlavors()[0]);
    assertEquals(
        "Constructor failed, element is not correctly set.",
        classElement,
        classElementsTransfer.getTransferData(ClassElementsTransfer.EXCEPTION_FLAVOR));
  }
  /** Creates the model element for new node. */
  protected void createModelElement() {
    element = new ClassImpl();
    element.setName(name);

    // Obtain the stereotypes from project configuration manager
    Set<Stereotype> newStereotypes = new HashSet<Stereotype>();

    newStereotypes.add(getStandardStereotype("Enum"));

    getMainFrame().getPropertiesPanel().addStereotypes(newStereotypes, element.getClass());
    for (Stereotype stereotype : newStereotypes) {
      element.addStereotype(stereotype);
    }

    NodeContainer nodeContainer = getNodeContainer();
    if (nodeContainer != null) {
      setAddModelElementAction(
          new AddClassAction(
              element, modelManager, (Namespace) DeployHelper.getElement(nodeContainer)));
    } else {
      setAddModelElementAction(new AddClassAction(element, modelManager));
    }
  }