Search in sources :

Example 1 with ArchimateTestEditor

use of com.archimatetool.testingtools.ArchimateTestEditor in project archi by archimatetool.

the class DiagramEditorFindReplaceProviderTests method runOnceBeforeAllTests.

@BeforeClass
public static void runOnceBeforeAllTests() throws IOException {
    tm = new ArchimateTestModel(new File(TestSupport.getTestDataFolder(), "models/testFindReplace.archimate"));
    model = tm.loadModelWithCommandStack();
    dm = (IArchimateDiagramModel) ArchimateModelUtils.getObjectByID(model, "6a346079");
    editor = new ArchimateTestEditor();
    editor.setDiagramModel(dm);
}
Also used : ArchimateTestEditor(com.archimatetool.testingtools.ArchimateTestEditor) File(java.io.File) ArchimateTestModel(com.archimatetool.testingtools.ArchimateTestModel) BeforeClass(org.junit.BeforeClass)

Example 2 with ArchimateTestEditor

use of com.archimatetool.testingtools.ArchimateTestEditor in project archi by archimatetool.

the class SelectAllActionTests method testSelectAll.

@Test
public void testSelectAll() throws Exception {
    ArchimateTestEditor editor = new ArchimateTestEditor();
    ArchimateTestModel tm = new ArchimateTestModel(TestData.TEST_MODEL_FILE_ARCHISURANCE);
    IArchimateModel model = tm.loadModelWithCommandStack();
    IArchimateDiagramModel dm = (IArchimateDiagramModel) ArchimateModelUtils.getObjectByID(model, "4165");
    editor.setDiagramModel(dm);
    SelectAllAction action = new SelectAllAction(mock(IWorkbenchPart.class));
    Set<GraphicalEditPart> selected = action.getSelectableEditParts(editor.getGraphicalViewer().getContents());
    assertEquals(47, selected.size());
    editor.dispose();
}
Also used : IWorkbenchPart(org.eclipse.ui.IWorkbenchPart) ArchimateTestEditor(com.archimatetool.testingtools.ArchimateTestEditor) IArchimateModel(com.archimatetool.model.IArchimateModel) GraphicalEditPart(org.eclipse.gef.GraphicalEditPart) ArchimateTestModel(com.archimatetool.testingtools.ArchimateTestModel) IArchimateDiagramModel(com.archimatetool.model.IArchimateDiagramModel) Test(org.junit.Test)

Example 3 with ArchimateTestEditor

use of com.archimatetool.testingtools.ArchimateTestEditor in project archi by archimatetool.

the class AbstractDiagramModelObjectFigureTests method runOnceBeforeAllTests.

@BeforeClass
public static void runOnceBeforeAllTests() {
    // Create a new model, get the default DiagramModel and open the test editor
    tm = new ArchimateTestModel();
    model = tm.createNewModel();
    dm = (IArchimateDiagramModel) model.getDefaultDiagramModel();
    editor = new ArchimateTestEditor();
    editor.setDiagramModel(dm);
}
Also used : ArchimateTestEditor(com.archimatetool.testingtools.ArchimateTestEditor) ArchimateTestModel(com.archimatetool.testingtools.ArchimateTestModel) BeforeClass(org.junit.BeforeClass)

Aggregations

ArchimateTestEditor (com.archimatetool.testingtools.ArchimateTestEditor)3 ArchimateTestModel (com.archimatetool.testingtools.ArchimateTestModel)3 BeforeClass (org.junit.BeforeClass)2 IArchimateDiagramModel (com.archimatetool.model.IArchimateDiagramModel)1 IArchimateModel (com.archimatetool.model.IArchimateModel)1 File (java.io.File)1 GraphicalEditPart (org.eclipse.gef.GraphicalEditPart)1 IWorkbenchPart (org.eclipse.ui.IWorkbenchPart)1 Test (org.junit.Test)1