Search in sources :

Example 31 with IProperty

use of com.archimatetool.model.IProperty in project archi by archimatetool.

the class TextRendererTests method render_PropertyKey_Indirection.

// ============================= Property Expression Tests =========================================
@Test
public void render_PropertyKey_Indirection() {
    IDiagramModelArchimateObject dmo = createDiagramModelObject();
    addProperty(dmo.getArchimateConcept(), "en", "English");
    addProperty(dmo.getArchimateConcept(), "fr", "French");
    IProperty property = TextRendererTests.addProperty(dmo.getArchimateModel(), "lang", "en");
    assertEquals("English", textRenderer.renderWithExpression(dmo, "${property:$model{property:lang}}"));
    property.setValue("fr");
    assertEquals("French", textRenderer.renderWithExpression(dmo, "${property:$model{property:lang}}"));
    assertEquals("French French", textRenderer.renderWithExpression(dmo, "${property:$model{property:lang}} ${property:$model{property:lang}}"));
}
Also used : IProperty(com.archimatetool.model.IProperty) IDiagramModelArchimateObject(com.archimatetool.model.IDiagramModelArchimateObject) Test(org.junit.Test)

Example 32 with IProperty

use of com.archimatetool.model.IProperty in project archi by archimatetool.

the class ArchimateFactoryTests method createProperty_WithParamaters.

@Test
public void createProperty_WithParamaters() {
    IProperty p = IArchimateFactory.eINSTANCE.createProperty("key", "value");
    assertNotNull(p);
    assertEquals("key", p.getKey());
    assertEquals("value", p.getValue());
}
Also used : IProperty(com.archimatetool.model.IProperty) Test(org.junit.Test)

Aggregations

IProperty (com.archimatetool.model.IProperty)32 EObject (org.eclipse.emf.ecore.EObject)10 Test (org.junit.Test)9 IArchimateElement (com.archimatetool.model.IArchimateElement)5 IProperties (com.archimatetool.model.IProperties)5 IArchimateModel (com.archimatetool.model.IArchimateModel)4 IArchimateModelObject (com.archimatetool.model.IArchimateModelObject)4 CompoundCommand (org.eclipse.gef.commands.CompoundCommand)4 Point (org.eclipse.swt.graphics.Point)4 HashSet (java.util.HashSet)3 Matcher (java.util.regex.Matcher)3 EObjectNonNotifyingCompoundCommand (com.archimatetool.editor.model.commands.EObjectNonNotifyingCompoundCommand)2 IArchimateConcept (com.archimatetool.model.IArchimateConcept)2 Command (org.eclipse.gef.commands.Command)2 ISelection (org.eclipse.jface.viewers.ISelection)2 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)2 Element (org.jdom2.Element)2 CSVParseException (com.archimatetool.csv.CSVParseException)1 EObjectFeatureCommand (com.archimatetool.editor.model.commands.EObjectFeatureCommand)1 IPreferenceConstants (com.archimatetool.editor.preferences.IPreferenceConstants)1