@fluid-experimental/property-properties 0.58.1001 → 0.58.2000-58133
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/containerSerializer.d.ts.map +1 -1
- package/dist/containerSerializer.js +4 -10
- package/dist/containerSerializer.js.map +1 -1
- package/dist/enableValidations.d.ts.map +1 -1
- package/dist/enableValidations.js +1 -1
- package/dist/enableValidations.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/properties/abstractStaticCollectionProperty.d.ts.map +1 -1
- package/dist/properties/abstractStaticCollectionProperty.js +1 -28
- package/dist/properties/abstractStaticCollectionProperty.js.map +1 -1
- package/dist/properties/arrayProperty.d.ts.map +1 -1
- package/dist/properties/arrayProperty.js +26 -85
- package/dist/properties/arrayProperty.js.map +1 -1
- package/dist/properties/baseProperty.d.ts.map +1 -1
- package/dist/properties/baseProperty.js +9 -71
- package/dist/properties/baseProperty.js.map +1 -1
- package/dist/properties/boolProperty.d.ts.map +1 -1
- package/dist/properties/boolProperty.js +0 -1
- package/dist/properties/boolProperty.js.map +1 -1
- package/dist/properties/containerProperty.d.ts.map +1 -1
- package/dist/properties/containerProperty.js +4 -22
- package/dist/properties/containerProperty.js.map +1 -1
- package/dist/properties/enumArrayProperty.d.ts.map +1 -1
- package/dist/properties/enumArrayProperty.js +2 -14
- package/dist/properties/enumArrayProperty.js.map +1 -1
- package/dist/properties/enumProperty.d.ts.map +1 -1
- package/dist/properties/enumProperty.js +3 -10
- package/dist/properties/enumProperty.js.map +1 -1
- package/dist/properties/floatProperties.js +0 -2
- package/dist/properties/floatProperties.js.map +1 -1
- package/dist/properties/index.d.ts +7 -38
- package/dist/properties/index.d.ts.map +1 -1
- package/dist/properties/index.js +37 -68
- package/dist/properties/index.js.map +1 -1
- package/dist/properties/indexedCollectionBaseProperty.d.ts.map +1 -1
- package/dist/properties/indexedCollectionBaseProperty.js +6 -18
- package/dist/properties/indexedCollectionBaseProperty.js.map +1 -1
- package/dist/properties/intProperties.d.ts.map +1 -1
- package/dist/properties/intProperties.js +3 -20
- package/dist/properties/intProperties.js.map +1 -1
- package/dist/properties/lazyLoadedProperties.js.map +1 -1
- package/dist/properties/mapProperty.d.ts.map +1 -1
- package/dist/properties/mapProperty.js +4 -23
- package/dist/properties/mapProperty.js.map +1 -1
- package/dist/properties/namedNodeProperty.d.ts.map +1 -1
- package/dist/properties/namedNodeProperty.js.map +1 -1
- package/dist/properties/namedProperty.d.ts.map +1 -1
- package/dist/properties/namedProperty.js +0 -3
- package/dist/properties/namedProperty.js.map +1 -1
- package/dist/properties/nodeProperty.d.ts.map +1 -1
- package/dist/properties/nodeProperty.js +0 -3
- package/dist/properties/nodeProperty.js.map +1 -1
- package/dist/properties/primitiveTypeCasts.d.ts.map +1 -1
- package/dist/properties/primitiveTypeCasts.js +2 -2
- package/dist/properties/primitiveTypeCasts.js.map +1 -1
- package/dist/properties/referenceArrayProperty.d.ts.map +1 -1
- package/dist/properties/referenceArrayProperty.js +3 -16
- package/dist/properties/referenceArrayProperty.js.map +1 -1
- package/dist/properties/referenceMapProperty.d.ts.map +1 -1
- package/dist/properties/referenceMapProperty.js +3 -13
- package/dist/properties/referenceMapProperty.js.map +1 -1
- package/dist/properties/referenceProperty.d.ts.map +1 -1
- package/dist/properties/referenceProperty.js +4 -12
- package/dist/properties/referenceProperty.js.map +1 -1
- package/dist/properties/setProperty.d.ts.map +1 -1
- package/dist/properties/setProperty.js +3 -22
- package/dist/properties/setProperty.js.map +1 -1
- package/dist/properties/stringProperty.d.ts.map +1 -1
- package/dist/properties/stringProperty.js +12 -48
- package/dist/properties/stringProperty.js.map +1 -1
- package/dist/properties/uintProperties.js +0 -3
- package/dist/properties/uintProperties.js.map +1 -1
- package/dist/properties/valueArrayProperty.d.ts.map +1 -1
- package/dist/properties/valueArrayProperty.js +3 -45
- package/dist/properties/valueArrayProperty.js.map +1 -1
- package/dist/properties/valueMapProperty.d.ts.map +1 -1
- package/dist/properties/valueMapProperty.js +4 -29
- package/dist/properties/valueMapProperty.js.map +1 -1
- package/dist/properties/valueProperty.d.ts.map +1 -1
- package/dist/properties/valueProperty.js +2 -14
- package/dist/properties/valueProperty.js.map +1 -1
- package/dist/propertyFactory.d.ts.map +1 -1
- package/dist/propertyFactory.js +35 -72
- package/dist/propertyFactory.js.map +1 -1
- package/dist/propertyTemplate.d.ts.map +1 -1
- package/dist/propertyTemplate.js +0 -14
- package/dist/propertyTemplate.js.map +1 -1
- package/dist/propertyTemplateWrapper.d.ts.map +1 -1
- package/dist/propertyTemplateWrapper.js +4 -12
- package/dist/propertyTemplateWrapper.js.map +1 -1
- package/dist/propertyUtils.d.ts.map +1 -1
- package/dist/propertyUtils.js.map +1 -1
- package/dist/test/properties/arrayProperty.spec.js +82 -82
- package/dist/test/properties/arrayProperty.spec.js.map +1 -1
- package/dist/test/properties/baseProperty.spec.js +53 -53
- package/dist/test/properties/baseProperty.spec.js.map +1 -1
- package/dist/test/properties/containerProperty.spec.js +25 -25
- package/dist/test/properties/containerProperty.spec.js.map +1 -1
- package/dist/test/properties/customArrayProperty.spec.js +35 -35
- package/dist/test/properties/customArrayProperty.spec.js.map +1 -1
- package/dist/test/properties/enumArrayProperty.spec.js +6 -6
- package/dist/test/properties/enumArrayProperty.spec.js.map +1 -1
- package/dist/test/properties/enumProperty.spec.js +26 -26
- package/dist/test/properties/enumProperty.spec.js.map +1 -1
- package/dist/test/properties/float32.spec.js.map +1 -1
- package/dist/test/properties/int64ArrayProperty.spec.js +22 -22
- package/dist/test/properties/int64ArrayProperty.spec.js.map +1 -1
- package/dist/test/properties/int64MapProperty.spec.js +28 -28
- package/dist/test/properties/int64MapProperty.spec.js.map +1 -1
- package/dist/test/properties/int64Property.spec.js +11 -11
- package/dist/test/properties/int64Property.spec.js.map +1 -1
- package/dist/test/properties/isLeafNode.spec.js +25 -25
- package/dist/test/properties/isLeafNode.spec.js.map +1 -1
- package/dist/test/properties/mapProperty.spec.js +110 -110
- package/dist/test/properties/mapProperty.spec.js.map +1 -1
- package/dist/test/properties/namedNodeProperty.spec.js +5 -5
- package/dist/test/properties/namedNodeProperty.spec.js.map +1 -1
- package/dist/test/properties/nodeProperty.spec.js +160 -160
- package/dist/test/properties/nodeProperty.spec.js.map +1 -1
- package/dist/test/properties/referenceProperty.spec.js +21 -21
- package/dist/test/properties/referenceProperty.spec.js.map +1 -1
- package/dist/test/properties/relationshipProperty.spec.js +4 -4
- package/dist/test/properties/relationshipProperty.spec.js.map +1 -1
- package/dist/test/properties/setProperty.spec.js +32 -32
- package/dist/test/properties/setProperty.spec.js.map +1 -1
- package/dist/test/properties/stringProperty.spec.js +38 -38
- package/dist/test/properties/stringProperty.spec.js.map +1 -1
- package/dist/test/properties/uint64Property.spec.js +3 -3
- package/dist/test/properties/uint64Property.spec.js.map +1 -1
- package/dist/test/properties/valueMapProperty.spec.js +28 -28
- package/dist/test/properties/valueMapProperty.spec.js.map +1 -1
- package/dist/test/properties/valueProperty.spec.js +7 -7
- package/dist/test/properties/valueProperty.spec.js.map +1 -1
- package/dist/test/propertyFactory.spec.js +559 -560
- package/dist/test/propertyFactory.spec.js.map +1 -1
- package/dist/test/propertyTemplateWrapper.spec.js +38 -38
- package/dist/test/propertyTemplateWrapper.spec.js.map +1 -1
- package/dist/test/propertyUtils.spec.js +5 -5
- package/dist/test/propertyUtils.spec.js.map +1 -1
- package/dist/test/reversibleChangeset.spec.js +266 -266
- package/dist/test/reversibleChangeset.spec.js.map +1 -1
- package/dist/test/setup.js.map +1 -1
- package/dist/test/tsconfig.tsbuildinfo +145 -145
- package/dist/test/utils.spec.js +508 -517
- package/dist/test/utils.spec.js.map +1 -1
- package/dist/test/validation/badMissingSemverInTypeid.js +9 -9
- package/dist/test/validation/badMissingSemverInTypeid.js.map +1 -1
- package/dist/test/validation/badPrimitiveTypeid.js +5 -5
- package/dist/test/validation/badPrimitiveTypeid.js.map +1 -1
- package/dist/test/validation/goodColorId.js +42 -42
- package/dist/test/validation/goodColorId.js.map +1 -1
- package/dist/test/validation/goodColorPalette.js +2 -2
- package/dist/test/validation/goodColorPalette.js.map +1 -1
- package/dist/test/validation/goodPointId.js +9 -9
- package/dist/test/validation/goodPointId.js.map +1 -1
- package/dist/test/validation/reversibleChangeSetTestData.js +1 -1
- package/dist/test/validation/reversibleChangeSetTestData.js.map +1 -1
- package/lib/containerSerializer.js +4 -10
- package/lib/containerSerializer.js.map +1 -1
- package/lib/enableValidations.js +1 -1
- package/lib/enableValidations.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/properties/abstractStaticCollectionProperty.js +1 -28
- package/lib/properties/abstractStaticCollectionProperty.js.map +1 -1
- package/lib/properties/arrayProperty.js +26 -85
- package/lib/properties/arrayProperty.js.map +1 -1
- package/lib/properties/baseProperty.js +7 -69
- package/lib/properties/baseProperty.js.map +1 -1
- package/lib/properties/boolProperty.js +0 -1
- package/lib/properties/boolProperty.js.map +1 -1
- package/lib/properties/containerProperty.js +4 -22
- package/lib/properties/containerProperty.js.map +1 -1
- package/lib/properties/enumArrayProperty.js +2 -14
- package/lib/properties/enumArrayProperty.js.map +1 -1
- package/lib/properties/enumProperty.js +3 -10
- package/lib/properties/enumProperty.js.map +1 -1
- package/lib/properties/floatProperties.js +0 -2
- package/lib/properties/floatProperties.js.map +1 -1
- package/lib/properties/index.js +7 -38
- package/lib/properties/index.js.map +1 -1
- package/lib/properties/indexedCollectionBaseProperty.js +6 -18
- package/lib/properties/indexedCollectionBaseProperty.js.map +1 -1
- package/lib/properties/intProperties.js +3 -20
- package/lib/properties/intProperties.js.map +1 -1
- package/lib/properties/lazyLoadedProperties.js.map +1 -1
- package/lib/properties/mapProperty.js +4 -23
- package/lib/properties/mapProperty.js.map +1 -1
- package/lib/properties/namedNodeProperty.js.map +1 -1
- package/lib/properties/namedProperty.js +0 -3
- package/lib/properties/namedProperty.js.map +1 -1
- package/lib/properties/nodeProperty.js +0 -3
- package/lib/properties/nodeProperty.js.map +1 -1
- package/lib/properties/primitiveTypeCasts.js +2 -2
- package/lib/properties/primitiveTypeCasts.js.map +1 -1
- package/lib/properties/referenceArrayProperty.js +3 -16
- package/lib/properties/referenceArrayProperty.js.map +1 -1
- package/lib/properties/referenceMapProperty.js +3 -13
- package/lib/properties/referenceMapProperty.js.map +1 -1
- package/lib/properties/referenceProperty.js +4 -12
- package/lib/properties/referenceProperty.js.map +1 -1
- package/lib/properties/setProperty.js +3 -22
- package/lib/properties/setProperty.js.map +1 -1
- package/lib/properties/stringProperty.js +12 -48
- package/lib/properties/stringProperty.js.map +1 -1
- package/lib/properties/uintProperties.js +0 -3
- package/lib/properties/uintProperties.js.map +1 -1
- package/lib/properties/valueArrayProperty.js +3 -45
- package/lib/properties/valueArrayProperty.js.map +1 -1
- package/lib/properties/valueMapProperty.js +4 -29
- package/lib/properties/valueMapProperty.js.map +1 -1
- package/lib/properties/valueProperty.js +2 -14
- package/lib/properties/valueProperty.js.map +1 -1
- package/lib/propertyFactory.js +35 -72
- package/lib/propertyFactory.js.map +1 -1
- package/lib/propertyTemplate.js +0 -14
- package/lib/propertyTemplate.js.map +1 -1
- package/lib/propertyTemplateWrapper.js +4 -12
- package/lib/propertyTemplateWrapper.js.map +1 -1
- package/lib/propertyUtils.js.map +1 -1
- package/package.json +13 -6
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
*/
|
|
5
5
|
/* globals sinon */
|
|
6
6
|
/* eslint-disable no-unused-expressions */
|
|
7
|
-
const { PropertyFactory } = require('..');
|
|
8
7
|
const { MSG } = require('@fluid-experimental/property-common').constants;
|
|
9
8
|
const { generateGUID } = require('@fluid-experimental/property-common').GuidUtils;
|
|
9
|
+
const { PropertyFactory } = require('..');
|
|
10
10
|
const { StringProperty } = require('../properties/stringProperty');
|
|
11
11
|
describe('PropertyFactory', function () {
|
|
12
12
|
beforeEach(() => {
|
|
@@ -20,25 +20,25 @@ describe('PropertyFactory', function () {
|
|
|
20
20
|
properties: [
|
|
21
21
|
{
|
|
22
22
|
id: 'x',
|
|
23
|
-
typeid: 'Float32'
|
|
23
|
+
typeid: 'Float32',
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
id: 'y',
|
|
27
|
-
typeid: 'Float32'
|
|
27
|
+
typeid: 'Float32',
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
id: 'z',
|
|
31
|
-
typeid: 'Float32'
|
|
32
|
-
}
|
|
33
|
-
]
|
|
31
|
+
typeid: 'Float32',
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
id: 'normal',
|
|
37
37
|
typeid: 'Float32',
|
|
38
38
|
context: 'array',
|
|
39
|
-
size: 3
|
|
40
|
-
}
|
|
41
|
-
]
|
|
39
|
+
size: 3,
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
42
|
};
|
|
43
43
|
it('is not a function.', function (done) {
|
|
44
44
|
expect(PropertyFactory).to.not.be.a('function');
|
|
@@ -65,9 +65,9 @@ describe('PropertyFactory', function () {
|
|
|
65
65
|
position: {
|
|
66
66
|
x: 0.0,
|
|
67
67
|
y: 1.0,
|
|
68
|
-
z: 2.0
|
|
68
|
+
z: 2.0,
|
|
69
69
|
},
|
|
70
|
-
normal: [1.23, 2.3399999141693115, 3.45]
|
|
70
|
+
normal: [1.23, 2.3399999141693115, 3.45],
|
|
71
71
|
});
|
|
72
72
|
expect(goodPoint.resolvePath('normal').get(1)).to.equal(2.3399999141693115);
|
|
73
73
|
});
|
|
@@ -77,11 +77,11 @@ describe('PropertyFactory', function () {
|
|
|
77
77
|
'UnknownProperty': {
|
|
78
78
|
'test': {
|
|
79
79
|
String: {
|
|
80
|
-
'unknownStringProperty': 'Hi There!'
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
80
|
+
'unknownStringProperty': 'Hi There!',
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
85
|
};
|
|
86
86
|
var root = PropertyFactory.create('NodeProperty');
|
|
87
87
|
expect(function () {
|
|
@@ -103,16 +103,15 @@ describe('PropertyFactory', function () {
|
|
|
103
103
|
it('should support the creation of a polymorphic collection', function () {
|
|
104
104
|
var testSet = {
|
|
105
105
|
typeid: 'autodesk.examples:test.set-1.0.0',
|
|
106
|
-
inherits: 'NamedProperty'
|
|
106
|
+
inherits: 'NamedProperty',
|
|
107
107
|
};
|
|
108
108
|
PropertyFactory.register(testSet);
|
|
109
109
|
var testTemplate = {
|
|
110
110
|
typeid: 'autodesk.examples:polymorphic.collection.test-1.0.0',
|
|
111
111
|
properties: [
|
|
112
112
|
{ id: 'testMap', context: 'map' },
|
|
113
|
-
{ id: 'testSet', typeid: 'autodesk.examples:test.set-1.0.0', context: 'set' }
|
|
114
|
-
|
|
115
|
-
]
|
|
113
|
+
{ id: 'testSet', typeid: 'autodesk.examples:test.set-1.0.0', context: 'set' },
|
|
114
|
+
],
|
|
116
115
|
};
|
|
117
116
|
PropertyFactory._reregister(testTemplate);
|
|
118
117
|
var instance = PropertyFactory.create('autodesk.examples:polymorphic.collection.test-1.0.0');
|
|
@@ -152,12 +151,12 @@ describe('PropertyFactory', function () {
|
|
|
152
151
|
{
|
|
153
152
|
id: 'border', properties: [
|
|
154
153
|
{ id: 'weight', typeid: 'Int32' }
|
|
155
|
-
]
|
|
154
|
+
],
|
|
156
155
|
}
|
|
157
|
-
]
|
|
156
|
+
],
|
|
158
157
|
}
|
|
159
|
-
]
|
|
160
|
-
}]
|
|
158
|
+
],
|
|
159
|
+
}],
|
|
161
160
|
};
|
|
162
161
|
PropertyFactory.register(Shape);
|
|
163
162
|
var Color = {
|
|
@@ -167,25 +166,25 @@ describe('PropertyFactory', function () {
|
|
|
167
166
|
{
|
|
168
167
|
id: 'fill', properties: [
|
|
169
168
|
{ id: 'rgb', typeid: 'String' }
|
|
170
|
-
]
|
|
169
|
+
],
|
|
171
170
|
}
|
|
172
|
-
]
|
|
171
|
+
],
|
|
173
172
|
};
|
|
174
173
|
PropertyFactory.register(Color);
|
|
175
174
|
var EntryWithOverriddenDefaults = {
|
|
176
175
|
typeid: 'SimpleTest:EntryWithOverriddenDefaults-1.0.0',
|
|
177
176
|
inherits: ['NamedProperty'],
|
|
178
177
|
properties: [
|
|
179
|
-
{ id: 'string', typeid: 'String', value: 'entry_string' }
|
|
180
|
-
]
|
|
178
|
+
{ id: 'string', typeid: 'String', value: 'entry_string' },
|
|
179
|
+
],
|
|
181
180
|
};
|
|
182
181
|
PropertyFactory.register(EntryWithOverriddenDefaults);
|
|
183
182
|
var EntryWithOverriddenPolyDefaults = {
|
|
184
183
|
typeid: 'SimpleTest:EntryWithOverriddenPolyDefaults-1.0.0',
|
|
185
184
|
inherits: ['SimpleTest:EntryWithOverriddenDefaults-1.0.0'],
|
|
186
185
|
properties: [
|
|
187
|
-
{ id: 'string', typeid: 'String', value: 'entry_string' }
|
|
188
|
-
]
|
|
186
|
+
{ id: 'string', typeid: 'String', value: 'entry_string' },
|
|
187
|
+
],
|
|
189
188
|
};
|
|
190
189
|
PropertyFactory.register(EntryWithOverriddenPolyDefaults);
|
|
191
190
|
var DynamicWithOverriddenDefaults = {
|
|
@@ -194,10 +193,10 @@ describe('PropertyFactory', function () {
|
|
|
194
193
|
{ id: 'num', typeid: 'Uint32' },
|
|
195
194
|
{
|
|
196
195
|
id: 'dynamic', properties: [
|
|
197
|
-
{ id: 'dynamic_string', typeid: 'String' }
|
|
198
|
-
]
|
|
199
|
-
}
|
|
200
|
-
]
|
|
196
|
+
{ id: 'dynamic_string', typeid: 'String' },
|
|
197
|
+
],
|
|
198
|
+
},
|
|
199
|
+
],
|
|
201
200
|
};
|
|
202
201
|
PropertyFactory.register(DynamicWithOverriddenDefaults);
|
|
203
202
|
});
|
|
@@ -206,8 +205,8 @@ describe('PropertyFactory', function () {
|
|
|
206
205
|
typeid: 'SimpleTest:Square-1.0.0',
|
|
207
206
|
inherits: ['SimpleTest:Shape-1.0.0'],
|
|
208
207
|
properties: [
|
|
209
|
-
{ id: 'area', typeid: 'Float32' }
|
|
210
|
-
]
|
|
208
|
+
{ id: 'area', typeid: 'Float32' },
|
|
209
|
+
],
|
|
211
210
|
};
|
|
212
211
|
PropertyFactory.register(Square);
|
|
213
212
|
var square = PropertyFactory.create('SimpleTest:Square-1.0.0');
|
|
@@ -220,15 +219,15 @@ describe('PropertyFactory', function () {
|
|
|
220
219
|
typeid: 'SimpleTest:ShapeWithConstant-1.0.0',
|
|
221
220
|
inherits: ['SimpleTest:Shape-1.0.0'],
|
|
222
221
|
constants: [
|
|
223
|
-
{ id: 'originX', typeid: 'Int8', value: 10 }
|
|
224
|
-
]
|
|
222
|
+
{ id: 'originX', typeid: 'Int8', value: 10 },
|
|
223
|
+
],
|
|
225
224
|
};
|
|
226
225
|
var SquareWithConstant = {
|
|
227
226
|
typeid: 'SimpleTest:SquareWithConstant-1.0.0',
|
|
228
227
|
inherits: ['SimpleTest:ShapeWithConstant-1.0.0'],
|
|
229
228
|
constants: [
|
|
230
|
-
{ id: 'originY', typeid: 'Int8', value: 20 }
|
|
231
|
-
]
|
|
229
|
+
{ id: 'originY', typeid: 'Int8', value: 20 },
|
|
230
|
+
],
|
|
232
231
|
};
|
|
233
232
|
PropertyFactory.register(ShapeWithConstant);
|
|
234
233
|
PropertyFactory.register(SquareWithConstant);
|
|
@@ -249,16 +248,16 @@ describe('PropertyFactory', function () {
|
|
|
249
248
|
id: 'const1',
|
|
250
249
|
typeid: 'String',
|
|
251
250
|
value: 'hello',
|
|
252
|
-
annotation: { description: 'The first constant.' }
|
|
251
|
+
annotation: { description: 'The first constant.' },
|
|
253
252
|
},
|
|
254
253
|
{
|
|
255
254
|
id: 'const2',
|
|
256
255
|
typeid: 'String',
|
|
257
256
|
value: ['hello'],
|
|
258
257
|
context: 'array',
|
|
259
|
-
annotation: { description: 'The second constant.' }
|
|
260
|
-
}
|
|
261
|
-
]
|
|
258
|
+
annotation: { description: 'The second constant.' },
|
|
259
|
+
},
|
|
260
|
+
],
|
|
262
261
|
};
|
|
263
262
|
var testedTemplate = {
|
|
264
263
|
typeid: 'consttest:template-2.0.0',
|
|
@@ -266,13 +265,13 @@ describe('PropertyFactory', function () {
|
|
|
266
265
|
constants: [
|
|
267
266
|
{
|
|
268
267
|
id: 'const1',
|
|
269
|
-
value: 'hello2'
|
|
268
|
+
value: 'hello2',
|
|
270
269
|
},
|
|
271
270
|
{
|
|
272
271
|
id: 'const2',
|
|
273
|
-
value: ['hello2']
|
|
274
|
-
}
|
|
275
|
-
]
|
|
272
|
+
value: ['hello2'],
|
|
273
|
+
},
|
|
274
|
+
],
|
|
276
275
|
};
|
|
277
276
|
PropertyFactory.register(testedTemplate);
|
|
278
277
|
PropertyFactory.register(template1);
|
|
@@ -291,9 +290,9 @@ describe('PropertyFactory', function () {
|
|
|
291
290
|
id: 'const2',
|
|
292
291
|
typeid: 'String',
|
|
293
292
|
value: 'hello',
|
|
294
|
-
annotation: { description: 'The first constant.' }
|
|
295
|
-
}
|
|
296
|
-
]
|
|
293
|
+
annotation: { description: 'The first constant.' },
|
|
294
|
+
},
|
|
295
|
+
],
|
|
297
296
|
};
|
|
298
297
|
var testedTemplate = {
|
|
299
298
|
typeid: 'consttest2:template-2.0.0',
|
|
@@ -301,9 +300,9 @@ describe('PropertyFactory', function () {
|
|
|
301
300
|
constants: [
|
|
302
301
|
{
|
|
303
302
|
id: 'const1',
|
|
304
|
-
value: 'hello2'
|
|
305
|
-
}
|
|
306
|
-
]
|
|
303
|
+
value: 'hello2',
|
|
304
|
+
},
|
|
305
|
+
],
|
|
307
306
|
};
|
|
308
307
|
PropertyFactory.register(template1);
|
|
309
308
|
PropertyFactory.register(testedTemplate);
|
|
@@ -323,9 +322,9 @@ describe('PropertyFactory', function () {
|
|
|
323
322
|
id: 'const1',
|
|
324
323
|
typeid: 'String',
|
|
325
324
|
value: 'hello',
|
|
326
|
-
annotation: { description: 'The first constant.' }
|
|
327
|
-
}
|
|
328
|
-
]
|
|
325
|
+
annotation: { description: 'The first constant.' },
|
|
326
|
+
},
|
|
327
|
+
],
|
|
329
328
|
};
|
|
330
329
|
var template2 = {
|
|
331
330
|
typeid: 'consttest3:template-2.0.0',
|
|
@@ -333,9 +332,9 @@ describe('PropertyFactory', function () {
|
|
|
333
332
|
{
|
|
334
333
|
id: 'const1',
|
|
335
334
|
typeid: 'Uint8',
|
|
336
|
-
value: 3
|
|
337
|
-
}
|
|
338
|
-
]
|
|
335
|
+
value: 3,
|
|
336
|
+
},
|
|
337
|
+
],
|
|
339
338
|
};
|
|
340
339
|
var testedTemplate = {
|
|
341
340
|
typeid: 'consttest3:template-3.0.0',
|
|
@@ -343,9 +342,9 @@ describe('PropertyFactory', function () {
|
|
|
343
342
|
constants: [
|
|
344
343
|
{
|
|
345
344
|
id: 'const1',
|
|
346
|
-
value: 'hello2'
|
|
347
|
-
}
|
|
348
|
-
]
|
|
345
|
+
value: 'hello2',
|
|
346
|
+
},
|
|
347
|
+
],
|
|
349
348
|
};
|
|
350
349
|
PropertyFactory.register(template2);
|
|
351
350
|
PropertyFactory.register(template1);
|
|
@@ -364,14 +363,14 @@ describe('PropertyFactory', function () {
|
|
|
364
363
|
{
|
|
365
364
|
id: 'const1',
|
|
366
365
|
typeid: 'String',
|
|
367
|
-
value: 'hello'
|
|
366
|
+
value: 'hello',
|
|
368
367
|
},
|
|
369
368
|
{
|
|
370
369
|
id: 'const2',
|
|
371
370
|
typeid: 'Uint8',
|
|
372
|
-
value: 5
|
|
373
|
-
}
|
|
374
|
-
]
|
|
371
|
+
value: 5,
|
|
372
|
+
},
|
|
373
|
+
],
|
|
375
374
|
};
|
|
376
375
|
var template2 = {
|
|
377
376
|
typeid: 'consttest4:template-2.0.0',
|
|
@@ -380,9 +379,9 @@ describe('PropertyFactory', function () {
|
|
|
380
379
|
id: 'const1',
|
|
381
380
|
typeid: 'String',
|
|
382
381
|
value: 'bye',
|
|
383
|
-
annotation: { description: 'The first constant.' }
|
|
384
|
-
}
|
|
385
|
-
]
|
|
382
|
+
annotation: { description: 'The first constant.' },
|
|
383
|
+
},
|
|
384
|
+
],
|
|
386
385
|
};
|
|
387
386
|
var testedTemplate = {
|
|
388
387
|
typeid: 'consttest4:template-3.0.0',
|
|
@@ -390,13 +389,13 @@ describe('PropertyFactory', function () {
|
|
|
390
389
|
constants: [
|
|
391
390
|
{
|
|
392
391
|
id: 'const1',
|
|
393
|
-
value: 'hello2'
|
|
392
|
+
value: 'hello2',
|
|
394
393
|
},
|
|
395
394
|
{
|
|
396
395
|
id: 'const2',
|
|
397
|
-
value: 14
|
|
398
|
-
}
|
|
399
|
-
]
|
|
396
|
+
value: 14,
|
|
397
|
+
},
|
|
398
|
+
],
|
|
400
399
|
};
|
|
401
400
|
PropertyFactory.register(testedTemplate);
|
|
402
401
|
PropertyFactory.register(template1);
|
|
@@ -412,9 +411,9 @@ describe('PropertyFactory', function () {
|
|
|
412
411
|
id: 'const1',
|
|
413
412
|
typeid: 'String',
|
|
414
413
|
value: 'hello',
|
|
415
|
-
annotation: { description: 'The first constant.' }
|
|
416
|
-
}
|
|
417
|
-
]
|
|
414
|
+
annotation: { description: 'The first constant.' },
|
|
415
|
+
},
|
|
416
|
+
],
|
|
418
417
|
};
|
|
419
418
|
var testedTemplate = {
|
|
420
419
|
typeid: 'consttest5:template-2.0.0',
|
|
@@ -422,9 +421,9 @@ describe('PropertyFactory', function () {
|
|
|
422
421
|
constants: [
|
|
423
422
|
{
|
|
424
423
|
id: 'const1',
|
|
425
|
-
value: 'hello2'
|
|
426
|
-
}
|
|
427
|
-
]
|
|
424
|
+
value: 'hello2',
|
|
425
|
+
},
|
|
426
|
+
],
|
|
428
427
|
};
|
|
429
428
|
PropertyFactory.register(template1);
|
|
430
429
|
PropertyFactory.register(testedTemplate);
|
|
@@ -438,9 +437,9 @@ describe('PropertyFactory', function () {
|
|
|
438
437
|
id: 'const1',
|
|
439
438
|
typeid: 'String',
|
|
440
439
|
value: 'hello',
|
|
441
|
-
annotation: { description: 'The first constant.' }
|
|
442
|
-
}
|
|
443
|
-
]
|
|
440
|
+
annotation: { description: 'The first constant.' },
|
|
441
|
+
},
|
|
442
|
+
],
|
|
444
443
|
};
|
|
445
444
|
var testedTemplate = {
|
|
446
445
|
typeid: 'consttest6:template-2.0.0',
|
|
@@ -448,9 +447,9 @@ describe('PropertyFactory', function () {
|
|
|
448
447
|
constants: [
|
|
449
448
|
{
|
|
450
449
|
id: 'const1',
|
|
451
|
-
value: 'hello2'
|
|
452
|
-
}
|
|
453
|
-
]
|
|
450
|
+
value: 'hello2',
|
|
451
|
+
},
|
|
452
|
+
],
|
|
454
453
|
};
|
|
455
454
|
var testedTemplate2 = {
|
|
456
455
|
typeid: 'consttest6:template-2.0.0',
|
|
@@ -458,9 +457,9 @@ describe('PropertyFactory', function () {
|
|
|
458
457
|
constants: [
|
|
459
458
|
{
|
|
460
459
|
id: 'const1',
|
|
461
|
-
value: 'hello3'
|
|
462
|
-
}
|
|
463
|
-
]
|
|
460
|
+
value: 'hello3',
|
|
461
|
+
},
|
|
462
|
+
],
|
|
464
463
|
};
|
|
465
464
|
try {
|
|
466
465
|
PropertyFactory.register(template1);
|
|
@@ -480,18 +479,18 @@ describe('PropertyFactory', function () {
|
|
|
480
479
|
id: 'const1',
|
|
481
480
|
typeid: 'String',
|
|
482
481
|
value: 'hello',
|
|
483
|
-
annotation: { description: 'The first constant.' }
|
|
484
|
-
}
|
|
485
|
-
]
|
|
482
|
+
annotation: { description: 'The first constant.' },
|
|
483
|
+
},
|
|
484
|
+
],
|
|
486
485
|
};
|
|
487
486
|
var testedTemplate = {
|
|
488
487
|
typeid: 'consttest7:template-2.0.0',
|
|
489
488
|
inherits: 'consttest7:template-1.0.0',
|
|
490
489
|
constants: [
|
|
491
490
|
{
|
|
492
|
-
value: 'hello2'
|
|
493
|
-
}
|
|
494
|
-
]
|
|
491
|
+
value: 'hello2',
|
|
492
|
+
},
|
|
493
|
+
],
|
|
495
494
|
};
|
|
496
495
|
try {
|
|
497
496
|
PropertyFactory.register(template1);
|
|
@@ -504,14 +503,14 @@ describe('PropertyFactory', function () {
|
|
|
504
503
|
});
|
|
505
504
|
it('should allow inheriting from schemas with no properties defined', function () {
|
|
506
505
|
var ShapeAbstract1 = {
|
|
507
|
-
typeid: 'SimpleTest:ShapeAbstract1-1.0.0'
|
|
506
|
+
typeid: 'SimpleTest:ShapeAbstract1-1.0.0',
|
|
508
507
|
};
|
|
509
508
|
var ShapeAbstract2 = {
|
|
510
509
|
typeid: 'SimpleTest:ShapeAbstract2-1.0.0',
|
|
511
510
|
properties: [
|
|
512
511
|
{ id: 'area', properties: [] },
|
|
513
|
-
{ id: 'color' }
|
|
514
|
-
]
|
|
512
|
+
{ id: 'color' },
|
|
513
|
+
],
|
|
515
514
|
};
|
|
516
515
|
var SquareAbstract = {
|
|
517
516
|
typeid: 'SimpleTest:SquareAbstract-1.0.0',
|
|
@@ -521,10 +520,10 @@ describe('PropertyFactory', function () {
|
|
|
521
520
|
{ id: 'originY' },
|
|
522
521
|
{
|
|
523
522
|
id: 'color', properties: [
|
|
524
|
-
{ id: 'rgb', typeid: 'Int64' }
|
|
525
|
-
]
|
|
526
|
-
}
|
|
527
|
-
]
|
|
523
|
+
{ id: 'rgb', typeid: 'Int64' },
|
|
524
|
+
],
|
|
525
|
+
},
|
|
526
|
+
],
|
|
528
527
|
};
|
|
529
528
|
PropertyFactory.register(ShapeAbstract1);
|
|
530
529
|
PropertyFactory.register(ShapeAbstract2);
|
|
@@ -542,8 +541,8 @@ describe('PropertyFactory', function () {
|
|
|
542
541
|
typeid: 'SimpleTest:SquareWithColor-1.0.0',
|
|
543
542
|
inherits: ['SimpleTest:Shape-1.0.0', 'SimpleTest:Color-1.0.0'],
|
|
544
543
|
properties: [
|
|
545
|
-
{ id: 'area', typeid: 'Float32' }
|
|
546
|
-
]
|
|
544
|
+
{ id: 'area', typeid: 'Float32' },
|
|
545
|
+
],
|
|
547
546
|
};
|
|
548
547
|
PropertyFactory.register(SquareWithColor);
|
|
549
548
|
var square = PropertyFactory.create('SimpleTest:SquareWithColor-1.0.0');
|
|
@@ -560,15 +559,15 @@ describe('PropertyFactory', function () {
|
|
|
560
559
|
id: 'props', properties: [
|
|
561
560
|
{ id: 'x', typeid: 'Float32' },
|
|
562
561
|
{ id: 'y', typeid: 'Float32' }
|
|
563
|
-
]
|
|
564
|
-
}]
|
|
562
|
+
],
|
|
563
|
+
}],
|
|
565
564
|
};
|
|
566
565
|
var ShapeWithInheritanceError = {
|
|
567
566
|
typeid: 'SimpleTest:ShapeWithInheritanceError-1.0.0',
|
|
568
567
|
inherits: ['SimpleTest:Shape-1.0.0', 'SimpleTest:Point-1.0.0'],
|
|
569
568
|
properties: [
|
|
570
|
-
{ id: 'weight', typeid: 'Float32' }
|
|
571
|
-
]
|
|
569
|
+
{ id: 'weight', typeid: 'Float32' },
|
|
570
|
+
],
|
|
572
571
|
};
|
|
573
572
|
PropertyFactory.register(Point);
|
|
574
573
|
PropertyFactory.register(ShapeWithInheritanceError);
|
|
@@ -579,7 +578,7 @@ describe('PropertyFactory', function () {
|
|
|
579
578
|
var ShapeWithOverridesError = {
|
|
580
579
|
typeid: 'SimpleTest:ShapeWithOverridesError-1.0.0',
|
|
581
580
|
inherits: ['SimpleTest:Shape-1.0.0'],
|
|
582
|
-
properties: [{ id: 'props', typeid: 'Float32' }]
|
|
581
|
+
properties: [{ id: 'props', typeid: 'Float32' }],
|
|
583
582
|
};
|
|
584
583
|
PropertyFactory.register(ShapeWithOverridesError);
|
|
585
584
|
expect(PropertyFactory.create.bind(PropertyFactory, 'SimpleTest:ShapeWithOverridesError-1.0.0'))
|
|
@@ -600,18 +599,18 @@ describe('PropertyFactory', function () {
|
|
|
600
599
|
{
|
|
601
600
|
id: 'border', properties: [
|
|
602
601
|
{ id: 'color', typeid: 'String' }
|
|
603
|
-
]
|
|
602
|
+
],
|
|
604
603
|
}
|
|
605
|
-
]
|
|
604
|
+
],
|
|
606
605
|
}
|
|
607
|
-
]
|
|
606
|
+
],
|
|
608
607
|
},
|
|
609
608
|
{
|
|
610
609
|
id: 'fill', properties: [
|
|
611
610
|
{ id: 'unit', typeid: 'Int32' }
|
|
612
|
-
]
|
|
611
|
+
],
|
|
613
612
|
}
|
|
614
|
-
]
|
|
613
|
+
],
|
|
615
614
|
};
|
|
616
615
|
PropertyFactory.register(SquareWithOverrides);
|
|
617
616
|
var square = PropertyFactory.create('SimpleTest:SquareWithOverrides-1.0.0');
|
|
@@ -647,11 +646,11 @@ describe('PropertyFactory', function () {
|
|
|
647
646
|
{
|
|
648
647
|
id: 'area', properties: [
|
|
649
648
|
{ id: 'length', typeid: 'Float32' }
|
|
650
|
-
]
|
|
649
|
+
],
|
|
651
650
|
}
|
|
652
|
-
]
|
|
651
|
+
],
|
|
653
652
|
}
|
|
654
|
-
]
|
|
653
|
+
],
|
|
655
654
|
};
|
|
656
655
|
var SquareWithArea = {
|
|
657
656
|
typeid: 'SimpleTest:SquareWithArea-1.0.0',
|
|
@@ -664,11 +663,11 @@ describe('PropertyFactory', function () {
|
|
|
664
663
|
{
|
|
665
664
|
id: 'area', properties: [
|
|
666
665
|
{ id: 'unit', typeid: 'String' }
|
|
667
|
-
]
|
|
666
|
+
],
|
|
668
667
|
}
|
|
669
|
-
]
|
|
668
|
+
],
|
|
670
669
|
}
|
|
671
|
-
]
|
|
670
|
+
],
|
|
672
671
|
};
|
|
673
672
|
PropertyFactory.register(ShapeWithArea);
|
|
674
673
|
PropertyFactory.register(SquareWithArea);
|
|
@@ -695,57 +694,57 @@ describe('PropertyFactory', function () {
|
|
|
695
694
|
'properties': [
|
|
696
695
|
{
|
|
697
696
|
'id': 'value',
|
|
698
|
-
'typeid': 'Float64'
|
|
697
|
+
'typeid': 'Float64',
|
|
699
698
|
},
|
|
700
699
|
{
|
|
701
700
|
'id': 'unit',
|
|
702
|
-
'typeid': 'String'
|
|
703
|
-
}
|
|
704
|
-
]
|
|
701
|
+
'typeid': 'String',
|
|
702
|
+
},
|
|
703
|
+
],
|
|
705
704
|
},
|
|
706
705
|
{
|
|
707
706
|
'id': 'boundingBox',
|
|
708
707
|
'properties': [
|
|
709
708
|
{
|
|
710
709
|
'id': 'length',
|
|
711
|
-
'typeid': 'Float64'
|
|
710
|
+
'typeid': 'Float64',
|
|
712
711
|
},
|
|
713
712
|
{
|
|
714
713
|
'id': 'width',
|
|
715
|
-
'typeid': 'Float64'
|
|
714
|
+
'typeid': 'Float64',
|
|
716
715
|
},
|
|
717
716
|
{
|
|
718
717
|
'id': 'height',
|
|
719
|
-
'typeid': 'Float64'
|
|
718
|
+
'typeid': 'Float64',
|
|
720
719
|
},
|
|
721
720
|
{
|
|
722
721
|
'id': 'unit',
|
|
723
|
-
'typeid': 'String'
|
|
724
|
-
}
|
|
725
|
-
]
|
|
722
|
+
'typeid': 'String',
|
|
723
|
+
},
|
|
724
|
+
],
|
|
726
725
|
},
|
|
727
726
|
{
|
|
728
727
|
'id': 'material',
|
|
729
|
-
'typeid': 'String'
|
|
730
|
-
}
|
|
728
|
+
'typeid': 'String',
|
|
729
|
+
},
|
|
731
730
|
],
|
|
732
731
|
'annotation': {
|
|
733
|
-
'description': 'Specialized component storing physical properties computed from a model.'
|
|
734
|
-
}
|
|
732
|
+
'description': 'Specialized component storing physical properties computed from a model.',
|
|
733
|
+
},
|
|
735
734
|
};
|
|
736
735
|
PropertyFactory.register(DefaultInitialValue);
|
|
737
736
|
var prop = PropertyFactory.create('autodesk.product:components.physicalProperties-0.0.0', null, {
|
|
738
737
|
mass: {
|
|
739
738
|
value: 1.2,
|
|
740
|
-
unit: 'units'
|
|
739
|
+
unit: 'units',
|
|
741
740
|
},
|
|
742
741
|
boundingBox: {
|
|
743
742
|
length: 1.2,
|
|
744
743
|
width: 1.4,
|
|
745
744
|
height: 34.2,
|
|
746
|
-
unit: 'units'
|
|
745
|
+
unit: 'units',
|
|
747
746
|
},
|
|
748
|
-
material: 'ABS Plastic'
|
|
747
|
+
material: 'ABS Plastic',
|
|
749
748
|
});
|
|
750
749
|
expect(prop.get('boundingBox').get('length').value).to.equal(1.2);
|
|
751
750
|
});
|
|
@@ -755,15 +754,15 @@ describe('PropertyFactory', function () {
|
|
|
755
754
|
typeid: 'SimpleTest:MapNestedWithOverriddenDefaults-1.0.0',
|
|
756
755
|
inherits: ['NamedProperty'],
|
|
757
756
|
properties: [{
|
|
758
|
-
id: 'map_nested', typeid: 'SimpleTest:EntryWithOverriddenDefaults-1.0.0', context: 'map'
|
|
759
|
-
}]
|
|
757
|
+
id: 'map_nested', typeid: 'SimpleTest:EntryWithOverriddenDefaults-1.0.0', context: 'map',
|
|
758
|
+
}],
|
|
760
759
|
};
|
|
761
760
|
var SetNestedWithOverriddenDefaults = {
|
|
762
761
|
typeid: 'SimpleTest:SetNestedWithOverriddenDefaults-1.0.0',
|
|
763
762
|
inherits: ['NamedProperty'],
|
|
764
763
|
properties: [{
|
|
765
|
-
id: 'set_nested', typeid: 'SimpleTest:EntryWithOverriddenDefaults-1.0.0', context: 'set'
|
|
766
|
-
}]
|
|
764
|
+
id: 'set_nested', typeid: 'SimpleTest:EntryWithOverriddenDefaults-1.0.0', context: 'set',
|
|
765
|
+
}],
|
|
767
766
|
};
|
|
768
767
|
var ShapeWithOverriddenDefaults = {
|
|
769
768
|
typeid: 'SimpleTest:ShapeWithOverriddenDefaults-1.0.0',
|
|
@@ -773,82 +772,82 @@ describe('PropertyFactory', function () {
|
|
|
773
772
|
{
|
|
774
773
|
id: 'array_poly', typeid: 'SimpleTest:EntryWithOverriddenDefaults-1.0.0', context: 'array', value: [
|
|
775
774
|
{ string: 'entry_string_poly' }
|
|
776
|
-
]
|
|
775
|
+
],
|
|
777
776
|
},
|
|
778
777
|
{
|
|
779
778
|
id: 'enum', typeid: 'Enum', properties: [{ id: 'solid', value: 1 }, { id: 'dashed', value: 2 }],
|
|
780
|
-
value: 'solid'
|
|
779
|
+
value: 'solid',
|
|
781
780
|
},
|
|
782
781
|
{
|
|
783
782
|
id: 'untyped', properties: [
|
|
784
783
|
{ id: 'num', typeid: 'Uint32' },
|
|
785
|
-
{ id: 'string', typeid: 'String' }
|
|
786
|
-
], value: { string: 'untyped_string', num: 1 }
|
|
784
|
+
{ id: 'string', typeid: 'String' },
|
|
785
|
+
], value: { string: 'untyped_string', num: 1 },
|
|
787
786
|
},
|
|
788
787
|
{
|
|
789
788
|
id: 'template', typeid: 'SimpleTest:DynamicWithOverriddenDefaults-1.0.0', value: {
|
|
790
|
-
num: 1, dynamic: { dynamic_string: 'dynamic_string' }
|
|
791
|
-
}
|
|
789
|
+
num: 1, dynamic: { dynamic_string: 'dynamic_string' },
|
|
790
|
+
},
|
|
792
791
|
},
|
|
793
792
|
{
|
|
794
793
|
id: 'map_primitive', typeid: 'Int32', context: 'map', value: {
|
|
795
794
|
key1: 1,
|
|
796
|
-
key3: 3
|
|
797
|
-
}
|
|
795
|
+
key3: 3,
|
|
796
|
+
},
|
|
798
797
|
},
|
|
799
798
|
{
|
|
800
799
|
id: 'map', typeid: 'SimpleTest:EntryWithOverriddenDefaults-1.0.0', context: 'map', value: {
|
|
801
800
|
key1: { string: 'map_string_1' },
|
|
802
|
-
key3: { string: 'map_string_3' }
|
|
803
|
-
}
|
|
801
|
+
key3: { string: 'map_string_3' },
|
|
802
|
+
},
|
|
804
803
|
},
|
|
805
804
|
{
|
|
806
805
|
id: 'map_poly', typeid: 'SimpleTest:EntryWithOverriddenDefaults-1.0.0', context: 'map', value: {
|
|
807
806
|
key1: { string: 'map_poly_string_1' },
|
|
808
|
-
key3: { string: 'map_poly_string_3' }
|
|
809
|
-
}
|
|
807
|
+
key3: { string: 'map_poly_string_3' },
|
|
808
|
+
},
|
|
810
809
|
},
|
|
811
810
|
{
|
|
812
811
|
id: 'map_nest', typeid: 'SimpleTest:MapNestedWithOverriddenDefaults-1.0.0', context: 'map', value: {
|
|
813
812
|
key1: {
|
|
814
813
|
map_nested: {
|
|
815
814
|
key1_1: { string: 'map_nested_1_string_1' },
|
|
816
|
-
key1_3: { string: 'map_nested_1_string_3' }
|
|
817
|
-
}
|
|
815
|
+
key1_3: { string: 'map_nested_1_string_3' },
|
|
816
|
+
},
|
|
818
817
|
},
|
|
819
818
|
key3: {
|
|
820
819
|
map_nested: {
|
|
821
|
-
key3_1: { string: 'map_nested_3_string_1' }
|
|
822
|
-
}
|
|
823
|
-
}
|
|
824
|
-
}
|
|
820
|
+
key3_1: { string: 'map_nested_3_string_1' },
|
|
821
|
+
},
|
|
822
|
+
},
|
|
823
|
+
},
|
|
825
824
|
},
|
|
826
825
|
{
|
|
827
826
|
id: 'set', typeid: 'SimpleTest:EntryWithOverriddenDefaults-1.0.0', context: 'set', value: [
|
|
828
827
|
{ string: 'set_string_1' },
|
|
829
|
-
{ string: 'set_string_2' }
|
|
830
|
-
]
|
|
828
|
+
{ string: 'set_string_2' },
|
|
829
|
+
],
|
|
831
830
|
},
|
|
832
831
|
{
|
|
833
832
|
id: 'set_poly', typeid: 'SimpleTest:EntryWithOverriddenDefaults-1.0.0', context: 'set', value: [
|
|
834
833
|
{ string: 'set_poly_string_1' },
|
|
835
|
-
{ string: 'set_poly_string_1' }
|
|
836
|
-
]
|
|
834
|
+
{ string: 'set_poly_string_1' },
|
|
835
|
+
],
|
|
837
836
|
},
|
|
838
837
|
{
|
|
839
838
|
id: 'set_nest', typeid: 'SimpleTest:SetNestedWithOverriddenDefaults-1.0.0', context: 'set', value: [{
|
|
840
839
|
set_nested: [
|
|
841
840
|
{ string: 'set_nested_1_string_1' },
|
|
842
|
-
{ string: 'set_nested_1_string_2' }
|
|
843
|
-
]
|
|
841
|
+
{ string: 'set_nested_1_string_2' },
|
|
842
|
+
],
|
|
844
843
|
}, {
|
|
845
844
|
set_nested: [
|
|
846
845
|
{ string: 'set_nested_3_string_1' },
|
|
847
|
-
{ string: 'set_nested_3_string_2' }
|
|
848
|
-
]
|
|
849
|
-
}]
|
|
850
|
-
}
|
|
851
|
-
]
|
|
846
|
+
{ string: 'set_nested_3_string_2' },
|
|
847
|
+
],
|
|
848
|
+
}],
|
|
849
|
+
},
|
|
850
|
+
],
|
|
852
851
|
};
|
|
853
852
|
var SquareWithOverriddenDefaults = {
|
|
854
853
|
typeid: 'SimpleTest:SquareWithOverriddenDefaults-1.0.0',
|
|
@@ -857,100 +856,100 @@ describe('PropertyFactory', function () {
|
|
|
857
856
|
{ id: 'num', typeid: 'Int8', value: 2 },
|
|
858
857
|
{
|
|
859
858
|
id: 'array', typeid: 'String', value: ['array_string_1_inherited', 'array_string_2_inherited'],
|
|
860
|
-
context: 'array'
|
|
859
|
+
context: 'array',
|
|
861
860
|
},
|
|
862
861
|
{
|
|
863
862
|
id: 'array_poly', typeid: 'SimpleTest:EntryWithOverriddenDefaults-1.0.0', context: 'array', typedValue: [{
|
|
864
863
|
typeid: 'SimpleTest:EntryWithOverriddenPolyDefaults-1.0.0',
|
|
865
|
-
value: { string: 'entry_string_poly_1_inherited' }
|
|
864
|
+
value: { string: 'entry_string_poly_1_inherited' },
|
|
866
865
|
},
|
|
867
866
|
{
|
|
868
867
|
typeid: 'SimpleTest:EntryWithOverriddenPolyDefaults-1.0.0',
|
|
869
|
-
value: { string: 'entry_string_poly_2_inherited' }
|
|
870
|
-
}
|
|
871
|
-
]
|
|
868
|
+
value: { string: 'entry_string_poly_2_inherited' },
|
|
869
|
+
},
|
|
870
|
+
],
|
|
872
871
|
},
|
|
873
872
|
{
|
|
874
873
|
id: 'enum', typeid: 'Enum', properties: [{ id: 'solid', value: 1 }, { id: 'dashed', value: 2 }],
|
|
875
|
-
value: 'dashed'
|
|
874
|
+
value: 'dashed',
|
|
876
875
|
},
|
|
877
876
|
{
|
|
878
877
|
id: 'untyped', properties: [
|
|
879
878
|
{ id: 'num', typeid: 'Uint32' },
|
|
880
|
-
{ id: 'string', typeid: 'String' }
|
|
881
|
-
], value: { string: 'untyped_string_inherited', num: 2 }
|
|
879
|
+
{ id: 'string', typeid: 'String' },
|
|
880
|
+
], value: { string: 'untyped_string_inherited', num: 2 },
|
|
882
881
|
},
|
|
883
882
|
{
|
|
884
883
|
id: 'template', typeid: 'SimpleTest:DynamicWithOverriddenDefaults-1.0.0', value: {
|
|
885
|
-
num: 2, dynamic: { dynamic_string: 'dynamic_string_inherited' }
|
|
886
|
-
}
|
|
884
|
+
num: 2, dynamic: { dynamic_string: 'dynamic_string_inherited' },
|
|
885
|
+
},
|
|
887
886
|
},
|
|
888
887
|
{
|
|
889
888
|
id: 'map_primitive', typeid: 'Int32', context: 'map', value: {
|
|
890
889
|
key2: 2,
|
|
891
|
-
key3: 3
|
|
892
|
-
}
|
|
890
|
+
key3: 3,
|
|
891
|
+
},
|
|
893
892
|
},
|
|
894
893
|
{
|
|
895
894
|
id: 'map', typeid: 'SimpleTest:EntryWithOverriddenDefaults-1.0.0', context: 'map', value: {
|
|
896
895
|
key2: { string: 'map_string_2_inherited' },
|
|
897
|
-
key3: { string: 'map_string_3_inherited' }
|
|
898
|
-
}
|
|
896
|
+
key3: { string: 'map_string_3_inherited' },
|
|
897
|
+
},
|
|
899
898
|
},
|
|
900
899
|
{
|
|
901
900
|
id: 'map_poly', typeid: 'SimpleTest:EntryWithOverriddenDefaults-1.0.0', context: 'map', typedValue: {
|
|
902
901
|
key2: {
|
|
903
902
|
typeid: 'SimpleTest:EntryWithOverriddenPolyDefaults-1.0.0',
|
|
904
|
-
value: { string: 'map_poly_string_2_inherited' }
|
|
903
|
+
value: { string: 'map_poly_string_2_inherited' },
|
|
905
904
|
},
|
|
906
905
|
key3: {
|
|
907
906
|
typeid: 'SimpleTest:EntryWithOverriddenPolyDefaults-1.0.0',
|
|
908
|
-
value: { string: 'map_poly_string_3_inherited' }
|
|
909
|
-
}
|
|
910
|
-
}
|
|
907
|
+
value: { string: 'map_poly_string_3_inherited' },
|
|
908
|
+
},
|
|
909
|
+
},
|
|
911
910
|
},
|
|
912
911
|
{
|
|
913
912
|
id: 'map_nest', typeid: 'SimpleTest:MapNestedWithOverriddenDefaults-1.0.0', context: 'map', value: {
|
|
914
913
|
key2: {
|
|
915
914
|
map_nested: {
|
|
916
915
|
key2_2: { string: 'map_nested_2_string_2_inherited' },
|
|
917
|
-
key2_3: { string: 'map_nested_2_string_3_inherited' }
|
|
918
|
-
}
|
|
916
|
+
key2_3: { string: 'map_nested_2_string_3_inherited' },
|
|
917
|
+
},
|
|
919
918
|
},
|
|
920
919
|
key3: {
|
|
921
920
|
map_nested: {
|
|
922
|
-
key3_1: { string: 'map_nested_3_string_1_inherited' }
|
|
923
|
-
}
|
|
924
|
-
}
|
|
925
|
-
}
|
|
921
|
+
key3_1: { string: 'map_nested_3_string_1_inherited' },
|
|
922
|
+
},
|
|
923
|
+
},
|
|
924
|
+
},
|
|
926
925
|
},
|
|
927
926
|
{
|
|
928
927
|
id: 'set', typeid: 'SimpleTest:EntryWithOverriddenDefaults-1.0.0', context: 'set', value: [
|
|
929
928
|
{ string: 'set_string_2_inherited' },
|
|
930
|
-
{ string: 'set_string_3_inherited' }
|
|
931
|
-
]
|
|
929
|
+
{ string: 'set_string_3_inherited' },
|
|
930
|
+
],
|
|
932
931
|
},
|
|
933
932
|
{
|
|
934
933
|
id: 'set_poly', typeid: 'SimpleTest:EntryWithOverriddenDefaults-1.0.0', context: 'set', typedValue: [
|
|
935
934
|
{
|
|
936
935
|
typeid: 'SimpleTest:EntryWithOverriddenDefaults-1.0.0',
|
|
937
|
-
value: { string: 'set_poly_string_2_inherited' }
|
|
936
|
+
value: { string: 'set_poly_string_2_inherited' },
|
|
938
937
|
},
|
|
939
938
|
{
|
|
940
939
|
typeid: 'SimpleTest:EntryWithOverriddenDefaults-1.0.0',
|
|
941
|
-
value: { string: 'set_poly_string_3_inherited' }
|
|
942
|
-
}
|
|
943
|
-
]
|
|
940
|
+
value: { string: 'set_poly_string_3_inherited' },
|
|
941
|
+
},
|
|
942
|
+
],
|
|
944
943
|
},
|
|
945
944
|
{
|
|
946
945
|
id: 'set_nest', typeid: 'SimpleTest:SetNestedWithOverriddenDefaults-1.0.0', context: 'set', value: [{
|
|
947
946
|
set_nested: [
|
|
948
947
|
{ string: 'set_nested_2_string_1_inherited' },
|
|
949
|
-
{ string: 'set_nested_2_string_2_inherited' }
|
|
950
|
-
]
|
|
951
|
-
}]
|
|
952
|
-
}
|
|
953
|
-
]
|
|
948
|
+
{ string: 'set_nested_2_string_2_inherited' },
|
|
949
|
+
],
|
|
950
|
+
}],
|
|
951
|
+
},
|
|
952
|
+
],
|
|
954
953
|
};
|
|
955
954
|
PropertyFactory.register(MapNestedWithOverriddenDefaults);
|
|
956
955
|
PropertyFactory.register(SetNestedWithOverriddenDefaults);
|
|
@@ -960,7 +959,7 @@ describe('PropertyFactory', function () {
|
|
|
960
959
|
expect(instance._getChildrenCount()).to.equal(13);
|
|
961
960
|
expect(instance.resolvePath('num').getValue()).and.eql(2);
|
|
962
961
|
expect(instance.resolvePath('array').getValues()).and.eql([
|
|
963
|
-
'array_string_1_inherited', 'array_string_2_inherited'
|
|
962
|
+
'array_string_1_inherited', 'array_string_2_inherited',
|
|
964
963
|
]);
|
|
965
964
|
expect(instance.resolvePath('array_poly').getValues().length).to.eql(2);
|
|
966
965
|
expect(instance.resolvePath('array_poly').getValues()[0].string).to.eql('entry_string_poly_1_inherited');
|
|
@@ -1017,12 +1016,12 @@ describe('PropertyFactory', function () {
|
|
|
1017
1016
|
it('should not allow overriding default values when typeid is different', function () {
|
|
1018
1017
|
var ShapeWithDiffTypeidDefaults = {
|
|
1019
1018
|
typeid: 'SimpleTest:ShapeWithDiffTypeidDefaults-1.0.0',
|
|
1020
|
-
properties: [{ id: 'num', typeid: 'Int8', value: 1 }]
|
|
1019
|
+
properties: [{ id: 'num', typeid: 'Int8', value: 1 }],
|
|
1021
1020
|
};
|
|
1022
1021
|
var SquareWithDiffTypeidDefaults = {
|
|
1023
1022
|
typeid: 'SimpleTest:SquareWithDiffTypeidDefaults-1.0.0',
|
|
1024
1023
|
inherits: ['SimpleTest:ShapeWithDiffTypeidDefaults-1.0.0'],
|
|
1025
|
-
properties: [{ id: 'num', typeid: 'Int32', value: 2 }]
|
|
1024
|
+
properties: [{ id: 'num', typeid: 'Int32', value: 2 }],
|
|
1026
1025
|
};
|
|
1027
1026
|
PropertyFactory.register(ShapeWithDiffTypeidDefaults);
|
|
1028
1027
|
PropertyFactory.register(SquareWithDiffTypeidDefaults);
|
|
@@ -1032,12 +1031,12 @@ describe('PropertyFactory', function () {
|
|
|
1032
1031
|
it('should not allow overriding default values when context is different', function () {
|
|
1033
1032
|
var ShapeWithDiffContextDefaults = {
|
|
1034
1033
|
typeid: 'SimpleTest:ShapeWithDiffContextDefaults-1.0.0',
|
|
1035
|
-
properties: [{ id: 'num', typeid: 'Int8', value: 1 }]
|
|
1034
|
+
properties: [{ id: 'num', typeid: 'Int8', value: 1 }],
|
|
1036
1035
|
};
|
|
1037
1036
|
var SquareWithDiffContextDefaults = {
|
|
1038
1037
|
typeid: 'SimpleTest:SquareWithDiffContextDefaults-1.0.0',
|
|
1039
1038
|
inherits: ['SimpleTest:ShapeWithDiffContextDefaults-1.0.0'],
|
|
1040
|
-
properties: [{ id: 'num', typeid: 'Int8', value: [1, 2], context: 'array' }]
|
|
1039
|
+
properties: [{ id: 'num', typeid: 'Int8', value: [1, 2], context: 'array' }],
|
|
1041
1040
|
};
|
|
1042
1041
|
PropertyFactory.register(ShapeWithDiffContextDefaults);
|
|
1043
1042
|
PropertyFactory.register(SquareWithDiffContextDefaults);
|
|
@@ -1051,15 +1050,15 @@ describe('PropertyFactory', function () {
|
|
|
1051
1050
|
typeid: 'SimpleTest:EntryWithOverriddenConstants-1.0.0',
|
|
1052
1051
|
inherits: ['NamedProperty'],
|
|
1053
1052
|
constants: [
|
|
1054
|
-
{ id: 'string', typeid: 'String', value: 'entry_string' }
|
|
1055
|
-
]
|
|
1053
|
+
{ id: 'string', typeid: 'String', value: 'entry_string' },
|
|
1054
|
+
],
|
|
1056
1055
|
};
|
|
1057
1056
|
var EntryWithOverriddenPolyConstants = {
|
|
1058
1057
|
typeid: 'SimpleTest:EntryWithOverriddenPolyConstants-1.0.0',
|
|
1059
1058
|
inherits: ['SimpleTest:EntryWithOverriddenConstants-1.0.0'],
|
|
1060
1059
|
constants: [
|
|
1061
|
-
{ id: 'string', typeid: 'String', value: 'entry_string' }
|
|
1062
|
-
]
|
|
1060
|
+
{ id: 'string', typeid: 'String', value: 'entry_string' },
|
|
1061
|
+
],
|
|
1063
1062
|
};
|
|
1064
1063
|
var DynamicWithOverriddenConstants = {
|
|
1065
1064
|
typeid: 'SimpleTest:DynamicWithOverriddenConstants-1.0.0',
|
|
@@ -1067,24 +1066,24 @@ describe('PropertyFactory', function () {
|
|
|
1067
1066
|
properties: [
|
|
1068
1067
|
{
|
|
1069
1068
|
id: 'dynamic', properties: [
|
|
1070
|
-
{ id: 'dynamic_string', typeid: 'String' }
|
|
1071
|
-
]
|
|
1072
|
-
}
|
|
1073
|
-
]
|
|
1069
|
+
{ id: 'dynamic_string', typeid: 'String' },
|
|
1070
|
+
],
|
|
1071
|
+
},
|
|
1072
|
+
],
|
|
1074
1073
|
};
|
|
1075
1074
|
var MapNestedWithOverriddenConstants = {
|
|
1076
1075
|
typeid: 'SimpleTest:MapNestedWithOverriddenConstants-1.0.0',
|
|
1077
1076
|
inherits: ['NamedProperty'],
|
|
1078
1077
|
constants: [{
|
|
1079
|
-
id: 'map_nested', typeid: 'SimpleTest:EntryWithOverriddenConstants-1.0.0', context: 'map', value: {}
|
|
1080
|
-
}]
|
|
1078
|
+
id: 'map_nested', typeid: 'SimpleTest:EntryWithOverriddenConstants-1.0.0', context: 'map', value: {},
|
|
1079
|
+
}],
|
|
1081
1080
|
};
|
|
1082
1081
|
var SetNestedWithOverriddenConstants = {
|
|
1083
1082
|
typeid: 'SimpleTest:SetNestedWithOverriddenConstants-1.0.0',
|
|
1084
1083
|
inherits: ['NamedProperty'],
|
|
1085
1084
|
constants: [{
|
|
1086
|
-
id: 'set_nested', typeid: 'SimpleTest:EntryWithOverriddenConstants-1.0.0', context: 'set', value: []
|
|
1087
|
-
}]
|
|
1085
|
+
id: 'set_nested', typeid: 'SimpleTest:EntryWithOverriddenConstants-1.0.0', context: 'set', value: [],
|
|
1086
|
+
}],
|
|
1088
1087
|
};
|
|
1089
1088
|
var ShapeWithOverriddenConstants = {
|
|
1090
1089
|
typeid: 'SimpleTest:ShapeWithOverriddenConstants-1.0.0',
|
|
@@ -1094,72 +1093,72 @@ describe('PropertyFactory', function () {
|
|
|
1094
1093
|
{
|
|
1095
1094
|
id: 'array_poly', typeid: 'SimpleTest:EntryWithOverriddenConstants-1.0.0', context: 'array', value: [
|
|
1096
1095
|
{ string: 'entry_string_poly' }
|
|
1097
|
-
]
|
|
1096
|
+
],
|
|
1098
1097
|
},
|
|
1099
1098
|
{
|
|
1100
1099
|
id: 'template', typeid: 'SimpleTest:DynamicWithOverriddenConstants-1.0.0', value: {
|
|
1101
|
-
num: 1, dynamic: { dynamic_string: 'dynamic_string' }
|
|
1102
|
-
}
|
|
1100
|
+
num: 1, dynamic: { dynamic_string: 'dynamic_string' },
|
|
1101
|
+
},
|
|
1103
1102
|
},
|
|
1104
1103
|
{
|
|
1105
1104
|
id: 'map_primitive', typeid: 'Int32', context: 'map', value: {
|
|
1106
1105
|
key1: 1,
|
|
1107
|
-
key3: 3
|
|
1108
|
-
}
|
|
1106
|
+
key3: 3,
|
|
1107
|
+
},
|
|
1109
1108
|
},
|
|
1110
1109
|
{
|
|
1111
1110
|
id: 'map', typeid: 'SimpleTest:EntryWithOverriddenConstants-1.0.0', context: 'map', value: {
|
|
1112
1111
|
key1: { string: 'map_string_1' },
|
|
1113
|
-
key3: { string: 'map_string_3' }
|
|
1114
|
-
}
|
|
1112
|
+
key3: { string: 'map_string_3' },
|
|
1113
|
+
},
|
|
1115
1114
|
},
|
|
1116
1115
|
{
|
|
1117
1116
|
id: 'map_poly', typeid: 'SimpleTest:EntryWithOverriddenConstants-1.0.0', context: 'map', value: {
|
|
1118
1117
|
key1: { string: 'map_poly_string_1' },
|
|
1119
|
-
key3: { string: 'map_poly_string_3' }
|
|
1120
|
-
}
|
|
1118
|
+
key3: { string: 'map_poly_string_3' },
|
|
1119
|
+
},
|
|
1121
1120
|
},
|
|
1122
1121
|
{
|
|
1123
1122
|
id: 'map_nest', typeid: 'SimpleTest:MapNestedWithOverriddenConstants-1.0.0', context: 'map', value: {
|
|
1124
1123
|
key1: {
|
|
1125
1124
|
map_nested: {
|
|
1126
1125
|
key1_1: { string: 'map_nested_1_string_1' },
|
|
1127
|
-
key1_3: { string: 'map_nested_1_string_3' }
|
|
1128
|
-
}
|
|
1126
|
+
key1_3: { string: 'map_nested_1_string_3' },
|
|
1127
|
+
},
|
|
1129
1128
|
},
|
|
1130
1129
|
key3: {
|
|
1131
1130
|
map_nested: {
|
|
1132
|
-
key3_1: { string: 'map_nested_3_string_1' }
|
|
1133
|
-
}
|
|
1134
|
-
}
|
|
1135
|
-
}
|
|
1131
|
+
key3_1: { string: 'map_nested_3_string_1' },
|
|
1132
|
+
},
|
|
1133
|
+
},
|
|
1134
|
+
},
|
|
1136
1135
|
},
|
|
1137
1136
|
{
|
|
1138
1137
|
id: 'set', typeid: 'SimpleTest:EntryWithOverriddenConstants-1.0.0', context: 'set', value: [
|
|
1139
1138
|
{ string: 'set_string_1' },
|
|
1140
|
-
{ string: 'set_string_2' }
|
|
1141
|
-
]
|
|
1139
|
+
{ string: 'set_string_2' },
|
|
1140
|
+
],
|
|
1142
1141
|
},
|
|
1143
1142
|
{
|
|
1144
1143
|
id: 'set_poly', typeid: 'SimpleTest:EntryWithOverriddenConstants-1.0.0', context: 'set', value: [
|
|
1145
1144
|
{ string: 'set_poly_string_1' },
|
|
1146
|
-
{ string: 'set_poly_string_1' }
|
|
1147
|
-
]
|
|
1145
|
+
{ string: 'set_poly_string_1' },
|
|
1146
|
+
],
|
|
1148
1147
|
},
|
|
1149
1148
|
{
|
|
1150
1149
|
id: 'set_nest', typeid: 'SimpleTest:SetNestedWithOverriddenConstants-1.0.0', context: 'set', value: [{
|
|
1151
1150
|
set_nested: [
|
|
1152
1151
|
{ string: 'set_nested_1_string_1' },
|
|
1153
|
-
{ string: 'set_nested_1_string_2' }
|
|
1154
|
-
]
|
|
1152
|
+
{ string: 'set_nested_1_string_2' },
|
|
1153
|
+
],
|
|
1155
1154
|
}, {
|
|
1156
1155
|
set_nested: [
|
|
1157
1156
|
{ string: 'set_nested_3_string_1' },
|
|
1158
|
-
{ string: 'set_nested_3_string_2' }
|
|
1159
|
-
]
|
|
1160
|
-
}]
|
|
1161
|
-
}
|
|
1162
|
-
]
|
|
1157
|
+
{ string: 'set_nested_3_string_2' },
|
|
1158
|
+
],
|
|
1159
|
+
}],
|
|
1160
|
+
},
|
|
1161
|
+
],
|
|
1163
1162
|
};
|
|
1164
1163
|
var SquareWithOverriddenConstants = {
|
|
1165
1164
|
typeid: 'SimpleTest:SquareWithOverriddenConstants-1.0.0',
|
|
@@ -1168,90 +1167,90 @@ describe('PropertyFactory', function () {
|
|
|
1168
1167
|
{ id: 'num', typeid: 'Int8', value: 2 },
|
|
1169
1168
|
{
|
|
1170
1169
|
id: 'array', typeid: 'String', value: ['array_string_1_inherited', 'array_string_2_inherited'],
|
|
1171
|
-
context: 'array'
|
|
1170
|
+
context: 'array',
|
|
1172
1171
|
},
|
|
1173
1172
|
{
|
|
1174
1173
|
id: 'array_poly', typeid: 'SimpleTest:EntryWithOverriddenConstants-1.0.0', context: 'array', typedValue: [{
|
|
1175
1174
|
typeid: 'SimpleTest:EntryWithOverriddenPolyConstants-1.0.0',
|
|
1176
|
-
value: { string: 'entry_string_poly_1_inherited' }
|
|
1175
|
+
value: { string: 'entry_string_poly_1_inherited' },
|
|
1177
1176
|
},
|
|
1178
1177
|
{
|
|
1179
1178
|
typeid: 'SimpleTest:EntryWithOverriddenPolyConstants-1.0.0',
|
|
1180
|
-
value: { string: 'entry_string_poly_2_inherited' }
|
|
1181
|
-
}
|
|
1182
|
-
]
|
|
1179
|
+
value: { string: 'entry_string_poly_2_inherited' },
|
|
1180
|
+
},
|
|
1181
|
+
],
|
|
1183
1182
|
},
|
|
1184
1183
|
{
|
|
1185
1184
|
id: 'template', typeid: 'SimpleTest:DynamicWithOverriddenConstants-1.0.0', value: {
|
|
1186
|
-
num: 2, dynamic: { dynamic_string: 'dynamic_string_inherited' }
|
|
1187
|
-
}
|
|
1185
|
+
num: 2, dynamic: { dynamic_string: 'dynamic_string_inherited' },
|
|
1186
|
+
},
|
|
1188
1187
|
},
|
|
1189
1188
|
{
|
|
1190
1189
|
id: 'map_primitive', typeid: 'Int32', context: 'map', value: {
|
|
1191
1190
|
key2: 2,
|
|
1192
|
-
key3: 3
|
|
1193
|
-
}
|
|
1191
|
+
key3: 3,
|
|
1192
|
+
},
|
|
1194
1193
|
},
|
|
1195
1194
|
{
|
|
1196
1195
|
id: 'map', typeid: 'SimpleTest:EntryWithOverriddenConstants-1.0.0', context: 'map', value: {
|
|
1197
1196
|
key2: { string: 'map_string_2_inherited' },
|
|
1198
|
-
key3: { string: 'map_string_3_inherited' }
|
|
1199
|
-
}
|
|
1197
|
+
key3: { string: 'map_string_3_inherited' },
|
|
1198
|
+
},
|
|
1200
1199
|
},
|
|
1201
1200
|
{
|
|
1202
1201
|
id: 'map_poly', typeid: 'SimpleTest:EntryWithOverriddenConstants-1.0.0', context: 'map', typedValue: {
|
|
1203
1202
|
key2: {
|
|
1204
1203
|
typeid: 'SimpleTest:EntryWithOverriddenPolyConstants-1.0.0',
|
|
1205
|
-
value: { string: 'map_poly_string_2_inherited' }
|
|
1204
|
+
value: { string: 'map_poly_string_2_inherited' },
|
|
1206
1205
|
},
|
|
1207
1206
|
key3: {
|
|
1208
1207
|
typeid: 'SimpleTest:EntryWithOverriddenPolyConstants-1.0.0',
|
|
1209
|
-
value: { string: 'map_poly_string_3_inherited' }
|
|
1210
|
-
}
|
|
1211
|
-
}
|
|
1208
|
+
value: { string: 'map_poly_string_3_inherited' },
|
|
1209
|
+
},
|
|
1210
|
+
},
|
|
1212
1211
|
},
|
|
1213
1212
|
{
|
|
1214
1213
|
id: 'map_nest', typeid: 'SimpleTest:MapNestedWithOverriddenConstants-1.0.0', context: 'map', value: {
|
|
1215
1214
|
key2: {
|
|
1216
1215
|
map_nested: {
|
|
1217
1216
|
key2_2: { string: 'map_nested_2_string_2_inherited' },
|
|
1218
|
-
key2_3: { string: 'map_nested_2_string_3_inherited' }
|
|
1219
|
-
}
|
|
1217
|
+
key2_3: { string: 'map_nested_2_string_3_inherited' },
|
|
1218
|
+
},
|
|
1220
1219
|
},
|
|
1221
1220
|
key3: {
|
|
1222
1221
|
map_nested: {
|
|
1223
|
-
key3_1: { string: 'map_nested_3_string_1_inherited' }
|
|
1224
|
-
}
|
|
1225
|
-
}
|
|
1226
|
-
}
|
|
1222
|
+
key3_1: { string: 'map_nested_3_string_1_inherited' },
|
|
1223
|
+
},
|
|
1224
|
+
},
|
|
1225
|
+
},
|
|
1227
1226
|
},
|
|
1228
1227
|
{
|
|
1229
1228
|
id: 'set', typeid: 'SimpleTest:EntryWithOverriddenConstants-1.0.0', context: 'set', value: [
|
|
1230
1229
|
{ string: 'set_string_2_inherited' },
|
|
1231
|
-
{ string: 'set_string_3_inherited' }
|
|
1232
|
-
]
|
|
1230
|
+
{ string: 'set_string_3_inherited' },
|
|
1231
|
+
],
|
|
1233
1232
|
},
|
|
1234
1233
|
{
|
|
1235
1234
|
id: 'set_poly', typeid: 'SimpleTest:EntryWithOverriddenConstants-1.0.0', context: 'set', typedValue: [
|
|
1236
1235
|
{
|
|
1237
1236
|
typeid: 'SimpleTest:EntryWithOverriddenConstants-1.0.0',
|
|
1238
|
-
value: { string: 'set_poly_string_2_inherited' }
|
|
1237
|
+
value: { string: 'set_poly_string_2_inherited' },
|
|
1239
1238
|
},
|
|
1240
1239
|
{
|
|
1241
1240
|
typeid: 'SimpleTest:EntryWithOverriddenConstants-1.0.0',
|
|
1242
|
-
value: { string: 'set_poly_string_3_inherited' }
|
|
1243
|
-
}
|
|
1244
|
-
]
|
|
1241
|
+
value: { string: 'set_poly_string_3_inherited' },
|
|
1242
|
+
},
|
|
1243
|
+
],
|
|
1245
1244
|
},
|
|
1246
1245
|
{
|
|
1247
1246
|
id: 'set_nest', typeid: 'SimpleTest:SetNestedWithOverriddenConstants-1.0.0', context: 'set', value: [{
|
|
1248
1247
|
set_nested: [
|
|
1249
1248
|
{ string: 'set_nested_2_string_1_inherited' },
|
|
1250
|
-
{ string: 'set_nested_2_string_2_inherited' }
|
|
1251
|
-
]
|
|
1252
|
-
}]
|
|
1253
|
-
}
|
|
1254
|
-
]
|
|
1249
|
+
{ string: 'set_nested_2_string_2_inherited' },
|
|
1250
|
+
],
|
|
1251
|
+
}],
|
|
1252
|
+
},
|
|
1253
|
+
],
|
|
1255
1254
|
};
|
|
1256
1255
|
PropertyFactory.register(EntryWithOverriddenConstants);
|
|
1257
1256
|
PropertyFactory.register(EntryWithOverriddenPolyConstants);
|
|
@@ -1264,7 +1263,7 @@ describe('PropertyFactory', function () {
|
|
|
1264
1263
|
expect(instance._getChildrenCount()).to.equal(11);
|
|
1265
1264
|
expect(instance.resolvePath('num').getValue()).and.eql(2);
|
|
1266
1265
|
expect(instance.resolvePath('array').getValues()).and.eql([
|
|
1267
|
-
'array_string_1_inherited', 'array_string_2_inherited'
|
|
1266
|
+
'array_string_1_inherited', 'array_string_2_inherited',
|
|
1268
1267
|
]);
|
|
1269
1268
|
expect(instance.resolvePath('array_poly').getValues().length).to.eql(2);
|
|
1270
1269
|
expect(instance.resolvePath('array_poly').getValues()[0].string).to.eql('entry_string_poly_1_inherited');
|
|
@@ -1320,16 +1319,16 @@ describe('PropertyFactory', function () {
|
|
|
1320
1319
|
typeid: 'SimpleTest:EntryWithTypedOverriddenConstants-1.0.0',
|
|
1321
1320
|
inherits: ['NamedProperty'],
|
|
1322
1321
|
constants: [
|
|
1323
|
-
{ id: 'string', typeid: 'String', value: 'entry_string' }
|
|
1324
|
-
]
|
|
1322
|
+
{ id: 'string', typeid: 'String', value: 'entry_string' },
|
|
1323
|
+
],
|
|
1325
1324
|
};
|
|
1326
1325
|
var EntryWithTypedOverriddenPolyConstants = {
|
|
1327
1326
|
typeid: 'SimpleTest:EntryWithTypedOverriddenPolyConstants-1.0.0',
|
|
1328
1327
|
inherits: ['SimpleTest:EntryWithTypedOverriddenConstants-1.0.0'],
|
|
1329
1328
|
constants: [
|
|
1330
1329
|
{ id: 'string', typeid: 'String', value: 'entry_string' },
|
|
1331
|
-
{ id: 'name', typeid: 'String', value: 'entry2' }
|
|
1332
|
-
]
|
|
1330
|
+
{ id: 'name', typeid: 'String', value: 'entry2' },
|
|
1331
|
+
],
|
|
1333
1332
|
};
|
|
1334
1333
|
var ShapeWithTypedOverriddenConstants = {
|
|
1335
1334
|
typeid: 'SimpleTest:ShapeWithTypedOverriddenConstants-1.0.0',
|
|
@@ -1338,21 +1337,21 @@ describe('PropertyFactory', function () {
|
|
|
1338
1337
|
{ id: 'entry2', typeid: 'SimpleTest:EntryWithTypedOverriddenConstants-1.0.0' },
|
|
1339
1338
|
{
|
|
1340
1339
|
id: 'array', typeid: 'SimpleTest:EntryWithTypedOverriddenConstants-1.0.0', context: 'array',
|
|
1341
|
-
value: [{ string: 'entry_string' }]
|
|
1340
|
+
value: [{ string: 'entry_string' }],
|
|
1342
1341
|
},
|
|
1343
1342
|
{
|
|
1344
1343
|
id: 'map', typeid: 'SimpleTest:EntryWithTypedOverriddenConstants-1.0.0', context: 'map', value: {
|
|
1345
1344
|
key1: { string: 'map_string_1' },
|
|
1346
|
-
key3: { string: 'map_string_3' }
|
|
1347
|
-
}
|
|
1345
|
+
key3: { string: 'map_string_3' },
|
|
1346
|
+
},
|
|
1348
1347
|
},
|
|
1349
1348
|
{
|
|
1350
1349
|
id: 'set', typeid: 'SimpleTest:EntryWithTypedOverriddenConstants-1.0.0', context: 'set', value: [
|
|
1351
1350
|
{ string: 'set_string_1' },
|
|
1352
|
-
{ string: 'set_string_1' }
|
|
1353
|
-
]
|
|
1354
|
-
}
|
|
1355
|
-
]
|
|
1351
|
+
{ string: 'set_string_1' },
|
|
1352
|
+
],
|
|
1353
|
+
},
|
|
1354
|
+
],
|
|
1356
1355
|
};
|
|
1357
1356
|
var SquareWithTypedOverriddenConstants = {
|
|
1358
1357
|
typeid: 'SimpleTest:SquareWithTypedOverriddenConstants-1.0.0',
|
|
@@ -1361,51 +1360,51 @@ describe('PropertyFactory', function () {
|
|
|
1361
1360
|
{
|
|
1362
1361
|
id: 'entry1', typedValue: {
|
|
1363
1362
|
typeid: 'SimpleTest:EntryWithTypedOverriddenConstants-1.0.0',
|
|
1364
|
-
value: { string: 'entry_string_1' }
|
|
1365
|
-
}
|
|
1363
|
+
value: { string: 'entry_string_1' },
|
|
1364
|
+
},
|
|
1366
1365
|
},
|
|
1367
1366
|
{
|
|
1368
1367
|
id: 'entry2', typedValue: {
|
|
1369
1368
|
typeid: 'SimpleTest:EntryWithTypedOverriddenPolyConstants-1.0.0',
|
|
1370
|
-
value: { string: 'entry_string_2', name: 'entry2' }
|
|
1371
|
-
}
|
|
1369
|
+
value: { string: 'entry_string_2', name: 'entry2' },
|
|
1370
|
+
},
|
|
1372
1371
|
},
|
|
1373
1372
|
{
|
|
1374
1373
|
id: 'array', context: 'array', typedValue: [{
|
|
1375
1374
|
typeid: 'SimpleTest:EntryWithTypedOverriddenPolyConstants-1.0.0',
|
|
1376
|
-
value: { string: 'entry_string_1_inherited', name: 'entry_string_1' }
|
|
1375
|
+
value: { string: 'entry_string_1_inherited', name: 'entry_string_1' },
|
|
1377
1376
|
},
|
|
1378
1377
|
{
|
|
1379
1378
|
typeid: 'SimpleTest:EntryWithTypedOverriddenPolyConstants-1.0.0',
|
|
1380
|
-
value: { string: 'entry_string_2_inherited', name: 'entry_string_2' }
|
|
1381
|
-
}
|
|
1382
|
-
]
|
|
1379
|
+
value: { string: 'entry_string_2_inherited', name: 'entry_string_2' },
|
|
1380
|
+
},
|
|
1381
|
+
],
|
|
1383
1382
|
},
|
|
1384
1383
|
{
|
|
1385
1384
|
id: 'map', typeid: 'SimpleTest:EntryWithTypedOverriddenConstants-1.0.0', context: 'map', typedValue: {
|
|
1386
1385
|
key2: {
|
|
1387
1386
|
typeid: 'SimpleTest:EntryWithTypedOverriddenPolyConstants-1.0.0',
|
|
1388
|
-
value: { string: 'map_string_2_inherited', name: 'map_string_2' }
|
|
1387
|
+
value: { string: 'map_string_2_inherited', name: 'map_string_2' },
|
|
1389
1388
|
},
|
|
1390
1389
|
key3: {
|
|
1391
1390
|
typeid: 'SimpleTest:EntryWithTypedOverriddenPolyConstants-1.0.0',
|
|
1392
|
-
value: { string: 'map_string_3_inherited', name: 'map_string_3' }
|
|
1393
|
-
}
|
|
1394
|
-
}
|
|
1391
|
+
value: { string: 'map_string_3_inherited', name: 'map_string_3' },
|
|
1392
|
+
},
|
|
1393
|
+
},
|
|
1395
1394
|
},
|
|
1396
1395
|
{
|
|
1397
1396
|
id: 'set', typeid: 'SimpleTest:EntryWithTypedOverriddenConstants-1.0.0', context: 'set', typedValue: [
|
|
1398
1397
|
{
|
|
1399
1398
|
typeid: 'SimpleTest:EntryWithTypedOverriddenPolyConstants-1.0.0',
|
|
1400
|
-
value: { string: 'set_string_2_inherited', name: 'set_string_2' }
|
|
1399
|
+
value: { string: 'set_string_2_inherited', name: 'set_string_2' },
|
|
1401
1400
|
},
|
|
1402
1401
|
{
|
|
1403
1402
|
typeid: 'SimpleTest:EntryWithTypedOverriddenPolyConstants-1.0.0',
|
|
1404
|
-
value: { string: 'set_string_3_inherited', name: 'set_string_3' }
|
|
1405
|
-
}
|
|
1406
|
-
]
|
|
1407
|
-
}
|
|
1408
|
-
]
|
|
1403
|
+
value: { string: 'set_string_3_inherited', name: 'set_string_3' },
|
|
1404
|
+
},
|
|
1405
|
+
],
|
|
1406
|
+
},
|
|
1407
|
+
],
|
|
1409
1408
|
};
|
|
1410
1409
|
PropertyFactory.register(EntryWithTypedOverriddenConstants);
|
|
1411
1410
|
PropertyFactory.register(EntryWithTypedOverriddenPolyConstants);
|
|
@@ -1447,12 +1446,12 @@ describe('PropertyFactory', function () {
|
|
|
1447
1446
|
it('should not allow overriding constants when typeid is different', function () {
|
|
1448
1447
|
var ShapeWithDiffTypeidConstants = {
|
|
1449
1448
|
typeid: 'SimpleTest:ShapeWithDiffTypeidConstants-1.0.0',
|
|
1450
|
-
constants: [{ id: 'num', typeid: 'Int8', value: 1 }]
|
|
1449
|
+
constants: [{ id: 'num', typeid: 'Int8', value: 1 }],
|
|
1451
1450
|
};
|
|
1452
1451
|
var SquareWithDiffTypeidConstants = {
|
|
1453
1452
|
typeid: 'SimpleTest:SquareWithDiffTypeidConstants-1.0.0',
|
|
1454
1453
|
inherits: ['SimpleTest:ShapeWithDiffTypeidConstants-1.0.0'],
|
|
1455
|
-
constants: [{ id: 'num', typeid: 'Int32', value: 2 }]
|
|
1454
|
+
constants: [{ id: 'num', typeid: 'Int32', value: 2 }],
|
|
1456
1455
|
};
|
|
1457
1456
|
PropertyFactory.register(ShapeWithDiffTypeidConstants);
|
|
1458
1457
|
PropertyFactory.register(SquareWithDiffTypeidConstants);
|
|
@@ -1462,12 +1461,12 @@ describe('PropertyFactory', function () {
|
|
|
1462
1461
|
it('should not allow overriding constants when context is different', function () {
|
|
1463
1462
|
var ShapeWithDiffContextConstants = {
|
|
1464
1463
|
typeid: 'SimpleTest:ShapeWithDiffContextConstants-1.0.0',
|
|
1465
|
-
constants: [{ id: 'num', typeid: 'Int8', value: 1 }]
|
|
1464
|
+
constants: [{ id: 'num', typeid: 'Int8', value: 1 }],
|
|
1466
1465
|
};
|
|
1467
1466
|
var SquareWithDiffContextConstants = {
|
|
1468
1467
|
typeid: 'SimpleTest:SquareWithDiffContextConstants-1.0.0',
|
|
1469
1468
|
inherits: ['SimpleTest:ShapeWithDiffContextConstants-1.0.0'],
|
|
1470
|
-
constants: [{ id: 'num', typeid: 'Int8', value: [1, 2], context: 'array' }]
|
|
1469
|
+
constants: [{ id: 'num', typeid: 'Int8', value: [1, 2], context: 'array' }],
|
|
1471
1470
|
};
|
|
1472
1471
|
PropertyFactory.register(ShapeWithDiffContextConstants);
|
|
1473
1472
|
PropertyFactory.register(SquareWithDiffContextConstants);
|
|
@@ -1477,20 +1476,20 @@ describe('PropertyFactory', function () {
|
|
|
1477
1476
|
it('should not allow overriding constants with a typedValue that does not inherit from base type', function () {
|
|
1478
1477
|
var Type1 = {
|
|
1479
1478
|
typeid: 'SimpleTest:Type1-1.0.0',
|
|
1480
|
-
constants: [{ id: 'num', typeid: 'Int32', value: 1 }]
|
|
1479
|
+
constants: [{ id: 'num', typeid: 'Int32', value: 1 }],
|
|
1481
1480
|
};
|
|
1482
1481
|
var Type2 = {
|
|
1483
1482
|
typeid: 'SimpleTest:Type2-1.0.0',
|
|
1484
|
-
constants: [{ id: 'num', typeid: 'Int32', value: 1 }]
|
|
1483
|
+
constants: [{ id: 'num', typeid: 'Int32', value: 1 }],
|
|
1485
1484
|
};
|
|
1486
1485
|
var ShapeWithDiffTypedTypeidConstants = {
|
|
1487
1486
|
typeid: 'SimpleTest:ShapeWithDiffTypeidConstants-1.0.0',
|
|
1488
|
-
constants: [{ id: 'type', typeid: 'SimpleTest:Type1-1.0.0' }]
|
|
1487
|
+
constants: [{ id: 'type', typeid: 'SimpleTest:Type1-1.0.0' }],
|
|
1489
1488
|
};
|
|
1490
1489
|
var SquareWithDiffTypedTypeidConstants = {
|
|
1491
1490
|
typeid: 'SimpleTest:SquareWithDiffTypeidConstants-1.0.0',
|
|
1492
1491
|
inherits: ['SimpleTest:ShapeWithDiffTypeidConstants-1.0.0'],
|
|
1493
|
-
constants: [{ id: 'type', typedValue: { typeid: 'SimpleTest:Type2-1.0.0' } }]
|
|
1492
|
+
constants: [{ id: 'type', typedValue: { typeid: 'SimpleTest:Type2-1.0.0' } }],
|
|
1494
1493
|
};
|
|
1495
1494
|
PropertyFactory.register(Type1);
|
|
1496
1495
|
PropertyFactory.register(Type2);
|
|
@@ -1508,8 +1507,8 @@ describe('PropertyFactory', function () {
|
|
|
1508
1507
|
typeid: 'SimpleTest:DefaultPrimitive-1.0.0',
|
|
1509
1508
|
properties: [
|
|
1510
1509
|
{ id: 'num', typeid: 'Uint32', value: 111 },
|
|
1511
|
-
{ id: 'bool', typeid: 'Bool', value: true }
|
|
1512
|
-
]
|
|
1510
|
+
{ id: 'bool', typeid: 'Bool', value: true },
|
|
1511
|
+
],
|
|
1513
1512
|
};
|
|
1514
1513
|
PropertyFactory.register(DefaultPrimitive);
|
|
1515
1514
|
var instance = PropertyFactory.create('SimpleTest:DefaultPrimitive-1.0.0');
|
|
@@ -1520,8 +1519,8 @@ describe('PropertyFactory', function () {
|
|
|
1520
1519
|
var DefaultString = {
|
|
1521
1520
|
typeid: 'SimpleTest:DefaultString-1.0.0',
|
|
1522
1521
|
properties: [
|
|
1523
|
-
{ id: 'string', typeid: 'String', value: 'I am a string' }
|
|
1524
|
-
]
|
|
1522
|
+
{ id: 'string', typeid: 'String', value: 'I am a string' },
|
|
1523
|
+
],
|
|
1525
1524
|
};
|
|
1526
1525
|
PropertyFactory.register(DefaultString);
|
|
1527
1526
|
var instance = PropertyFactory.create('SimpleTest:DefaultString-1.0.0');
|
|
@@ -1531,8 +1530,8 @@ describe('PropertyFactory', function () {
|
|
|
1531
1530
|
var DefaultArray = {
|
|
1532
1531
|
typeid: 'SimpleTest:DefaultArray-1.0.0',
|
|
1533
1532
|
properties: [
|
|
1534
|
-
{ id: 'array', typeid: 'Int32', value: [111, 222], context: 'array' }
|
|
1535
|
-
]
|
|
1533
|
+
{ id: 'array', typeid: 'Int32', value: [111, 222], context: 'array' },
|
|
1534
|
+
],
|
|
1536
1535
|
};
|
|
1537
1536
|
PropertyFactory.register(DefaultArray);
|
|
1538
1537
|
var instance = PropertyFactory.create('SimpleTest:DefaultArray-1.0.0');
|
|
@@ -1543,8 +1542,8 @@ describe('PropertyFactory', function () {
|
|
|
1543
1542
|
var DefaultTypedArrayEntry = {
|
|
1544
1543
|
typeid: 'SimpleTest:DefaultTypedArrayEntry-1.0.0',
|
|
1545
1544
|
properties: [
|
|
1546
|
-
{ id: 'string', typeid: 'String' }
|
|
1547
|
-
]
|
|
1545
|
+
{ id: 'string', typeid: 'String' },
|
|
1546
|
+
],
|
|
1548
1547
|
};
|
|
1549
1548
|
var DefaultTypedArray = {
|
|
1550
1549
|
typeid: 'SimpleTest:DefaultTypedArray-1.0.0',
|
|
@@ -1552,9 +1551,9 @@ describe('PropertyFactory', function () {
|
|
|
1552
1551
|
{
|
|
1553
1552
|
id: 'array', typeid: 'SimpleTest:DefaultTypedArrayEntry-1.0.0', context: 'array', value: [
|
|
1554
1553
|
{ string: 'I am string 1' }, { string: 'I am string 2' }
|
|
1555
|
-
]
|
|
1556
|
-
}
|
|
1557
|
-
]
|
|
1554
|
+
],
|
|
1555
|
+
},
|
|
1556
|
+
],
|
|
1558
1557
|
};
|
|
1559
1558
|
PropertyFactory.register(DefaultTypedArrayEntry);
|
|
1560
1559
|
PropertyFactory.register(DefaultTypedArray);
|
|
@@ -1570,10 +1569,10 @@ describe('PropertyFactory', function () {
|
|
|
1570
1569
|
id: 'enum', typeid: 'Enum', properties: [
|
|
1571
1570
|
{ id: 'solid', value: 111 },
|
|
1572
1571
|
{ id: 'dashed', value: 222 },
|
|
1573
|
-
{ id: 'dotted', value: 333 }
|
|
1574
|
-
], value: 'dashed'
|
|
1575
|
-
}
|
|
1576
|
-
]
|
|
1572
|
+
{ id: 'dotted', value: 333 },
|
|
1573
|
+
], value: 'dashed',
|
|
1574
|
+
},
|
|
1575
|
+
],
|
|
1577
1576
|
};
|
|
1578
1577
|
PropertyFactory.register(DefaultEnum);
|
|
1579
1578
|
var instance = PropertyFactory.create('SimpleTest:DefaultEnum-1.0.0');
|
|
@@ -1586,10 +1585,10 @@ describe('PropertyFactory', function () {
|
|
|
1586
1585
|
{
|
|
1587
1586
|
id: 'untyped', properties: [
|
|
1588
1587
|
{ id: 'num', typeid: 'Uint32', value: 222 },
|
|
1589
|
-
{ id: 'string', typeid: 'String', value: 'I should not be set' }
|
|
1590
|
-
], value: { string: 'I am a string', num: 111 }
|
|
1591
|
-
}
|
|
1592
|
-
]
|
|
1588
|
+
{ id: 'string', typeid: 'String', value: 'I should not be set' },
|
|
1589
|
+
], value: { string: 'I am a string', num: 111 },
|
|
1590
|
+
},
|
|
1591
|
+
],
|
|
1593
1592
|
};
|
|
1594
1593
|
PropertyFactory.register(DefaultUntyped);
|
|
1595
1594
|
var instance = PropertyFactory.create('SimpleTest:DefaultUntyped-1.0.0');
|
|
@@ -1603,20 +1602,20 @@ describe('PropertyFactory', function () {
|
|
|
1603
1602
|
{ id: 'num', typeid: 'Uint32', value: '222' },
|
|
1604
1603
|
{
|
|
1605
1604
|
id: 'dynamic', properties: [
|
|
1606
|
-
{ id: 'dynamic_string', typeid: 'String' }
|
|
1607
|
-
], value: { dynamic_string: 'I should not be set' }
|
|
1608
|
-
}
|
|
1609
|
-
]
|
|
1605
|
+
{ id: 'dynamic_string', typeid: 'String' },
|
|
1606
|
+
], value: { dynamic_string: 'I should not be set' },
|
|
1607
|
+
},
|
|
1608
|
+
],
|
|
1610
1609
|
};
|
|
1611
1610
|
var DefaultTemplate = {
|
|
1612
1611
|
typeid: 'SimpleTest:DefaultTemplate-1.0.0',
|
|
1613
1612
|
properties: [
|
|
1614
1613
|
{
|
|
1615
1614
|
id: 'template', typeid: 'SimpleTest:DefaultTemplateEntry-1.0.0', value: {
|
|
1616
|
-
num: 111, dynamic: { dynamic_string: 'I am a string' }
|
|
1617
|
-
}
|
|
1618
|
-
}
|
|
1619
|
-
]
|
|
1615
|
+
num: 111, dynamic: { dynamic_string: 'I am a string' },
|
|
1616
|
+
},
|
|
1617
|
+
},
|
|
1618
|
+
],
|
|
1620
1619
|
};
|
|
1621
1620
|
PropertyFactory.register(DefaultTemplateEntry);
|
|
1622
1621
|
PropertyFactory.register(DefaultTemplate);
|
|
@@ -1629,8 +1628,8 @@ describe('PropertyFactory', function () {
|
|
|
1629
1628
|
typeid: 'SimpleTest:DefaultSetEntry-1.0.0',
|
|
1630
1629
|
inherits: ['NamedProperty'],
|
|
1631
1630
|
properties: [
|
|
1632
|
-
{ id: 'string', typeid: 'String' }
|
|
1633
|
-
]
|
|
1631
|
+
{ id: 'string', typeid: 'String' },
|
|
1632
|
+
],
|
|
1634
1633
|
};
|
|
1635
1634
|
var DefaultSet = {
|
|
1636
1635
|
typeid: 'SimpleTest:DefaultSet-1.0.0',
|
|
@@ -1638,10 +1637,10 @@ describe('PropertyFactory', function () {
|
|
|
1638
1637
|
{
|
|
1639
1638
|
id: 'set', typeid: 'SimpleTest:DefaultSetEntry-1.0.0', context: 'set', value: [
|
|
1640
1639
|
{ string: 'I am a string 1' },
|
|
1641
|
-
{ string: 'I am a string 2' }
|
|
1642
|
-
]
|
|
1643
|
-
}
|
|
1644
|
-
]
|
|
1640
|
+
{ string: 'I am a string 2' },
|
|
1641
|
+
],
|
|
1642
|
+
},
|
|
1643
|
+
],
|
|
1645
1644
|
};
|
|
1646
1645
|
PropertyFactory.register(DefaultSetEntry);
|
|
1647
1646
|
PropertyFactory.register(DefaultSet);
|
|
@@ -1657,10 +1656,10 @@ describe('PropertyFactory', function () {
|
|
|
1657
1656
|
{
|
|
1658
1657
|
id: 'map', typeid: 'Int32', context: 'map', value: {
|
|
1659
1658
|
key1: 111,
|
|
1660
|
-
key2: 222
|
|
1661
|
-
}
|
|
1662
|
-
}
|
|
1663
|
-
]
|
|
1659
|
+
key2: 222,
|
|
1660
|
+
},
|
|
1661
|
+
},
|
|
1662
|
+
],
|
|
1664
1663
|
};
|
|
1665
1664
|
PropertyFactory.register(DefaultPrimitiveMap);
|
|
1666
1665
|
var instance = PropertyFactory.create('SimpleTest:DefaultPrimitiveMap-1.0.0');
|
|
@@ -1672,8 +1671,8 @@ describe('PropertyFactory', function () {
|
|
|
1672
1671
|
typeid: 'SimpleTest:DefaultTypedMapEntry-1.0.0',
|
|
1673
1672
|
inherits: ['NamedProperty'],
|
|
1674
1673
|
properties: [
|
|
1675
|
-
{ id: 'string', typeid: 'String' }
|
|
1676
|
-
]
|
|
1674
|
+
{ id: 'string', typeid: 'String' },
|
|
1675
|
+
],
|
|
1677
1676
|
};
|
|
1678
1677
|
var DefaultTypedMap = {
|
|
1679
1678
|
typeid: 'SimpleTest:DefaultTypedMap-1.0.0',
|
|
@@ -1681,10 +1680,10 @@ describe('PropertyFactory', function () {
|
|
|
1681
1680
|
{
|
|
1682
1681
|
id: 'map', typeid: 'SimpleTest:DefaultTypedMapEntry-1.0.0', context: 'map', value: {
|
|
1683
1682
|
key1: { string: 'I am a string 1' },
|
|
1684
|
-
key2: { string: 'I am a string 2' }
|
|
1685
|
-
}
|
|
1686
|
-
}
|
|
1687
|
-
]
|
|
1683
|
+
key2: { string: 'I am a string 2' },
|
|
1684
|
+
},
|
|
1685
|
+
},
|
|
1686
|
+
],
|
|
1688
1687
|
};
|
|
1689
1688
|
PropertyFactory.register(DefaultTypedMapEntry);
|
|
1690
1689
|
PropertyFactory.register(DefaultTypedMap);
|
|
@@ -1696,12 +1695,12 @@ describe('PropertyFactory', function () {
|
|
|
1696
1695
|
var DefaultInitialValue = {
|
|
1697
1696
|
typeid: 'SimpleTest:DefaultInitialValue-1.0.0',
|
|
1698
1697
|
properties: [
|
|
1699
|
-
{ id: 'string', typeid: 'String', value: 'I should not be set' }
|
|
1700
|
-
]
|
|
1698
|
+
{ id: 'string', typeid: 'String', value: 'I should not be set' },
|
|
1699
|
+
],
|
|
1701
1700
|
};
|
|
1702
1701
|
PropertyFactory.register(DefaultInitialValue);
|
|
1703
1702
|
var instance = PropertyFactory.create('SimpleTest:DefaultInitialValue-1.0.0', null, {
|
|
1704
|
-
string: 'I am a string'
|
|
1703
|
+
string: 'I am a string',
|
|
1705
1704
|
});
|
|
1706
1705
|
expect(instance.get('string').getValue()).to.equal('I am a string');
|
|
1707
1706
|
});
|
|
@@ -1710,16 +1709,16 @@ describe('PropertyFactory', function () {
|
|
|
1710
1709
|
typeid: 'SimpleTest:DefaultPolyBase-1.0.0',
|
|
1711
1710
|
inherits: ['NamedProperty'],
|
|
1712
1711
|
properties: [
|
|
1713
|
-
{ id: 'num', typeid: 'Uint32', value: 111 }
|
|
1714
|
-
]
|
|
1712
|
+
{ id: 'num', typeid: 'Uint32', value: 111 },
|
|
1713
|
+
],
|
|
1715
1714
|
};
|
|
1716
1715
|
var DefaultPolySub = {
|
|
1717
1716
|
typeid: 'SimpleTest:DefaultPolySub-1.0.0',
|
|
1718
1717
|
inherits: 'SimpleTest:DefaultPolyBase-1.0.0',
|
|
1719
1718
|
properties: [
|
|
1720
1719
|
{ id: 'num', typeid: 'Uint32', value: 222 },
|
|
1721
|
-
{ id: 'str', typeid: 'String', value: 'Sub' }
|
|
1722
|
-
]
|
|
1720
|
+
{ id: 'str', typeid: 'String', value: 'Sub' },
|
|
1721
|
+
],
|
|
1723
1722
|
};
|
|
1724
1723
|
var DefaultPolySubSub = {
|
|
1725
1724
|
typeid: 'SimpleTest:DefaultPolySubSub-1.0.0',
|
|
@@ -1727,8 +1726,8 @@ describe('PropertyFactory', function () {
|
|
|
1727
1726
|
properties: [
|
|
1728
1727
|
{ id: 'num', typeid: 'Uint32', value: 333 },
|
|
1729
1728
|
{ id: 'num2', typeid: 'Uint32', value: 111 },
|
|
1730
|
-
{ id: 'str', typeid: 'String', value: 'SubSub' }
|
|
1731
|
-
]
|
|
1729
|
+
{ id: 'str', typeid: 'String', value: 'SubSub' },
|
|
1730
|
+
],
|
|
1732
1731
|
};
|
|
1733
1732
|
beforeEach(function () {
|
|
1734
1733
|
PropertyFactory._clear();
|
|
@@ -1742,13 +1741,13 @@ describe('PropertyFactory', function () {
|
|
|
1742
1741
|
properties: [
|
|
1743
1742
|
{
|
|
1744
1743
|
id: 'polySub', typeid: 'SimpleTest:DefaultPolyBase-1.0.0',
|
|
1745
|
-
typedValue: { typeid: 'SimpleTest:DefaultPolySub-1.0.0', value: { num: 333, str: 'PolySub' } }
|
|
1744
|
+
typedValue: { typeid: 'SimpleTest:DefaultPolySub-1.0.0', value: { num: 333, str: 'PolySub' } },
|
|
1746
1745
|
},
|
|
1747
1746
|
{
|
|
1748
1747
|
id: 'polySubSub', typeid: 'SimpleTest:DefaultPolyBase-1.0.0',
|
|
1749
|
-
typedValue: { typeid: 'SimpleTest:DefaultPolySubSub-1.0.0', value: { num: 444, str: 'PolySubSub' } }
|
|
1750
|
-
}
|
|
1751
|
-
]
|
|
1748
|
+
typedValue: { typeid: 'SimpleTest:DefaultPolySubSub-1.0.0', value: { num: 444, str: 'PolySubSub' } },
|
|
1749
|
+
},
|
|
1750
|
+
],
|
|
1752
1751
|
};
|
|
1753
1752
|
PropertyFactory.register(DefaultPolyContainer);
|
|
1754
1753
|
var instance = PropertyFactory.create('SimpleTest:DefaultPolyContainer-1.0.0');
|
|
@@ -1763,8 +1762,8 @@ describe('PropertyFactory', function () {
|
|
|
1763
1762
|
typeid: 'SimpleTest:DefaultPolyNoTypeIdContainer-1.0.0',
|
|
1764
1763
|
properties: [{
|
|
1765
1764
|
id: 'polySub', typeid: 'SimpleTest:DefaultPolyBase-1.0.0',
|
|
1766
|
-
typedValue: { value: { num: 333, str: 'PolySub' } }
|
|
1767
|
-
}]
|
|
1765
|
+
typedValue: { value: { num: 333, str: 'PolySub' } },
|
|
1766
|
+
}],
|
|
1768
1767
|
};
|
|
1769
1768
|
PropertyFactory.register(DefaultPolyNoTypeIdContainer);
|
|
1770
1769
|
expect(PropertyFactory.create.bind(PropertyFactory, 'SimpleTest:DefaultPolyNoTypeIdContainer-1.0.0'))
|
|
@@ -1778,10 +1777,10 @@ describe('PropertyFactory', function () {
|
|
|
1778
1777
|
id: 'array', typeid: 'SimpleTest:DefaultPolyBase-1.0.0', context: 'array', typedValue: [
|
|
1779
1778
|
{ typeid: 'SimpleTest:DefaultPolySub-1.0.0' },
|
|
1780
1779
|
{ typeid: 'SimpleTest:DefaultPolySub-1.0.0', value: { str: 'ArrSub' } },
|
|
1781
|
-
{ typeid: 'SimpleTest:DefaultPolySubSub-1.0.0', value: { str: 'ArrSubSub' } }
|
|
1782
|
-
]
|
|
1783
|
-
}
|
|
1784
|
-
]
|
|
1780
|
+
{ typeid: 'SimpleTest:DefaultPolySubSub-1.0.0', value: { str: 'ArrSubSub' } },
|
|
1781
|
+
],
|
|
1782
|
+
},
|
|
1783
|
+
],
|
|
1785
1784
|
};
|
|
1786
1785
|
PropertyFactory.register(DefaultPolyArrayContainer);
|
|
1787
1786
|
var instance = PropertyFactory.create('SimpleTest:DefaultPolyArrayContainer-1.0.0');
|
|
@@ -1801,10 +1800,10 @@ describe('PropertyFactory', function () {
|
|
|
1801
1800
|
id: 'set', typeid: 'SimpleTest:DefaultPolyBase-1.0.0', context: 'set', typedValue: [
|
|
1802
1801
|
{ typeid: 'SimpleTest:DefaultPolySub-1.0.0' },
|
|
1803
1802
|
{ typeid: 'SimpleTest:DefaultPolySub-1.0.0', value: { str: 'ArrSub' } },
|
|
1804
|
-
{ typeid: 'SimpleTest:DefaultPolySubSub-1.0.0', value: { str: 'ArrSubSub' } }
|
|
1805
|
-
]
|
|
1806
|
-
}
|
|
1807
|
-
]
|
|
1803
|
+
{ typeid: 'SimpleTest:DefaultPolySubSub-1.0.0', value: { str: 'ArrSubSub' } },
|
|
1804
|
+
],
|
|
1805
|
+
},
|
|
1806
|
+
],
|
|
1808
1807
|
};
|
|
1809
1808
|
PropertyFactory.register(DefaultPolySetContainer);
|
|
1810
1809
|
var instance = PropertyFactory.create('SimpleTest:DefaultPolySetContainer-1.0.0');
|
|
@@ -1825,10 +1824,10 @@ describe('PropertyFactory', function () {
|
|
|
1825
1824
|
id: 'map', typeid: 'SimpleTest:DefaultPolyBase-1.0.0', context: 'map', typedValue: {
|
|
1826
1825
|
key1: { typeid: 'SimpleTest:DefaultPolySub-1.0.0' },
|
|
1827
1826
|
key2: { typeid: 'SimpleTest:DefaultPolySub-1.0.0', value: { str: 'ArrSub' } },
|
|
1828
|
-
key3: { typeid: 'SimpleTest:DefaultPolySubSub-1.0.0', value: { str: 'ArrSubSub' } }
|
|
1829
|
-
}
|
|
1830
|
-
}
|
|
1831
|
-
]
|
|
1827
|
+
key3: { typeid: 'SimpleTest:DefaultPolySubSub-1.0.0', value: { str: 'ArrSubSub' } },
|
|
1828
|
+
},
|
|
1829
|
+
},
|
|
1830
|
+
],
|
|
1832
1831
|
};
|
|
1833
1832
|
PropertyFactory.register(DefaultPolyMapContainer);
|
|
1834
1833
|
var instance = PropertyFactory.create('SimpleTest:DefaultPolyMapContainer-1.0.0');
|
|
@@ -1844,17 +1843,17 @@ describe('PropertyFactory', function () {
|
|
|
1844
1843
|
var DefaultPoly = {
|
|
1845
1844
|
typeid: 'SimpleTest:DefaultPoly-1.0.0',
|
|
1846
1845
|
properties: [
|
|
1847
|
-
{ id: 'num', typeid: 'Uint32', value: 111 }
|
|
1848
|
-
]
|
|
1846
|
+
{ id: 'num', typeid: 'Uint32', value: 111 },
|
|
1847
|
+
],
|
|
1849
1848
|
};
|
|
1850
1849
|
var DefaultPolyUnderivedContainer = {
|
|
1851
1850
|
typeid: 'SimpleTest:DefaultPolyUnderivedContainer-1.0.0',
|
|
1852
1851
|
properties: [
|
|
1853
1852
|
{
|
|
1854
1853
|
id: 'poly', typeid: 'SimpleTest:DefaultPolyBase-1.0.0',
|
|
1855
|
-
typedValue: { typeid: 'SimpleTest:DefaultPoly-1.0.0', value: { num: 333 } }
|
|
1856
|
-
}
|
|
1857
|
-
]
|
|
1854
|
+
typedValue: { typeid: 'SimpleTest:DefaultPoly-1.0.0', value: { num: 333 } },
|
|
1855
|
+
},
|
|
1856
|
+
],
|
|
1858
1857
|
};
|
|
1859
1858
|
PropertyFactory.register(DefaultPoly);
|
|
1860
1859
|
PropertyFactory.register(DefaultPolyUnderivedContainer);
|
|
@@ -1867,9 +1866,9 @@ describe('PropertyFactory', function () {
|
|
|
1867
1866
|
constants: [
|
|
1868
1867
|
{
|
|
1869
1868
|
id: 'type', typeid: 'SimpleTest:DefaultPolyBase-1.0.0',
|
|
1870
|
-
typedValue: { typeid: 'SimpleTest:DefaultPolyBase-1.0.0' }
|
|
1871
|
-
}
|
|
1872
|
-
]
|
|
1869
|
+
typedValue: { typeid: 'SimpleTest:DefaultPolyBase-1.0.0' },
|
|
1870
|
+
},
|
|
1871
|
+
],
|
|
1873
1872
|
};
|
|
1874
1873
|
PropertyFactory.register(DefaultPoly);
|
|
1875
1874
|
var prop = PropertyFactory.create(DefaultPoly.typeid);
|
|
@@ -1879,8 +1878,8 @@ describe('PropertyFactory', function () {
|
|
|
1879
1878
|
var DefaultPrimitiveArrayPoly = {
|
|
1880
1879
|
typeid: 'SimpleTest:DefaultPrimitivePoly-1.0.0',
|
|
1881
1880
|
properties: [{
|
|
1882
|
-
id: 'int', typeid: 'Int32', typedValue: { typeid: 'Int32', value: 123 }
|
|
1883
|
-
}]
|
|
1881
|
+
id: 'int', typeid: 'Int32', typedValue: { typeid: 'Int32', value: 123 },
|
|
1882
|
+
}],
|
|
1884
1883
|
};
|
|
1885
1884
|
PropertyFactory.register(DefaultPrimitiveArrayPoly);
|
|
1886
1885
|
expect(PropertyFactory.create.bind(PropertyFactory, 'SimpleTest:DefaultPrimitivePoly-1.0.0'))
|
|
@@ -1890,8 +1889,8 @@ describe('PropertyFactory', function () {
|
|
|
1890
1889
|
var DefaultPrimitiveArrayPoly = {
|
|
1891
1890
|
typeid: 'SimpleTest:DefaultPrimitiveArrayPoly-1.0.0',
|
|
1892
1891
|
properties: [{
|
|
1893
|
-
id: 'array', context: 'array', typeid: 'Int32', typedValue: [{ typeid: 'Int32', value: 123 }]
|
|
1894
|
-
}]
|
|
1892
|
+
id: 'array', context: 'array', typeid: 'Int32', typedValue: [{ typeid: 'Int32', value: 123 }],
|
|
1893
|
+
}],
|
|
1895
1894
|
};
|
|
1896
1895
|
PropertyFactory.register(DefaultPrimitiveArrayPoly);
|
|
1897
1896
|
expect(PropertyFactory.create.bind(PropertyFactory, 'SimpleTest:DefaultPrimitiveArrayPoly-1.0.0'))
|
|
@@ -1903,9 +1902,9 @@ describe('PropertyFactory', function () {
|
|
|
1903
1902
|
properties: [{
|
|
1904
1903
|
id: 'map', context: 'map', typeid: 'Int32', typedValue: {
|
|
1905
1904
|
key1: { typeid: 'Int32', value: 1 },
|
|
1906
|
-
key2: { typeid: 'Int32', value: 2 }
|
|
1907
|
-
}
|
|
1908
|
-
}]
|
|
1905
|
+
key2: { typeid: 'Int32', value: 2 },
|
|
1906
|
+
},
|
|
1907
|
+
}],
|
|
1909
1908
|
};
|
|
1910
1909
|
PropertyFactory.register(DefaultPrimitiveMapPoly);
|
|
1911
1910
|
expect(PropertyFactory.create.bind(PropertyFactory, 'SimpleTest:DefaultPrimitiveMapPoly-1.0.0'))
|
|
@@ -1918,9 +1917,9 @@ describe('PropertyFactory', function () {
|
|
|
1918
1917
|
var ConstantReadonly = {
|
|
1919
1918
|
typeid: 'SimpleTest:ConstantReadonly-1.0.0',
|
|
1920
1919
|
constants: [
|
|
1921
|
-
{ id: 'num', typeid: 'Uint32', value: 111 }
|
|
1920
|
+
{ id: 'num', typeid: 'Uint32', value: 111 },
|
|
1922
1921
|
],
|
|
1923
|
-
properties: [{ id: 'default', typeid: 'Uint32' }]
|
|
1922
|
+
properties: [{ id: 'default', typeid: 'Uint32' }],
|
|
1924
1923
|
};
|
|
1925
1924
|
PropertyFactory.register(ConstantReadonly);
|
|
1926
1925
|
var instance = PropertyFactory.create('SimpleTest:ConstantReadonly-1.0.0');
|
|
@@ -1936,21 +1935,21 @@ describe('PropertyFactory', function () {
|
|
|
1936
1935
|
{ id: 'num', typeid: 'Uint32' },
|
|
1937
1936
|
{
|
|
1938
1937
|
id: 'dynamic', properties: [
|
|
1939
|
-
{ id: 'dynamic_string', typeid: 'String' }
|
|
1940
|
-
]
|
|
1941
|
-
}
|
|
1942
|
-
]
|
|
1938
|
+
{ id: 'dynamic_string', typeid: 'String' },
|
|
1939
|
+
],
|
|
1940
|
+
},
|
|
1941
|
+
],
|
|
1943
1942
|
};
|
|
1944
1943
|
var ConstantChildReadonly = {
|
|
1945
1944
|
typeid: 'SimpleTest:ConstantChildReadonly-1.0.0',
|
|
1946
1945
|
constants: [
|
|
1947
1946
|
{
|
|
1948
1947
|
id: 'template', typeid: 'SimpleTest:ConstantChildReadonlyEntry-1.0.0', value: {
|
|
1949
|
-
num: 111, dynamic: { dynamic_string: 'I am a string' }
|
|
1950
|
-
}
|
|
1951
|
-
}
|
|
1948
|
+
num: 111, dynamic: { dynamic_string: 'I am a string' },
|
|
1949
|
+
},
|
|
1950
|
+
},
|
|
1952
1951
|
],
|
|
1953
|
-
properties: [{ id: 'default', typeid: 'Uint32' }]
|
|
1952
|
+
properties: [{ id: 'default', typeid: 'Uint32' }],
|
|
1954
1953
|
};
|
|
1955
1954
|
PropertyFactory.register(ConstantChildReadonlyEntry);
|
|
1956
1955
|
PropertyFactory.register(ConstantChildReadonly);
|
|
@@ -1968,9 +1967,9 @@ describe('PropertyFactory', function () {
|
|
|
1968
1967
|
typeid: 'SimpleTest:ConstantPrimitive-1.0.0',
|
|
1969
1968
|
constants: [
|
|
1970
1969
|
{ id: 'num', typeid: 'Uint32', value: 111 },
|
|
1971
|
-
{ id: 'bool', typeid: 'Bool', value: true }
|
|
1970
|
+
{ id: 'bool', typeid: 'Bool', value: true },
|
|
1972
1971
|
],
|
|
1973
|
-
properties: [{ id: 'default', typeid: 'Uint32' }]
|
|
1972
|
+
properties: [{ id: 'default', typeid: 'Uint32' }],
|
|
1974
1973
|
};
|
|
1975
1974
|
PropertyFactory.register(ConstantPrimitive);
|
|
1976
1975
|
var instance = PropertyFactory.create('SimpleTest:ConstantPrimitive-1.0.0');
|
|
@@ -1982,16 +1981,16 @@ describe('PropertyFactory', function () {
|
|
|
1982
1981
|
typeid: 'SimpleTest:ConstantEntry-1.0.0',
|
|
1983
1982
|
constants: [
|
|
1984
1983
|
{ id: 'num', typeid: 'Uint32', value: 111 },
|
|
1985
|
-
{ id: 'bool', typeid: 'Bool', value: true }
|
|
1984
|
+
{ id: 'bool', typeid: 'Bool', value: true },
|
|
1986
1985
|
],
|
|
1987
|
-
properties: [{ id: 'default', typeid: 'Uint32' }]
|
|
1986
|
+
properties: [{ id: 'default', typeid: 'Uint32' }],
|
|
1988
1987
|
};
|
|
1989
1988
|
var ConstantTyped = {
|
|
1990
1989
|
typeid: 'SimpleTest:ConstantTyped-1.0.0',
|
|
1991
1990
|
constants: [
|
|
1992
|
-
{ id: 'entry', typeid: 'SimpleTest:ConstantEntry-1.0.0', value: { num: 222, bool: false } }
|
|
1991
|
+
{ id: 'entry', typeid: 'SimpleTest:ConstantEntry-1.0.0', value: { num: 222, bool: false } },
|
|
1993
1992
|
],
|
|
1994
|
-
properties: [{ id: 'default2', typeid: 'Uint32' }]
|
|
1993
|
+
properties: [{ id: 'default2', typeid: 'Uint32' }],
|
|
1995
1994
|
};
|
|
1996
1995
|
PropertyFactory.register(ConstantEntry);
|
|
1997
1996
|
PropertyFactory.register(ConstantTyped);
|
|
@@ -2003,9 +2002,9 @@ describe('PropertyFactory', function () {
|
|
|
2003
2002
|
var ConstantString = {
|
|
2004
2003
|
typeid: 'SimpleTest:ConstantString-1.0.0',
|
|
2005
2004
|
constants: [
|
|
2006
|
-
{ id: 'string', typeid: 'String', value: 'I am a string' }
|
|
2005
|
+
{ id: 'string', typeid: 'String', value: 'I am a string' },
|
|
2007
2006
|
],
|
|
2008
|
-
properties: [{ id: 'default', typeid: 'Uint32' }]
|
|
2007
|
+
properties: [{ id: 'default', typeid: 'Uint32' }],
|
|
2009
2008
|
};
|
|
2010
2009
|
PropertyFactory.register(ConstantString);
|
|
2011
2010
|
var instance = PropertyFactory.create('SimpleTest:ConstantString-1.0.0');
|
|
@@ -2015,9 +2014,9 @@ describe('PropertyFactory', function () {
|
|
|
2015
2014
|
var ConstantArray = {
|
|
2016
2015
|
typeid: 'SimpleTest:ConstantArray-1.0.0',
|
|
2017
2016
|
constants: [
|
|
2018
|
-
{ id: 'array', typeid: 'Int32', value: [111, 222], context: 'array' }
|
|
2017
|
+
{ id: 'array', typeid: 'Int32', value: [111, 222], context: 'array' },
|
|
2019
2018
|
],
|
|
2020
|
-
properties: [{ id: 'default', typeid: 'Uint32' }]
|
|
2019
|
+
properties: [{ id: 'default', typeid: 'Uint32' }],
|
|
2021
2020
|
};
|
|
2022
2021
|
PropertyFactory.register(ConstantArray);
|
|
2023
2022
|
var instance = PropertyFactory.create('SimpleTest:ConstantArray-1.0.0');
|
|
@@ -2028,8 +2027,8 @@ describe('PropertyFactory', function () {
|
|
|
2028
2027
|
var ConstantTypedArrayEntry = {
|
|
2029
2028
|
typeid: 'SimpleTest:ConstantTypedArrayEntry-1.0.0',
|
|
2030
2029
|
properties: [
|
|
2031
|
-
{ id: 'string', typeid: 'String' }
|
|
2032
|
-
]
|
|
2030
|
+
{ id: 'string', typeid: 'String' },
|
|
2031
|
+
],
|
|
2033
2032
|
};
|
|
2034
2033
|
var ConstantTypedArray = {
|
|
2035
2034
|
typeid: 'SimpleTest:ConstantTypedArray-1.0.0',
|
|
@@ -2037,9 +2036,9 @@ describe('PropertyFactory', function () {
|
|
|
2037
2036
|
{
|
|
2038
2037
|
id: 'array', typeid: 'SimpleTest:ConstantTypedArrayEntry-1.0.0', context: 'array', value: [
|
|
2039
2038
|
{ string: 'I am string 1' }, { string: 'I am string 2' }
|
|
2040
|
-
]
|
|
2041
|
-
}
|
|
2042
|
-
]
|
|
2039
|
+
],
|
|
2040
|
+
},
|
|
2041
|
+
],
|
|
2043
2042
|
};
|
|
2044
2043
|
PropertyFactory.register(ConstantTypedArrayEntry);
|
|
2045
2044
|
PropertyFactory.register(ConstantTypedArray);
|
|
@@ -2054,21 +2053,21 @@ describe('PropertyFactory', function () {
|
|
|
2054
2053
|
{ id: 'num', typeid: 'Uint32' },
|
|
2055
2054
|
{
|
|
2056
2055
|
id: 'dynamic', properties: [
|
|
2057
|
-
{ id: 'dynamic_string', typeid: 'String' }
|
|
2058
|
-
]
|
|
2059
|
-
}
|
|
2060
|
-
]
|
|
2056
|
+
{ id: 'dynamic_string', typeid: 'String' },
|
|
2057
|
+
],
|
|
2058
|
+
},
|
|
2059
|
+
],
|
|
2061
2060
|
};
|
|
2062
2061
|
var ConstantTemplate = {
|
|
2063
2062
|
typeid: 'SimpleTest:ConstantTemplate-1.0.0',
|
|
2064
2063
|
constants: [
|
|
2065
2064
|
{
|
|
2066
2065
|
id: 'template', typeid: 'SimpleTest:ConstantTemplateEntry-1.0.0', value: {
|
|
2067
|
-
num: 111, dynamic: { dynamic_string: 'I am a string' }
|
|
2068
|
-
}
|
|
2069
|
-
}
|
|
2066
|
+
num: 111, dynamic: { dynamic_string: 'I am a string' },
|
|
2067
|
+
},
|
|
2068
|
+
},
|
|
2070
2069
|
],
|
|
2071
|
-
properties: [{ id: 'default', typeid: 'Uint32' }]
|
|
2070
|
+
properties: [{ id: 'default', typeid: 'Uint32' }],
|
|
2072
2071
|
};
|
|
2073
2072
|
PropertyFactory.register(ConstantTemplateEntry);
|
|
2074
2073
|
PropertyFactory._reregister(ConstantTemplate);
|
|
@@ -2081,8 +2080,8 @@ describe('PropertyFactory', function () {
|
|
|
2081
2080
|
typeid: 'SimpleTest:ConstantSetEntry-1.0.0',
|
|
2082
2081
|
inherits: ['NamedProperty'],
|
|
2083
2082
|
properties: [
|
|
2084
|
-
{ id: 'string', typeid: 'String' }
|
|
2085
|
-
]
|
|
2083
|
+
{ id: 'string', typeid: 'String' },
|
|
2084
|
+
],
|
|
2086
2085
|
};
|
|
2087
2086
|
var ConstantSet = {
|
|
2088
2087
|
typeid: 'SimpleTest:ConstantSet-1.0.0',
|
|
@@ -2090,11 +2089,11 @@ describe('PropertyFactory', function () {
|
|
|
2090
2089
|
{
|
|
2091
2090
|
id: 'set', typeid: 'SimpleTest:ConstantSetEntry-1.0.0', context: 'set', value: [
|
|
2092
2091
|
{ string: 'I am a string 1' },
|
|
2093
|
-
{ string: 'I am a string 2' }
|
|
2094
|
-
]
|
|
2095
|
-
}
|
|
2092
|
+
{ string: 'I am a string 2' },
|
|
2093
|
+
],
|
|
2094
|
+
},
|
|
2096
2095
|
],
|
|
2097
|
-
properties: [{ id: 'default', typeid: 'Uint32' }]
|
|
2096
|
+
properties: [{ id: 'default', typeid: 'Uint32' }],
|
|
2098
2097
|
};
|
|
2099
2098
|
PropertyFactory.register(ConstantSetEntry);
|
|
2100
2099
|
PropertyFactory.register(ConstantSet);
|
|
@@ -2113,11 +2112,11 @@ describe('PropertyFactory', function () {
|
|
|
2113
2112
|
{
|
|
2114
2113
|
id: 'map', typeid: 'Int32', context: 'map', value: {
|
|
2115
2114
|
key1: 111,
|
|
2116
|
-
key2: 222
|
|
2117
|
-
}
|
|
2118
|
-
}
|
|
2115
|
+
key2: 222,
|
|
2116
|
+
},
|
|
2117
|
+
},
|
|
2119
2118
|
],
|
|
2120
|
-
properties: [{ id: 'default', typeid: 'Uint32' }]
|
|
2119
|
+
properties: [{ id: 'default', typeid: 'Uint32' }],
|
|
2121
2120
|
};
|
|
2122
2121
|
PropertyFactory.register(ConstantPrimitiveMap);
|
|
2123
2122
|
var instance = PropertyFactory.create('SimpleTest:ConstantPrimitiveMap-1.0.0');
|
|
@@ -2129,8 +2128,8 @@ describe('PropertyFactory', function () {
|
|
|
2129
2128
|
typeid: 'SimpleTest:ConstantTypedMapEntry-1.0.0',
|
|
2130
2129
|
inherits: ['NamedProperty'],
|
|
2131
2130
|
properties: [
|
|
2132
|
-
{ id: 'string', typeid: 'String' }
|
|
2133
|
-
]
|
|
2131
|
+
{ id: 'string', typeid: 'String' },
|
|
2132
|
+
],
|
|
2134
2133
|
};
|
|
2135
2134
|
var ConstantTypedMap = {
|
|
2136
2135
|
typeid: 'SimpleTest:ConstantTypedMap-1.0.0',
|
|
@@ -2138,11 +2137,11 @@ describe('PropertyFactory', function () {
|
|
|
2138
2137
|
{
|
|
2139
2138
|
id: 'map', typeid: 'SimpleTest:ConstantTypedMapEntry-1.0.0', context: 'map', value: {
|
|
2140
2139
|
key1: { string: 'I am a string 1' },
|
|
2141
|
-
key2: { string: 'I am a string 2' }
|
|
2142
|
-
}
|
|
2143
|
-
}
|
|
2140
|
+
key2: { string: 'I am a string 2' },
|
|
2141
|
+
},
|
|
2142
|
+
},
|
|
2144
2143
|
],
|
|
2145
|
-
properties: [{ id: 'default', typeid: 'Uint32' }]
|
|
2144
|
+
properties: [{ id: 'default', typeid: 'Uint32' }],
|
|
2146
2145
|
};
|
|
2147
2146
|
PropertyFactory.register(ConstantTypedMapEntry);
|
|
2148
2147
|
PropertyFactory.register(ConstantTypedMap);
|
|
@@ -2160,10 +2159,10 @@ describe('PropertyFactory', function () {
|
|
|
2160
2159
|
typeid: 'Int32',
|
|
2161
2160
|
context: 'map',
|
|
2162
2161
|
contextKeyType: 'typeid',
|
|
2163
|
-
value: { 'SimpleTest:ConstantTemplate1-1.0.0': 1, 'SimpleTest:ConstantTemplate2-1.0.0': -1 }
|
|
2164
|
-
}
|
|
2162
|
+
value: { 'SimpleTest:ConstantTemplate1-1.0.0': 1, 'SimpleTest:ConstantTemplate2-1.0.0': -1 },
|
|
2163
|
+
},
|
|
2165
2164
|
],
|
|
2166
|
-
properties: [{ id: 'default', typeid: 'Uint32' }]
|
|
2165
|
+
properties: [{ id: 'default', typeid: 'Uint32' }],
|
|
2167
2166
|
};
|
|
2168
2167
|
PropertyFactory._reregister(ConstantTemplate);
|
|
2169
2168
|
var instance = PropertyFactory.create('SimpleTest:ConstantTemplate-1.0.0');
|
|
@@ -2178,8 +2177,8 @@ describe('PropertyFactory', function () {
|
|
|
2178
2177
|
constants: [
|
|
2179
2178
|
{ id: 'num', typeid: 'Int16' },
|
|
2180
2179
|
{ id: 'bool', typeid: 'Bool' },
|
|
2181
|
-
{ id: 'string', typeid: 'String' }
|
|
2182
|
-
]
|
|
2180
|
+
{ id: 'string', typeid: 'String' },
|
|
2181
|
+
],
|
|
2183
2182
|
};
|
|
2184
2183
|
var ConstantNoValue = {
|
|
2185
2184
|
typeid: 'SimpleTest:ConstantNoValue-1.0.0',
|
|
@@ -2190,8 +2189,8 @@ describe('PropertyFactory', function () {
|
|
|
2190
2189
|
{ id: 'array', typeid: 'Int16', context: 'array' },
|
|
2191
2190
|
{ id: 'array_typed', typeid: 'SimpleTest:ConstantNoValueEntry-1.0.0', context: 'array' },
|
|
2192
2191
|
{ id: 'set', typeid: 'SimpleTest:ConstantNoValueEntry-1.0.0', context: 'set' },
|
|
2193
|
-
{ id: 'map', typeid: 'SimpleTest:ConstantNoValueEntry-1.0.0', context: 'map' }
|
|
2194
|
-
]
|
|
2192
|
+
{ id: 'map', typeid: 'SimpleTest:ConstantNoValueEntry-1.0.0', context: 'map' },
|
|
2193
|
+
],
|
|
2195
2194
|
};
|
|
2196
2195
|
var ConstantNoValueInherited = {
|
|
2197
2196
|
typeid: 'SimpleTest:ConstantNoValueInherited-1.0.0',
|
|
@@ -2205,21 +2204,21 @@ describe('PropertyFactory', function () {
|
|
|
2205
2204
|
id: 'array_typed', typeid: 'SimpleTest:ConstantNoValueEntry-1.0.0', context: 'array', value: [
|
|
2206
2205
|
{ num: 100 },
|
|
2207
2206
|
{ num: 200, string: 'I am a string 2', bool: true }
|
|
2208
|
-
]
|
|
2207
|
+
],
|
|
2209
2208
|
},
|
|
2210
2209
|
{
|
|
2211
2210
|
id: 'set', typeid: 'SimpleTest:ConstantNoValueEntry-1.0.0', context: 'set', value: [
|
|
2212
2211
|
{ num: 100 },
|
|
2213
2212
|
{ num: 200, string: 'I am a string 2', bool: true }
|
|
2214
|
-
]
|
|
2213
|
+
],
|
|
2215
2214
|
},
|
|
2216
2215
|
{
|
|
2217
2216
|
id: 'map', typeid: 'SimpleTest:ConstantNoValueEntry-1.0.0', context: 'map', value: {
|
|
2218
2217
|
key1: { num: 100 },
|
|
2219
|
-
key2: { num: 200, string: 'I am a string 2', bool: true }
|
|
2220
|
-
}
|
|
2221
|
-
}
|
|
2222
|
-
]
|
|
2218
|
+
key2: { num: 200, string: 'I am a string 2', bool: true },
|
|
2219
|
+
},
|
|
2220
|
+
},
|
|
2221
|
+
],
|
|
2223
2222
|
};
|
|
2224
2223
|
PropertyFactory.register(ConstantNoValueEntry);
|
|
2225
2224
|
PropertyFactory.register(ConstantNoValue);
|
|
@@ -2264,16 +2263,16 @@ describe('PropertyFactory', function () {
|
|
|
2264
2263
|
typeid: 'SimpleTest:ConstantPolyBase-1.0.0',
|
|
2265
2264
|
inherits: ['NamedProperty'],
|
|
2266
2265
|
constants: [
|
|
2267
|
-
{ id: 'num', typeid: 'Uint32', value: 111 }
|
|
2268
|
-
]
|
|
2266
|
+
{ id: 'num', typeid: 'Uint32', value: 111 },
|
|
2267
|
+
],
|
|
2269
2268
|
};
|
|
2270
2269
|
var ConstantPolySub = {
|
|
2271
2270
|
typeid: 'SimpleTest:ConstantPolySub-1.0.0',
|
|
2272
2271
|
inherits: 'SimpleTest:ConstantPolyBase-1.0.0',
|
|
2273
2272
|
constants: [
|
|
2274
2273
|
{ id: 'num', typeid: 'Uint32', value: 222 },
|
|
2275
|
-
{ id: 'str', typeid: 'String', value: 'Sub' }
|
|
2276
|
-
]
|
|
2274
|
+
{ id: 'str', typeid: 'String', value: 'Sub' },
|
|
2275
|
+
],
|
|
2277
2276
|
};
|
|
2278
2277
|
var ConstantPolySubSub = {
|
|
2279
2278
|
typeid: 'SimpleTest:ConstantPolySubSub-1.0.0',
|
|
@@ -2281,8 +2280,8 @@ describe('PropertyFactory', function () {
|
|
|
2281
2280
|
constants: [
|
|
2282
2281
|
{ id: 'num', typeid: 'Uint32', value: 333 },
|
|
2283
2282
|
{ id: 'num2', typeid: 'Uint32', value: 111 },
|
|
2284
|
-
{ id: 'str', typeid: 'String', value: 'SubSub' }
|
|
2285
|
-
]
|
|
2283
|
+
{ id: 'str', typeid: 'String', value: 'SubSub' },
|
|
2284
|
+
],
|
|
2286
2285
|
};
|
|
2287
2286
|
beforeEach(function () {
|
|
2288
2287
|
PropertyFactory._clear();
|
|
@@ -2296,13 +2295,13 @@ describe('PropertyFactory', function () {
|
|
|
2296
2295
|
constants: [
|
|
2297
2296
|
{
|
|
2298
2297
|
id: 'polySub', typeid: 'SimpleTest:ConstantPolyBase-1.0.0',
|
|
2299
|
-
typedValue: { typeid: 'SimpleTest:ConstantPolySub-1.0.0', value: { num: 333, str: 'PolySub' } }
|
|
2298
|
+
typedValue: { typeid: 'SimpleTest:ConstantPolySub-1.0.0', value: { num: 333, str: 'PolySub' } },
|
|
2300
2299
|
},
|
|
2301
2300
|
{
|
|
2302
2301
|
id: 'polySubSub', typeid: 'SimpleTest:ConstantPolyBase-1.0.0',
|
|
2303
|
-
typedValue: { typeid: 'SimpleTest:ConstantPolySubSub-1.0.0', value: { num: 444, str: 'PolySubSub' } }
|
|
2304
|
-
}
|
|
2305
|
-
]
|
|
2302
|
+
typedValue: { typeid: 'SimpleTest:ConstantPolySubSub-1.0.0', value: { num: 444, str: 'PolySubSub' } },
|
|
2303
|
+
},
|
|
2304
|
+
],
|
|
2306
2305
|
};
|
|
2307
2306
|
PropertyFactory.register(ConstantPolyContainer);
|
|
2308
2307
|
var instance = PropertyFactory.create('SimpleTest:ConstantPolyContainer-1.0.0');
|
|
@@ -2317,8 +2316,8 @@ describe('PropertyFactory', function () {
|
|
|
2317
2316
|
typeid: 'SimpleTest:ConstantPolyNoValueContainer-1.0.0',
|
|
2318
2317
|
constants: [{
|
|
2319
2318
|
id: 'polySub', typeid: 'SimpleTest:ConstantPolyBase-1.0.0',
|
|
2320
|
-
typedValue: { typeid: 'SimpleTest:ConstantPolySub-1.0.0' }
|
|
2321
|
-
}]
|
|
2319
|
+
typedValue: { typeid: 'SimpleTest:ConstantPolySub-1.0.0' },
|
|
2320
|
+
}],
|
|
2322
2321
|
};
|
|
2323
2322
|
PropertyFactory.register(ConstantPolyNoValueContainer);
|
|
2324
2323
|
var prop = PropertyFactory.create('SimpleTest:ConstantPolyNoValueContainer-1.0.0');
|
|
@@ -2329,8 +2328,8 @@ describe('PropertyFactory', function () {
|
|
|
2329
2328
|
typeid: 'SimpleTest:ConstantPolyNoTypeIdContainer-1.0.0',
|
|
2330
2329
|
constants: [{
|
|
2331
2330
|
id: 'polySub', typeid: 'SimpleTest:ConstantPolyBase-1.0.0',
|
|
2332
|
-
typedValue: { value: { num: 333, str: 'PolySub' } }
|
|
2333
|
-
}]
|
|
2331
|
+
typedValue: { value: { num: 333, str: 'PolySub' } },
|
|
2332
|
+
}],
|
|
2334
2333
|
};
|
|
2335
2334
|
PropertyFactory.register(ConstantPolyNoTypeIdContainer);
|
|
2336
2335
|
expect(PropertyFactory.create.bind(PropertyFactory, 'SimpleTest:ConstantPolyNoTypeIdContainer-1.0.0'))
|
|
@@ -2344,10 +2343,10 @@ describe('PropertyFactory', function () {
|
|
|
2344
2343
|
id: 'array', typeid: 'SimpleTest:ConstantPolyBase-1.0.0', context: 'array', typedValue: [
|
|
2345
2344
|
{ typeid: 'SimpleTest:ConstantPolySub-1.0.0' },
|
|
2346
2345
|
{ typeid: 'SimpleTest:ConstantPolySub-1.0.0', value: { str: 'ArrSub' } },
|
|
2347
|
-
{ typeid: 'SimpleTest:ConstantPolySubSub-1.0.0', value: { str: 'ArrSubSub' } }
|
|
2348
|
-
]
|
|
2349
|
-
}
|
|
2350
|
-
]
|
|
2346
|
+
{ typeid: 'SimpleTest:ConstantPolySubSub-1.0.0', value: { str: 'ArrSubSub' } },
|
|
2347
|
+
],
|
|
2348
|
+
},
|
|
2349
|
+
],
|
|
2351
2350
|
};
|
|
2352
2351
|
PropertyFactory.register(ConstantPolyArrayContainer);
|
|
2353
2352
|
var instance = PropertyFactory.create('SimpleTest:ConstantPolyArrayContainer-1.0.0');
|
|
@@ -2367,10 +2366,10 @@ describe('PropertyFactory', function () {
|
|
|
2367
2366
|
id: 'set', typeid: 'SimpleTest:ConstantPolyBase-1.0.0', context: 'set', typedValue: [
|
|
2368
2367
|
{ typeid: 'SimpleTest:ConstantPolySub-1.0.0' },
|
|
2369
2368
|
{ typeid: 'SimpleTest:ConstantPolySub-1.0.0', value: { str: 'ArrSub' } },
|
|
2370
|
-
{ typeid: 'SimpleTest:ConstantPolySubSub-1.0.0', value: { str: 'ArrSubSub' } }
|
|
2371
|
-
]
|
|
2372
|
-
}
|
|
2373
|
-
]
|
|
2369
|
+
{ typeid: 'SimpleTest:ConstantPolySubSub-1.0.0', value: { str: 'ArrSubSub' } },
|
|
2370
|
+
],
|
|
2371
|
+
},
|
|
2372
|
+
],
|
|
2374
2373
|
};
|
|
2375
2374
|
PropertyFactory.register(ConstantPolySetContainer);
|
|
2376
2375
|
var instance = PropertyFactory.create('SimpleTest:ConstantPolySetContainer-1.0.0');
|
|
@@ -2391,10 +2390,10 @@ describe('PropertyFactory', function () {
|
|
|
2391
2390
|
id: 'map', typeid: 'SimpleTest:ConstantPolyBase-1.0.0', context: 'map', typedValue: {
|
|
2392
2391
|
key1: { typeid: 'SimpleTest:ConstantPolySub-1.0.0' },
|
|
2393
2392
|
key2: { typeid: 'SimpleTest:ConstantPolySub-1.0.0', value: { str: 'ArrSub' } },
|
|
2394
|
-
key3: { typeid: 'SimpleTest:ConstantPolySubSub-1.0.0', value: { str: 'ArrSubSub' } }
|
|
2395
|
-
}
|
|
2396
|
-
}
|
|
2397
|
-
]
|
|
2393
|
+
key3: { typeid: 'SimpleTest:ConstantPolySubSub-1.0.0', value: { str: 'ArrSubSub' } },
|
|
2394
|
+
},
|
|
2395
|
+
},
|
|
2396
|
+
],
|
|
2398
2397
|
};
|
|
2399
2398
|
PropertyFactory.register(ConstantPolyMapContainer);
|
|
2400
2399
|
var instance = PropertyFactory.create('SimpleTest:ConstantPolyMapContainer-1.0.0');
|
|
@@ -2410,17 +2409,17 @@ describe('PropertyFactory', function () {
|
|
|
2410
2409
|
var ConstantPoly = {
|
|
2411
2410
|
typeid: 'SimpleTest:ConstantPoly-1.0.0',
|
|
2412
2411
|
constants: [
|
|
2413
|
-
{ id: 'num', typeid: 'Uint32', value: 111 }
|
|
2414
|
-
]
|
|
2412
|
+
{ id: 'num', typeid: 'Uint32', value: 111 },
|
|
2413
|
+
],
|
|
2415
2414
|
};
|
|
2416
2415
|
var ConstantPolyUnderivedContainer = {
|
|
2417
2416
|
typeid: 'SimpleTest:ConstantPolyUnderivedContainer-1.0.0',
|
|
2418
2417
|
constants: [
|
|
2419
2418
|
{
|
|
2420
2419
|
id: 'poly', typeid: 'SimpleTest:ConstantPolyBase-1.0.0',
|
|
2421
|
-
typedValue: { typeid: 'SimpleTest:ConstantPoly-1.0.0', value: { num: 333 } }
|
|
2422
|
-
}
|
|
2423
|
-
]
|
|
2420
|
+
typedValue: { typeid: 'SimpleTest:ConstantPoly-1.0.0', value: { num: 333 } },
|
|
2421
|
+
},
|
|
2422
|
+
],
|
|
2424
2423
|
};
|
|
2425
2424
|
PropertyFactory.register(ConstantPoly);
|
|
2426
2425
|
PropertyFactory.register(ConstantPolyUnderivedContainer);
|
|
@@ -2431,8 +2430,8 @@ describe('PropertyFactory', function () {
|
|
|
2431
2430
|
var DefaultPrimitiveArrayPoly = {
|
|
2432
2431
|
typeid: 'SimpleTest:DefaultPrimitivePoly-1.0.0',
|
|
2433
2432
|
constants: [{
|
|
2434
|
-
id: 'int', typeid: 'Int32', typedValue: { typeid: 'Int32', value: 123 }
|
|
2435
|
-
}]
|
|
2433
|
+
id: 'int', typeid: 'Int32', typedValue: { typeid: 'Int32', value: 123 },
|
|
2434
|
+
}],
|
|
2436
2435
|
};
|
|
2437
2436
|
PropertyFactory.register(DefaultPrimitiveArrayPoly);
|
|
2438
2437
|
expect(PropertyFactory.create.bind(PropertyFactory, 'SimpleTest:DefaultPrimitivePoly-1.0.0'))
|
|
@@ -2442,8 +2441,8 @@ describe('PropertyFactory', function () {
|
|
|
2442
2441
|
var DefaultPrimitiveArrayPoly = {
|
|
2443
2442
|
typeid: 'SimpleTest:DefaultPrimitiveArrayPoly-1.0.0',
|
|
2444
2443
|
constants: [{
|
|
2445
|
-
id: 'array', context: 'array', typeid: 'Int32', typedValue: [{ typeid: 'Int32', value: 123 }]
|
|
2446
|
-
}]
|
|
2444
|
+
id: 'array', context: 'array', typeid: 'Int32', typedValue: [{ typeid: 'Int32', value: 123 }],
|
|
2445
|
+
}],
|
|
2447
2446
|
};
|
|
2448
2447
|
PropertyFactory.register(DefaultPrimitiveArrayPoly);
|
|
2449
2448
|
expect(PropertyFactory.create.bind(PropertyFactory, 'SimpleTest:DefaultPrimitiveArrayPoly-1.0.0'))
|
|
@@ -2455,9 +2454,9 @@ describe('PropertyFactory', function () {
|
|
|
2455
2454
|
constants: [{
|
|
2456
2455
|
id: 'map', context: 'map', typeid: 'Int32', typedValue: {
|
|
2457
2456
|
key1: { typeid: 'Int32', value: 1 },
|
|
2458
|
-
key2: { typeid: 'Int32', value: 2 }
|
|
2459
|
-
}
|
|
2460
|
-
}]
|
|
2457
|
+
key2: { typeid: 'Int32', value: 2 },
|
|
2458
|
+
},
|
|
2459
|
+
}],
|
|
2461
2460
|
};
|
|
2462
2461
|
PropertyFactory.register(DefaultPrimitiveMapPoly);
|
|
2463
2462
|
expect(PropertyFactory.create.bind(PropertyFactory, 'SimpleTest:DefaultPrimitiveMapPoly-1.0.0'))
|
|
@@ -2491,7 +2490,7 @@ describe('PropertyFactory', function () {
|
|
|
2491
2490
|
const testEnum = {
|
|
2492
2491
|
inherits: 'Enum',
|
|
2493
2492
|
typeid: 'test:testEnum-1.0.0',
|
|
2494
|
-
properties: [{ id: 'test', value: 1 }]
|
|
2493
|
+
properties: [{ id: 'test', value: 1 }],
|
|
2495
2494
|
};
|
|
2496
2495
|
PropertyFactory.register(testEnum);
|
|
2497
2496
|
expect(PropertyFactory.instanceOf(PropertyFactory.create(testEnum.typeid, 'array'), 'Enum', 'array')).to.be.true;
|
|
@@ -2531,8 +2530,8 @@ describe('Template registration', function () {
|
|
|
2531
2530
|
properties: [{
|
|
2532
2531
|
id: 'values',
|
|
2533
2532
|
context: 'array',
|
|
2534
|
-
typeid: 'Float32'
|
|
2535
|
-
}]
|
|
2533
|
+
typeid: 'Float32',
|
|
2534
|
+
}],
|
|
2536
2535
|
};
|
|
2537
2536
|
var ValuesTemplate2 = {
|
|
2538
2537
|
typeid: testPropertyTypeId,
|
|
@@ -2541,8 +2540,8 @@ describe('Template registration', function () {
|
|
|
2541
2540
|
id: 'values',
|
|
2542
2541
|
context: 'array',
|
|
2543
2542
|
typeid: 'Float32',
|
|
2544
|
-
length: 0
|
|
2545
|
-
}]
|
|
2543
|
+
length: 0,
|
|
2544
|
+
}],
|
|
2546
2545
|
};
|
|
2547
2546
|
myPropertyFactory.register(ValuesTemplate1);
|
|
2548
2547
|
expect(myPropertyFactory.register.bind(myPropertyFactory, ValuesTemplate2)).to.not.throw();
|
|
@@ -2647,7 +2646,7 @@ describe('Template registration', function () {
|
|
|
2647
2646
|
};
|
|
2648
2647
|
PropertyFactory.addListener('registered', registeredEventListener);
|
|
2649
2648
|
PropertyFactory.register({
|
|
2650
|
-
typeid: typeid
|
|
2649
|
+
typeid: typeid,
|
|
2651
2650
|
});
|
|
2652
2651
|
// We remove the listener to avoid unnecessary calls for later templates registration.
|
|
2653
2652
|
PropertyFactory.removeListener('registered', registeredEventListener);
|
|
@@ -2660,7 +2659,7 @@ describe('Only properties and constants that inherit from NamedProperty can have
|
|
|
2660
2659
|
describe('should throw when trying to register a set not inheriting from a namedProperty', () => {
|
|
2661
2660
|
it('declared in a template', () => {
|
|
2662
2661
|
var templateChild = {
|
|
2663
|
-
typeid: 'adsk.test:anotherTestSchema-1.0.0'
|
|
2662
|
+
typeid: 'adsk.test:anotherTestSchema-1.0.0',
|
|
2664
2663
|
};
|
|
2665
2664
|
var template = {
|
|
2666
2665
|
typeid: 'adsk.test:testSchema-1.0.0',
|
|
@@ -2668,9 +2667,9 @@ describe('Only properties and constants that inherit from NamedProperty can have
|
|
|
2668
2667
|
{
|
|
2669
2668
|
id: 'something',
|
|
2670
2669
|
context: 'set',
|
|
2671
|
-
typeid: 'adsk.test:anotherTestSchema-1.0.0'
|
|
2672
|
-
}
|
|
2673
|
-
]
|
|
2670
|
+
typeid: 'adsk.test:anotherTestSchema-1.0.0',
|
|
2671
|
+
},
|
|
2672
|
+
],
|
|
2674
2673
|
};
|
|
2675
2674
|
PropertyFactory.register(template);
|
|
2676
2675
|
PropertyFactory.register(templateChild);
|
|
@@ -2680,11 +2679,11 @@ describe('Only properties and constants that inherit from NamedProperty can have
|
|
|
2680
2679
|
});
|
|
2681
2680
|
it('declared in a template with two level of inheritance', () => {
|
|
2682
2681
|
var itemParentTemplate = {
|
|
2683
|
-
typeid: 'adsk.test:itemParent-1.0.0'
|
|
2682
|
+
typeid: 'adsk.test:itemParent-1.0.0',
|
|
2684
2683
|
};
|
|
2685
2684
|
var itemTemplate = {
|
|
2686
2685
|
typeid: 'adsk.test:item-1.0.0',
|
|
2687
|
-
inherits: 'adsk.test:itemParent-1.0.0'
|
|
2686
|
+
inherits: 'adsk.test:itemParent-1.0.0',
|
|
2688
2687
|
};
|
|
2689
2688
|
var template = {
|
|
2690
2689
|
typeid: 'adsk.test:set-1.0.0',
|
|
@@ -2692,9 +2691,9 @@ describe('Only properties and constants that inherit from NamedProperty can have
|
|
|
2692
2691
|
{
|
|
2693
2692
|
id: 'something',
|
|
2694
2693
|
context: 'set',
|
|
2695
|
-
typeid: 'adsk.test:item-1.0.0'
|
|
2696
|
-
}
|
|
2697
|
-
]
|
|
2694
|
+
typeid: 'adsk.test:item-1.0.0',
|
|
2695
|
+
},
|
|
2696
|
+
],
|
|
2698
2697
|
};
|
|
2699
2698
|
PropertyFactory.register(itemParentTemplate);
|
|
2700
2699
|
PropertyFactory.register(itemTemplate);
|
|
@@ -2705,7 +2704,7 @@ describe('Only properties and constants that inherit from NamedProperty can have
|
|
|
2705
2704
|
});
|
|
2706
2705
|
it('when passed as a parameter of the create method', () => {
|
|
2707
2706
|
var template = {
|
|
2708
|
-
typeid: 'adsk.test:test-1.0.0'
|
|
2707
|
+
typeid: 'adsk.test:test-1.0.0',
|
|
2709
2708
|
};
|
|
2710
2709
|
PropertyFactory.register(template);
|
|
2711
2710
|
expect(() => {
|
|
@@ -2718,7 +2717,7 @@ describe('Only properties and constants that inherit from NamedProperty can have
|
|
|
2718
2717
|
describe('should throw when trying to register a set not inheriting from a namedProperty', () => {
|
|
2719
2718
|
it('declared in a template', () => {
|
|
2720
2719
|
var templateChild = {
|
|
2721
|
-
typeid: 'adsk.test:anotherTestSchema-1.0.0'
|
|
2720
|
+
typeid: 'adsk.test:anotherTestSchema-1.0.0',
|
|
2722
2721
|
};
|
|
2723
2722
|
var template = {
|
|
2724
2723
|
typeid: 'adsk.test:testSchema-1.0.0',
|
|
@@ -2727,9 +2726,9 @@ describe('Only properties and constants that inherit from NamedProperty can have
|
|
|
2727
2726
|
id: 'something',
|
|
2728
2727
|
context: 'set',
|
|
2729
2728
|
typeid: 'adsk.test:anotherTestSchema-1.0.0',
|
|
2730
|
-
value: 'hello'
|
|
2731
|
-
}
|
|
2732
|
-
]
|
|
2729
|
+
value: 'hello',
|
|
2730
|
+
},
|
|
2731
|
+
],
|
|
2733
2732
|
};
|
|
2734
2733
|
PropertyFactory.register(template);
|
|
2735
2734
|
PropertyFactory.register(templateChild);
|
|
@@ -2739,11 +2738,11 @@ describe('Only properties and constants that inherit from NamedProperty can have
|
|
|
2739
2738
|
});
|
|
2740
2739
|
it('declared in a template with two level of inheritance', () => {
|
|
2741
2740
|
var itemParentTemplate = {
|
|
2742
|
-
typeid: 'adsk.test:itemParent-1.0.0'
|
|
2741
|
+
typeid: 'adsk.test:itemParent-1.0.0',
|
|
2743
2742
|
};
|
|
2744
2743
|
var itemTemplate = {
|
|
2745
2744
|
typeid: 'adsk.test:item-1.0.0',
|
|
2746
|
-
inherits: 'adsk.test:itemParent-1.0.0'
|
|
2745
|
+
inherits: 'adsk.test:itemParent-1.0.0',
|
|
2747
2746
|
};
|
|
2748
2747
|
var template = {
|
|
2749
2748
|
typeid: 'adsk.test:set-1.0.0',
|
|
@@ -2752,9 +2751,9 @@ describe('Only properties and constants that inherit from NamedProperty can have
|
|
|
2752
2751
|
id: 'something',
|
|
2753
2752
|
context: 'set',
|
|
2754
2753
|
typeid: 'adsk.test:item-1.0.0',
|
|
2755
|
-
value: 'hello'
|
|
2756
|
-
}
|
|
2757
|
-
]
|
|
2754
|
+
value: 'hello',
|
|
2755
|
+
},
|
|
2756
|
+
],
|
|
2758
2757
|
};
|
|
2759
2758
|
PropertyFactory.register(itemParentTemplate);
|
|
2760
2759
|
PropertyFactory.register(itemTemplate);
|
|
@@ -2766,15 +2765,15 @@ describe('Only properties and constants that inherit from NamedProperty can have
|
|
|
2766
2765
|
var unit = {
|
|
2767
2766
|
'annotation': {
|
|
2768
2767
|
'description': 'A definite magnitude used as a standard of measurement.',
|
|
2769
|
-
'doc': 'http://docs.adskunits.apiary.io/#introduction/definitions/measurement-units'
|
|
2768
|
+
'doc': 'http://docs.adskunits.apiary.io/#introduction/definitions/measurement-units',
|
|
2770
2769
|
},
|
|
2771
2770
|
'typeid': 'autodesk.unit:unit-1.0.0',
|
|
2772
2771
|
'constants': [
|
|
2773
2772
|
{
|
|
2774
2773
|
'id': 'name',
|
|
2775
|
-
'typeid': 'String'
|
|
2776
|
-
}
|
|
2777
|
-
]
|
|
2774
|
+
'typeid': 'String',
|
|
2775
|
+
},
|
|
2776
|
+
],
|
|
2778
2777
|
};
|
|
2779
2778
|
var quantity = {
|
|
2780
2779
|
'annotation': { 'description': 'A quantity typically measured in a particular set of compatible units.' },
|
|
@@ -2782,16 +2781,16 @@ describe('Only properties and constants that inherit from NamedProperty can have
|
|
|
2782
2781
|
'constants': [
|
|
2783
2782
|
{
|
|
2784
2783
|
'id': 'name',
|
|
2785
|
-
'typeid': 'String'
|
|
2784
|
+
'typeid': 'String',
|
|
2786
2785
|
},
|
|
2787
2786
|
{
|
|
2788
2787
|
'id': 'units',
|
|
2789
2788
|
'typeid': 'autodesk.unit:unit-1.0.0',
|
|
2790
2789
|
'context': 'array',
|
|
2791
2790
|
'typedValue': [],
|
|
2792
|
-
'annotation': { 'description': 'List of all measurement units applicable to the measurable quantity.' }
|
|
2793
|
-
}
|
|
2794
|
-
]
|
|
2791
|
+
'annotation': { 'description': 'List of all measurement units applicable to the measurable quantity.' },
|
|
2792
|
+
},
|
|
2793
|
+
],
|
|
2795
2794
|
};
|
|
2796
2795
|
var area = {
|
|
2797
2796
|
'annotation': { 'description': 'Area.' },
|
|
@@ -2802,18 +2801,18 @@ describe('Only properties and constants that inherit from NamedProperty can have
|
|
|
2802
2801
|
{
|
|
2803
2802
|
'id': 'units',
|
|
2804
2803
|
'typedValue': [
|
|
2805
|
-
{ 'typeid': 'autodesk.unit.unit:squareCentimeters-1.0.0' }
|
|
2806
|
-
]
|
|
2807
|
-
}
|
|
2808
|
-
]
|
|
2804
|
+
{ 'typeid': 'autodesk.unit.unit:squareCentimeters-1.0.0' },
|
|
2805
|
+
],
|
|
2806
|
+
},
|
|
2807
|
+
],
|
|
2809
2808
|
};
|
|
2810
2809
|
var centimeter = {
|
|
2811
2810
|
'annotation': { 'description': 'Square centimeters.' },
|
|
2812
2811
|
'typeid': 'autodesk.unit.unit:squareCentimeters-1.0.0',
|
|
2813
2812
|
'inherits': ['autodesk.unit:unit-1.0.0'],
|
|
2814
2813
|
'constants': [
|
|
2815
|
-
{ 'id': 'name', 'value': 'Square centimeters' }
|
|
2816
|
-
]
|
|
2814
|
+
{ 'id': 'name', 'value': 'Square centimeters' },
|
|
2815
|
+
],
|
|
2817
2816
|
};
|
|
2818
2817
|
it('@bugfix should support constant which inhirets from a polymorphic array', () => {
|
|
2819
2818
|
PropertyFactory.register(unit);
|
|
@@ -2829,7 +2828,7 @@ describe('Only properties and constants that inherit from NamedProperty can have
|
|
|
2829
2828
|
});
|
|
2830
2829
|
describe('Async validation', function () {
|
|
2831
2830
|
var TemplateValidator;
|
|
2832
|
-
var inheritsFromAsync = function (child, ancestor) {
|
|
2831
|
+
var inheritsFromAsync = async function (child, ancestor) {
|
|
2833
2832
|
return new Promise(function (resolve, reject) {
|
|
2834
2833
|
setTimeout(function () {
|
|
2835
2834
|
try {
|
|
@@ -2841,7 +2840,7 @@ describe('Async validation', function () {
|
|
|
2841
2840
|
}, 0);
|
|
2842
2841
|
});
|
|
2843
2842
|
};
|
|
2844
|
-
var hasSchemaAsync = function (typeid) {
|
|
2843
|
+
var hasSchemaAsync = async function (typeid) {
|
|
2845
2844
|
return new Promise(function (resolve, reject) {
|
|
2846
2845
|
setTimeout(function () {
|
|
2847
2846
|
resolve(PropertyFactory._has(typeid));
|
|
@@ -2854,7 +2853,7 @@ describe('Async validation', function () {
|
|
|
2854
2853
|
it('can validate asynchronously', function () {
|
|
2855
2854
|
var templateValidator = new TemplateValidator({
|
|
2856
2855
|
inheritsFromAsync: inheritsFromAsync,
|
|
2857
|
-
hasSchemaAsync: hasSchemaAsync
|
|
2856
|
+
hasSchemaAsync: hasSchemaAsync,
|
|
2858
2857
|
});
|
|
2859
2858
|
var templatePrevious = JSON.parse(JSON.stringify(require('./validation/goodPointId')));
|
|
2860
2859
|
var template = JSON.parse(JSON.stringify(templatePrevious));
|
|
@@ -2868,15 +2867,15 @@ describe('Async validation', function () {
|
|
|
2868
2867
|
it('can perform context validation asynchronously', function (done) {
|
|
2869
2868
|
var templateValidator = new TemplateValidator({
|
|
2870
2869
|
inheritsFromAsync: inheritsFromAsync,
|
|
2871
|
-
hasSchemaAsync: hasSchemaAsync
|
|
2870
|
+
hasSchemaAsync: hasSchemaAsync,
|
|
2872
2871
|
});
|
|
2873
2872
|
// Doesn't inherit from 'NamedProperty'. Will cause an error
|
|
2874
2873
|
var grandParentSchema = {
|
|
2875
|
-
'typeid': 'test:grandparentschema-1.0.0'
|
|
2874
|
+
'typeid': 'test:grandparentschema-1.0.0',
|
|
2876
2875
|
};
|
|
2877
2876
|
var parentSchema = {
|
|
2878
2877
|
'typeid': 'test:parentschema-1.0.0',
|
|
2879
|
-
'inherits': ['test:grandparentschema-1.0.0']
|
|
2878
|
+
'inherits': ['test:grandparentschema-1.0.0'],
|
|
2880
2879
|
};
|
|
2881
2880
|
var childSchema = {
|
|
2882
2881
|
'typeid': 'test:childchema-1.0.0',
|
|
@@ -2884,9 +2883,9 @@ describe('Async validation', function () {
|
|
|
2884
2883
|
{
|
|
2885
2884
|
id: 'set',
|
|
2886
2885
|
typeid: 'test:parentschema-1.0.0',
|
|
2887
|
-
context: 'set'
|
|
2888
|
-
}
|
|
2889
|
-
]
|
|
2886
|
+
context: 'set',
|
|
2887
|
+
},
|
|
2888
|
+
],
|
|
2890
2889
|
};
|
|
2891
2890
|
PropertyFactory.register(grandParentSchema);
|
|
2892
2891
|
PropertyFactory.register(parentSchema);
|
|
@@ -2904,8 +2903,8 @@ describe('inheritsFrom() method', () => {
|
|
|
2904
2903
|
PropertyFactory.register([
|
|
2905
2904
|
{
|
|
2906
2905
|
typeid: 'autodesk.examples:test.set-1.0.0',
|
|
2907
|
-
inherits: 'NamedProperty'
|
|
2908
|
-
}
|
|
2906
|
+
inherits: 'NamedProperty',
|
|
2907
|
+
},
|
|
2909
2908
|
]);
|
|
2910
2909
|
});
|
|
2911
2910
|
it('should recognize that the Int8 only inherits from BaseProperty', () => {
|
|
@@ -3038,7 +3037,7 @@ describe('inheritsFrom() method', () => {
|
|
|
3038
3037
|
// add a second schema for the cache tests
|
|
3039
3038
|
PropertyFactory.register({
|
|
3040
3039
|
typeid: 'autodesk.examples:test.set-2.0.0',
|
|
3041
|
-
inherits: 'NamedProperty'
|
|
3040
|
+
inherits: 'NamedProperty',
|
|
3042
3041
|
});
|
|
3043
3042
|
});
|
|
3044
3043
|
it('should cache results', () => {
|
|
@@ -3048,13 +3047,13 @@ describe('inheritsFrom() method', () => {
|
|
|
3048
3047
|
'autodesk.examples:test.set-1.0.0': {
|
|
3049
3048
|
BaseProperty: true,
|
|
3050
3049
|
AbstractStaticCollectionProperty: true,
|
|
3051
|
-
NamedProperty: true
|
|
3050
|
+
NamedProperty: true,
|
|
3052
3051
|
},
|
|
3053
3052
|
'autodesk.examples:test.set-2.0.0': {
|
|
3054
3053
|
BaseProperty: true,
|
|
3055
3054
|
AbstractStaticCollectionProperty: true,
|
|
3056
|
-
NamedProperty: true
|
|
3057
|
-
}
|
|
3055
|
+
NamedProperty: true,
|
|
3056
|
+
},
|
|
3058
3057
|
};
|
|
3059
3058
|
expect(PropertyFactory._inheritanceCache).to.deep.equal(expectedResults);
|
|
3060
3059
|
});
|
|
@@ -3068,13 +3067,13 @@ describe('inheritsFrom() method', () => {
|
|
|
3068
3067
|
'autodesk.examples:test.set-1.0.0': {
|
|
3069
3068
|
BaseProperty: true,
|
|
3070
3069
|
AbstractStaticCollectionProperty: true,
|
|
3071
|
-
NodeProperty: true
|
|
3070
|
+
NodeProperty: true,
|
|
3072
3071
|
},
|
|
3073
3072
|
'autodesk.examples:test.set-2.0.0': {
|
|
3074
3073
|
BaseProperty: true,
|
|
3075
3074
|
AbstractStaticCollectionProperty: true,
|
|
3076
|
-
NodeProperty: true
|
|
3077
|
-
}
|
|
3075
|
+
NodeProperty: true,
|
|
3076
|
+
},
|
|
3078
3077
|
};
|
|
3079
3078
|
expect(PropertyFactory._inheritanceCache).to.deep.equal(expectedResults);
|
|
3080
3079
|
});
|