* - * PLEASE NOTE - THIS IS THE VERSION OF THE INTERNAL MODEL, NOT ARCHI. + * PLEASE NOTE - THIS IS THE VERSION OF THE MODEL, NOT ARCHI. + * As from Archi version 2.6.0 I will try to keep the model version number the same as Archi's version number when the model version is incremented. * Only need to change the model version number if there are changes that affect backwards compatibility.
- *
- * History: * - * 1.0.0 - Archi versions 0.7 - 1.2.0 the version number was not saved to the XMI file + * History:* @author Phillip Beauvoir */ public interface ModelVersion { - String VERSION = "5.0.1"; //$NON-NLS-1$ + String VERSION = "5.0.0"; //$NON-NLS-1$ } diff --git a/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/AbstractGraphicalObjectUIProviderTests.java b/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/AbstractGraphicalObjectUIProviderTests.java index 289202a17..7cdd0bfea 100644 --- a/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/AbstractGraphicalObjectUIProviderTests.java +++ b/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/AbstractGraphicalObjectUIProviderTests.java @@ -12,6 +12,7 @@ import org.eclipse.swt.graphics.Color; import com.archimatetool.editor.ParamsTest; +import com.archimatetool.model.IDiagramModelObject; import com.archimatetool.model.ITextAlignment; import com.archimatetool.model.ITextPosition; @@ -46,4 +47,11 @@ public void testGetDefaultTextPosition(IGraphicalObjectUIProvider provider) { assertEquals(ITextPosition.TEXT_POSITION_TOP, provider.getDefaultTextPosition()); } + @Override + @ParamsTest + public void testGetDefaultFeatureValue(IObjectUIProvider provider) { + super.testGetDefaultFeatureValue(provider); + assertEquals(IDiagramModelObject.LINE_STYLE_SOLID, provider.getDefaultFeatureValue(IDiagramModelObject.FEATURE_LINE_STYLE)); + } + } diff --git a/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/AbstractObjectUIProviderTests.java b/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/AbstractObjectUIProviderTests.java index c07914baf..b686c8854 100644 --- a/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/AbstractObjectUIProviderTests.java +++ b/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/AbstractObjectUIProviderTests.java @@ -7,6 +7,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import org.eclipse.emf.ecore.EClass; @@ -82,7 +83,16 @@ public void testShouldExposeFeature(IObjectUIProvider provider) { assertTrue(provider.shouldExposeFeature((String)null)); } + @ParamsTest + public void testGetDefaultFeatureValue(IObjectUIProvider provider) { + assertNull(provider.getDefaultFeatureValue((String)null)); + } + @ParamsTest + public void testGetFeatureValue(IObjectUIProvider provider) { + assertNull(provider.getFeatureValue((String)null)); + } + protected EObject createInstanceForExpectedClass(EClass expectedClass) { return expectedClass.getEPackage().getEFactoryInstance().create(expectedClass); } diff --git a/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/AllArchiMateElementUIProviderTests.java b/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/AllArchiMateElementUIProviderTests.java index d8777aace..df91ec957 100644 --- a/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/AllArchiMateElementUIProviderTests.java +++ b/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/AllArchiMateElementUIProviderTests.java @@ -78,7 +78,11 @@ import com.archimatetool.editor.ui.factory.elements.ValueStreamUIProvider; import com.archimatetool.editor.ui.factory.elements.ValueUIProvider; import com.archimatetool.editor.ui.factory.elements.WorkPackageUIProvider; +import com.archimatetool.model.IArchimateElement; +import com.archimatetool.model.IArchimateFactory; import com.archimatetool.model.IArchimatePackage; +import com.archimatetool.model.IDiagramModelArchimateObject; +import com.archimatetool.model.IDiagramModelObject; import com.archimatetool.model.ITextAlignment; public class AllArchiMateElementUIProviderTests extends AbstractGraphicalObjectUIProviderTests { @@ -213,4 +217,32 @@ public void testGetDefaultTextAlignment(IGraphicalObjectUIProvider provider) { super.testGetDefaultTextAlignment(provider); } } + + @Override + @ParamsTest + public void testGetDefaultFeatureValue(IObjectUIProvider provider) { + if(provider instanceof GroupingUIProvider) { + assertEquals(IDiagramModelObject.LINE_STYLE_DASHED, provider.getDefaultFeatureValue(IDiagramModelObject.FEATURE_LINE_STYLE)); + } + else { + super.testGetDefaultFeatureValue(provider); + } + } + + @Override + @ParamsTest + public void testGetFeatureValue(IObjectUIProvider provider) { + super.testGetFeatureValue(provider); + + IDiagramModelArchimateObject dmo = IArchimateFactory.eINSTANCE.createDiagramModelArchimateObject(); + dmo.setArchimateElement((IArchimateElement)IArchimateFactory.eINSTANCE.create(provider.providerFor())); + ((AbstractObjectUIProvider)provider).setInstance(dmo); + + if(provider instanceof GroupingUIProvider) { + assertEquals(IDiagramModelObject.LINE_STYLE_DASHED, provider.getFeatureValue(IDiagramModelObject.FEATURE_LINE_STYLE)); + } + else { + assertEquals(IDiagramModelObject.LINE_STYLE_SOLID, provider.getFeatureValue(IDiagramModelObject.FEATURE_LINE_STYLE)); + } + } } diff --git a/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/DiagramModelImageUIProviderTests.java b/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/DiagramModelImageUIProviderTests.java index 6ac94d85a..a8095c9ae 100644 --- a/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/DiagramModelImageUIProviderTests.java +++ b/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/DiagramModelImageUIProviderTests.java @@ -18,7 +18,10 @@ import com.archimatetool.editor.ParamsTest; import com.archimatetool.editor.diagram.editparts.diagram.DiagramImageEditPart; import com.archimatetool.editor.ui.factory.diagram.DiagramImageUIProvider; +import com.archimatetool.model.IArchimateFactory; import com.archimatetool.model.IArchimatePackage; +import com.archimatetool.model.IDiagramModelImage; +import com.archimatetool.model.IDiagramModelObject; public class DiagramModelImageUIProviderTests extends AbstractGraphicalObjectUIProviderTests { @@ -47,4 +50,15 @@ public void testShouldExposeFeature(IObjectUIProvider provider) { assertTrue(provider.shouldExposeFeature(IArchimatePackage.Literals.BORDER_OBJECT__BORDER_COLOR.getName())); assertFalse(provider.shouldExposeFeature((String)null)); } + + @Override + @ParamsTest + public void testGetFeatureValue(IObjectUIProvider provider) { + super.testGetFeatureValue(provider); + IDiagramModelImage dmi = IArchimateFactory.eINSTANCE.createDiagramModelImage(); + ((AbstractObjectUIProvider)provider).setInstance(dmi); + + assertEquals(IDiagramModelObject.LINE_STYLE_SOLID, provider.getFeatureValue(IDiagramModelObject.FEATURE_LINE_STYLE)); + } + } diff --git a/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/DiagramModelReferenceUIProviderTests.java b/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/DiagramModelReferenceUIProviderTests.java index ae7d6b7aa..e459fb7b8 100644 --- a/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/DiagramModelReferenceUIProviderTests.java +++ b/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/DiagramModelReferenceUIProviderTests.java @@ -23,6 +23,7 @@ import com.archimatetool.editor.ui.factory.diagram.DiagramModelReferenceUIProvider; import com.archimatetool.model.IArchimateFactory; import com.archimatetool.model.IArchimatePackage; +import com.archimatetool.model.IDiagramModelObject; import com.archimatetool.model.IDiagramModelReference; public class DiagramModelReferenceUIProviderTests extends AbstractGraphicalObjectUIProviderTests { @@ -73,4 +74,13 @@ public void testHasIcon(IGraphicalObjectUIProvider provider) { assertTrue(provider.hasIcon()); } + @Override + @ParamsTest + public void testGetFeatureValue(IObjectUIProvider provider) { + super.testGetFeatureValue(provider); + IDiagramModelReference ref = IArchimateFactory.eINSTANCE.createDiagramModelReference(); + ((AbstractObjectUIProvider)provider).setInstance(ref); + + assertEquals(IDiagramModelObject.LINE_STYLE_SOLID, provider.getFeatureValue(IDiagramModelObject.FEATURE_LINE_STYLE)); + } } diff --git a/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/GroupUIProviderTests.java b/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/GroupUIProviderTests.java index a9660462c..ada21869b 100644 --- a/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/GroupUIProviderTests.java +++ b/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/GroupUIProviderTests.java @@ -18,7 +18,10 @@ import com.archimatetool.editor.ParamsTest; import com.archimatetool.editor.diagram.editparts.diagram.GroupEditPart; import com.archimatetool.editor.ui.factory.diagram.GroupUIProvider; +import com.archimatetool.model.IArchimateFactory; import com.archimatetool.model.IArchimatePackage; +import com.archimatetool.model.IDiagramModelGroup; +import com.archimatetool.model.IDiagramModelObject; import com.archimatetool.model.ITextAlignment; public class GroupUIProviderTests extends AbstractGraphicalObjectUIProviderTests { @@ -61,4 +64,14 @@ public void testGetDefaultTextAlignment(IGraphicalObjectUIProvider provider) { assertEquals(ITextAlignment.TEXT_ALIGNMENT_LEFT, provider.getDefaultTextAlignment()); } + @Override + @ParamsTest + public void testGetFeatureValue(IObjectUIProvider provider) { + super.testGetFeatureValue(provider); + IDiagramModelGroup group = IArchimateFactory.eINSTANCE.createDiagramModelGroup(); + ((AbstractObjectUIProvider)provider).setInstance(group); + + assertEquals(IDiagramModelObject.LINE_STYLE_SOLID, provider.getFeatureValue(IDiagramModelObject.FEATURE_LINE_STYLE)); + } + } diff --git a/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/NoteUIProviderTests.java b/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/NoteUIProviderTests.java index 63345ad13..9428407d8 100644 --- a/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/NoteUIProviderTests.java +++ b/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/NoteUIProviderTests.java @@ -17,7 +17,10 @@ import com.archimatetool.editor.ParamsTest; import com.archimatetool.editor.diagram.editparts.diagram.NoteEditPart; import com.archimatetool.editor.ui.factory.diagram.NoteUIProvider; +import com.archimatetool.model.IArchimateFactory; import com.archimatetool.model.IArchimatePackage; +import com.archimatetool.model.IDiagramModelNote; +import com.archimatetool.model.IDiagramModelObject; import com.archimatetool.model.ITextAlignment; public class NoteUIProviderTests extends AbstractGraphicalObjectUIProviderTests { @@ -46,4 +49,14 @@ public void testGetDefaultSize(IGraphicalObjectUIProvider provider) { public void testGetDefaultTextAlignment(IGraphicalObjectUIProvider provider) { assertEquals(ITextAlignment.TEXT_ALIGNMENT_LEFT, provider.getDefaultTextAlignment()); } + + @Override + @ParamsTest + public void testGetFeatureValue(IObjectUIProvider provider) { + super.testGetFeatureValue(provider); + IDiagramModelNote note = IArchimateFactory.eINSTANCE.createDiagramModelNote(); + ((AbstractObjectUIProvider)provider).setInstance(note); + + assertEquals(IDiagramModelObject.LINE_STYLE_SOLID, provider.getFeatureValue(IDiagramModelObject.FEATURE_LINE_STYLE)); + } } diff --git a/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/SketchStickyUIProviderTests.java b/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/SketchStickyUIProviderTests.java index 3509c4d9f..fe0b7a1a4 100644 --- a/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/SketchStickyUIProviderTests.java +++ b/tests/com.archimatetool.editor.tests/src/com/archimatetool/editor/ui/factory/SketchStickyUIProviderTests.java @@ -17,7 +17,10 @@ import com.archimatetool.editor.ParamsTest; import com.archimatetool.editor.diagram.sketch.editparts.StickyEditPart; import com.archimatetool.editor.ui.factory.sketch.SketchStickyUIProvider; +import com.archimatetool.model.IArchimateFactory; import com.archimatetool.model.IArchimatePackage; +import com.archimatetool.model.IDiagramModelObject; +import com.archimatetool.model.ISketchModelSticky; import com.archimatetool.model.ITextAlignment; public class SketchStickyUIProviderTests extends AbstractGraphicalObjectUIProviderTests { @@ -46,4 +49,14 @@ public void testGetDefaultSize(IGraphicalObjectUIProvider provider) { public void testGetDefaultTextAlignment(IGraphicalObjectUIProvider provider) { assertEquals(ITextAlignment.TEXT_ALIGNMENT_LEFT, provider.getDefaultTextAlignment()); } + + @Override + @ParamsTest + public void testGetFeatureValue(IObjectUIProvider provider) { + super.testGetFeatureValue(provider); + ISketchModelSticky sticky = IArchimateFactory.eINSTANCE.createSketchModelSticky(); + ((AbstractObjectUIProvider)provider).setInstance(sticky); + + assertEquals(IDiagramModelObject.LINE_STYLE_SOLID, provider.getFeatureValue(IDiagramModelObject.FEATURE_LINE_STYLE)); + } } diff --git a/tests/com.archimatetool.model.tests/src/com/archimatetool/model/impl/DiagramModelObjectTests.java b/tests/com.archimatetool.model.tests/src/com/archimatetool/model/impl/DiagramModelObjectTests.java index 3aed579c7..8791c845b 100644 --- a/tests/com.archimatetool.model.tests/src/com/archimatetool/model/impl/DiagramModelObjectTests.java +++ b/tests/com.archimatetool.model.tests/src/com/archimatetool/model/impl/DiagramModelObjectTests.java @@ -161,9 +161,9 @@ public void testGetLineColor() { @Test public void testGetLineStyle() { - assertEquals(0, object.getLineStyle()); - object.setLineStyle(1); - assertEquals(1, object.getLineStyle()); + assertEquals(IDiagramModelObject.LINE_STYLE_DEFAULT, object.getLineStyle()); + object.setLineStyle(IDiagramModelObject.LINE_STYLE_SOLID); + assertEquals(IDiagramModelObject.LINE_STYLE_SOLID, object.getLineStyle()); } @Test
+ * + * 1.0.0 - Archi versions 0.7 - 1.2.0 the version number was not saved to the XMI file
* 1.1.0 - Archi version 1.3.0 introduced sub-folders which are not backwards-compatible * 1.1.1 - Archi version 1.4.0 added sub-folders in the Views folder which are not backwards-compatible * 1.2.0 - Archi version 1.5.0 added the Sketch View which is not backwards-compatible, and text alignment attribute @@ -50,11 +51,9 @@ * - Add images to IDiagramModelArchimateObject * - Refactor IDiagramModelImageProvider, IIconic and more... * 5.0.0 - ArchiMate 3.2 - * 5.0.1 - Line styles on diagram objects. Grouping figure has to be set to dashed lines. * - *