Search in sources :

Example 6 with MappingRule

use of org.eclipse.vorto.core.api.model.mapping.MappingRule in project vorto by eclipse.

the class LWM2MMappingParseTest method parseEntityMapping.

@Test
public void parseEntityMapping() throws IOException {
    MappingModel mappingModel = this.createMappingModel("LWM2MResourceEntity.mapping");
    EList<MappingRule> rules = mappingModel.getRules();
    assertEquals(4, rules.size());
}
Also used : MappingRule(org.eclipse.vorto.core.api.model.mapping.MappingRule) MappingModel(org.eclipse.vorto.core.api.model.mapping.MappingModel) Test(org.junit.Test)

Example 7 with MappingRule

use of org.eclipse.vorto.core.api.model.mapping.MappingRule in project vorto by eclipse.

the class MappingModelSyntaxTest method parseMappingWithEntityReference.

@Test
public void parseMappingWithEntityReference() throws IOException {
    MappingModel mappingModel = createMappingModel("type/Entity_Ref.mapping");
    EList<MappingRule> rules = mappingModel.getRules();
    assertEquals(1, rules.size());
}
Also used : MappingRule(org.eclipse.vorto.core.api.model.mapping.MappingRule) MappingModel(org.eclipse.vorto.core.api.model.mapping.MappingModel) Test(org.junit.Test)

Example 8 with MappingRule

use of org.eclipse.vorto.core.api.model.mapping.MappingRule in project vorto by eclipse.

the class MappingModelSyntaxTest method parseMappingWithEnumAttribute.

@Test
public void parseMappingWithEnumAttribute() throws IOException {
    MappingModel mappingModel = createMappingModel("type/Enum_Attribute.mapping");
    EList<MappingRule> rules = mappingModel.getRules();
    assertEquals(3, rules.size());
}
Also used : MappingRule(org.eclipse.vorto.core.api.model.mapping.MappingRule) MappingModel(org.eclipse.vorto.core.api.model.mapping.MappingModel) Test(org.junit.Test)

Example 9 with MappingRule

use of org.eclipse.vorto.core.api.model.mapping.MappingRule in project vorto by eclipse.

the class MappingModelSyntaxTest method parseMappingWithEntityProperty.

@Test
public void parseMappingWithEntityProperty() throws IOException {
    MappingModel mappingModel = createMappingModel("type/Entity_Property.mapping");
    EList<MappingRule> rules = mappingModel.getRules();
    assertEquals(1, rules.size());
}
Also used : MappingRule(org.eclipse.vorto.core.api.model.mapping.MappingRule) MappingModel(org.eclipse.vorto.core.api.model.mapping.MappingModel) Test(org.junit.Test)

Example 10 with MappingRule

use of org.eclipse.vorto.core.api.model.mapping.MappingRule in project vorto by eclipse.

the class MappingModelSyntaxTest method parseMappingWithInfoModelAttribute.

@Test
public void parseMappingWithInfoModelAttribute() throws IOException {
    MappingModel mappingModel = createMappingModel("Infomodel_Attribute.mapping");
    EList<MappingRule> rules = mappingModel.getRules();
    assertEquals(6, rules.size());
}
Also used : MappingRule(org.eclipse.vorto.core.api.model.mapping.MappingRule) MappingModel(org.eclipse.vorto.core.api.model.mapping.MappingModel) Test(org.junit.Test)

Aggregations

MappingRule (org.eclipse.vorto.core.api.model.mapping.MappingRule)20 MappingModel (org.eclipse.vorto.core.api.model.mapping.MappingModel)18 Test (org.junit.Test)14 StereoTypeTarget (org.eclipse.vorto.core.api.model.mapping.StereoTypeTarget)6 ModelId (org.eclipse.vorto.repository.api.ModelId)5 ReferenceTarget (org.eclipse.vorto.core.api.model.mapping.ReferenceTarget)3 Optional (java.util.Optional)2 FunctionblockModel (org.eclipse.vorto.core.api.model.functionblock.FunctionblockModel)2 FunctionblockProperty (org.eclipse.vorto.core.api.model.informationmodel.FunctionblockProperty)2 Attribute (org.eclipse.vorto.core.api.model.mapping.Attribute)2 EntityModel (org.eclipse.vorto.repository.api.content.EntityModel)2 Infomodel (org.eclipse.vorto.repository.api.content.Infomodel)2 ModelProperty (org.eclipse.vorto.repository.api.content.ModelProperty)2 List (java.util.List)1 Map (java.util.Map)1 Collectors (java.util.stream.Collectors)1 BooleanPropertyAttribute (org.eclipse.vorto.core.api.model.datatype.BooleanPropertyAttribute)1 Entity (org.eclipse.vorto.core.api.model.datatype.Entity)1 Enum (org.eclipse.vorto.core.api.model.datatype.Enum)1 EnumLiteralPropertyAttribute (org.eclipse.vorto.core.api.model.datatype.EnumLiteralPropertyAttribute)1