Package org.openiaml.model.tests.eclipse

Source Code of org.openiaml.model.tests.eclipse.InitializeDiagramTestCase

/**
*
*/
package org.openiaml.model.tests.eclipse;

import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
import org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor;
import org.openiaml.model.model.ModelPackage;

/**
* Emulate right click > initialise diagram.
*
* @author jmwright
*
*/
public class InitializeDiagramTestCase extends EclipseTestCaseHelper {

  /**
   * Tests loading the model file with the editor.
   *
   * @throws Exception
   */
  public void testLoadModel() throws Exception {
    DiagramDocumentEditor editor = initializeAndLoad(
        "shortcuts-root.iaml",
        "src/org/openiaml/model/tests/eclipse/",
        "shortcuts-root.iaml_diagram");
    assertEditorRoot(editor);

    // there should be three children
    assertEditorHasChildren(3, editor);

    // a primitive operation, a frame, and a shortcutted EventTrigger
    assertHasBuiltinOperation(editor, "op", false);
    ShapeNodeEditPart page = assertHasFrame(editor, "page", false);
    assertHasEvent(editor, true, ModelPackage.eINSTANCE.getScope_OnInit());

    // open the domain store
    DiagramDocumentEditor editor_page = openDiagram(page);

    assertEditorFrame(editor_page);

    // close editors
    ((DiagramDocumentEditor) editor_page).close(false);
    ((DiagramDocumentEditor) editor).close(false);
 
  }
 
}
TOP

Related Classes of org.openiaml.model.tests.eclipse.InitializeDiagramTestCase

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.