Skip to content

Commit

Permalink
Fixes #1059
Browse files Browse the repository at this point in the history
  • Loading branch information
aedelmann committed Sep 29, 2018
1 parent 2922b62 commit cd95fee
Show file tree
Hide file tree
Showing 34 changed files with 69 additions and 72 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Vorto Core (Incubation)
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.vorto.core;singleton:=true
Bundle-Version: 0.10.0.qualifier
Bundle-ClassPath: .
Bundle-Vendor: Eclipse.org/Vorto
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Require-Bundle: org.eclipse.emf.ecore;visibility:=reexport,
org.eclipse.emf.ecore.xmi,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private static class TestMappingSpecification implements IMappingSpecification {

//################# BAROMETER Function Block ####################

FunctionblockModel barometerModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb.Barometer:1.0.0"), ModelType.Functionblock);
FunctionblockModel barometerModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb:Barometer:1.0.0"), ModelType.Functionblock);
barometerModel.setDisplayName("Barometer");
barometerModel.setTargetPlatformKey("blegatt");

Expand Down Expand Up @@ -154,7 +154,7 @@ private static class TestMappingSpecification implements IMappingSpecification {

//################# ACELLEROMETER Function Block ####################

FunctionblockModel accelerometerModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb.Accelerometer:1.0.0"), ModelType.Functionblock);
FunctionblockModel accelerometerModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb:Accelerometer:1.0.0"), ModelType.Functionblock);
accelerometerModel.setDisplayName("Accelerometer");
accelerometerModel.setTargetPlatformKey("blegatt");

Expand Down Expand Up @@ -261,17 +261,17 @@ private static class TestMappingSpecification implements IMappingSpecification {
@Override
public Infomodel getInfoModel() {

Infomodel infomodel = new Infomodel(ModelId.fromPrettyFormat("devices.TiSensorTag:1.0.0"), ModelType.InformationModel);
Infomodel infomodel = new Infomodel(ModelId.fromPrettyFormat("devices:TiSensorTag:1.0.0"), ModelType.InformationModel);
infomodel.setTargetPlatformKey("blegatt");

ModelProperty barometerProperty = new ModelProperty();
barometerProperty.setName("barometer");
barometerProperty.setType(ModelId.fromPrettyFormat("demo.fb.Barometer:1.0.0"));
barometerProperty.setType(ModelId.fromPrettyFormat("demo.fb:Barometer:1.0.0"));
infomodel.getFunctionblocks().add(barometerProperty);

ModelProperty accelerometerProperty = new ModelProperty();
accelerometerProperty.setName("accelerometer");
accelerometerProperty.setType(ModelId.fromPrettyFormat("demo.fb.Accelerometer:1.0.0"));
accelerometerProperty.setType(ModelId.fromPrettyFormat("demo.fb:Accelerometer:1.0.0"));
infomodel.getFunctionblocks().add(accelerometerProperty);

return infomodel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void testMapSimpleOperation() throws Exception {
public void testMapOperationWithParams() throws Exception {
IMappingSpecification mappingSpecification = MappingSpecificationBuilder.create()
// .remoteClient(repository)
.infomodelId("com.bshg.CoffeeMakerCTL636ES1:1.0.0")
.infomodelId("com.bshg:CoffeeMakerCTL636ES1:1.0.0")
.targetPlatformKey("homeconnect").build();
IDataMapper<JsonData> mapper = IDataMapper.newBuilder().withSpecification(mappingSpecification).buildCommandMapper();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,15 +292,15 @@ public void testDittoMappingOnlyOneFeature() throws Exception {

@Test(expected = MappingSpecificationProblem.class)
public void testBuildMappingSpecificationForInvalidModelId() {
MappingSpecificationBuilder.create().infomodelId("devices.PhilipsLivingBloo:1.0.0").targetPlatformKey("button")
MappingSpecificationBuilder.create().infomodelId("devices:PhilipsLivingBloo:1.0.0").targetPlatformKey("button")
.remoteClient(this.getModelRepository()).build();
}

@Ignore
public void testDittoMappingFromRemoteRepository() throws Exception {

IMappingSpecification mappingSpecification = MappingSpecificationBuilder.create()
.infomodelId("devices.aws.button.AWSIoTButton:1.0.0")
.infomodelId("devices.aws.button:AWSIoTButton:1.0.0")
.targetPlatformKey("aws_ipso")
.remoteClient(this.getModelRepository())
.build();
Expand Down Expand Up @@ -331,7 +331,7 @@ public void testDittoMappingFromRemoteRepository() throws Exception {
public void testCreateDynamicMappingSpec() throws Exception {

IMappingSpecification mappingSpecification = MappingSpecificationBuilder.create()
.infomodelId("com.bosch.BoschGLM100C:1.0.0")
.infomodelId("com.bosch:BoschGLM100C:1.0.0")
.remoteClient(this.getModelRepository())
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class MappingSerializerTest extends AbstractMappingTest {
public void testCreateAndSerializeMappingSpec() throws Exception {

IMappingSpecification mappingSpecification = MappingSpecificationBuilder.create()
.infomodelId("com.bosch.BoschGLM100C:1.0.0")
.infomodelId("com.bosch:BoschGLM100C:1.0.0")
.remoteClient(this.getModelRepository())
.build();

Expand All @@ -32,7 +32,7 @@ public void testCreateAndSerializeMappingSpec() throws Exception {
public void testCreateAndSerializeMappingSpec2() throws Exception {

IMappingSpecification mappingSpecification = MappingSpecificationBuilder.create()
.infomodelId("com.bosch.BoschGLM100C:1.0.0")
.infomodelId("com.bosch:BoschGLM100C:1.0.0")
.remoteClient(this.getModelRepository())
.build();

Expand All @@ -48,7 +48,7 @@ public void testCreateAndSerializeMappingSpec2() throws Exception {
public void testCreateAndSerializeMappingSpecContainingCustomFunctions() throws Exception {

IMappingSpecification mappingSpecification = MappingSpecificationBuilder.create()
.infomodelId("com.bosch.BoschGLM100C:1.0.0")
.infomodelId("com.bosch:BoschGLM100C:1.0.0")
.remoteClient(this.getModelRepository())
.build();

Expand All @@ -65,7 +65,7 @@ public void testCreateAndSerializeMappingSpecContainingCustomFunctions() throws
public void testCreateAndSerializeMappingSpecContainingEmptyFunctions() throws Exception {

IMappingSpecification mappingSpecification = MappingSpecificationBuilder.create()
.infomodelId("com.bosch.BoschGLM100C:1.0.0")
.infomodelId("com.bosch:BoschGLM100C:1.0.0")
.remoteClient(this.getModelRepository())
.build();

Expand All @@ -82,7 +82,7 @@ public void testCreateAndSerializeMappingSpecContainingEmptyFunctions() throws E
public void testCreateAndSerializeMappingSpecContainingDoubleQuotesFunction() throws Exception {

IMappingSpecification mappingSpecification = MappingSpecificationBuilder.create()
.infomodelId("com.bosch.BoschGLM100C:1.0.0")
.infomodelId("com.bosch:BoschGLM100C:1.0.0")
.remoteClient(this.getModelRepository())
.build();

Expand All @@ -99,7 +99,7 @@ public void testCreateAndSerializeMappingSpecContainingDoubleQuotesFunction() th
public void testCreateAndSerializeMappingSpecContainingDoubleQuotesCondition() throws Exception {

IMappingSpecification mappingSpecification = MappingSpecificationBuilder.create()
.infomodelId("com.bosch.BoschGLM100C:1.0.0")
.infomodelId("com.bosch:BoschGLM100C:1.0.0")
.remoteClient(this.getModelRepository())
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class UnideMappingTest extends AbstractMappingTest {
@Test
public void testMapUnideMessageToDitto() throws Exception {
IMappingSpecification mappingSpecification = MappingSpecificationBuilder.create()
.infomodelId("org.eclipse.unide.devices.MobilePhone:1.0.0")
.infomodelId("org.eclipse.unide.devices:MobilePhone:1.0.0")
.targetPlatformKey("org_eclipse_unide_devices_MobilePhone_1_0_0")
.remoteClient(this.getModelRepository())
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public abstract class AbstractTestSpec implements IMappingSpecification {

private static Map<String, FunctionblockModel> FBS = new HashMap<String, FunctionblockModel>(2);

private Infomodel infomodel = new Infomodel(ModelId.fromPrettyFormat("devices.AWSIoTButton:1.0.0"),
private Infomodel infomodel = new Infomodel(ModelId.fromPrettyFormat("devices:AWSIoTButton:1.0.0"),
ModelType.InformationModel);

public AbstractTestSpec() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class SpecGattConverter extends AbstractTestSpec {
@Override
protected void createFBSpec() {
FunctionblockModel buttonModel = new FunctionblockModel(
ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), ModelType.Functionblock);
ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock);
ModelProperty digitalInputStateProperty = new ModelProperty();
digitalInputStateProperty.setMandatory(true);
digitalInputStateProperty.setName("sensor_value");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class SpecWithArrayPayload extends AbstractTestSpec {
@Override
protected void createFBSpec() {
FunctionblockModel buttonModel = new FunctionblockModel(
ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), ModelType.Functionblock);
ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock);
ModelProperty digitalInputStateProperty = new ModelProperty();
digitalInputStateProperty.setMandatory(true);
digitalInputStateProperty.setName("sensor_value");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ protected void createFBSpec() {
}

private FunctionblockModel createButtonFb() {
FunctionblockModel buttonModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"),
FunctionblockModel buttonModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"),
ModelType.Functionblock);
ModelProperty digitalInputStateProperty = new ModelProperty();
digitalInputStateProperty.setMandatory(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class SpecWithByteArrayConverter extends AbstractTestSpec {
@Override
protected void createFBSpec() {
FunctionblockModel buttonModel = new FunctionblockModel(
ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), ModelType.Functionblock);
ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock);
ModelProperty digitalInputStateProperty = new ModelProperty();
digitalInputStateProperty.setMandatory(true);
digitalInputStateProperty.setName("sensor_value");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class SpecWithCondition extends AbstractTestSpec {
@Override
protected void createFBSpec() {
FunctionblockModel buttonModel = new FunctionblockModel(
ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), ModelType.Functionblock);
ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock);
ModelProperty digitalInputStateProperty = new ModelProperty();
digitalInputStateProperty.setMandatory(true);
digitalInputStateProperty.setName("sensor_value");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class SpecWithConditionFunction extends AbstractTestSpec {
@Override
protected void createFBSpec() {
FunctionblockModel buttonModel = new FunctionblockModel(
ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), ModelType.Functionblock);
ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock);
ModelProperty digitalInputStateProperty = new ModelProperty();
digitalInputStateProperty.setMandatory(true);
digitalInputStateProperty.setName("sensor_value");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class SpecWithConditionXpath extends AbstractTestSpec {
@Override
protected void createFBSpec() {
FunctionblockModel buttonModel = new FunctionblockModel(
ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), ModelType.Functionblock);
ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock);
ModelProperty digitalInputStateProperty = new ModelProperty();
digitalInputStateProperty.setMandatory(true);
digitalInputStateProperty.setName("sensor_value");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class SpecWithConditionedRules extends AbstractTestSpec {
@Override
protected void createFBSpec() {
FunctionblockModel doorState = new FunctionblockModel(
ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), ModelType.Functionblock);
ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock);
ModelProperty digitalInputStateProperty = new ModelProperty();
digitalInputStateProperty.setMandatory(true);
digitalInputStateProperty.setName("sensor_value");
Expand All @@ -27,7 +27,7 @@ protected void createFBSpec() {
Arrays.asList(new ModelProperty[] { digitalInputStateProperty}));

FunctionblockModel operationState = new FunctionblockModel(
ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), ModelType.Functionblock);
ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock);
ModelProperty digitalInputStateProperty1 = new ModelProperty();
digitalInputStateProperty1.setMandatory(true);
digitalInputStateProperty1.setName("sensor_value");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protected void createFBSpec() {
}

private FunctionblockModel createButtonFb() {
FunctionblockModel buttonModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"),
FunctionblockModel buttonModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"),
ModelType.Functionblock);
ModelProperty digitalInputStateProperty = new ModelProperty();
digitalInputStateProperty.setMandatory(true);
Expand All @@ -47,7 +47,7 @@ private FunctionblockModel createButtonFb() {
}

private FunctionblockModel createVoltageFb() {
FunctionblockModel voltageModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb.Voltage:1.0.0"),
FunctionblockModel voltageModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb:Voltage:1.0.0"),
ModelType.Functionblock);
ModelProperty sensorValueProperty = new ModelProperty();
sensorValueProperty.setMandatory(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protected void createFBSpec() {
}

private FunctionblockModel createButtonFb() {
FunctionblockModel buttonModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"),
FunctionblockModel buttonModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"),
ModelType.Functionblock);
ModelProperty digitalInputStateProperty = new ModelProperty();
digitalInputStateProperty.setMandatory(true);
Expand All @@ -49,7 +49,7 @@ private FunctionblockModel createButtonFb() {
}

private FunctionblockModel createVoltageFb() {
FunctionblockModel voltageModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb.Voltage:1.0.0"),
FunctionblockModel voltageModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb:Voltage:1.0.0"),
ModelType.Functionblock);
ModelProperty sensorValueProperty = new ModelProperty();
sensorValueProperty.setMandatory(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protected void createFBSpec() {
}

private FunctionblockModel createButtonFb() {
FunctionblockModel buttonModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"),
FunctionblockModel buttonModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"),
ModelType.Functionblock);
ModelProperty digitalInputStateProperty = new ModelProperty();
digitalInputStateProperty.setMandatory(true);
Expand All @@ -47,7 +47,7 @@ private FunctionblockModel createButtonFb() {
}

private FunctionblockModel createVoltageFb() {
FunctionblockModel voltageModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb.Voltage:1.0.0"),
FunctionblockModel voltageModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb:Voltage:1.0.0"),
ModelType.Functionblock);
ModelProperty sensorValueProperty = new ModelProperty();
sensorValueProperty.setMandatory(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ protected void createFBSpec() {
}

private FunctionblockModel createButtonFb() {
FunctionblockModel buttonModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"),
FunctionblockModel buttonModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"),
ModelType.Functionblock);
ModelProperty digitalInputCount = new ModelProperty();
digitalInputCount.setMandatory(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ public class SpecWithOperationMapping extends AbstractTestSpec {
@Override
protected void createFBSpec() {
FunctionblockModel buttonModel = new FunctionblockModel(
ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), ModelType.Functionblock);
ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock);
Operation operation = new Operation();
operation.setName("press");
Param param = new Param();
param.setName("count");
param.setType(ModelId.fromPrettyFormat("demo.types.Count:1.0.0"));
param.setType(ModelId.fromPrettyFormat("demo.types:Count:1.0.0"));
param.setTargetPlatformKey("iotbutton");
param.addStereotype(Stereotype.createOperationTarget("data/count", "type:convertInt(obj/count)"));
operation.setParams(Arrays.asList(param));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class SpecWithOperationRule extends AbstractTestSpec {
@Override
protected void createFBSpec() {
FunctionblockModel buttonModel = new FunctionblockModel(
ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), ModelType.Functionblock);
ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock);
Operation operation = new Operation();
operation.setName("press");
operation.setTargetPlatformKey("iotbutton");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class SpecWithSameFunctionblock extends AbstractTestSpec {
@Override
protected void createFBSpec() {
FunctionblockModel buttonModel = new FunctionblockModel(
ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), ModelType.Functionblock);
ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock);
ModelProperty digitalInputStateProperty = new ModelProperty();
digitalInputStateProperty.setMandatory(true);
digitalInputStateProperty.setName("sensor_value");
Expand All @@ -29,7 +29,7 @@ protected void createFBSpec() {
addFunctionblockProperty("btn1", buttonModel);

FunctionblockModel buttonModel2 = new FunctionblockModel(
ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), ModelType.Functionblock);
ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock);
ModelProperty digitalInputStateProperty2 = new ModelProperty();
digitalInputStateProperty2.setMandatory(true);
digitalInputStateProperty2.setName("sensor_value");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class SpecWithTimestamp extends AbstractTestSpec {
@Override
protected void createFBSpec() {
FunctionblockModel buttonModel = new FunctionblockModel(
ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), ModelType.Functionblock);
ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock);
ModelProperty digitalInputStateProperty = new ModelProperty();
digitalInputStateProperty.setMandatory(true);
digitalInputStateProperty.setName("sensor_value");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class SpecWithTypeConversion extends AbstractTestSpec {
@Override
protected void createFBSpec() {
FunctionblockModel buttonModel = new FunctionblockModel(
ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), ModelType.Functionblock);
ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock);
ModelProperty digitalInputStateProperty = new ModelProperty();
digitalInputStateProperty.setMandatory(true);
digitalInputStateProperty.setName("sensor_value");
Expand Down
Loading

0 comments on commit cd95fee

Please sign in to comment.