Source:
private void testCustomDash(EditPart editPart) { IFigure primaryShape = ((IPapyrusEditPart) editPart).getPrimaryShape(); Assert.assertTrue("The Figure must implement IRoundedRectangleFigure", primaryShape instanceof IRoundedRectangleFigure); int[] defaultCustomDash = ((PapyrusNodeFigure) primaryShape).getCustomDash(); List<Integer> defaultCustomDashList = new ArrayList<Integer>(); for (int index = 0; index < defaultCustomDash.length; index++) { defaultCustomDashList.add(defaultCustomDash[index]); } int[] customDashForTest = { 10, 20, 30 }; List<String> customDashForTestList = new ArrayList<String>(); customDashForTestList.add("" + customDashForTest[0]); customDashForTestList.add("" + customDashForTest[1]); customDashForTestList.add("" + customDashForTest[2]); getCommandStack() .execute(new CustomStyleValueCommand((View) editPart.getModel(), customDashForTestList, NotationPackage.eINSTANCE.getStringListValueStyle(), NotationPackage.eINSTANCE.getStringListValueStyle_StringListValue(), NamedStyleProperties.LINE_CUSTOM_VALUE)); Assert.assertArrayEquals("custom dash not well set on IRoundedRectangleFigure", customDashForTest, ((PapyrusNodeFigure) primaryShape).getCustomDash()); getCommandStack().undo(); Assert.assertArrayEquals("custom dash not well undo on IRoundedRectangleFigure", defaultCustomDash, ((PapyrusNodeFigure) primaryShape).getCustomDash()); getCommandStack().redo(); Assert.assertArrayEquals("custom dash not well redo on IRoundedRectangleFigure", customDashForTest, ((PapyrusNodeFigure) primaryShape).getCustomDash()); getCommandStack().undo(); }

Target:
private void testCustomDash(EditPart editPart) { IFigure primaryShape = ((IPapyrusEditPart) editPart).getPrimaryShape(); Assert.assertTrue("The Figure must implement IRoundedRectangleFigure", primaryShape instanceof IRoundedRectangleFigure); int[] defaultCustomDash = ((PapyrusNodeFigure) primaryShape).getCustomDash(); List<Integer> defaultCustomDashList = new ArrayList<Integer>(); for (int index = 0; index < defaultCustomDash.length; index++) { defaultCustomDashList.add(defaultCustomDash[index]); } int[] customDashForTest = { 10, 20, 30 }; List<String> customDashForTestList = new ArrayList<String>(3); customDashForTestList.add(Integer.toString(customDashForTest[0])); customDashForTestList.add(Integer.toString(customDashForTest[1])); customDashForTestList.add(Integer.toString(customDashForTest[2])); getCommandStack() .execute(new CustomStyleValueCommand((View) editPart.getModel(), customDashForTestList, NotationPackage.eINSTANCE.getStringListValueStyle(), NotationPackage.eINSTANCE.getStringListValueStyle_StringListValue(), NamedStyleProperties.LINE_CUSTOM_VALUE)); Assert.assertArrayEquals("custom dash not well set on IRoundedRectangleFigure", customDashForTest, ((PapyrusNodeFigure) primaryShape).getCustomDash()); getCommandStack().undo(); Assert.assertArrayEquals("custom dash not well undo on IRoundedRectangleFigure", defaultCustomDash, ((PapyrusNodeFigure) primaryShape).getCustomDash()); getCommandStack().redo(); Assert.assertArrayEquals("custom dash not well redo on IRoundedRectangleFigure", customDashForTest, ((PapyrusNodeFigure) primaryShape).getCustomDash()); getCommandStack().undo(); }