use of com.archimatetool.model.IArchimateModel in project archi by archimatetool.
the class ModelCompatibilityTests method testIsLaterModelVersion_IsLater.
@Test
public void testIsLaterModelVersion_IsLater() {
createResource(file1);
IArchimateModel model = (IArchimateModel) resource.getContents().get(0);
assertEquals("10.0.0", model.getVersion());
assertTrue(mc.isLaterModelVersion("2.6.1"));
}
use of com.archimatetool.model.IArchimateModel in project archi by archimatetool.
the class ModelCompatibilityTests method testIsLaterModelVersion_IsNotLater.
@Test
public void testIsLaterModelVersion_IsNotLater() {
createResource(file1);
IArchimateModel model = (IArchimateModel) resource.getContents().get(0);
model.setVersion("3.4.1");
assertFalse(mc.isLaterModelVersion("10.0.0"));
model.setVersion("99.9.9");
assertFalse(mc.isLaterModelVersion("99.9.9"));
}
use of com.archimatetool.model.IArchimateModel in project archi by archimatetool.
the class EditorModelManagerTests method createNewModel_IsValid.
@Test
public void createNewModel_IsValid() {
IArchimateModel model = editorModelManager.createNewModel();
assertNotNull(model);
// Has default folders
assertFalse(model.getFolders().isEmpty());
// Has One Default View
// $NON-NLS-1$
assertTrue(model.getFolder(FolderType.DIAGRAMS).getElements().get(0) instanceof IArchimateDiagramModel);
// Has a Command Stack
assertTrue(model.getAdapter(CommandStack.class) instanceof CommandStack);
// Has an Archive Manager
assertTrue(model.getAdapter(IArchiveManager.class) instanceof IArchiveManager);
// Has an ECore Adapter
assertTrue(hasECoreAdapter(model));
}
use of com.archimatetool.model.IArchimateModel in project archi by archimatetool.
the class EditorModelManagerTests method openModel_File_Null.
@Test
public void openModel_File_Null() {
IArchimateModel model = editorModelManager.openModel((File) null);
assertNull(model);
}
use of com.archimatetool.model.IArchimateModel in project archi by archimatetool.
the class EditorModelManagerTests method openModel_File.
@Test
public void openModel_File() {
File file = TestData.TEST_MODEL_FILE_ARCHISURANCE;
IArchimateModel model = editorModelManager.openModel(file);
assertNotNull(model);
// Is registered
assertEquals(1, editorModelManager.getModels().size());
assertTrue(editorModelManager.getModels().contains(model));
// Do it again, should be the same
IArchimateModel model2 = editorModelManager.openModel(file);
assertEquals(model2, model);
// Is not registered twice
editorModelManager.openModel(model);
assertEquals(1, editorModelManager.getModels().size());
}
Aggregations