/** * Tests AssociationCompartmentExtractor#updateStereotype(GraphElement) for accuracy. * * <p>Verify : UpdateStereotype is correct. * * @throws Exception to JUnit */ public void testUpdateStereotype() throws Exception { GraphElement newElement = getStereotypeNodeForUpdate(); extractor.updateStereotype(newElement); assertSame( "The stereotype compartment should be updated.", newElement, extractor.extractStereotype()); }
/** * Tests AssociationCompartmentExtractor#extractStereotype() for accuracy. * * <p>Verify : ExtractStereotype is correct. * * @throws Exception to JUnit */ public void testExtractStereotype() throws Exception { GraphElement element = (GraphElement) edge.getContaineds().get(3); assertSame( "The stereotype compartment should be extracted correctly.", element, extractor.extractStereotype()); }
/** * Tests AssociationCompartmentExtractor#extractStereotype() for failure. * * <p>Expects CompartmentNotFoundException. * * @throws Exception to JUnit */ public void testExtractStereotype_CompartmentNotFoundException() throws Exception { edge.clearContaineds(); try { extractor.extractStereotype(); fail("CompartmentNotFoundException expected."); } catch (CompartmentNotFoundException e) { // good } }
/** * Tests AssociationCompartmentExtractor#extractStereotype() for failure. * * <p>Expects CompartmentMalformedException. * * @throws Exception to JUnit */ public void testExtractStereotype_CompartmentMalformedException() throws Exception { GraphElement element = (GraphElement) edge.getContaineds().get(3); element.setSemanticModel(TestHelper.createSimpleSemanticModel("Invalid")); try { extractor.extractStereotype(); fail("CompartmentMalformedException expected."); } catch (CompartmentMalformedException e) { // good } }