Source:
public void test_Resize_State_On_Execution() { editor.reveal(LIFELINE_A); arrangeAll(); editor.maximize(); createSyncCall(new Point(getLifelineScreenX(LIFELINE_B), 150), new Point(getLifelineScreenX(LIFELINE_A), 150)); Rectangle firstSyncCall = getExecutionScreenBounds(LIFELINE_A, 0); ExecutionEditPart executionEP = getExecutionEditPart(LIFELINE_A, 0); Rectangle firstExecutionBoundsA = assertExecutionHasValidScreenBounds(LIFELINE_A, 0, new Rectangle(0, 150, 0, 50), false); editor.click(firstExecutionBoundsA.getBottom()); Point expectedTranslation = new Point(0, 200); CheckEditPartResized cR = new CheckEditPartResized(executionEP); editor.drag(firstExecutionBoundsA.getBottom(), firstExecutionBoundsA.getBottom().getCopy().getTranslated(expectedTranslation)); bot.waitUntil(cR); Option<SWTBotGefEditPart> state = createStateWithResult(new Point(getLifelineScreenX(LIFELINE_A), 250)); Rectangle stateBoundsA = assertStateHasValidScreenBounds((StateEditPart) state.get().part(), new Rectangle(0, 250, 0, 30), false); editor.select(state.get()); expectedTranslation = new Point(0, -95); cR = new CheckEditPartResized(state.get()); editor.drag(stateBoundsA.getTop(), stateBoundsA.getTop().getCopy().getTranslated(expectedTranslation)); try { bot.waitUntil(cR); } catch (TimeoutException e) { boolean doesAnErrorOccurs = doesAnErrorOccurs(); if (doesAnErrorOccurs) { Throwable exception = errors.values().iterator().next().getException(); if (exception instanceof ClassCastException) { fail("The resize of the state next to the message m1 caused a ClassCastException"); } } fail(e.getMessage()); } }

Target:
public void test_Resize_State_On_Execution() { editor.reveal(LIFELINE_A); arrangeAll(); editor.maximize(); createSyncCall(new Point(getLifelineScreenX(LIFELINE_B), 150), new Point(getLifelineScreenX(LIFELINE_A), 150)); Rectangle firstSyncCall = getExecutionScreenBounds(LIFELINE_A, 0); ExecutionEditPart executionEP = getExecutionEditPart(LIFELINE_A, 0); Rectangle firstExecutionBoundsA = assertExecutionHasValidScreenBounds(LIFELINE_A, 0, new Rectangle(0, 150, 0, 50), false); editor.click(firstExecutionBoundsA.getBottom()); Point expectedTranslation = new Point(0, 200); CheckEditPartResized cR = new CheckEditPartResized(executionEP); editor.drag(firstExecutionBoundsA.getBottom(), firstExecutionBoundsA.getBottom().getCopy().getTranslated(expectedTranslation)); bot.waitUntil(cR); Option<SWTBotGefEditPart> state = createStateWithResult(new Point(getLifelineScreenX(LIFELINE_A), 250)); Rectangle stateBoundsA = assertStateHasValidScreenBounds((StateEditPart) state.get().part(), new Rectangle(0, 250, 0, 30), false); editor.select(state.get()); expectedTranslation = new Point(0, -95); cR = new CheckEditPartResized(state.get()); editor.drag(stateBoundsA.getTop(), stateBoundsA.getTop().getCopy().getTranslated(expectedTranslation)); try { bot.waitUntil(cR); } catch (TimeoutException e) { boolean doesAnErrorOccurs = doesAnErrorOccurs(); if (doesAnErrorOccurs) { Throwable exception = errors.values().iterator().next().getException(); if (exception instanceof ClassCastException || (exception instanceof SWTException && exception.getCause() instanceof ClassCastException)) { fail("The resize of the state next to the message m1 cause a ClassCastException"); } } fail(e.getMessage()); } }