/**
   * 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#updateSecondAssociationEnd(GraphElement) for accuracy.
   *
   * <p>Verify : UpdateSecondAssociationEnd is correct.
   *
   * @throws Exception to JUnit
   */
  public void testUpdateSecondAssociationEnd() throws Exception {
    GraphElement newElement = getAssociationEndNodeForUpdate();

    extractor.updateSecondAssociationEnd(newElement);

    assertSame(
        "The Second Association End compartment should be updated.",
        newElement,
        extractor.extractSecondAssociationEnd());
  }
  /**
   * 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#updateSecondAssociationEnd(GraphElement) for failure.
  *
  * <p>It tests the case that when newElement is invalid and expects IllegalArgumentException.
  *
  * @throws Exception to JUnit
  */
 public void testUpdateSecondAssociationEnd_InvalidNewElement() throws Exception {
   try {
     extractor.updateSecondAssociationEnd(getNameNodeForUpdate());
     fail("CompartmentMalformedException expected.");
   } catch (CompartmentMalformedException e) {
     // good
   }
 }
 /**
  * Tests AssociationCompartmentExtractor#updateSecondAssociationEnd(GraphElement) for failure.
  *
  * <p>It tests the case that when newElement is null and expects IllegalArgumentException.
  *
  * @throws Exception to JUnit
  */
 public void testUpdateSecondAssociationEnd_NullNewElement() throws Exception {
   try {
     extractor.updateSecondAssociationEnd(null);
     fail("IllegalArgumentException expected.");
   } catch (IllegalArgumentException iae) {
     // good
   }
 }
  /**
   * Tests AssociationCompartmentExtractor#extractSecondAssociationEnd() for accuracy.
   *
   * <p>Verify : ExtractSecondAssociationEnd is correct.
   *
   * @throws Exception to JUnit
   */
  public void testExtractSecondAssociationEnd() throws Exception {
    GraphElement expectedElement = (GraphElement) edge.getContaineds().get(1);

    assertSame(
        "The Second Association End compartment should be extracted correctly.",
        expectedElement,
        extractor.extractSecondAssociationEnd());
  }
 /**
  * Tests AssociationCompartmentExtractor#updateStereotype(GraphElement) for failure.
  *
  * <p>It tests the case that when newElement is null and expects IllegalArgumentException.
  *
  * @throws Exception to JUnit
  */
 public void testUpdateStereotype_NullNewElement() throws Exception {
   try {
     extractor.updateStereotype(null);
     fail("IllegalArgumentException expected.");
   } catch (IllegalArgumentException iae) {
     // good
   }
 }
  /**
   * Tests AssociationCompartmentExtractor#updateSecondAssociationEnd(GraphElement) for failure.
   *
   * <p>Expects CompartmentNotFoundException.
   *
   * @throws Exception to JUnit
   */
  public void testUpdateSecondAssociationEnd_CompartmentNotFoundException() throws Exception {
    edge.clearContaineds();

    try {
      extractor.updateSecondAssociationEnd(getAssociationEndNodeForUpdate());
      fail("CompartmentNotFoundException expected.");
    } catch (CompartmentNotFoundException e) {
      // good
    }
  }
  /**
   * Tests AssociationCompartmentExtractor#extractSecondAssociationEnd() for failure.
   *
   * <p>Expects CompartmentNotFoundException.
   *
   * @throws Exception to JUnit
   */
  public void testExtractSecondAssociationEnd_CompartmentNotFoundException() throws Exception {
    edge.clearContaineds();

    try {
      extractor.extractSecondAssociationEnd();
      fail("CompartmentNotFoundException expected.");
    } catch (CompartmentNotFoundException e) {
      // good
    }
  }
  /**
   * Tests AssociationCompartmentExtractor#updateStereotype(GraphElement) for failure.
   *
   * <p>Expects CompartmentNotFoundException.
   *
   * @throws Exception to JUnit
   */
  public void testUpdateStereotype_CompartmentNotFoundException() throws Exception {
    edge.clearContaineds();

    try {
      extractor.updateStereotype(getStereotypeNodeForUpdate());
      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
    }
  }
  /**
   * Tests AssociationCompartmentExtractor#updateSecondAssociationEnd(GraphElement) for failure.
   *
   * <p>Expects CompartmentMalformedException.
   *
   * @throws Exception to JUnit
   */
  public void testUpdateSecondAssociationEnd_CompartmentMalformedException() throws Exception {
    GraphElement element = (GraphElement) edge.getContaineds().get(1);
    element.setSemanticModel(TestHelper.createSimpleSemanticModel("Invalid"));

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