/**
   * Tests AssociationCompartmentExtractor#updateName(GraphElement) for accuracy.
   *
   * <p>Verify : UpdateName is correct.
   *
   * @throws Exception to JUnit
   */
  public void testUpdateName() throws Exception {
    GraphElement newElement = getNameNodeForUpdate();

    extractor.updateName(newElement);

    assertSame("The name compartment should be updated.", newElement, extractor.extractName());
  }
  /**
   * Tests AssociationCompartmentExtractor#extractName() for accuracy.
   *
   * <p>Verify : ExtractName is correct.
   *
   * @throws Exception to JUnit
   */
  public void testExtractName() throws Exception {
    GraphElement element = (GraphElement) edge.getContaineds().get(2);
    element = (GraphElement) element.getContaineds().get(0);

    assertSame(
        "The name compartment should be extracted correctly.", element, extractor.extractName());
  }
  /**
   * Tests AssociationCompartmentExtractor#extractName() for failure.
   *
   * <p>Expects CompartmentNotFoundException.
   *
   * @throws Exception to JUnit
   */
  public void testExtractName_CompartmentNotFoundException() throws Exception {
    edge.clearContaineds();

    try {
      extractor.extractName();
      fail("CompartmentNotFoundException expected.");
    } catch (CompartmentNotFoundException e) {
      // good
    }
  }
  /**
   * Tests AssociationCompartmentExtractor#extractName() for failure.
   *
   * <p>Expects CompartmentMalformedException.
   *
   * @throws Exception to JUnit
   */
  public void testExtractName_CompartmentMalformedException() throws Exception {
    GraphElement element = (GraphElement) edge.getContaineds().get(2);
    element.setSemanticModel(TestHelper.createSimpleSemanticModel("Invalid"));

    try {
      extractor.extractName();
      fail("CompartmentMalformedException expected.");
    } catch (CompartmentMalformedException e) {
      // good
    }
  }