Search in sources :

Example 6 with ArchimateTestModel

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

the class DiagramModelUtilsNestedRelationsTests method runOnceBeforeAllTests.

/*

    dm
     |-- dmo1 (element1)
     |     |-- dmo2 (element2)
     |
     |-- dmo3 (element1)
           |-- dmo4  (element2)
                |-- dmo5  (element3)

     */
@Before
public void runOnceBeforeAllTests() {
    tm = new ArchimateTestModel();
    model = tm.createNewModel();
    dm = model.getDefaultDiagramModel();
    // Elements
    element1 = IArchimateFactory.eINSTANCE.createBusinessActor();
    element2 = IArchimateFactory.eINSTANCE.createBusinessActor();
    element3 = IArchimateFactory.eINSTANCE.createBusinessActor();
    // A nested type relationship
    relationship1 = IArchimateFactory.eINSTANCE.createCompositionRelationship();
    relationship1.setSource(element1);
    relationship1.setTarget(element2);
    model.getArchimateModel().getFolder(FolderType.RELATIONS).getElements().add(relationship1);
    // A non-nested type relationship
    relationship2 = IArchimateFactory.eINSTANCE.createAssociationRelationship();
    relationship2.setSource(element2);
    relationship2.setTarget(element3);
    model.getArchimateModel().getFolder(FolderType.RELATIONS).getElements().add(relationship2);
    // Add some objects to the diagram
    dmo1 = tm.createDiagramModelArchimateObjectAndAddToModel(element1);
    dm.getChildren().add(dmo1);
    dmo2 = tm.createDiagramModelArchimateObjectAndAddToModel(element2);
    dmo1.getChildren().add(dmo2);
    dmo3 = tm.createDiagramModelArchimateObjectAndAddToModel(element1);
    dm.getChildren().add(dmo3);
    dmo4 = tm.createDiagramModelArchimateObjectAndAddToModel(element2);
    dmo3.getChildren().add(dmo4);
    dmo5 = tm.createDiagramModelArchimateObjectAndAddToModel(element3);
    dmo4.getChildren().add(dmo5);
}
Also used : ArchimateTestModel(com.archimatetool.testingtools.ArchimateTestModel) Before(org.junit.Before)

Example 7 with ArchimateTestModel

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

the class IArchiveManagerTests method testFactory_createArchiveManager.

@Test
public void testFactory_createArchiveManager() throws IOException {
    ArchimateTestModel tm = new ArchimateTestModel(TestData.TEST_MODEL_FILE_ARCHISURANCE);
    IArchimateModel model = tm.loadModel();
    IArchiveManager archiveManager = IArchiveManager.FACTORY.createArchiveManager(model);
    assertNotNull(archiveManager);
}
Also used : IArchimateModel(com.archimatetool.model.IArchimateModel) ArchimateTestModel(com.archimatetool.testingtools.ArchimateTestModel) Test(org.junit.Test)

Example 8 with ArchimateTestModel

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

the class ModelCheckerTests method runBeforeEachTest.

@Before
public void runBeforeEachTest() {
    tm = new ArchimateTestModel();
    model = tm.createNewModel();
    modelChecker = new ModelChecker(model);
}
Also used : ArchimateTestModel(com.archimatetool.testingtools.ArchimateTestModel) Before(org.junit.Before)

Example 9 with ArchimateTestModel

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

the class ArchiveManagerTests method runBeforeEachTest.

@Before
public void runBeforeEachTest() {
    tm = new ArchimateTestModel();
    model = tm.createNewModel();
    dm = model.getDefaultDiagramModel();
    archiveManager = (ArchiveManager) model.getAdapter(IArchiveManager.class);
}
Also used : ArchimateTestModel(com.archimatetool.testingtools.ArchimateTestModel) Before(org.junit.Before)

Example 10 with ArchimateTestModel

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

the class DiagramUtilsTests method runOnceBeforeAllTests.

@BeforeClass
public static void runOnceBeforeAllTests() throws IOException {
    tm = new ArchimateTestModel(TestSupport.TEST_MODEL_FILE_1);
    model = tm.loadModel();
}
Also used : ArchimateTestModel(com.archimatetool.testingtools.ArchimateTestModel) BeforeClass(org.junit.BeforeClass)

Aggregations

ArchimateTestModel (com.archimatetool.testingtools.ArchimateTestModel)33 Test (org.junit.Test)14 IArchimateModel (com.archimatetool.model.IArchimateModel)13 BeforeClass (org.junit.BeforeClass)11 IArchimateElement (com.archimatetool.model.IArchimateElement)8 IArchimateRelationship (com.archimatetool.model.IArchimateRelationship)6 IDiagramModelArchimateObject (com.archimatetool.model.IDiagramModelArchimateObject)6 Before (org.junit.Before)6 IDiagramModelArchimateConnection (com.archimatetool.model.IDiagramModelArchimateConnection)5 File (java.io.File)4 IDiagramModel (com.archimatetool.model.IDiagramModel)3 IDiagramModelObject (com.archimatetool.model.IDiagramModelObject)3 ArchimateTestEditor (com.archimatetool.testingtools.ArchimateTestEditor)3 ArrayList (java.util.ArrayList)3 IIssue (com.archimatetool.hammer.validation.issues.IIssue)2 IArchimateDiagramModel (com.archimatetool.model.IArchimateDiagramModel)2 IAssignmentRelationship (com.archimatetool.model.IAssignmentRelationship)2 IDiagramModelConnection (com.archimatetool.model.IDiagramModelConnection)2 DuplicateCommandHandler (com.archimatetool.editor.views.tree.commands.DuplicateCommandHandler)1 NewMapViewCommand (com.archimatetool.help.cheatsheets.CreateMapViewCheatSheetAction.NewMapViewCommand)1