/** * Tests AssociationCompartmentExtractor#extractFirstAssociationEnd() for accuracy. * * <p>Verify : ExtractFirstAssociationEnd is correct. * * @throws Exception to JUnit */ public void testExtractFirstAssociationEnd() throws Exception { GraphElement expectedElement = (GraphElement) edge.getContaineds().get(0); assertSame( "The First Association End compartment should be extracted correctly.", expectedElement, extractor.extractFirstAssociationEnd()); }
/** * Tests AssociationCompartmentExtractor#updateFirstAssociationEnd(GraphElement) for accuracy. * * <p>Verify : UpdateFirstAssociationEnd is correct. * * @throws Exception to JUnit */ public void testUpdateFirstAssociationEnd() throws Exception { GraphElement newElement = getAssociationEndNodeForUpdate(); extractor.updateFirstAssociationEnd(newElement); assertSame( "The Second Association End compartment should be updated.", newElement, extractor.extractFirstAssociationEnd()); }
/** * Tests AssociationCompartmentExtractor#extractFirstAssociationEnd() for failure. * * <p>Expects CompartmentNotFoundException. * * @throws Exception to JUnit */ public void testExtractFirstAssociationEnd_CompartmentNotFoundException() throws Exception { edge.clearContaineds(); try { extractor.extractFirstAssociationEnd(); fail("CompartmentNotFoundException expected."); } catch (CompartmentNotFoundException e) { // good } }
/** * Tests AssociationCompartmentExtractor#extractFirstAssociationEnd() for failure. * * <p>Expects CompartmentMalformedException. * * @throws Exception to JUnit */ public void testExtractFirstAssociationEnd_CompartmentMalformedException() throws Exception { GraphElement element = (GraphElement) edge.getContaineds().get(0); element.setSemanticModel(TestHelper.createSimpleSemanticModel("Invalid")); try { extractor.extractFirstAssociationEnd(); fail("CompartmentMalformedException expected."); } catch (CompartmentMalformedException e) { // good } }