@itwin/ecschema-locaters 5.0.0-dev.9 → 5.0.0-dev.92
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 +51 -1
- package/lib/cjs/SchemaFileLocater.d.ts +10 -2
- package/lib/cjs/SchemaFileLocater.d.ts.map +1 -1
- package/lib/cjs/SchemaFileLocater.js +14 -9
- package/lib/cjs/SchemaFileLocater.js.map +1 -1
- package/lib/cjs/SchemaJsonFileLocater.d.ts +2 -2
- package/lib/cjs/SchemaJsonFileLocater.d.ts.map +1 -1
- package/lib/cjs/SchemaJsonFileLocater.js.map +1 -1
- package/lib/cjs/SchemaStringLocater.d.ts +2 -2
- package/lib/cjs/SchemaStringLocater.d.ts.map +1 -1
- package/lib/cjs/SchemaStringLocater.js +12 -9
- package/lib/cjs/SchemaStringLocater.js.map +1 -1
- package/lib/cjs/SchemaXml.js.map +1 -1
- package/lib/cjs/SchemaXmlFileLocater.d.ts +30 -2
- package/lib/cjs/SchemaXmlFileLocater.d.ts.map +1 -1
- package/lib/cjs/SchemaXmlFileLocater.js +43 -1
- package/lib/cjs/SchemaXmlFileLocater.js.map +1 -1
- package/lib/cjs/SchemaXmlStringLocater.d.ts +2 -2
- package/lib/cjs/SchemaXmlStringLocater.d.ts.map +1 -1
- package/lib/cjs/SchemaXmlStringLocater.js.map +1 -1
- package/lib/cjs/StubSchemaXmlFileLocater.d.ts +2 -2
- package/lib/cjs/StubSchemaXmlFileLocater.d.ts.map +1 -1
- package/lib/cjs/StubSchemaXmlFileLocater.js.map +1 -1
- package/lib/cjs/ecschema-locaters.js.map +1 -1
- package/lib/cjs/test/ConcurrentGetSchemaJson.test.js.map +1 -1
- package/lib/cjs/test/ConcurrentGetSchemaXml.test.js.map +1 -1
- package/lib/cjs/test/SchemaJsonFileLocator.test.js.map +1 -1
- package/lib/cjs/test/SchemaXml.test.js.map +1 -1
- package/lib/cjs/test/SchemaXmlFileLocator.test.js +3 -0
- package/lib/cjs/test/SchemaXmlFileLocator.test.js.map +1 -1
- package/lib/cjs/test/SchemaXmlStringLocater.test.js.map +1 -1
- package/lib/cjs/test/StubSchemaXmlFileLocater.test.js.map +1 -1
- package/lib/esm/SchemaFileLocater.d.ts +94 -0
- package/lib/esm/SchemaFileLocater.d.ts.map +1 -0
- package/lib/esm/SchemaFileLocater.js +213 -0
- package/lib/esm/SchemaFileLocater.js.map +1 -0
- package/lib/esm/SchemaJsonFileLocater.d.ts +42 -0
- package/lib/esm/SchemaJsonFileLocater.d.ts.map +1 -0
- package/lib/esm/SchemaJsonFileLocater.js +96 -0
- package/lib/esm/SchemaJsonFileLocater.js.map +1 -0
- package/lib/esm/SchemaStringLocater.d.ts +54 -0
- package/lib/esm/SchemaStringLocater.d.ts.map +1 -0
- package/lib/esm/SchemaStringLocater.js +83 -0
- package/lib/esm/SchemaStringLocater.js.map +1 -0
- package/lib/esm/SchemaXml.d.ts +22 -0
- package/lib/esm/SchemaXml.d.ts.map +1 -0
- package/lib/esm/SchemaXml.js +55 -0
- package/lib/esm/SchemaXml.js.map +1 -0
- package/lib/esm/SchemaXmlFileLocater.d.ts +70 -0
- package/lib/esm/SchemaXmlFileLocater.d.ts.map +1 -0
- package/lib/esm/SchemaXmlFileLocater.js +140 -0
- package/lib/esm/SchemaXmlFileLocater.js.map +1 -0
- package/lib/esm/SchemaXmlStringLocater.d.ts +48 -0
- package/lib/esm/SchemaXmlStringLocater.d.ts.map +1 -0
- package/lib/esm/SchemaXmlStringLocater.js +100 -0
- package/lib/esm/SchemaXmlStringLocater.js.map +1 -0
- package/lib/esm/StubSchemaXmlFileLocater.d.ts +81 -0
- package/lib/esm/StubSchemaXmlFileLocater.d.ts.map +1 -0
- package/lib/esm/StubSchemaXmlFileLocater.js +184 -0
- package/lib/esm/StubSchemaXmlFileLocater.js.map +1 -0
- package/lib/esm/ecschema-locaters.d.ts +20 -0
- package/lib/esm/ecschema-locaters.d.ts.map +1 -0
- package/lib/esm/ecschema-locaters.js +24 -0
- package/lib/esm/ecschema-locaters.js.map +1 -0
- package/lib/esm/test/ConcurrentGetSchemaJson.test.d.ts +2 -0
- package/lib/esm/test/ConcurrentGetSchemaJson.test.d.ts.map +1 -0
- package/lib/esm/test/ConcurrentGetSchemaJson.test.js +249 -0
- package/lib/esm/test/ConcurrentGetSchemaJson.test.js.map +1 -0
- package/lib/esm/test/ConcurrentGetSchemaXml.test.d.ts +2 -0
- package/lib/esm/test/ConcurrentGetSchemaXml.test.d.ts.map +1 -0
- package/lib/esm/test/ConcurrentGetSchemaXml.test.js +186 -0
- package/lib/esm/test/ConcurrentGetSchemaXml.test.js.map +1 -0
- package/lib/esm/test/SchemaJsonFileLocator.test.d.ts +2 -0
- package/lib/esm/test/SchemaJsonFileLocator.test.d.ts.map +1 -0
- package/lib/esm/test/SchemaJsonFileLocator.test.js +118 -0
- package/lib/esm/test/SchemaJsonFileLocator.test.js.map +1 -0
- package/lib/esm/test/SchemaXml.test.d.ts +2 -0
- package/lib/esm/test/SchemaXml.test.d.ts.map +1 -0
- package/lib/esm/test/SchemaXml.test.js +55 -0
- package/lib/esm/test/SchemaXml.test.js.map +1 -0
- package/lib/esm/test/SchemaXmlFileLocator.test.d.ts +2 -0
- package/lib/esm/test/SchemaXmlFileLocator.test.d.ts.map +1 -0
- package/lib/esm/test/SchemaXmlFileLocator.test.js +182 -0
- package/lib/esm/test/SchemaXmlFileLocator.test.js.map +1 -0
- package/lib/esm/test/SchemaXmlStringLocater.test.d.ts +2 -0
- package/lib/esm/test/SchemaXmlStringLocater.test.d.ts.map +1 -0
- package/lib/esm/test/SchemaXmlStringLocater.test.js +219 -0
- package/lib/esm/test/SchemaXmlStringLocater.test.js.map +1 -0
- package/lib/esm/test/StubSchemaXmlFileLocater.test.d.ts +2 -0
- package/lib/esm/test/StubSchemaXmlFileLocater.test.d.ts.map +1 -0
- package/lib/esm/test/StubSchemaXmlFileLocater.test.js +169 -0
- package/lib/esm/test/StubSchemaXmlFileLocater.test.js.map +1 -0
- package/package.json +14 -12
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { assert, expect } from "chai";
|
|
6
|
+
import * as fs from "fs";
|
|
7
|
+
import * as path from "path";
|
|
8
|
+
import { SchemaContext, SchemaKey, SchemaMatchType } from "@itwin/ecschema-metadata";
|
|
9
|
+
import { SchemaXmlFileLocater } from "../SchemaXmlFileLocater";
|
|
10
|
+
import { StubSchemaXmlFileLocater } from "../StubSchemaXmlFileLocater";
|
|
11
|
+
import { SchemaXml } from "../SchemaXml";
|
|
12
|
+
import { SchemaXmlStringLocater } from "../SchemaXmlStringLocater";
|
|
13
|
+
describe("Concurrent XML schema deserialization", () => {
|
|
14
|
+
const assetDir = path.join(__dirname, "assets");
|
|
15
|
+
const schemaFolder = path.join(__dirname, "assets", "xml");
|
|
16
|
+
const schemaKeys = [];
|
|
17
|
+
let context;
|
|
18
|
+
let contextSync;
|
|
19
|
+
let syncSchemas = [];
|
|
20
|
+
const locater = new SchemaXmlFileLocater();
|
|
21
|
+
const helperLocater = new StubSchemaXmlFileLocater();
|
|
22
|
+
before(() => {
|
|
23
|
+
if (!fs.existsSync(assetDir))
|
|
24
|
+
fs.mkdirSync(assetDir);
|
|
25
|
+
if (!fs.existsSync(schemaFolder))
|
|
26
|
+
fs.mkdirSync(schemaFolder);
|
|
27
|
+
copySchemasToAssetsDir();
|
|
28
|
+
// Deserialize schemas synchronously/serially as standard to compare to
|
|
29
|
+
contextSync = new SchemaContext();
|
|
30
|
+
locater.addSchemaSearchPath(schemaFolder);
|
|
31
|
+
contextSync.addLocater(locater);
|
|
32
|
+
const schemaFiles = fs.readdirSync(schemaFolder);
|
|
33
|
+
schemaFiles.forEach((fileName) => {
|
|
34
|
+
const schemaFile = path.join(schemaFolder, fileName);
|
|
35
|
+
const key = helperLocater.getSchemaKey(fs.readFileSync(schemaFile, "utf-8"));
|
|
36
|
+
schemaKeys.push(key);
|
|
37
|
+
});
|
|
38
|
+
syncSchemas = schemaKeys.map((key) => {
|
|
39
|
+
if (!key)
|
|
40
|
+
return undefined;
|
|
41
|
+
const schema = contextSync.getSchemaSync(key, SchemaMatchType.Latest);
|
|
42
|
+
return schema;
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
beforeEach(() => {
|
|
46
|
+
context = new SchemaContext();
|
|
47
|
+
context.addLocater(locater);
|
|
48
|
+
});
|
|
49
|
+
function getSchemaPathFromPackage(packageName, schemaFileName) {
|
|
50
|
+
const schemaFile = path.join(__dirname, "..", "..", "..", "node_modules", "@bentley", packageName, schemaFileName);
|
|
51
|
+
return schemaFile;
|
|
52
|
+
}
|
|
53
|
+
function copySchemasToAssetsDir() {
|
|
54
|
+
// Copy Schemas that we need for testing
|
|
55
|
+
fs.copyFileSync(getSchemaPathFromPackage("aec-units-schema", "AecUnits.ecschema.xml"), path.join(schemaFolder, "AecUnits.ecschema.xml"));
|
|
56
|
+
fs.copyFileSync(getSchemaPathFromPackage("bis-custom-attributes-schema", "BisCustomAttributes.ecschema.xml"), path.join(schemaFolder, "BisCustomAttributes.ecschema.xml"));
|
|
57
|
+
fs.copyFileSync(getSchemaPathFromPackage("ecdb-map-schema", "ECDbMap.ecschema.xml"), path.join(schemaFolder, "ECDbMap.ecschema.xml"));
|
|
58
|
+
fs.copyFileSync(getSchemaPathFromPackage("ecdb-schema-policies-schema", "ECDbSchemaPolicies.ecschema.xml"), path.join(schemaFolder, "ECDbSchemaPolicies.ecschema.xml"));
|
|
59
|
+
fs.copyFileSync(getSchemaPathFromPackage("formats-schema", "Formats.ecschema.xml"), path.join(schemaFolder, "Formats.ecschema.xml"));
|
|
60
|
+
fs.copyFileSync(getSchemaPathFromPackage("units-schema", "Units.ecschema.xml"), path.join(schemaFolder, "Units.ecschema.xml"));
|
|
61
|
+
fs.copyFileSync(getSchemaPathFromPackage("core-custom-attributes-schema", "CoreCustomAttributes.ecschema.xml"), path.join(schemaFolder, "CoreCustomAttributes.ecschema.xml"));
|
|
62
|
+
fs.copyFileSync(getSchemaPathFromPackage("bis-core-schema", "BisCore.ecschema.xml"), path.join(schemaFolder, "BisCore.ecschema.xml"));
|
|
63
|
+
}
|
|
64
|
+
const loadSchemaString = (schemaName) => {
|
|
65
|
+
const searchPath = path.join(__dirname, "assets", "xml", `${schemaName}.ecschema.xml`);
|
|
66
|
+
const file = fs.readFileSync(searchPath);
|
|
67
|
+
return file.toString();
|
|
68
|
+
};
|
|
69
|
+
it("should match schemas deserialized concurrently with schemas deserialized serially", async () => {
|
|
70
|
+
const schemaPromises = schemaKeys.map(async (key) => {
|
|
71
|
+
if (!key)
|
|
72
|
+
return undefined;
|
|
73
|
+
const schema = await context.getSchema(key, SchemaMatchType.Latest);
|
|
74
|
+
return schema;
|
|
75
|
+
});
|
|
76
|
+
const asyncSchemas = await Promise.all(schemaPromises);
|
|
77
|
+
for (let i = 0; i < schemaKeys.length; i++) {
|
|
78
|
+
const syncSchema = syncSchemas[i];
|
|
79
|
+
expect(syncSchema).not.to.be.undefined;
|
|
80
|
+
const syncXML = await SchemaXml.writeString(syncSchema);
|
|
81
|
+
const asyncSchema = asyncSchemas[i];
|
|
82
|
+
expect(asyncSchema).not.to.be.undefined;
|
|
83
|
+
const asyncXML = await SchemaXml.writeString(asyncSchema);
|
|
84
|
+
expect(asyncXML).to.deep.equal(syncXML);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
it("should be able to mix getSchema and getSchemaSync", async () => {
|
|
88
|
+
const schemaPromises = schemaKeys.map(async (key, index) => {
|
|
89
|
+
if (index % 2 === 0) {
|
|
90
|
+
// Use getSchema() for even indices
|
|
91
|
+
if (!key)
|
|
92
|
+
return undefined;
|
|
93
|
+
const schema = await context.getSchema(key, SchemaMatchType.Latest);
|
|
94
|
+
return schema;
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
// Use getSchemaSync() for odd indices
|
|
98
|
+
if (!key)
|
|
99
|
+
return undefined;
|
|
100
|
+
const schema = context.getSchemaSync(key, SchemaMatchType.Latest);
|
|
101
|
+
return schema;
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
const asyncSchemas = await Promise.all(schemaPromises);
|
|
105
|
+
for (let i = 0; i < schemaKeys.length; i++) {
|
|
106
|
+
const syncSchema = syncSchemas[i];
|
|
107
|
+
expect(syncSchema).not.to.be.undefined;
|
|
108
|
+
const syncXML = await SchemaXml.writeString(syncSchema);
|
|
109
|
+
const asyncSchema = asyncSchemas[i];
|
|
110
|
+
expect(asyncSchema).not.to.be.undefined;
|
|
111
|
+
const asyncXML = await SchemaXml.writeString(asyncSchema);
|
|
112
|
+
expect(asyncXML).to.deep.equal(syncXML);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
it("Concurrently get BisCore with SchemaXmlFileLocater", async () => {
|
|
116
|
+
const schemaContext = new SchemaContext();
|
|
117
|
+
const xmlFileLocater = new SchemaXmlFileLocater();
|
|
118
|
+
xmlFileLocater.addSchemaSearchPath(schemaFolder);
|
|
119
|
+
schemaContext.addLocater(xmlFileLocater);
|
|
120
|
+
const schemas = await Promise.all([...Array(100).keys()].map(async () => {
|
|
121
|
+
return schemaContext.getSchema(new SchemaKey("BisCore"));
|
|
122
|
+
}));
|
|
123
|
+
expect(schemas.length).to.equal(100);
|
|
124
|
+
schemas.forEach((schema) => {
|
|
125
|
+
assert(schema !== undefined);
|
|
126
|
+
expect(schema.fullName).to.equal("BisCore");
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
it("Concurrently get a schema and it's referenced schema with SchemaXmlFileLocater", async () => {
|
|
130
|
+
const schemaContext = new SchemaContext();
|
|
131
|
+
const xmlFileLocater = new SchemaXmlFileLocater();
|
|
132
|
+
xmlFileLocater.addSchemaSearchPath(schemaFolder);
|
|
133
|
+
schemaContext.addLocater(xmlFileLocater);
|
|
134
|
+
let getBisCoreFirst = 0;
|
|
135
|
+
const schemas = await Promise.all([...Array(2).keys()].map(async () => {
|
|
136
|
+
if (getBisCoreFirst === 0) {
|
|
137
|
+
getBisCoreFirst = 1;
|
|
138
|
+
return schemaContext.getSchema(new SchemaKey("BisCore"));
|
|
139
|
+
}
|
|
140
|
+
return schemaContext.getSchema(new SchemaKey("CoreCustomAttributes"));
|
|
141
|
+
}));
|
|
142
|
+
expect(schemas.length).to.equal(2);
|
|
143
|
+
schemas.forEach((schema) => {
|
|
144
|
+
expect(schema).to.not.be.undefined;
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
it("Concurrently get BisCore with SchemaXmlStringLocater", async () => {
|
|
148
|
+
const schemaContext = new SchemaContext();
|
|
149
|
+
const xmlStringLocater = new SchemaXmlStringLocater();
|
|
150
|
+
schemaContext.addLocater(xmlStringLocater);
|
|
151
|
+
xmlStringLocater.addSchemaString(loadSchemaString("CoreCustomAttributes"));
|
|
152
|
+
xmlStringLocater.addSchemaString(loadSchemaString("ECDbMap"));
|
|
153
|
+
xmlStringLocater.addSchemaString(loadSchemaString("ECDbSchemaPolicies"));
|
|
154
|
+
xmlStringLocater.addSchemaString(loadSchemaString("BisCore"));
|
|
155
|
+
const schemas = await Promise.all([...Array(100).keys()].map(async () => {
|
|
156
|
+
return schemaContext.getSchema(new SchemaKey("BisCore"));
|
|
157
|
+
}));
|
|
158
|
+
expect(schemas.length).to.equal(100);
|
|
159
|
+
schemas.forEach((schema) => {
|
|
160
|
+
assert(schema !== undefined);
|
|
161
|
+
expect(schema.fullName).to.equal("BisCore");
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
it("Concurrently get a schema and it's referenced schema with SchemaXmlStringLocater", async () => {
|
|
165
|
+
const schemaContext = new SchemaContext();
|
|
166
|
+
const xmlStringLocater = new SchemaXmlStringLocater();
|
|
167
|
+
schemaContext.addLocater(xmlStringLocater);
|
|
168
|
+
xmlStringLocater.addSchemaString(loadSchemaString("CoreCustomAttributes"));
|
|
169
|
+
xmlStringLocater.addSchemaString(loadSchemaString("ECDbMap"));
|
|
170
|
+
xmlStringLocater.addSchemaString(loadSchemaString("ECDbSchemaPolicies"));
|
|
171
|
+
xmlStringLocater.addSchemaString(loadSchemaString("BisCore"));
|
|
172
|
+
let getBisCoreFirst = 0;
|
|
173
|
+
const schemas = await Promise.all([...Array(2).keys()].map(async () => {
|
|
174
|
+
if (getBisCoreFirst === 0) {
|
|
175
|
+
getBisCoreFirst = 1;
|
|
176
|
+
return schemaContext.getSchema(new SchemaKey("BisCore"));
|
|
177
|
+
}
|
|
178
|
+
return schemaContext.getSchema(new SchemaKey("CoreCustomAttributes"));
|
|
179
|
+
}));
|
|
180
|
+
expect(schemas.length).to.equal(2);
|
|
181
|
+
schemas.forEach((schema) => {
|
|
182
|
+
expect(schema).to.not.be.undefined;
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
//# sourceMappingURL=ConcurrentGetSchemaXml.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConcurrentGetSchemaXml.test.js","sourceRoot":"","sources":["../../../src/test/ConcurrentGetSchemaXml.test.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAU,aAAa,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA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AAM,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,SAAS,CAAC;QACrC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { assert, expect } from \"chai\";\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport { Schema, SchemaContext, SchemaKey, SchemaMatchType } from \"@itwin/ecschema-metadata\";\nimport { SchemaXmlFileLocater } from \"../SchemaXmlFileLocater\";\nimport { StubSchemaXmlFileLocater } from \"../StubSchemaXmlFileLocater\";\nimport { SchemaXml } from \"../SchemaXml\";\nimport { SchemaXmlStringLocater } from \"../SchemaXmlStringLocater\";\n\ndescribe(\"Concurrent XML schema deserialization\", () => {\n const assetDir: string = path.join(__dirname, \"assets\");\n const schemaFolder = path.join(__dirname, \"assets\", \"xml\");\n\n const schemaKeys: SchemaKey[] = [];\n let context: SchemaContext;\n let contextSync: SchemaContext;\n let syncSchemas: Array<Schema | undefined> = [];\n\n const locater = new SchemaXmlFileLocater();\n const helperLocater = new StubSchemaXmlFileLocater();\n\n before(() => {\n if (!fs.existsSync(assetDir))\n fs.mkdirSync(assetDir);\n if (!fs.existsSync(schemaFolder))\n fs.mkdirSync(schemaFolder);\n\n copySchemasToAssetsDir();\n\n // Deserialize schemas synchronously/serially as standard to compare to\n contextSync = new SchemaContext();\n locater.addSchemaSearchPath(schemaFolder);\n contextSync.addLocater(locater);\n\n const schemaFiles = fs.readdirSync(schemaFolder);\n schemaFiles.forEach((fileName) => {\n const schemaFile = path.join(schemaFolder, fileName);\n const key = helperLocater.getSchemaKey(fs.readFileSync(schemaFile, \"utf-8\"));\n\n schemaKeys.push(key);\n });\n\n syncSchemas = schemaKeys.map((key): Schema | undefined => {\n if (!key)\n return undefined;\n\n const schema = contextSync.getSchemaSync(key, SchemaMatchType.Latest);\n return schema;\n });\n });\n\n beforeEach(() => {\n context = new SchemaContext();\n context.addLocater(locater);\n });\n\n function getSchemaPathFromPackage(packageName: string, schemaFileName: string): string {\n const schemaFile = path.join(__dirname, \"..\", \"..\", \"..\", \"node_modules\", \"@bentley\", packageName, schemaFileName);\n return schemaFile;\n }\n\n function copySchemasToAssetsDir() {\n // Copy Schemas that we need for testing\n fs.copyFileSync(getSchemaPathFromPackage(\"aec-units-schema\", \"AecUnits.ecschema.xml\"), path.join(schemaFolder, \"AecUnits.ecschema.xml\"));\n fs.copyFileSync(getSchemaPathFromPackage(\"bis-custom-attributes-schema\", \"BisCustomAttributes.ecschema.xml\"), path.join(schemaFolder, \"BisCustomAttributes.ecschema.xml\"));\n fs.copyFileSync(getSchemaPathFromPackage(\"ecdb-map-schema\", \"ECDbMap.ecschema.xml\"), path.join(schemaFolder, \"ECDbMap.ecschema.xml\"));\n fs.copyFileSync(getSchemaPathFromPackage(\"ecdb-schema-policies-schema\", \"ECDbSchemaPolicies.ecschema.xml\"), path.join(schemaFolder, \"ECDbSchemaPolicies.ecschema.xml\"));\n fs.copyFileSync(getSchemaPathFromPackage(\"formats-schema\", \"Formats.ecschema.xml\"), path.join(schemaFolder, \"Formats.ecschema.xml\"));\n fs.copyFileSync(getSchemaPathFromPackage(\"units-schema\", \"Units.ecschema.xml\"), path.join(schemaFolder, \"Units.ecschema.xml\"));\n fs.copyFileSync(getSchemaPathFromPackage(\"core-custom-attributes-schema\", \"CoreCustomAttributes.ecschema.xml\"), path.join(schemaFolder, \"CoreCustomAttributes.ecschema.xml\"));\n fs.copyFileSync(getSchemaPathFromPackage(\"bis-core-schema\", \"BisCore.ecschema.xml\"), path.join(schemaFolder, \"BisCore.ecschema.xml\"));\n }\n\n const loadSchemaString = (schemaName: string) => {\n const searchPath = path.join(__dirname, \"assets\", \"xml\", `${schemaName}.ecschema.xml`);\n const file = fs.readFileSync(searchPath);\n return file.toString();\n };\n\n it(\"should match schemas deserialized concurrently with schemas deserialized serially\", async () => {\n const schemaPromises = schemaKeys.map(async (key): Promise<Schema | undefined> => {\n if (!key)\n return undefined;\n\n const schema = await context.getSchema(key, SchemaMatchType.Latest);\n return schema;\n });\n const asyncSchemas = await Promise.all(schemaPromises);\n\n for (let i = 0; i < schemaKeys.length; i++) {\n const syncSchema = syncSchemas[i];\n expect(syncSchema).not.to.be.undefined;\n const syncXML = await SchemaXml.writeString(syncSchema!);\n\n const asyncSchema = asyncSchemas[i];\n expect(asyncSchema).not.to.be.undefined;\n const asyncXML = await SchemaXml.writeString(asyncSchema!);\n expect(asyncXML).to.deep.equal(syncXML);\n }\n });\n\n it(\"should be able to mix getSchema and getSchemaSync\", async () => {\n const schemaPromises = schemaKeys.map(async (key, index): Promise<Schema | undefined> => {\n if (index % 2 === 0) {\n // Use getSchema() for even indices\n if (!key)\n return undefined;\n\n const schema = await context.getSchema(key, SchemaMatchType.Latest);\n return schema;\n } else {\n // Use getSchemaSync() for odd indices\n if (!key)\n return undefined;\n\n const schema = context.getSchemaSync(key, SchemaMatchType.Latest);\n return schema;\n }\n });\n const asyncSchemas = await Promise.all(schemaPromises);\n\n for (let i = 0; i < schemaKeys.length; i++) {\n const syncSchema = syncSchemas[i];\n expect(syncSchema).not.to.be.undefined;\n const syncXML = await SchemaXml.writeString(syncSchema!);\n\n const asyncSchema = asyncSchemas[i];\n expect(asyncSchema).not.to.be.undefined;\n const asyncXML = await SchemaXml.writeString(asyncSchema!);\n expect(asyncXML).to.deep.equal(syncXML);\n }\n });\n\n it(\"Concurrently get BisCore with SchemaXmlFileLocater\", async () => {\n const schemaContext = new SchemaContext();\n const xmlFileLocater = new SchemaXmlFileLocater();\n xmlFileLocater.addSchemaSearchPath(schemaFolder);\n schemaContext.addLocater(xmlFileLocater);\n\n const schemas = await Promise.all(\n [...Array(100).keys()].map(async () => {\n return schemaContext.getSchema(new SchemaKey(\"BisCore\"));\n }),\n );\n expect(schemas.length).to.equal(100);\n schemas.forEach((schema) => {\n assert(schema !== undefined);\n expect(schema.fullName).to.equal(\"BisCore\");\n });\n });\n\n it(\"Concurrently get a schema and it's referenced schema with SchemaXmlFileLocater\", async () => {\n const schemaContext = new SchemaContext();\n const xmlFileLocater = new SchemaXmlFileLocater();\n xmlFileLocater.addSchemaSearchPath(schemaFolder);\n schemaContext.addLocater(xmlFileLocater);\n\n let getBisCoreFirst = 0;\n const schemas = await Promise.all(\n [...Array(2).keys()].map(async () => {\n if (getBisCoreFirst === 0) {\n getBisCoreFirst = 1;\n return schemaContext.getSchema(new SchemaKey(\"BisCore\"));\n }\n return schemaContext.getSchema(new SchemaKey(\"CoreCustomAttributes\"));\n }),\n );\n expect(schemas.length).to.equal(2);\n schemas.forEach((schema) => {\n expect(schema).to.not.be.undefined;\n });\n });\n\n it(\"Concurrently get BisCore with SchemaXmlStringLocater\", async () => {\n const schemaContext = new SchemaContext();\n const xmlStringLocater = new SchemaXmlStringLocater();\n schemaContext.addLocater(xmlStringLocater);\n\n xmlStringLocater.addSchemaString(loadSchemaString(\"CoreCustomAttributes\"));\n xmlStringLocater.addSchemaString(loadSchemaString(\"ECDbMap\"));\n xmlStringLocater.addSchemaString(loadSchemaString(\"ECDbSchemaPolicies\"));\n xmlStringLocater.addSchemaString(loadSchemaString(\"BisCore\"));\n\n const schemas = await Promise.all(\n [...Array(100).keys()].map(async () => {\n return schemaContext.getSchema(new SchemaKey(\"BisCore\"));\n }),\n );\n expect(schemas.length).to.equal(100);\n schemas.forEach((schema) => {\n assert(schema !== undefined);\n expect(schema.fullName).to.equal(\"BisCore\");\n });\n });\n\n it(\"Concurrently get a schema and it's referenced schema with SchemaXmlStringLocater\", async () => {\n const schemaContext = new SchemaContext();\n const xmlStringLocater = new SchemaXmlStringLocater();\n schemaContext.addLocater(xmlStringLocater);\n\n xmlStringLocater.addSchemaString(loadSchemaString(\"CoreCustomAttributes\"));\n xmlStringLocater.addSchemaString(loadSchemaString(\"ECDbMap\"));\n xmlStringLocater.addSchemaString(loadSchemaString(\"ECDbSchemaPolicies\"));\n xmlStringLocater.addSchemaString(loadSchemaString(\"BisCore\"));\n\n let getBisCoreFirst = 0;\n const schemas = await Promise.all(\n [...Array(2).keys()].map(async () => {\n if (getBisCoreFirst === 0) {\n getBisCoreFirst = 1;\n return schemaContext.getSchema(new SchemaKey(\"BisCore\"));\n }\n return schemaContext.getSchema(new SchemaKey(\"CoreCustomAttributes\"));\n }),\n );\n expect(schemas.length).to.equal(2);\n schemas.forEach((schema) => {\n expect(schema).to.not.be.undefined;\n });\n });\n});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaJsonFileLocator.test.d.ts","sourceRoot":"","sources":["../../../src/test/SchemaJsonFileLocator.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { assert } from "chai";
|
|
6
|
+
import * as path from "path";
|
|
7
|
+
import * as EC from "@itwin/ecschema-metadata";
|
|
8
|
+
import { SchemaJsonFileLocater } from "../SchemaJsonFileLocater";
|
|
9
|
+
describe("SchemaJsonFileLocater tests: ", () => {
|
|
10
|
+
let locater;
|
|
11
|
+
let context;
|
|
12
|
+
beforeEach(() => {
|
|
13
|
+
locater = new SchemaJsonFileLocater();
|
|
14
|
+
locater.addSchemaSearchPath(path.join(__dirname, "assets"));
|
|
15
|
+
context = new EC.SchemaContext();
|
|
16
|
+
context.addLocater(locater);
|
|
17
|
+
});
|
|
18
|
+
it("locate valid schema with multiple references", async () => {
|
|
19
|
+
const schemaKey = new EC.SchemaKey("SchemaA", 1, 1, 1);
|
|
20
|
+
const schema = await context.getSchema(schemaKey, EC.SchemaMatchType.Exact);
|
|
21
|
+
assert.isDefined(schema);
|
|
22
|
+
assert.strictEqual(schema.schemaKey.name, "SchemaA");
|
|
23
|
+
assert.strictEqual(schema.schemaKey.version.toString(), "01.01.01");
|
|
24
|
+
});
|
|
25
|
+
it("locate valid schema with multiple references synchronously", () => {
|
|
26
|
+
const schemaKey = new EC.SchemaKey("SchemaA", 1, 1, 1);
|
|
27
|
+
const schema = context.getSchemaSync(schemaKey, EC.SchemaMatchType.Exact);
|
|
28
|
+
assert.isDefined(schema);
|
|
29
|
+
assert.strictEqual(schema.schemaKey.name, "SchemaA");
|
|
30
|
+
assert.strictEqual(schema.schemaKey.version.toString(), "01.01.01");
|
|
31
|
+
});
|
|
32
|
+
it("getSchema called multiple times for same schema", async () => {
|
|
33
|
+
const schemaKey = new EC.SchemaKey("SchemaD", 4, 4, 4);
|
|
34
|
+
const locater1 = await locater.getSchema(schemaKey, EC.SchemaMatchType.Exact, new EC.SchemaContext());
|
|
35
|
+
const locater2 = await locater.getSchema(schemaKey, EC.SchemaMatchType.Exact, new EC.SchemaContext());
|
|
36
|
+
const context1 = await context.getSchema(schemaKey, EC.SchemaMatchType.Exact);
|
|
37
|
+
const context2 = await context.getSchema(schemaKey, EC.SchemaMatchType.Exact);
|
|
38
|
+
// locater should not cache, but context should cache
|
|
39
|
+
assert.notEqual(locater1, locater2);
|
|
40
|
+
assert.notEqual(locater1, context1);
|
|
41
|
+
assert.strictEqual(context1, context2);
|
|
42
|
+
});
|
|
43
|
+
it("getSchema called multiple times for same schema synchronously", () => {
|
|
44
|
+
const schemaKey = new EC.SchemaKey("SchemaD", 4, 4, 4);
|
|
45
|
+
const locater1 = locater.getSchemaSync(schemaKey, EC.SchemaMatchType.Exact, new EC.SchemaContext());
|
|
46
|
+
const locater2 = locater.getSchemaSync(schemaKey, EC.SchemaMatchType.Exact, new EC.SchemaContext());
|
|
47
|
+
const context1 = context.getSchemaSync(schemaKey, EC.SchemaMatchType.Exact);
|
|
48
|
+
const context2 = context.getSchemaSync(schemaKey, EC.SchemaMatchType.Exact);
|
|
49
|
+
// locater should not cache, but context should cache
|
|
50
|
+
assert.notEqual(locater1, locater2);
|
|
51
|
+
assert.notEqual(locater1, context1);
|
|
52
|
+
assert.strictEqual(context1, context2);
|
|
53
|
+
});
|
|
54
|
+
it("getSchema which does not exist, returns undefined", async () => {
|
|
55
|
+
const schemaKey = new EC.SchemaKey("DoesNotExist");
|
|
56
|
+
const result = await locater.getSchema(schemaKey, EC.SchemaMatchType.Exact, context);
|
|
57
|
+
assert.isUndefined(result);
|
|
58
|
+
});
|
|
59
|
+
it("loadSchema from file, bad schema name, throws", async () => {
|
|
60
|
+
const schemaKey = new EC.SchemaKey("BadSchemaName");
|
|
61
|
+
try {
|
|
62
|
+
await locater.getSchema(schemaKey, EC.SchemaMatchType.Exact, context);
|
|
63
|
+
}
|
|
64
|
+
catch (e) {
|
|
65
|
+
const error = e;
|
|
66
|
+
assert.strictEqual(error.errorNumber, EC.ECObjectsStatus.InvalidECJson);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
assert.fail(0, 1, "Expected ECObjects exception");
|
|
70
|
+
});
|
|
71
|
+
it("loadSchema from file, bad schema version, throws", async () => {
|
|
72
|
+
const schemaKey = new EC.SchemaKey("BadSchemaVersion");
|
|
73
|
+
try {
|
|
74
|
+
await locater.getSchema(schemaKey, EC.SchemaMatchType.Exact, context);
|
|
75
|
+
}
|
|
76
|
+
catch (e) {
|
|
77
|
+
const error = e;
|
|
78
|
+
assert.strictEqual(error.errorNumber, EC.ECObjectsStatus.InvalidECJson);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
assert.fail(0, 1, "Expected ECObjects exception");
|
|
82
|
+
});
|
|
83
|
+
it("getSchema, full version, succeeds", async () => {
|
|
84
|
+
const stub = await locater.getSchema(new EC.SchemaKey("SchemaA", 1, 1, 1), EC.SchemaMatchType.Exact, context);
|
|
85
|
+
assert.isDefined(stub);
|
|
86
|
+
const key = stub.schemaKey;
|
|
87
|
+
assert.strictEqual(key.name, "SchemaA");
|
|
88
|
+
assert.strictEqual(key.version.toString(), "01.01.01");
|
|
89
|
+
});
|
|
90
|
+
it("getSchema, exact version, wrong minor, fails", async () => {
|
|
91
|
+
assert.isUndefined(await locater.getSchema(new EC.SchemaKey("SchemaA", 1, 1, 2), EC.SchemaMatchType.Exact, context));
|
|
92
|
+
});
|
|
93
|
+
it("getSchema, latest, succeeds", async () => {
|
|
94
|
+
const schema = await locater.getSchema(new EC.SchemaKey("SchemaA", 1, 1, 0), EC.SchemaMatchType.Latest, context);
|
|
95
|
+
assert.isDefined(schema);
|
|
96
|
+
assert.strictEqual(schema.schemaKey.name, "SchemaA");
|
|
97
|
+
assert.strictEqual(schema.schemaKey.version.toString(), "02.00.02");
|
|
98
|
+
});
|
|
99
|
+
it("getSchema, latest write compatible, succeeds", async () => {
|
|
100
|
+
const stub = await locater.getSchema(new EC.SchemaKey("SchemaA", 1, 1, 0), EC.SchemaMatchType.LatestWriteCompatible, context);
|
|
101
|
+
assert.isDefined(stub);
|
|
102
|
+
assert.strictEqual(stub.schemaKey.name, "SchemaA");
|
|
103
|
+
assert.strictEqual(stub.schemaKey.version.toString(), "01.01.01");
|
|
104
|
+
});
|
|
105
|
+
it("getSchema, latest write compatible, write version wrong, fails", async () => {
|
|
106
|
+
assert.isUndefined(await locater.getSchema(new EC.SchemaKey("SchemaA", 1, 2, 0), EC.SchemaMatchType.LatestWriteCompatible, context));
|
|
107
|
+
});
|
|
108
|
+
it("getSchema, latest read compatible, succeeds", async () => {
|
|
109
|
+
const stub = await locater.getSchema(new EC.SchemaKey("SchemaA", 1, 0, 0), EC.SchemaMatchType.LatestReadCompatible, context);
|
|
110
|
+
assert.isDefined(stub);
|
|
111
|
+
assert.strictEqual(stub.schemaKey.name, "SchemaA");
|
|
112
|
+
assert.strictEqual(stub.schemaKey.version.toString(), "01.01.01");
|
|
113
|
+
});
|
|
114
|
+
it("getSchema, latest read compatible, read version wrong, fails", async () => {
|
|
115
|
+
assert.isUndefined(await locater.getSchema(new EC.SchemaKey("SchemaA", 2, 1, 1), EC.SchemaMatchType.LatestReadCompatible, context));
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
//# sourceMappingURL=SchemaJsonFileLocator.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaJsonFileLocator.test.js","sourceRoot":"","sources":["../../../src/test/SchemaJsonFileLocator.test.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAE/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;IAC7C,IAAI,OAA8B,CAAC;IACnC,IAAI,OAAyB,CAAC;IAE9B,UAAU,CAAC,GAAG,EAAE;QACd,OAAO,GAAG,IAAI,qBAAqB,EAAE,CAAC;QAEtC,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;QAC5D,OAAO,GAAG,IAAI,EAAE,CAAC,aAAa,EAAE,CAAC;QACjC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8CAA8C,EAAE,KAAK,IAAI,EAAE;QAC5D,MAAM,SAAS,GAAG,IAAI,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACvD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QAE5E,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACzB,MAAM,CAAC,WAAW,CAAC,MAAO,CAAC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AC,eAAe,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;QAE7H,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACvB,MAAM,CAAC,WAAW,CAAC,IAAK,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QACpD,MAAM,CAAC,WAAW,CAAC,IAAK,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,UAAU,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8DAA8D,EAAE,KAAK,IAAI,EAAE;QAC5E,MAAM,CAAC,WAAW,CAAC,MAAM,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC,CAAC;IACtI,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { assert } from \"chai\";\nimport * as path from \"path\";\nimport * as EC from \"@itwin/ecschema-metadata\";\nimport { FileSchemaKey } from \"../SchemaFileLocater\";\nimport { SchemaJsonFileLocater } from \"../SchemaJsonFileLocater\";\n\ndescribe(\"SchemaJsonFileLocater tests: \", () => {\n let locater: SchemaJsonFileLocater;\n let context: EC.SchemaContext;\n\n beforeEach(() => {\n locater = new SchemaJsonFileLocater();\n\n locater.addSchemaSearchPath(path.join(__dirname, \"assets\"));\n context = new EC.SchemaContext();\n context.addLocater(locater);\n });\n\n it(\"locate valid schema with multiple references\", async () => {\n const schemaKey = new EC.SchemaKey(\"SchemaA\", 1, 1, 1);\n const schema = await context.getSchema(schemaKey, EC.SchemaMatchType.Exact);\n\n assert.isDefined(schema);\n assert.strictEqual(schema!.schemaKey.name, \"SchemaA\");\n assert.strictEqual(schema!.schemaKey.version.toString(), \"01.01.01\");\n });\n\n it(\"locate valid schema with multiple references synchronously\", () => {\n const schemaKey = new EC.SchemaKey(\"SchemaA\", 1, 1, 1);\n const schema = context.getSchemaSync(schemaKey, EC.SchemaMatchType.Exact);\n\n assert.isDefined(schema);\n assert.strictEqual(schema!.schemaKey.name, \"SchemaA\");\n assert.strictEqual(schema!.schemaKey.version.toString(), \"01.01.01\");\n });\n\n it(\"getSchema called multiple times for same schema\", async () => {\n const schemaKey = new EC.SchemaKey(\"SchemaD\", 4, 4, 4);\n\n const locater1 = await locater.getSchema(schemaKey, EC.SchemaMatchType.Exact, new EC.SchemaContext());\n const locater2 = await locater.getSchema(schemaKey, EC.SchemaMatchType.Exact, new EC.SchemaContext());\n const context1 = await context.getSchema(schemaKey, EC.SchemaMatchType.Exact);\n const context2 = await context.getSchema(schemaKey, EC.SchemaMatchType.Exact);\n\n // locater should not cache, but context should cache\n assert.notEqual(locater1, locater2);\n assert.notEqual(locater1, context1);\n assert.strictEqual(context1, context2);\n });\n\n it(\"getSchema called multiple times for same schema synchronously\", () => {\n const schemaKey = new EC.SchemaKey(\"SchemaD\", 4, 4, 4);\n\n const locater1 = locater.getSchemaSync(schemaKey, EC.SchemaMatchType.Exact, new EC.SchemaContext());\n const locater2 = locater.getSchemaSync(schemaKey, EC.SchemaMatchType.Exact, new EC.SchemaContext());\n const context1 = context.getSchemaSync(schemaKey, EC.SchemaMatchType.Exact);\n const context2 = context.getSchemaSync(schemaKey, EC.SchemaMatchType.Exact);\n\n // locater should not cache, but context should cache\n assert.notEqual(locater1, locater2);\n assert.notEqual(locater1, context1);\n assert.strictEqual(context1, context2);\n });\n\n it(\"getSchema which does not exist, returns undefined\", async () => {\n const schemaKey = new EC.SchemaKey(\"DoesNotExist\");\n const result = await locater.getSchema(schemaKey, EC.SchemaMatchType.Exact, context);\n assert.isUndefined(result);\n });\n\n it(\"loadSchema from file, bad schema name, throws\", async () => {\n const schemaKey = new EC.SchemaKey(\"BadSchemaName\");\n\n try {\n await locater.getSchema(schemaKey, EC.SchemaMatchType.Exact, context);\n } catch (e) {\n const error = e as EC.ECObjectsError;\n assert.strictEqual(error.errorNumber, EC.ECObjectsStatus.InvalidECJson);\n return;\n }\n\n assert.fail(0, 1, \"Expected ECObjects exception\");\n });\n\n it(\"loadSchema from file, bad schema version, throws\", async () => {\n const schemaKey = new EC.SchemaKey(\"BadSchemaVersion\");\n\n try {\n await locater.getSchema(schemaKey, EC.SchemaMatchType.Exact, context);\n } catch (e) {\n const error = e as EC.ECObjectsError;\n assert.strictEqual(error.errorNumber, EC.ECObjectsStatus.InvalidECJson);\n return;\n }\n\n assert.fail(0, 1, \"Expected ECObjects exception\");\n });\n\n it(\"getSchema, full version, succeeds\", async () => {\n const stub = await locater.getSchema(new EC.SchemaKey(\"SchemaA\", 1, 1, 1), EC.SchemaMatchType.Exact, context);\n\n assert.isDefined(stub);\n const key = stub!.schemaKey as FileSchemaKey;\n assert.strictEqual(key.name, \"SchemaA\");\n assert.strictEqual(key.version.toString(), \"01.01.01\");\n });\n\n it(\"getSchema, exact version, wrong minor, fails\", async () => {\n assert.isUndefined(await locater.getSchema(new EC.SchemaKey(\"SchemaA\", 1, 1, 2), EC.SchemaMatchType.Exact, context));\n });\n\n it(\"getSchema, latest, succeeds\", async () => {\n const schema = await locater.getSchema(new EC.SchemaKey(\"SchemaA\", 1, 1, 0), EC.SchemaMatchType.Latest, context);\n assert.isDefined(schema);\n assert.strictEqual(schema!.schemaKey.name, \"SchemaA\");\n assert.strictEqual(schema!.schemaKey.version.toString(), \"02.00.02\");\n });\n\n it(\"getSchema, latest write compatible, succeeds\", async () => {\n const stub = await locater.getSchema(new EC.SchemaKey(\"SchemaA\", 1, 1, 0), EC.SchemaMatchType.LatestWriteCompatible, context);\n\n assert.isDefined(stub);\n assert.strictEqual(stub!.schemaKey.name, \"SchemaA\");\n assert.strictEqual(stub!.schemaKey.version.toString(), \"01.01.01\");\n });\n\n it(\"getSchema, latest write compatible, write version wrong, fails\", async () => {\n assert.isUndefined(await locater.getSchema(new EC.SchemaKey(\"SchemaA\", 1, 2, 0), EC.SchemaMatchType.LatestWriteCompatible, context));\n });\n\n it(\"getSchema, latest read compatible, succeeds\", async () => {\n const stub = await locater.getSchema(new EC.SchemaKey(\"SchemaA\", 1, 0, 0), EC.SchemaMatchType.LatestReadCompatible, context);\n\n assert.isDefined(stub);\n assert.strictEqual(stub!.schemaKey.name, \"SchemaA\");\n assert.strictEqual(stub!.schemaKey.version.toString(), \"01.01.01\");\n });\n\n it(\"getSchema, latest read compatible, read version wrong, fails\", async () => {\n assert.isUndefined(await locater.getSchema(new EC.SchemaKey(\"SchemaA\", 2, 1, 1), EC.SchemaMatchType.LatestReadCompatible, context));\n });\n});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaXml.test.d.ts","sourceRoot":"","sources":["../../../src/test/SchemaXml.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { expect } from "chai";
|
|
6
|
+
import * as path from "path";
|
|
7
|
+
import * as fs from "fs-extra";
|
|
8
|
+
import * as sinon from "sinon";
|
|
9
|
+
import { SchemaContext, SchemaKey, SchemaMatchType } from "@itwin/ecschema-metadata";
|
|
10
|
+
import { SchemaXmlFileLocater } from "../SchemaXmlFileLocater";
|
|
11
|
+
import { SchemaXml } from "../SchemaXml";
|
|
12
|
+
describe("SchemaXml tests:", () => {
|
|
13
|
+
let locater;
|
|
14
|
+
let resultLocater;
|
|
15
|
+
let context;
|
|
16
|
+
let resultContext;
|
|
17
|
+
const outDir = path.join(__dirname, "output");
|
|
18
|
+
before(() => {
|
|
19
|
+
fs.ensureDirSync(outDir);
|
|
20
|
+
});
|
|
21
|
+
beforeEach(() => {
|
|
22
|
+
locater = new SchemaXmlFileLocater();
|
|
23
|
+
locater.addSchemaSearchPath(path.join(__dirname, "assets"));
|
|
24
|
+
context = new SchemaContext();
|
|
25
|
+
context.addLocater(locater);
|
|
26
|
+
resultLocater = new SchemaXmlFileLocater();
|
|
27
|
+
resultLocater.addSchemaSearchPath(path.join(__dirname, "output"));
|
|
28
|
+
resultContext = new SchemaContext();
|
|
29
|
+
resultContext.addLocater(resultLocater);
|
|
30
|
+
});
|
|
31
|
+
afterEach(() => {
|
|
32
|
+
sinon.restore();
|
|
33
|
+
});
|
|
34
|
+
it("writeFile creates schema xml file successfully.", async () => {
|
|
35
|
+
const schemaKey = new SchemaKey("SchemaD", 4, 4, 4);
|
|
36
|
+
const schema = await context.getSchema(schemaKey, SchemaMatchType.Exact);
|
|
37
|
+
await SchemaXml.writeFile(schema, outDir);
|
|
38
|
+
const resultSchema = await resultContext.getSchema(schemaKey, SchemaMatchType.Exact);
|
|
39
|
+
expect(resultSchema).to.not.be.undefined;
|
|
40
|
+
expect(resultSchema?.schemaKey.matches(schema?.schemaKey)).to.be.true;
|
|
41
|
+
});
|
|
42
|
+
it("writeFile with bad path specified, should fail.", async () => {
|
|
43
|
+
const schemaKey = new SchemaKey("SchemaD", 4, 4, 4);
|
|
44
|
+
const schema = await context.getSchema(schemaKey, SchemaMatchType.Exact);
|
|
45
|
+
await expect(SchemaXml.writeFile(schema, "badPath")).to.be.rejectedWith(`The output directory 'badPath' does not exist.`);
|
|
46
|
+
});
|
|
47
|
+
it("writeFile, writeFile fails, failure handled properly.", async () => {
|
|
48
|
+
const schemaKey = new SchemaKey("SchemaD", 4, 4, 4);
|
|
49
|
+
const schema = await context.getSchema(schemaKey, SchemaMatchType.Exact);
|
|
50
|
+
sinon.stub(fs, "writeFile").rejects(new Error("SomeError"));
|
|
51
|
+
const outFile = path.resolve(outDir, `${schema.name}.ecschema.xml`);
|
|
52
|
+
await expect(SchemaXml.writeFile(schema, outDir)).to.be.rejectedWith(`An error occurred writing to file '${outFile}': SomeError`);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=SchemaXml.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaXml.test.js","sourceRoot":"","sources":["../../../src/test/SchemaXml.test.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,IAAI,OAA6B,CAAC;IAClC,IAAI,aAAmC,CAAC;IACxC,IAAI,OAAsB,CAAC;IAC3B,IAAI,aAA4B,CAAC;IACjC,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAE9C,MAAM,CAAC,GAAG,EAAE;QACV,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;IAEH,UAAU,CAAC,GAAG,EAAE;QACd,OAAO,GAAG,IAAI,oBAAoB,EAAE,CAAC;QACrC,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;QAC5D,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC;QAC9B,OAAO,CAAC,UAAU,CAAC,OAA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AAK,CAAC,CAAC;QAEzE,MAAM,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,MAAO,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,gDAAgD,CAAC,CAAC;IAC7H,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uDAAuD,EAAE,KAAK,IAAI,EAAE;QACrE,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACpD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,SAAS,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC;QACzE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;QAC5D,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,MAAO,CAAC,IAAI,eAAe,CAAC,CAAC;QAErE,MAAM,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,MAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,sCAAsC,OAAO,cAAc,CAAC,CAAC;IACrI,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { expect } from \"chai\";\nimport * as path from \"path\";\nimport * as fs from \"fs-extra\";\nimport * as sinon from \"sinon\";\nimport { SchemaContext, SchemaKey, SchemaMatchType } from \"@itwin/ecschema-metadata\";\nimport { SchemaXmlFileLocater } from \"../SchemaXmlFileLocater\";\nimport { SchemaXml } from \"../SchemaXml\";\n\ndescribe(\"SchemaXml tests:\", () => {\n let locater: SchemaXmlFileLocater;\n let resultLocater: SchemaXmlFileLocater;\n let context: SchemaContext;\n let resultContext: SchemaContext;\n const outDir = path.join(__dirname, \"output\");\n\n before(() => {\n fs.ensureDirSync(outDir);\n });\n\n beforeEach(() => {\n locater = new SchemaXmlFileLocater();\n locater.addSchemaSearchPath(path.join(__dirname, \"assets\"));\n context = new SchemaContext();\n context.addLocater(locater);\n\n resultLocater = new SchemaXmlFileLocater();\n resultLocater.addSchemaSearchPath(path.join(__dirname, \"output\"));\n resultContext = new SchemaContext();\n resultContext.addLocater(resultLocater);\n });\n\n afterEach(() => {\n sinon.restore();\n });\n\n it(\"writeFile creates schema xml file successfully.\", async () => {\n const schemaKey = new SchemaKey(\"SchemaD\", 4, 4, 4);\n const schema = await context.getSchema(schemaKey, SchemaMatchType.Exact);\n\n await SchemaXml.writeFile(schema!, outDir);\n\n const resultSchema = await resultContext.getSchema(schemaKey, SchemaMatchType.Exact);\n\n expect(resultSchema).to.not.be.undefined;\n expect(resultSchema?.schemaKey.matches(schema?.schemaKey as SchemaKey)).to.be.true;\n });\n\n it(\"writeFile with bad path specified, should fail.\", async () => {\n const schemaKey = new SchemaKey(\"SchemaD\", 4, 4, 4);\n const schema = await context.getSchema(schemaKey, SchemaMatchType.Exact);\n\n await expect(SchemaXml.writeFile(schema!, \"badPath\")).to.be.rejectedWith(`The output directory 'badPath' does not exist.`);\n });\n\n it(\"writeFile, writeFile fails, failure handled properly.\", async () => {\n const schemaKey = new SchemaKey(\"SchemaD\", 4, 4, 4);\n const schema = await context.getSchema(schemaKey, SchemaMatchType.Exact);\n sinon.stub(fs, \"writeFile\").rejects(new Error(\"SomeError\"));\n const outFile = path.resolve(outDir, `${schema!.name}.ecschema.xml`);\n\n await expect(SchemaXml.writeFile(schema!, outDir)).to.be.rejectedWith(`An error occurred writing to file '${outFile}': SomeError`);\n });\n});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaXmlFileLocator.test.d.ts","sourceRoot":"","sources":["../../../src/test/SchemaXmlFileLocator.test.ts"],"names":[],"mappings":""}
|