Search in sources :

Example 6 with ArchimateDiagramModelFactory

use of com.archimatetool.editor.diagram.ArchimateDiagramModelFactory in project archi by archimatetool.

the class ArchimateDiagramConnectionPolicyTests method testGetConnectionCreateCommand_CreatesArchimateConnectionCommand.

@Test
public void testGetConnectionCreateCommand_CreatesArchimateConnectionCommand() throws Exception {
    setupSourcePolicy(IArchimateFactory.eINSTANCE.createBusinessActor());
    CreateConnectionRequest request = new CreateConnectionRequest();
    request.setFactory(new ArchimateDiagramModelFactory(IArchimatePackage.eINSTANCE.getAssignmentRelationship()));
    Command cmd = sourcePolicy.getConnectionCreateCommand(request);
    assertNotNull(cmd);
    assertTrue(cmd.getClass() == CreateDiagramArchimateConnectionWithDialogCommand.class);
    assertEquals(cmd, request.getStartCommand());
    assertEquals(sourceDiagramObject, TestUtils.getPrivateField(cmd, "fSource"));
}
Also used : CreateDiagramConnectionCommand(com.archimatetool.editor.diagram.commands.CreateDiagramConnectionCommand) CreateDiagramArchimateConnectionWithDialogCommand(com.archimatetool.editor.diagram.commands.CreateDiagramArchimateConnectionWithDialogCommand) Command(org.eclipse.gef.commands.Command) CreateDiagramArchimateConnectionWithDialogCommand(com.archimatetool.editor.diagram.commands.CreateDiagramArchimateConnectionWithDialogCommand) ArchimateDiagramModelFactory(com.archimatetool.editor.diagram.ArchimateDiagramModelFactory) CreateConnectionRequest(org.eclipse.gef.requests.CreateConnectionRequest) Test(org.junit.Test)

Aggregations

ArchimateDiagramModelFactory (com.archimatetool.editor.diagram.ArchimateDiagramModelFactory)6 CreateConnectionRequest (org.eclipse.gef.requests.CreateConnectionRequest)5 CreateDiagramArchimateConnectionWithDialogCommand (com.archimatetool.editor.diagram.commands.CreateDiagramArchimateConnectionWithDialogCommand)4 CreateDiagramConnectionCommand (com.archimatetool.editor.diagram.commands.CreateDiagramConnectionCommand)4 Command (org.eclipse.gef.commands.Command)4 Test (org.junit.Test)4 ICreationFactory (com.archimatetool.editor.diagram.ICreationFactory)1 IArchimateConcept (com.archimatetool.model.IArchimateConcept)1 IArchimateElement (com.archimatetool.model.IArchimateElement)1 IBounds (com.archimatetool.model.IBounds)1 IDiagramModelContainer (com.archimatetool.model.IDiagramModelContainer)1 IDiagramModelGroup (com.archimatetool.model.IDiagramModelGroup)1 IDiagramModelNote (com.archimatetool.model.IDiagramModelNote)1 IDiagramModelObject (com.archimatetool.model.IDiagramModelObject)1 IDiagramModelReference (com.archimatetool.model.IDiagramModelReference)1 EditPart (org.eclipse.gef.EditPart)1 Element (org.jdom2.Element)1 Before (org.junit.Before)1