Search in sources :

Example 16 with MappingModel

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

the class LWM2MMappingParseTest method parseEnumMapping.

@Test
public void parseEnumMapping() throws IOException {
    MappingModel mappingModel = this.createMappingModel("LWM2MResourceEnum.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 17 with MappingModel

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

the class LWM2MMappingParseTest method parseInformationModelMapping.

@Test
public void parseInformationModelMapping() throws IOException {
    MappingModel mappingModel = createMappingModel("LWM2MObjectType.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 18 with MappingModel

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

the class MappingModelSyntaxTest method parseMappingWithFunctionBlockProperty.

@Test
public void parseMappingWithFunctionBlockProperty() throws IOException {
    MappingModel mappingModel = createMappingModel("fb/FunctionBlock_Property.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)

Example 19 with MappingModel

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

the class MappingModelSyntaxTest method parseMappingWithFunctionBlockReference.

@Test
public void parseMappingWithFunctionBlockReference() throws IOException {
    MappingModel mappingModel = createMappingModel("fb/FunctionBlock_Ref.mapping");
    EList<MappingRule> rules = mappingModel.getRules();
    assertEquals(2, 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 20 with MappingModel

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

the class MappingModelSyntaxTest method parseMappingWithEntityAttribute.

@Test
public void parseMappingWithEntityAttribute() throws IOException {
    MappingModel mappingModel = createMappingModel("type/Entity_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)

Aggregations

MappingModel (org.eclipse.vorto.core.api.model.mapping.MappingModel)27 MappingRule (org.eclipse.vorto.core.api.model.mapping.MappingRule)18 Test (org.junit.Test)15 ZipInputStream (java.util.zip.ZipInputStream)6 ModelId (org.eclipse.vorto.repository.api.ModelId)6 IModelWorkspace (org.eclipse.vorto.server.commons.reader.IModelWorkspace)6 ByteArrayInputStream (java.io.ByteArrayInputStream)5 List (java.util.List)5 Optional (java.util.Optional)5 Collectors (java.util.stream.Collectors)5 InvocationContext (org.eclipse.vorto.codegen.api.InvocationContext)4 FunctionblockModel (org.eclipse.vorto.core.api.model.functionblock.FunctionblockModel)4 InformationModel (org.eclipse.vorto.core.api.model.informationmodel.InformationModel)4 StereoTypeTarget (org.eclipse.vorto.core.api.model.mapping.StereoTypeTarget)4 ModelInfo (org.eclipse.vorto.repository.api.ModelInfo)4 ByteArrayOutputStream (java.io.ByteArrayOutputStream)3 IOException (java.io.IOException)3 ZipEntry (java.util.zip.ZipEntry)3 ZipOutputStream (java.util.zip.ZipOutputStream)3 IOUtils (org.apache.commons.io.IOUtils)3