@itwin/core-backend 5.5.0-dev.1 → 5.5.0-dev.10
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/CHANGELOG.md +24 -1
- package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.js +0 -2
- package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +11 -2
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +20 -15
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts.map +1 -1
- package/lib/cjs/TxnManager.js +2 -1
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/esm/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/esm/ChangesetECAdaptor.js +0 -2
- package/lib/esm/ChangesetECAdaptor.js.map +1 -1
- package/lib/esm/IModelDb.d.ts +11 -2
- package/lib/esm/IModelDb.d.ts.map +1 -1
- package/lib/esm/IModelDb.js +20 -15
- package/lib/esm/IModelDb.js.map +1 -1
- package/lib/esm/TxnManager.d.ts.map +1 -1
- package/lib/esm/TxnManager.js +2 -1
- package/lib/esm/TxnManager.js.map +1 -1
- package/lib/esm/test/annotations/Fields.test.js +2 -2
- package/lib/esm/test/annotations/Fields.test.js.map +1 -1
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js +5 -5
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js.map +1 -1
- package/lib/esm/test/ecdb/ConcurrentQuery.test.js +39 -0
- package/lib/esm/test/ecdb/ConcurrentQuery.test.js.map +1 -1
- package/lib/esm/test/imodel/IModel.test.js +31 -2
- package/lib/esm/test/imodel/IModel.test.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js +432 -198
- package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js +272 -190
- package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/TestContext.d.ts +27 -0
- package/lib/esm/test/incrementalSchemaLocater/TestContext.d.ts.map +1 -0
- package/lib/esm/test/incrementalSchemaLocater/TestContext.js +136 -0
- package/lib/esm/test/incrementalSchemaLocater/TestContext.js.map +1 -0
- package/lib/esm/test/standalone/ChangesetReader.test.js +222 -3
- package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
- package/lib/esm/test/standalone/RenderTimeline.test.js +1 -1
- package/lib/esm/test/standalone/RenderTimeline.test.js.map +1 -1
- package/lib/esm/test/standalone/StandaloneDb.test.d.ts +2 -0
- package/lib/esm/test/standalone/StandaloneDb.test.d.ts.map +1 -0
- package/lib/esm/test/standalone/StandaloneDb.test.js +103 -0
- package/lib/esm/test/standalone/StandaloneDb.test.js.map +1 -0
- package/lib/esm/test/standalone/TxnManager.test.js +43 -0
- package/lib/esm/test/standalone/TxnManager.test.js.map +1 -1
- package/package.json +13 -13
- package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.d.ts +0 -11
- package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.d.ts.map +0 -1
- package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.js +0 -36
- package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.js.map +0 -1
- package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.d.ts +0 -20
- package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.d.ts.map +0 -1
- package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.js +0 -126
- package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.js.map +0 -1
- package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.d.ts +0 -24
- package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.d.ts.map +0 -1
- package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.js +0 -67
- package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.js.map +0 -1
|
@@ -1,8 +1,60 @@
|
|
|
1
|
+
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
2
|
+
if (value !== null && value !== void 0) {
|
|
3
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
4
|
+
var dispose, inner;
|
|
5
|
+
if (async) {
|
|
6
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
7
|
+
dispose = value[Symbol.asyncDispose];
|
|
8
|
+
}
|
|
9
|
+
if (dispose === void 0) {
|
|
10
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
11
|
+
dispose = value[Symbol.dispose];
|
|
12
|
+
if (async) inner = dispose;
|
|
13
|
+
}
|
|
14
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
15
|
+
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
16
|
+
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
17
|
+
}
|
|
18
|
+
else if (async) {
|
|
19
|
+
env.stack.push({ async: true });
|
|
20
|
+
}
|
|
21
|
+
return value;
|
|
22
|
+
};
|
|
23
|
+
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
24
|
+
return function (env) {
|
|
25
|
+
function fail(e) {
|
|
26
|
+
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
27
|
+
env.hasError = true;
|
|
28
|
+
}
|
|
29
|
+
var r, s = 0;
|
|
30
|
+
function next() {
|
|
31
|
+
while (r = env.stack.pop()) {
|
|
32
|
+
try {
|
|
33
|
+
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
34
|
+
if (r.dispose) {
|
|
35
|
+
var result = r.dispose.call(r.value);
|
|
36
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
37
|
+
}
|
|
38
|
+
else s |= 1;
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
fail(e);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
45
|
+
if (env.hasError) throw env.error;
|
|
46
|
+
}
|
|
47
|
+
return next();
|
|
48
|
+
};
|
|
49
|
+
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
50
|
+
var e = new Error(message);
|
|
51
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
52
|
+
});
|
|
1
53
|
import { Schema, SchemaItemType, SchemaKey } from "@itwin/ecschema-metadata";
|
|
2
|
-
import { IncrementalTestHelper } from "./utils/IncrementalTestHelper";
|
|
3
54
|
import { expect, use } from "chai";
|
|
55
|
+
import { TestContext } from "./TestContext";
|
|
56
|
+
import { IModelIncrementalSchemaLocater } from "../../IModelIncrementalSchemaLocater";
|
|
4
57
|
import * as deepEqualInAnyOrder from "deep-equal-in-any-order";
|
|
5
|
-
import { TestSqlSchemaLocater } from "./utils/TestSqlSchemaLocater";
|
|
6
58
|
use(deepEqualInAnyOrder);
|
|
7
59
|
function findItem(name, rowData) {
|
|
8
60
|
const item = rowData.find((i) => i.name === name);
|
|
@@ -20,8 +72,12 @@ function isECClass(item) {
|
|
|
20
72
|
function isRelationshipClass(item) {
|
|
21
73
|
return "source" in item && "target" in item;
|
|
22
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* A test locater that exposes the protected methods of IModelIncrementalSchemaLocater for granular testing.
|
|
77
|
+
*/
|
|
78
|
+
class TestSchemaLocater extends IModelIncrementalSchemaLocater {
|
|
79
|
+
}
|
|
23
80
|
describe("ECSql query tests", function () {
|
|
24
|
-
let schemaLocater;
|
|
25
81
|
function validateItem(name, itemPropObjects, schema) {
|
|
26
82
|
const actualJson = findItem(name, itemPropObjects);
|
|
27
83
|
const expectedItem = schema.getItemSync(name);
|
|
@@ -104,239 +160,417 @@ describe("ECSql query tests", function () {
|
|
|
104
160
|
}
|
|
105
161
|
expect(actualJson).to.deep.equalInAnyOrder(expectedJson);
|
|
106
162
|
}
|
|
107
|
-
|
|
108
|
-
await
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
afterEach(async () => {
|
|
112
|
-
await IncrementalTestHelper.close();
|
|
113
|
-
});
|
|
163
|
+
async function createTestContext() {
|
|
164
|
+
const testEnv = await TestContext.create();
|
|
165
|
+
return testEnv;
|
|
166
|
+
}
|
|
114
167
|
it("Schema query, props parsed successfully", async function () {
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
168
|
+
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
169
|
+
try {
|
|
170
|
+
const testSchemaKey = new SchemaKey("SchemaTest", 1, 0, 0);
|
|
171
|
+
const env = __addDisposableResource(env_1, await createTestContext(), true);
|
|
172
|
+
const expectedSchema = await env.importAssetSchema(testSchemaKey);
|
|
173
|
+
const actualSchemaProps = await env.schemaLocater.getSchemaJson(testSchemaKey, env.schemaContext);
|
|
174
|
+
expect(actualSchemaProps).to.not.be.undefined;
|
|
175
|
+
const actualSchema = await Schema.fromJson(actualSchemaProps, env.schemaContext);
|
|
176
|
+
expect(actualSchema.toJSON()).to.deep.equal(expectedSchema?.toJSON());
|
|
177
|
+
}
|
|
178
|
+
catch (e_1) {
|
|
179
|
+
env_1.error = e_1;
|
|
180
|
+
env_1.hasError = true;
|
|
181
|
+
}
|
|
182
|
+
finally {
|
|
183
|
+
const result_1 = __disposeResources(env_1);
|
|
184
|
+
if (result_1)
|
|
185
|
+
await result_1;
|
|
186
|
+
}
|
|
123
187
|
});
|
|
124
188
|
it("Property query, props parsed successfully", async function () {
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
189
|
+
const env_2 = { stack: [], error: void 0, hasError: false };
|
|
190
|
+
try {
|
|
191
|
+
const testKey = new SchemaKey("PropertyTest", 1, 0, 0);
|
|
192
|
+
const env = __addDisposableResource(env_2, await createTestContext(), true);
|
|
193
|
+
const schema = await env.importAssetSchema(testKey);
|
|
194
|
+
const classPropsObjects = await env.schemaLocater.getEntities(testKey.name, env.schemaContext);
|
|
195
|
+
const entityOneProps = findItem("EntityOne", classPropsObjects);
|
|
196
|
+
const entityTwoProps = findItem("EntityTwo", classPropsObjects);
|
|
197
|
+
const expectedEntityOne = await schema.getEntityClass("EntityOne");
|
|
198
|
+
const expectedEntityTwo = await schema.getEntityClass("EntityTwo");
|
|
199
|
+
const validateProperty = (propertyName, actualItem = entityOneProps, expectedItem = expectedEntityOne) => {
|
|
200
|
+
const actualProperty = findProperty(propertyName, actualItem.properties);
|
|
201
|
+
const expectedProperty = expectedItem?.getPropertySync(propertyName);
|
|
202
|
+
// if maxOccurs is the maximum int value in the context Schema,
|
|
203
|
+
// the property from the DB will not have a value
|
|
204
|
+
if (expectedProperty.maxOccurs === 2147483647) {
|
|
205
|
+
expect(actualProperty.maxOccurs).to.be.undefined;
|
|
206
|
+
// set so comparison will pass
|
|
207
|
+
actualProperty.maxOccurs = 2147483647;
|
|
208
|
+
}
|
|
209
|
+
expect(actualProperty).to.deep.equal(expectedProperty?.toJSON());
|
|
210
|
+
};
|
|
211
|
+
// All but one testable property is in EntityOne
|
|
212
|
+
for (const property of await expectedEntityOne.getProperties(true)) {
|
|
213
|
+
validateProperty(property.name);
|
|
144
214
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
215
|
+
// Backward direction Navigation property is in EntityTwo
|
|
216
|
+
validateProperty("EntityTwoParent", entityTwoProps, expectedEntityTwo);
|
|
217
|
+
}
|
|
218
|
+
catch (e_2) {
|
|
219
|
+
env_2.error = e_2;
|
|
220
|
+
env_2.hasError = true;
|
|
221
|
+
}
|
|
222
|
+
finally {
|
|
223
|
+
const result_2 = __disposeResources(env_2);
|
|
224
|
+
if (result_2)
|
|
225
|
+
await result_2;
|
|
226
|
+
}
|
|
153
227
|
});
|
|
154
228
|
it("Entity query, props parsed successfully", async function () {
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
229
|
+
const env_3 = { stack: [], error: void 0, hasError: false };
|
|
230
|
+
try {
|
|
231
|
+
const testKey = new SchemaKey("EntityTest", 1, 0, 0);
|
|
232
|
+
const env = __addDisposableResource(env_3, await createTestContext(), true);
|
|
233
|
+
const schema = await env.importAssetSchema(testKey);
|
|
234
|
+
const classPropsObjects = await env.schemaLocater.getEntities(testKey.name, env.schemaContext);
|
|
235
|
+
expect(classPropsObjects.length).to.be.greaterThan(0);
|
|
236
|
+
validateItem("EntityModifierNone", classPropsObjects, schema);
|
|
237
|
+
validateItem("EntityModifierAbstract", classPropsObjects, schema);
|
|
238
|
+
validateItem("EntityModifierSealed", classPropsObjects, schema);
|
|
239
|
+
}
|
|
240
|
+
catch (e_3) {
|
|
241
|
+
env_3.error = e_3;
|
|
242
|
+
env_3.hasError = true;
|
|
243
|
+
}
|
|
244
|
+
finally {
|
|
245
|
+
const result_3 = __disposeResources(env_3);
|
|
246
|
+
if (result_3)
|
|
247
|
+
await result_3;
|
|
248
|
+
}
|
|
165
249
|
});
|
|
166
250
|
it("Struct query, props parsed successfully", async function () {
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
251
|
+
const env_4 = { stack: [], error: void 0, hasError: false };
|
|
252
|
+
try {
|
|
253
|
+
const testKey = new SchemaKey("StructTest", 1, 0, 0);
|
|
254
|
+
const env = __addDisposableResource(env_4, await createTestContext(), true);
|
|
255
|
+
const schema = await env.importAssetSchema(testKey);
|
|
256
|
+
const classPropsObjects = await env.schemaLocater.getStructs(testKey.name, env.schemaContext);
|
|
257
|
+
expect(classPropsObjects.length).to.be.greaterThan(0);
|
|
258
|
+
validateItem("StructModifierNone", classPropsObjects, schema);
|
|
259
|
+
validateItem("StructModifierAbstract", classPropsObjects, schema);
|
|
260
|
+
validateItem("StructModifierSealed", classPropsObjects, schema);
|
|
261
|
+
}
|
|
262
|
+
catch (e_4) {
|
|
263
|
+
env_4.error = e_4;
|
|
264
|
+
env_4.hasError = true;
|
|
265
|
+
}
|
|
266
|
+
finally {
|
|
267
|
+
const result_4 = __disposeResources(env_4);
|
|
268
|
+
if (result_4)
|
|
269
|
+
await result_4;
|
|
270
|
+
}
|
|
177
271
|
});
|
|
178
272
|
it("Mixin query, props parsed successfully", async function () {
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
273
|
+
const env_5 = { stack: [], error: void 0, hasError: false };
|
|
274
|
+
try {
|
|
275
|
+
const testKey = new SchemaKey("MixinTest", 1, 0, 0);
|
|
276
|
+
const env = __addDisposableResource(env_5, await createTestContext(), true);
|
|
277
|
+
const schema = await env.importAssetSchema(testKey);
|
|
278
|
+
const classPropsObjects = await env.schemaLocater.getMixins(testKey.name, env.schemaContext);
|
|
279
|
+
expect(classPropsObjects.length).to.be.greaterThan(0);
|
|
280
|
+
validateItem("IBaseMixin", classPropsObjects, schema);
|
|
281
|
+
validateItem("ITestMixin", classPropsObjects, schema);
|
|
282
|
+
}
|
|
283
|
+
catch (e_5) {
|
|
284
|
+
env_5.error = e_5;
|
|
285
|
+
env_5.hasError = true;
|
|
286
|
+
}
|
|
287
|
+
finally {
|
|
288
|
+
const result_5 = __disposeResources(env_5);
|
|
289
|
+
if (result_5)
|
|
290
|
+
await result_5;
|
|
291
|
+
}
|
|
188
292
|
});
|
|
189
293
|
it("Relationship query, props parsed successfully", async function () {
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
294
|
+
const env_6 = { stack: [], error: void 0, hasError: false };
|
|
295
|
+
try {
|
|
296
|
+
const testKey = new SchemaKey("RelationshipTest", 1, 0, 0);
|
|
297
|
+
const env = __addDisposableResource(env_6, await createTestContext(), true);
|
|
298
|
+
const schema = await env.importAssetSchema(testKey);
|
|
299
|
+
const classPropsObjects = await env.schemaLocater.getRelationships(testKey.name, env.schemaContext);
|
|
300
|
+
expect(classPropsObjects.length).to.be.greaterThan(0);
|
|
301
|
+
validateItem("OwnerOwnsVehicles", classPropsObjects, schema);
|
|
302
|
+
validateItem("OwnerOwnsCars", classPropsObjects, schema);
|
|
303
|
+
validateItem("OwnerOwnsAmericanCars", classPropsObjects, schema);
|
|
304
|
+
validateItem("PhysicalModelBreaksDownCarElement", classPropsObjects, schema);
|
|
305
|
+
}
|
|
306
|
+
catch (e_6) {
|
|
307
|
+
env_6.error = e_6;
|
|
308
|
+
env_6.hasError = true;
|
|
309
|
+
}
|
|
310
|
+
finally {
|
|
311
|
+
const result_6 = __disposeResources(env_6);
|
|
312
|
+
if (result_6)
|
|
313
|
+
await result_6;
|
|
314
|
+
}
|
|
201
315
|
});
|
|
202
316
|
it("CustomAttributeClass query, props parsed successfully", async function () {
|
|
203
|
-
const
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
317
|
+
const env_7 = { stack: [], error: void 0, hasError: false };
|
|
318
|
+
try {
|
|
319
|
+
const testKey = new SchemaKey("CustomAttributeClassTest", 1, 0, 0);
|
|
320
|
+
const env = __addDisposableResource(env_7, await createTestContext(), true);
|
|
321
|
+
const schema = await env.importAssetSchema(testKey);
|
|
322
|
+
const classPropsObjects = await env.schemaLocater.getCustomAttributeClasses(testKey.name, env.schemaContext);
|
|
323
|
+
expect(classPropsObjects.length).to.be.greaterThan(0);
|
|
324
|
+
validateItem("CustomAttributeModifierNone", classPropsObjects, schema);
|
|
325
|
+
validateItem("CustomAttributeModifierSealed", classPropsObjects, schema);
|
|
326
|
+
validateItem("CustomAttributeModifierAbstract", classPropsObjects, schema);
|
|
327
|
+
}
|
|
328
|
+
catch (e_7) {
|
|
329
|
+
env_7.error = e_7;
|
|
330
|
+
env_7.hasError = true;
|
|
331
|
+
}
|
|
332
|
+
finally {
|
|
333
|
+
const result_7 = __disposeResources(env_7);
|
|
334
|
+
if (result_7)
|
|
335
|
+
await result_7;
|
|
336
|
+
}
|
|
213
337
|
});
|
|
214
338
|
it("KindOfQuantity query, props parsed successfully", async function () {
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
339
|
+
const env_8 = { stack: [], error: void 0, hasError: false };
|
|
340
|
+
try {
|
|
341
|
+
const testKey = new SchemaKey("KindOfQuantityTest", 1, 0, 0);
|
|
342
|
+
const env = __addDisposableResource(env_8, await createTestContext(), true);
|
|
343
|
+
const schema = await env.importAssetSchema(testKey);
|
|
344
|
+
const itemPropsObjects = await env.schemaLocater.getKindOfQuantities(testKey.name, env.schemaContext);
|
|
345
|
+
expect(itemPropsObjects.length).to.be.greaterThan(0);
|
|
346
|
+
validateItem("ACCELERATION", itemPropsObjects, schema);
|
|
347
|
+
validateItem("ANGLE", itemPropsObjects, schema);
|
|
348
|
+
}
|
|
349
|
+
catch (e_8) {
|
|
350
|
+
env_8.error = e_8;
|
|
351
|
+
env_8.hasError = true;
|
|
352
|
+
}
|
|
353
|
+
finally {
|
|
354
|
+
const result_8 = __disposeResources(env_8);
|
|
355
|
+
if (result_8)
|
|
356
|
+
await result_8;
|
|
357
|
+
}
|
|
224
358
|
});
|
|
225
359
|
it("PropertyCategory query, props parsed successfully", async function () {
|
|
226
|
-
const
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
360
|
+
const env_9 = { stack: [], error: void 0, hasError: false };
|
|
361
|
+
try {
|
|
362
|
+
const testKey = new SchemaKey("PropertyCategoryTest", 1, 0, 0);
|
|
363
|
+
const env = __addDisposableResource(env_9, await createTestContext(), true);
|
|
364
|
+
const schema = await env.importAssetSchema(testKey);
|
|
365
|
+
const itemPropsObjects = await env.schemaLocater.getPropertyCategories(testKey.name, env.schemaContext);
|
|
366
|
+
expect(itemPropsObjects.length).to.be.greaterThan(0);
|
|
367
|
+
validateItem("PropertyCategory1", itemPropsObjects, schema);
|
|
368
|
+
validateItem("PropertyCategory2", itemPropsObjects, schema);
|
|
369
|
+
}
|
|
370
|
+
catch (e_9) {
|
|
371
|
+
env_9.error = e_9;
|
|
372
|
+
env_9.hasError = true;
|
|
373
|
+
}
|
|
374
|
+
finally {
|
|
375
|
+
const result_9 = __disposeResources(env_9);
|
|
376
|
+
if (result_9)
|
|
377
|
+
await result_9;
|
|
378
|
+
}
|
|
235
379
|
});
|
|
236
380
|
it("Enumeration query, props parsed successfully", async function () {
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
381
|
+
const env_10 = { stack: [], error: void 0, hasError: false };
|
|
382
|
+
try {
|
|
383
|
+
const testKey = new SchemaKey("EnumerationTest", 1, 0, 0);
|
|
384
|
+
const env = __addDisposableResource(env_10, await createTestContext(), true);
|
|
385
|
+
const schema = await env.importAssetSchema(testKey);
|
|
386
|
+
const itemPropsObjects = await env.schemaLocater.getEnumerations(testKey.name, env.schemaContext);
|
|
387
|
+
expect(itemPropsObjects.length).to.be.greaterThan(0);
|
|
388
|
+
validateItem("IntEnumeration", itemPropsObjects, schema);
|
|
389
|
+
validateItem("StringEnumeration", itemPropsObjects, schema);
|
|
390
|
+
}
|
|
391
|
+
catch (e_10) {
|
|
392
|
+
env_10.error = e_10;
|
|
393
|
+
env_10.hasError = true;
|
|
394
|
+
}
|
|
395
|
+
finally {
|
|
396
|
+
const result_10 = __disposeResources(env_10);
|
|
397
|
+
if (result_10)
|
|
398
|
+
await result_10;
|
|
399
|
+
}
|
|
246
400
|
});
|
|
247
401
|
it("Unit query, props parsed successfully", async function () {
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
402
|
+
const env_11 = { stack: [], error: void 0, hasError: false };
|
|
403
|
+
try {
|
|
404
|
+
const testKey = new SchemaKey("UnitTest", 1, 0, 0);
|
|
405
|
+
const env = __addDisposableResource(env_11, await createTestContext(), true);
|
|
406
|
+
const schema = await env.importAssetSchema(testKey);
|
|
407
|
+
const itemPropsObjects = await env.schemaLocater.getUnits(testKey.name, env.schemaContext);
|
|
408
|
+
expect(itemPropsObjects.length).to.be.greaterThan(0);
|
|
409
|
+
validateItem("LITRE", itemPropsObjects, schema);
|
|
410
|
+
validateItem("GALLON", itemPropsObjects, schema);
|
|
411
|
+
validateItem("ACRE", itemPropsObjects, schema);
|
|
412
|
+
validateItem("FAHRENHEIT", itemPropsObjects, schema);
|
|
413
|
+
}
|
|
414
|
+
catch (e_11) {
|
|
415
|
+
env_11.error = e_11;
|
|
416
|
+
env_11.hasError = true;
|
|
417
|
+
}
|
|
418
|
+
finally {
|
|
419
|
+
const result_11 = __disposeResources(env_11);
|
|
420
|
+
if (result_11)
|
|
421
|
+
await result_11;
|
|
422
|
+
}
|
|
259
423
|
});
|
|
260
424
|
it("InvertedUnit query, props parsed successfully", async function () {
|
|
261
|
-
const
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
425
|
+
const env_12 = { stack: [], error: void 0, hasError: false };
|
|
426
|
+
try {
|
|
427
|
+
const testKey = new SchemaKey("InvertedUnitTest", 1, 0, 0);
|
|
428
|
+
const env = __addDisposableResource(env_12, await createTestContext(), true);
|
|
429
|
+
const schema = await env.importAssetSchema(testKey);
|
|
430
|
+
const itemPropsObjects = await env.schemaLocater.getInvertedUnits(testKey.name, env.schemaContext);
|
|
431
|
+
expect(itemPropsObjects.length).to.be.greaterThan(0);
|
|
432
|
+
validateItem("FT_HORIZONTAL_PER_FT_VERTICAL", itemPropsObjects, schema);
|
|
433
|
+
}
|
|
434
|
+
catch (e_12) {
|
|
435
|
+
env_12.error = e_12;
|
|
436
|
+
env_12.hasError = true;
|
|
437
|
+
}
|
|
438
|
+
finally {
|
|
439
|
+
const result_12 = __disposeResources(env_12);
|
|
440
|
+
if (result_12)
|
|
441
|
+
await result_12;
|
|
442
|
+
}
|
|
269
443
|
});
|
|
270
444
|
it("UnitSystem query, props parsed successfully", async function () {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
445
|
+
const env_13 = { stack: [], error: void 0, hasError: false };
|
|
446
|
+
try {
|
|
447
|
+
// There's a UnitSystem in there.
|
|
448
|
+
const testKey = new SchemaKey("InvertedUnitTest", 1, 0, 0);
|
|
449
|
+
const env = __addDisposableResource(env_13, await createTestContext(), true);
|
|
450
|
+
const schema = await env.importAssetSchema(testKey);
|
|
451
|
+
const itemPropsObjects = await env.schemaLocater.getUnitSystems(testKey.name, env.schemaContext);
|
|
452
|
+
expect(itemPropsObjects.length).to.be.greaterThan(0);
|
|
453
|
+
validateItem("USCUSTOM", itemPropsObjects, schema);
|
|
454
|
+
}
|
|
455
|
+
catch (e_13) {
|
|
456
|
+
env_13.error = e_13;
|
|
457
|
+
env_13.hasError = true;
|
|
458
|
+
}
|
|
459
|
+
finally {
|
|
460
|
+
const result_13 = __disposeResources(env_13);
|
|
461
|
+
if (result_13)
|
|
462
|
+
await result_13;
|
|
463
|
+
}
|
|
280
464
|
});
|
|
281
465
|
it("Constant query, props parsed successfully", async function () {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
466
|
+
const env_14 = { stack: [], error: void 0, hasError: false };
|
|
467
|
+
try {
|
|
468
|
+
// There's a UnitSystem in there.
|
|
469
|
+
const testKey = new SchemaKey("ConstantTest", 1, 0, 0);
|
|
470
|
+
const env = __addDisposableResource(env_14, await createTestContext(), true);
|
|
471
|
+
const schema = await env.importAssetSchema(testKey);
|
|
472
|
+
const itemPropsObjects = await env.schemaLocater.getConstants(testKey.name, env.schemaContext);
|
|
473
|
+
expect(itemPropsObjects.length).to.be.greaterThan(0);
|
|
474
|
+
validateItem("KILO", itemPropsObjects, schema);
|
|
475
|
+
validateItem("HALF_PI", itemPropsObjects, schema);
|
|
476
|
+
}
|
|
477
|
+
catch (e_14) {
|
|
478
|
+
env_14.error = e_14;
|
|
479
|
+
env_14.hasError = true;
|
|
480
|
+
}
|
|
481
|
+
finally {
|
|
482
|
+
const result_14 = __disposeResources(env_14);
|
|
483
|
+
if (result_14)
|
|
484
|
+
await result_14;
|
|
485
|
+
}
|
|
292
486
|
});
|
|
293
487
|
it("Phenomenon query, props parsed successfully", async function () {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
488
|
+
const env_15 = { stack: [], error: void 0, hasError: false };
|
|
489
|
+
try {
|
|
490
|
+
// There's a Phenomenon in there.
|
|
491
|
+
const testKey = new SchemaKey("ConstantTest", 1, 0, 0);
|
|
492
|
+
const env = __addDisposableResource(env_15, await createTestContext(), true);
|
|
493
|
+
const schema = await env.importAssetSchema(testKey);
|
|
494
|
+
const itemPropsObjects = await env.schemaLocater.getPhenomenon(testKey.name, env.schemaContext);
|
|
495
|
+
expect(itemPropsObjects.length).to.be.greaterThan(0);
|
|
496
|
+
validateItem("NUMBER", itemPropsObjects, schema);
|
|
497
|
+
validateItem("LENGTH_RATIO", itemPropsObjects, schema);
|
|
498
|
+
}
|
|
499
|
+
catch (e_15) {
|
|
500
|
+
env_15.error = e_15;
|
|
501
|
+
env_15.hasError = true;
|
|
502
|
+
}
|
|
503
|
+
finally {
|
|
504
|
+
const result_15 = __disposeResources(env_15);
|
|
505
|
+
if (result_15)
|
|
506
|
+
await result_15;
|
|
507
|
+
}
|
|
304
508
|
});
|
|
305
509
|
it("Format Schema parses successfully", async function () {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
510
|
+
const env_16 = { stack: [], error: void 0, hasError: false };
|
|
511
|
+
try {
|
|
512
|
+
// Using installed Formats schema
|
|
513
|
+
const testKey = new SchemaKey("Formats", 1, 0, 0);
|
|
514
|
+
const env = __addDisposableResource(env_16, await createTestContext(), true);
|
|
515
|
+
const schema = await env.importAssetSchema(testKey);
|
|
516
|
+
const itemPropsObjects = await env.schemaLocater.getFormats(testKey.name, env.schemaContext);
|
|
517
|
+
expect(itemPropsObjects.length).to.be.greaterThan(0);
|
|
518
|
+
for (const props of itemPropsObjects) {
|
|
519
|
+
validateItem(props.name, itemPropsObjects, schema);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
catch (e_16) {
|
|
523
|
+
env_16.error = e_16;
|
|
524
|
+
env_16.hasError = true;
|
|
525
|
+
}
|
|
526
|
+
finally {
|
|
527
|
+
const result_16 = __disposeResources(env_16);
|
|
528
|
+
if (result_16)
|
|
529
|
+
await result_16;
|
|
316
530
|
}
|
|
317
531
|
});
|
|
318
532
|
it("Comprehensive Format parses successfully", async function () {
|
|
319
|
-
const
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
533
|
+
const env_17 = { stack: [], error: void 0, hasError: false };
|
|
534
|
+
try {
|
|
535
|
+
const testKey = new SchemaKey("FormatTest", 1, 0, 0);
|
|
536
|
+
const env = __addDisposableResource(env_17, await createTestContext(), true);
|
|
537
|
+
const schema = await env.importAssetSchema(testKey);
|
|
538
|
+
const itemPropsObjects = await env.schemaLocater.getFormats(testKey.name, env.schemaContext);
|
|
539
|
+
expect(itemPropsObjects.length).to.be.greaterThan(0);
|
|
540
|
+
for (const props of itemPropsObjects) {
|
|
541
|
+
validateItem(props.name, itemPropsObjects, schema);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
catch (e_17) {
|
|
545
|
+
env_17.error = e_17;
|
|
546
|
+
env_17.hasError = true;
|
|
547
|
+
}
|
|
548
|
+
finally {
|
|
549
|
+
const result_17 = __disposeResources(env_17);
|
|
550
|
+
if (result_17)
|
|
551
|
+
await result_17;
|
|
328
552
|
}
|
|
329
553
|
});
|
|
330
554
|
it("CustomAttribute instances parse successfully", async function () {
|
|
331
|
-
const
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
555
|
+
const env_18 = { stack: [], error: void 0, hasError: false };
|
|
556
|
+
try {
|
|
557
|
+
const testKey = new SchemaKey("CustomAttributeInstanceTest", 1, 0, 0);
|
|
558
|
+
const env = __addDisposableResource(env_18, await createTestContext(), true);
|
|
559
|
+
const schema = await env.importAssetSchema(testKey);
|
|
560
|
+
const itemPropsObjects = await env.schemaLocater.getStructs(testKey.name, env.schemaContext);
|
|
561
|
+
expect(itemPropsObjects.length).to.be.greaterThan(0);
|
|
562
|
+
for (const props of itemPropsObjects) {
|
|
563
|
+
validateItem(props.name, itemPropsObjects, schema);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
catch (e_18) {
|
|
567
|
+
env_18.error = e_18;
|
|
568
|
+
env_18.hasError = true;
|
|
569
|
+
}
|
|
570
|
+
finally {
|
|
571
|
+
const result_18 = __disposeResources(env_18);
|
|
572
|
+
if (result_18)
|
|
573
|
+
await result_18;
|
|
340
574
|
}
|
|
341
575
|
});
|
|
342
576
|
});
|