@finos/legend-graph 30.0.8 → 30.0.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/lib/graph/Core_HashUtils.d.ts +0 -4
- package/lib/graph/Core_HashUtils.d.ts.map +1 -1
- package/lib/graph/Core_HashUtils.js +0 -4
- package/lib/graph/Core_HashUtils.js.map +1 -1
- package/lib/graph/MetaModelConst.d.ts +1 -2
- package/lib/graph/MetaModelConst.d.ts.map +1 -1
- package/lib/graph/MetaModelConst.js +1 -2
- package/lib/graph/MetaModelConst.js.map +1 -1
- package/lib/graph/helpers/STO_Relational_Helper.d.ts +2 -0
- package/lib/graph/helpers/STO_Relational_Helper.d.ts.map +1 -1
- package/lib/graph/helpers/STO_Relational_Helper.js +6 -0
- package/lib/graph/helpers/STO_Relational_Helper.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/mapping/MappingTest.d.ts +1 -13
- package/lib/graph/metamodel/pure/packageableElements/mapping/MappingTest.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/mapping/MappingTest.js +1 -20
- package/lib/graph/metamodel/pure/packageableElements/mapping/MappingTest.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/mapping/MappingTestSuite.d.ts +1 -8
- package/lib/graph/metamodel/pure/packageableElements/mapping/MappingTestSuite.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/mapping/MappingTestSuite.js +1 -15
- package/lib/graph/metamodel/pure/packageableElements/mapping/MappingTestSuite.js.map +1 -1
- package/lib/graph-manager/AbstractPureGraphManager.d.ts +0 -5
- package/lib/graph-manager/AbstractPureGraphManager.d.ts.map +1 -1
- package/lib/graph-manager/AbstractPureGraphManager.js.map +1 -1
- package/lib/graph-manager/GraphManagerState.d.ts.map +1 -1
- package/lib/graph-manager/GraphManagerState.js +1 -1
- package/lib/graph-manager/GraphManagerState.js.map +1 -1
- package/lib/graph-manager/action/changeDetection/DSL_Mapping_ObserverHelper.d.ts +2 -4
- package/lib/graph-manager/action/changeDetection/DSL_Mapping_ObserverHelper.d.ts.map +1 -1
- package/lib/graph-manager/action/changeDetection/DSL_Mapping_ObserverHelper.js +2 -45
- package/lib/graph-manager/action/changeDetection/DSL_Mapping_ObserverHelper.js.map +1 -1
- package/lib/graph-manager/action/execution/ExecutionResult.d.ts +2 -2
- package/lib/graph-manager/action/execution/ExecutionResult.d.ts.map +1 -1
- package/lib/graph-manager/action/execution/ExecutionResult.js.map +1 -1
- package/lib/graph-manager/action/query/Query.d.ts +2 -0
- package/lib/graph-manager/action/query/Query.d.ts.map +1 -1
- package/lib/graph-manager/action/query/Query.js +13 -0
- package/lib/graph-manager/action/query/Query.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.d.ts +0 -5
- package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.js +2 -61
- package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/engine/execution/V1_ExecutionHelper.d.ts +1 -1
- package/lib/graph-manager/protocol/pure/v1/engine/execution/V1_ExecutionHelper.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/engine/execution/V1_ExecutionHelper.js +3 -3
- package/lib/graph-manager/protocol/pure/v1/engine/execution/V1_ExecutionHelper.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/engine/execution/V1_ExecutionResult.d.ts +2 -2
- package/lib/graph-manager/protocol/pure/v1/engine/execution/V1_ExecutionResult.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/engine/execution/V1_ExecutionResult.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTest.d.ts +1 -13
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTest.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTest.js +1 -20
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTest.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTestSuite.d.ts +1 -8
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTestSuite.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTestSuite.js +1 -15
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTestSuite.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/V1_ValueSpecification.d.ts +2 -0
- package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/V1_ValueSpecification.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/V1_ValueSpecification.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CByteArray.d.ts +22 -0
- package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CByteArray.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CByteArray.js +23 -0
- package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CByteArray.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.d.ts +4 -8
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.js +7 -42
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_ValueSpecificationTransformer.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_ValueSpecificationTransformer.js +6 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_ValueSpecificationTransformer.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_MappingBuilderHelper.d.ts +3 -5
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_MappingBuilderHelper.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_MappingBuilderHelper.js +14 -43
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_MappingBuilderHelper.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.d.ts +2 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.js +5 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationPathResolver.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationPathResolver.js +5 -5
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationPathResolver.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.d.ts +4 -6
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.js +6 -20
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TestSerializationHelper.d.ts +1 -2
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TestSerializationHelper.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TestSerializationHelper.js +12 -23
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TestSerializationHelper.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ValueSpecificationSerializer.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ValueSpecificationSerializer.js +12 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ValueSpecificationSerializer.js.map +1 -1
- package/lib/package.json +2 -2
- package/package.json +5 -5
- package/src/graph/Core_HashUtils.ts +0 -4
- package/src/graph/MetaModelConst.ts +1 -2
- package/src/graph/helpers/STO_Relational_Helper.ts +10 -0
- package/src/graph/metamodel/pure/packageableElements/mapping/MappingTest.ts +2 -24
- package/src/graph/metamodel/pure/packageableElements/mapping/MappingTestSuite.ts +2 -22
- package/src/graph-manager/AbstractPureGraphManager.ts +0 -11
- package/src/graph-manager/GraphManagerState.ts +2 -1
- package/src/graph-manager/action/changeDetection/DSL_Mapping_ObserverHelper.ts +6 -78
- package/src/graph-manager/action/execution/ExecutionResult.ts +2 -2
- package/src/graph-manager/action/query/Query.ts +17 -0
- package/src/graph-manager/protocol/pure/v1/V1_PureGraphManager.ts +1 -100
- package/src/graph-manager/protocol/pure/v1/engine/execution/V1_ExecutionHelper.ts +5 -3
- package/src/graph-manager/protocol/pure/v1/engine/execution/V1_ExecutionResult.ts +2 -2
- package/src/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTest.ts +2 -26
- package/src/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTestSuite.ts +2 -27
- package/src/graph-manager/protocol/pure/v1/model/valueSpecification/V1_ValueSpecification.ts +2 -0
- package/src/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CByteArray.ts +28 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.ts +12 -85
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_ValueSpecificationTransformer.ts +6 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_MappingBuilderHelper.ts +20 -93
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.ts +11 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationPathResolver.ts +9 -4
- package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.ts +10 -47
- package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TestSerializationHelper.ts +13 -30
- package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ValueSpecificationSerializer.ts +18 -0
- package/tsconfig.json +1 -0
|
@@ -34,11 +34,7 @@ import {
|
|
|
34
34
|
promisify,
|
|
35
35
|
StopWatch,
|
|
36
36
|
isNonNullable,
|
|
37
|
-
addUniqueEntry,
|
|
38
|
-
uuid,
|
|
39
|
-
deleteEntry,
|
|
40
37
|
uniq,
|
|
41
|
-
IllegalStateError,
|
|
42
38
|
filterByType,
|
|
43
39
|
isString,
|
|
44
40
|
} from '@finos/legend-shared';
|
|
@@ -235,23 +231,12 @@ import {
|
|
|
235
231
|
import { V1_UniqueTestId } from './model/test/V1_UniqueTestId.js';
|
|
236
232
|
import type { RunTestsTestableInput } from '../../../../graph/metamodel/pure/test/result/RunTestsTestableInput.js';
|
|
237
233
|
import { V1_buildTestsResult } from './engine/test/V1_RunTestsResult.js';
|
|
238
|
-
import {
|
|
239
|
-
type TestResult,
|
|
240
|
-
TestError,
|
|
241
|
-
TestExecuted,
|
|
242
|
-
TestExecutionStatus,
|
|
243
|
-
} from '../../../../graph/metamodel/pure/test/result/TestResult.js';
|
|
234
|
+
import { type TestResult } from '../../../../graph/metamodel/pure/test/result/TestResult.js';
|
|
244
235
|
import type { Testable } from '../../../../graph/metamodel/pure/test/Testable.js';
|
|
245
236
|
import {
|
|
246
237
|
getNullableIDFromTestable,
|
|
247
238
|
getNullableTestable,
|
|
248
239
|
} from '../../../helpers/DSL_Data_GraphManagerHelper.js';
|
|
249
|
-
import type { TestAssertion } from '../../../../graph/metamodel/pure/test/assertion/TestAssertion.js';
|
|
250
|
-
import { AssertFail } from '../../../../graph/metamodel/pure/test/assertion/status/AssertFail.js';
|
|
251
|
-
import {
|
|
252
|
-
type AtomicTest,
|
|
253
|
-
TestSuite,
|
|
254
|
-
} from '../../../../graph/metamodel/pure/test/Test.js';
|
|
255
240
|
import { pruneSourceInformation } from '../../../../graph/MetaModelUtils.js';
|
|
256
241
|
import {
|
|
257
242
|
V1_buildModelCoverageAnalysisResult,
|
|
@@ -273,7 +258,6 @@ import { V1_transformParameterValue } from './transformation/pureGraph/from/V1_S
|
|
|
273
258
|
import { V1_transformModelUnit } from './transformation/pureGraph/from/V1_DSL_ExternalFormat_Transformer.js';
|
|
274
259
|
import type { ModelUnit } from '../../../../graph/metamodel/pure/packageableElements/externalFormat/store/DSL_ExternalFormat_ModelUnit.js';
|
|
275
260
|
import { V1_LambdaReturnTypeInput } from './engine/compilation/V1_LambdaReturnType.js';
|
|
276
|
-
import { MultiExecutionServiceTestResult } from '../../../../graph/metamodel/pure/packageableElements/service/MultiExecutionServiceTestResult.js';
|
|
277
261
|
import type { ParameterValue } from '../../../../graph/metamodel/pure/packageableElements/service/ParameterValue.js';
|
|
278
262
|
import type { Service } from '../../../../graph/metamodel/pure/packageableElements/service/Service.js';
|
|
279
263
|
import { V1_ExecutionEnvironmentInstance } from './model/packageableElements/service/V1_ExecutionEnvironmentInstance.js';
|
|
@@ -2133,89 +2117,6 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2133
2117
|
return result;
|
|
2134
2118
|
}
|
|
2135
2119
|
|
|
2136
|
-
async generateExpectedResult(
|
|
2137
|
-
testable: Testable,
|
|
2138
|
-
test: AtomicTest,
|
|
2139
|
-
baseAssertion: TestAssertion,
|
|
2140
|
-
graph: PureModel,
|
|
2141
|
-
): Promise<AssertFail> {
|
|
2142
|
-
const id = uuid();
|
|
2143
|
-
try {
|
|
2144
|
-
baseAssertion.id = id;
|
|
2145
|
-
addUniqueEntry(test.assertions, baseAssertion);
|
|
2146
|
-
const runTestsInput = new V1_RunTestsInput();
|
|
2147
|
-
runTestsInput.model = this.getFullGraphModelData(graph);
|
|
2148
|
-
const runTestableInput = new V1_RunTestsTestableInput();
|
|
2149
|
-
const unitAtomicTest = new V1_UniqueTestId();
|
|
2150
|
-
runTestableInput.testable = guaranteeNonNullable(
|
|
2151
|
-
getNullableIDFromTestable(
|
|
2152
|
-
testable,
|
|
2153
|
-
graph,
|
|
2154
|
-
this.pluginManager.getPureGraphManagerPlugins(),
|
|
2155
|
-
),
|
|
2156
|
-
);
|
|
2157
|
-
runTestableInput.unitTestIds = [unitAtomicTest];
|
|
2158
|
-
runTestsInput.testables = [runTestableInput];
|
|
2159
|
-
const parent = test.__parent;
|
|
2160
|
-
unitAtomicTest.testSuiteId =
|
|
2161
|
-
parent instanceof TestSuite ? parent.id : undefined;
|
|
2162
|
-
unitAtomicTest.atomicTestId = test.id;
|
|
2163
|
-
const runTestsResult = await this.engine.runTests(runTestsInput);
|
|
2164
|
-
const results = V1_buildTestsResult(
|
|
2165
|
-
runTestsResult,
|
|
2166
|
-
(_id: string): Testable | undefined =>
|
|
2167
|
-
getNullableTestable(
|
|
2168
|
-
_id,
|
|
2169
|
-
graph,
|
|
2170
|
-
this.pluginManager.getPureGraphManagerPlugins(),
|
|
2171
|
-
),
|
|
2172
|
-
this.pluginManager.getPureProtocolProcessorPlugins(),
|
|
2173
|
-
);
|
|
2174
|
-
const result = results[0];
|
|
2175
|
-
let status: AssertFail | undefined = undefined;
|
|
2176
|
-
if (
|
|
2177
|
-
result instanceof TestExecuted &&
|
|
2178
|
-
result.testExecutionStatus === TestExecutionStatus.FAIL
|
|
2179
|
-
) {
|
|
2180
|
-
status = result.assertStatuses.find(
|
|
2181
|
-
(aStatus) =>
|
|
2182
|
-
aStatus.assertion === baseAssertion &&
|
|
2183
|
-
aStatus instanceof AssertFail,
|
|
2184
|
-
);
|
|
2185
|
-
} else if (result instanceof MultiExecutionServiceTestResult) {
|
|
2186
|
-
status = Array.from(result.keyIndexedTestResults.values())
|
|
2187
|
-
.map((testResult) => {
|
|
2188
|
-
if (
|
|
2189
|
-
testResult instanceof TestExecuted &&
|
|
2190
|
-
testResult.testExecutionStatus === TestExecutionStatus.FAIL
|
|
2191
|
-
) {
|
|
2192
|
-
return testResult.assertStatuses.find(
|
|
2193
|
-
(aStatus) =>
|
|
2194
|
-
aStatus.assertion === baseAssertion &&
|
|
2195
|
-
aStatus instanceof AssertFail,
|
|
2196
|
-
);
|
|
2197
|
-
} else if (testResult instanceof TestError) {
|
|
2198
|
-
throw new IllegalStateError(testResult.error);
|
|
2199
|
-
}
|
|
2200
|
-
return undefined;
|
|
2201
|
-
})
|
|
2202
|
-
.filter(isNonNullable)[0];
|
|
2203
|
-
} else if (result instanceof TestError) {
|
|
2204
|
-
throw new IllegalStateError(result.error);
|
|
2205
|
-
} else {
|
|
2206
|
-
throw new UnsupportedOperationError(
|
|
2207
|
-
'Unable to derive expected result from test result',
|
|
2208
|
-
);
|
|
2209
|
-
}
|
|
2210
|
-
return guaranteeNonNullable(status);
|
|
2211
|
-
} catch (error) {
|
|
2212
|
-
assertErrorThrown(error);
|
|
2213
|
-
throw error;
|
|
2214
|
-
} finally {
|
|
2215
|
-
deleteEntry(test.assertions, baseAssertion);
|
|
2216
|
-
}
|
|
2217
|
-
}
|
|
2218
|
-
|
|
2219
2120
|
// ------------------------------------------- Value Specification -------------------------------------------
|
|
2220
2121
|
|
|
2221
2122
|
buildValueSpecification(
|
|
@@ -19,6 +19,8 @@ import {
|
|
|
19
19
|
UnsupportedOperationError,
|
|
20
20
|
type PlainObject,
|
|
21
21
|
isString,
|
|
22
|
+
isNumber,
|
|
23
|
+
isBoolean,
|
|
22
24
|
} from '@finos/legend-shared';
|
|
23
25
|
import {
|
|
24
26
|
type ExecutionResult,
|
|
@@ -167,12 +169,12 @@ export const V1_buildExecutionResult = (
|
|
|
167
169
|
};
|
|
168
170
|
|
|
169
171
|
export const V1_serializeExecutionResult = (
|
|
170
|
-
json: PlainObject<V1_ExecutionResult> | string,
|
|
172
|
+
json: PlainObject<V1_ExecutionResult> | string | null | boolean | number,
|
|
171
173
|
): V1_ExecutionResult => {
|
|
172
|
-
if (isString(json)) {
|
|
174
|
+
if (json === null || isString(json) || isNumber(json) || isBoolean(json)) {
|
|
173
175
|
return new V1_RawExecutionResult(json);
|
|
174
176
|
}
|
|
175
|
-
switch ((json.builder as PlainObject<V1_ResultBuilder>)
|
|
177
|
+
switch ((json.builder as PlainObject<V1_ResultBuilder> | undefined)?._type) {
|
|
176
178
|
case BuilderType.CLASS_BUILDER:
|
|
177
179
|
return V1_ClassExecutionResult.serialization.fromJson(json);
|
|
178
180
|
case BuilderType.TDS_BUILDER:
|
|
@@ -163,9 +163,9 @@ export class V1_ClassExecutionResult extends V1_ExecutionResult {
|
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
export class V1_RawExecutionResult extends V1_ExecutionResult {
|
|
166
|
-
value: string;
|
|
166
|
+
value: string | number | boolean | null;
|
|
167
167
|
|
|
168
|
-
constructor(value: string) {
|
|
168
|
+
constructor(value: string | number | boolean | null) {
|
|
169
169
|
super();
|
|
170
170
|
this.value = value;
|
|
171
171
|
}
|
package/src/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTest.ts
CHANGED
|
@@ -16,39 +16,15 @@
|
|
|
16
16
|
|
|
17
17
|
import { hashArray, type Hashable } from '@finos/legend-shared';
|
|
18
18
|
import { CORE_HASH_STRUCTURE } from '../../../../../../../graph/Core_HashUtils.js';
|
|
19
|
-
import type { V1_RawLambda } from '../../rawValueSpecification/V1_RawLambda.js';
|
|
20
19
|
import { V1_AtomicTest } from '../../test/V1_AtomicTest.js';
|
|
21
20
|
import type { V1_MappingStoreTestData } from './V1_MappingStoreTestData.js';
|
|
22
21
|
|
|
23
|
-
export
|
|
24
|
-
extends V1_AtomicTest
|
|
25
|
-
implements Hashable {}
|
|
26
|
-
|
|
27
|
-
export class V1_MappingQueryTest extends V1_MappingTest implements Hashable {
|
|
28
|
-
/**
|
|
29
|
-
* Studio does not process value specification, they are left in raw JSON form
|
|
30
|
-
*
|
|
31
|
-
* @discrepancy model
|
|
32
|
-
*/
|
|
33
|
-
func!: V1_RawLambda;
|
|
34
|
-
|
|
35
|
-
get hashCode(): string {
|
|
36
|
-
return hashArray([
|
|
37
|
-
CORE_HASH_STRUCTURE.MAPPING_QUERY_TEST,
|
|
38
|
-
this.id,
|
|
39
|
-
this.doc ?? '',
|
|
40
|
-
this.func,
|
|
41
|
-
hashArray(this.assertions),
|
|
42
|
-
]);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export class V1_MappingDataTest extends V1_MappingTest implements Hashable {
|
|
22
|
+
export class V1_MappingTest extends V1_AtomicTest implements Hashable {
|
|
47
23
|
storeTestData: V1_MappingStoreTestData[] = [];
|
|
48
24
|
|
|
49
25
|
get hashCode(): string {
|
|
50
26
|
return hashArray([
|
|
51
|
-
CORE_HASH_STRUCTURE.
|
|
27
|
+
CORE_HASH_STRUCTURE.MAPPING_TEST,
|
|
52
28
|
this.id,
|
|
53
29
|
this.doc ?? '',
|
|
54
30
|
hashArray(this.storeTestData),
|
package/src/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTestSuite.ts
CHANGED
|
@@ -17,34 +17,9 @@
|
|
|
17
17
|
import { hashArray, type Hashable } from '@finos/legend-shared';
|
|
18
18
|
import { CORE_HASH_STRUCTURE } from '../../../../../../../graph/Core_HashUtils.js';
|
|
19
19
|
import { V1_TestSuite } from '../../test/V1_TestSuite.js';
|
|
20
|
-
import type { V1_MappingStoreTestData } from './V1_MappingStoreTestData.js';
|
|
21
20
|
import type { V1_RawLambda } from '../../rawValueSpecification/V1_RawLambda.js';
|
|
22
21
|
|
|
23
|
-
export
|
|
24
|
-
extends V1_TestSuite
|
|
25
|
-
implements Hashable {}
|
|
26
|
-
|
|
27
|
-
export class V1_MappingDataTestSuite
|
|
28
|
-
extends V1_MappingTestSuite
|
|
29
|
-
implements Hashable
|
|
30
|
-
{
|
|
31
|
-
storeTestData: V1_MappingStoreTestData[] = [];
|
|
32
|
-
|
|
33
|
-
get hashCode(): string {
|
|
34
|
-
return hashArray([
|
|
35
|
-
CORE_HASH_STRUCTURE.MAPPING_TEST_DATA_SUITE,
|
|
36
|
-
this.id,
|
|
37
|
-
this.doc ?? '',
|
|
38
|
-
hashArray(this.storeTestData),
|
|
39
|
-
hashArray(this.tests),
|
|
40
|
-
]);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export class V1_MappingQueryTestSuite
|
|
45
|
-
extends V1_MappingTestSuite
|
|
46
|
-
implements Hashable
|
|
47
|
-
{
|
|
22
|
+
export class V1_MappingTestSuite extends V1_TestSuite implements Hashable {
|
|
48
23
|
/**
|
|
49
24
|
* Studio does not process value specification, they are left in raw JSON form
|
|
50
25
|
*
|
|
@@ -54,7 +29,7 @@ export class V1_MappingQueryTestSuite
|
|
|
54
29
|
|
|
55
30
|
get hashCode(): string {
|
|
56
31
|
return hashArray([
|
|
57
|
-
CORE_HASH_STRUCTURE.
|
|
32
|
+
CORE_HASH_STRUCTURE.MAPPING_TEST_SUITE,
|
|
58
33
|
this.id,
|
|
59
34
|
this.doc ?? '',
|
|
60
35
|
this.func,
|
package/src/graph-manager/protocol/pure/v1/model/valueSpecification/V1_ValueSpecification.ts
CHANGED
|
@@ -34,6 +34,7 @@ import type { V1_PackageableElementPtr } from './raw/V1_PackageableElementPtr.js
|
|
|
34
34
|
import type { V1_INTERNAL__UnknownValueSpecification } from './V1_INTERNAL__UnknownValueSpecfication.js';
|
|
35
35
|
import type { V1_GenericTypeInstance } from './raw/V1_GenericTypeInstance.js';
|
|
36
36
|
import type { V1_ClassInstance } from './raw/V1_ClassInstance.js';
|
|
37
|
+
import type { V1_CByteArray } from './raw/V1_CByteArray.js';
|
|
37
38
|
|
|
38
39
|
export interface V1_ValueSpecificationVisitor<T> {
|
|
39
40
|
visit_INTERNAL__UnknownValueSpecfication(
|
|
@@ -56,6 +57,7 @@ export interface V1_ValueSpecificationVisitor<T> {
|
|
|
56
57
|
visit_CDecimal(valueSpecification: V1_CDecimal): T;
|
|
57
58
|
visit_CString(valueSpecification: V1_CString): T;
|
|
58
59
|
visit_CBoolean(valueSpecification: V1_CBoolean): T;
|
|
60
|
+
visit_CByteArray(valueSpecification: V1_CByteArray): T;
|
|
59
61
|
visit_CFloat(valueSpecification: V1_CFloat): T;
|
|
60
62
|
visit_CDateTime(valueSpecification: V1_CDateTime): T;
|
|
61
63
|
visit_CStrictDate(valueSpecification: V1_CStrictDate): T;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import type { V1_ValueSpecificationVisitor } from '../V1_ValueSpecification.js';
|
|
18
|
+
import { V1_PrimitiveValueSpecification } from './V1_PrimitiveValueSpecification.js';
|
|
19
|
+
|
|
20
|
+
export class V1_CByteArray extends V1_PrimitiveValueSpecification {
|
|
21
|
+
value!: string; // the Base64String transformed from byte[] by Jackson
|
|
22
|
+
|
|
23
|
+
accept_ValueSpecificationVisitor<T>(
|
|
24
|
+
visitor: V1_ValueSpecificationVisitor<T>,
|
|
25
|
+
): T {
|
|
26
|
+
return visitor.visit_CByteArray(this);
|
|
27
|
+
}
|
|
28
|
+
}
|
package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.ts
CHANGED
|
@@ -158,31 +158,15 @@ import { FlatDataAssociationImplementation } from '../../../../../../../graph/me
|
|
|
158
158
|
import { V1_FlatDataAssociationMapping } from '../../../model/packageableElements/store/flatData/mapping/V1_FlatDataAssociationMapping.js';
|
|
159
159
|
import type { FlatDataAssociationPropertyMapping } from '../../../../../../../graph/metamodel/pure/packageableElements/store/flatData/mapping/FlatDataAssociationPropertyMapping.js';
|
|
160
160
|
import { V1_FlatDataAssociationPropertyMapping } from '../../../model/packageableElements/store/flatData/mapping/V1_FlatDataAssociationPropertyMapping.js';
|
|
161
|
-
import {
|
|
162
|
-
V1_MappingDataTest,
|
|
163
|
-
V1_MappingQueryTest,
|
|
164
|
-
type V1_MappingTest,
|
|
165
|
-
} from '../../../model/packageableElements/mapping/V1_MappingTest.js';
|
|
161
|
+
import { V1_MappingTest } from '../../../model/packageableElements/mapping/V1_MappingTest.js';
|
|
166
162
|
import {
|
|
167
163
|
V1_transformAtomicTest,
|
|
168
164
|
V1_transformTestAssertion,
|
|
169
165
|
V1_transformTestSuite,
|
|
170
166
|
} from './V1_TestTransformer.js';
|
|
171
|
-
import {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
MappingQueryTest,
|
|
175
|
-
} from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/MappingTest.js';
|
|
176
|
-
import {
|
|
177
|
-
MappingDataTestSuite,
|
|
178
|
-
MappingQueryTestSuite,
|
|
179
|
-
type MappingTestSuite,
|
|
180
|
-
} from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/MappingTestSuite.js';
|
|
181
|
-
import {
|
|
182
|
-
type V1_MappingTestSuite,
|
|
183
|
-
V1_MappingDataTestSuite,
|
|
184
|
-
V1_MappingQueryTestSuite,
|
|
185
|
-
} from '../../../model/packageableElements/mapping/V1_MappingTestSuite.js';
|
|
167
|
+
import type { MappingTest } from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/MappingTest.js';
|
|
168
|
+
import { type MappingTestSuite } from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/MappingTestSuite.js';
|
|
169
|
+
import { V1_MappingTestSuite } from '../../../model/packageableElements/mapping/V1_MappingTestSuite.js';
|
|
186
170
|
import type { StoreTestData } from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/MappingStoreTestData.js';
|
|
187
171
|
import { V1_MappingStoreTestData } from '../../../model/packageableElements/mapping/V1_MappingStoreTestData.js';
|
|
188
172
|
import { V1_transformEmbeddedData } from './V1_DataElementTransformer.js';
|
|
@@ -378,27 +362,11 @@ const transformMappingStoreTestData = (
|
|
|
378
362
|
return testData;
|
|
379
363
|
};
|
|
380
364
|
|
|
381
|
-
export const
|
|
382
|
-
element:
|
|
383
|
-
context: V1_GraphTransformerContext,
|
|
384
|
-
): V1_MappingQueryTest => {
|
|
385
|
-
const mappingTest = new V1_MappingQueryTest();
|
|
386
|
-
mappingTest.id = element.id;
|
|
387
|
-
mappingTest.doc = element.doc;
|
|
388
|
-
mappingTest.assertions = element.assertions.map((assertion) =>
|
|
389
|
-
V1_transformTestAssertion(assertion),
|
|
390
|
-
);
|
|
391
|
-
mappingTest.func = element.func.accept_RawValueSpecificationVisitor(
|
|
392
|
-
new V1_RawValueSpecificationTransformer(context),
|
|
393
|
-
) as V1_RawLambda;
|
|
394
|
-
return mappingTest;
|
|
395
|
-
};
|
|
396
|
-
|
|
397
|
-
export const V1_transformMappingDataTest = (
|
|
398
|
-
element: MappingDataTest,
|
|
365
|
+
export const V1_transformMappingTest = (
|
|
366
|
+
element: MappingTest,
|
|
399
367
|
context: V1_GraphTransformerContext,
|
|
400
|
-
):
|
|
401
|
-
const mappingTest = new
|
|
368
|
+
): V1_MappingTest => {
|
|
369
|
+
const mappingTest = new V1_MappingTest();
|
|
402
370
|
mappingTest.id = element.id;
|
|
403
371
|
mappingTest.doc = element.doc;
|
|
404
372
|
mappingTest.assertions = element.assertions.map((assertion) =>
|
|
@@ -410,39 +378,11 @@ export const V1_transformMappingDataTest = (
|
|
|
410
378
|
return mappingTest;
|
|
411
379
|
};
|
|
412
380
|
|
|
413
|
-
export const
|
|
414
|
-
element:
|
|
415
|
-
context: V1_GraphTransformerContext,
|
|
416
|
-
): V1_MappingTest => {
|
|
417
|
-
if (element instanceof MappingQueryTest) {
|
|
418
|
-
return V1_transformMappingQueryTest(element, context);
|
|
419
|
-
} else if (element instanceof MappingDataTest) {
|
|
420
|
-
return V1_transformMappingDataTest(element, context);
|
|
421
|
-
}
|
|
422
|
-
throw new UnsupportedOperationError('Unsupported mapping test');
|
|
423
|
-
};
|
|
424
|
-
|
|
425
|
-
export const V1_transformMappingDataTestSuite = (
|
|
426
|
-
element: MappingDataTestSuite,
|
|
427
|
-
context: V1_GraphTransformerContext,
|
|
428
|
-
): V1_MappingDataTestSuite => {
|
|
429
|
-
const mappingTestSuite = new V1_MappingDataTestSuite();
|
|
430
|
-
mappingTestSuite.id = element.id;
|
|
431
|
-
mappingTestSuite.doc = element.doc;
|
|
432
|
-
mappingTestSuite.storeTestData = element.storeTestData.map((testData) =>
|
|
433
|
-
transformMappingStoreTestData(testData, context),
|
|
434
|
-
);
|
|
435
|
-
mappingTestSuite.tests = element.tests.map((test) =>
|
|
436
|
-
V1_transformAtomicTest(test, context),
|
|
437
|
-
);
|
|
438
|
-
return mappingTestSuite;
|
|
439
|
-
};
|
|
440
|
-
|
|
441
|
-
export const V1_transformMappingQueryTestSuite = (
|
|
442
|
-
element: MappingQueryTestSuite,
|
|
381
|
+
export const V1_transformMappingTestSuite = (
|
|
382
|
+
element: MappingTestSuite,
|
|
443
383
|
context: V1_GraphTransformerContext,
|
|
444
|
-
):
|
|
445
|
-
const mappingTestSuite = new
|
|
384
|
+
): V1_MappingTestSuite => {
|
|
385
|
+
const mappingTestSuite = new V1_MappingTestSuite();
|
|
446
386
|
mappingTestSuite.id = element.id;
|
|
447
387
|
mappingTestSuite.doc = element.doc;
|
|
448
388
|
mappingTestSuite.func = element.func.accept_RawValueSpecificationVisitor(
|
|
@@ -454,20 +394,7 @@ export const V1_transformMappingQueryTestSuite = (
|
|
|
454
394
|
return mappingTestSuite;
|
|
455
395
|
};
|
|
456
396
|
|
|
457
|
-
export const V1_transformMappingTestSuite = (
|
|
458
|
-
element: MappingTestSuite,
|
|
459
|
-
context: V1_GraphTransformerContext,
|
|
460
|
-
): V1_MappingTestSuite => {
|
|
461
|
-
if (element instanceof MappingDataTestSuite) {
|
|
462
|
-
return V1_transformMappingDataTestSuite(element, context);
|
|
463
|
-
} else if (element instanceof MappingQueryTestSuite) {
|
|
464
|
-
return V1_transformMappingQueryTestSuite(element, context);
|
|
465
|
-
}
|
|
466
|
-
throw new UnsupportedOperationError('Unsupported mapping test suite');
|
|
467
|
-
};
|
|
468
|
-
|
|
469
397
|
// Include Mapping
|
|
470
|
-
|
|
471
398
|
const transformMappingInclude = (
|
|
472
399
|
element: MappingInclude,
|
|
473
400
|
context: V1_GraphTransformerContext,
|
|
@@ -85,6 +85,7 @@ import { V1_GenericTypeInstance } from '../../../model/valueSpecification/raw/V1
|
|
|
85
85
|
import { V1_ClassInstance } from '../../../model/valueSpecification/raw/V1_ClassInstance.js';
|
|
86
86
|
import { V1_ClassInstanceType } from '../../pureProtocol/serializationHelpers/V1_ValueSpecificationSerializer.js';
|
|
87
87
|
import type { KeyExpressionInstanceValue } from '../../../../../../../graph/metamodel/pure/valueSpecification/KeyExpressionInstanceValue.js';
|
|
88
|
+
import { V1_CByteArray } from '../../../model/valueSpecification/raw/V1_CByteArray.js';
|
|
88
89
|
|
|
89
90
|
class V1_ValueSpecificationTransformer
|
|
90
91
|
implements ValueSpecificationVisitor<V1_ValueSpecification>
|
|
@@ -292,6 +293,11 @@ class V1_ValueSpecificationTransformer
|
|
|
292
293
|
cBoolean.value = guaranteeIsBoolean(valueSpecification.values[0]);
|
|
293
294
|
return cBoolean;
|
|
294
295
|
}
|
|
296
|
+
case PRIMITIVE_TYPE.BYTE: {
|
|
297
|
+
const cByteArray = new V1_CByteArray();
|
|
298
|
+
cByteArray.value = guaranteeIsString(valueSpecification.values[0]);
|
|
299
|
+
return cByteArray;
|
|
300
|
+
}
|
|
295
301
|
// since we don't have a corresponding protocol for abstract type `Date`, we will default to use `DateTime`
|
|
296
302
|
case PRIMITIVE_TYPE.DATE:
|
|
297
303
|
case PRIMITIVE_TYPE.DATETIME: {
|
|
@@ -80,27 +80,11 @@ import {
|
|
|
80
80
|
import { getRelationalInputType } from '../../../../../../../../graph/helpers/STO_Relational_Helper.js';
|
|
81
81
|
import { getEnumValue } from '../../../../../../../../graph/helpers/DomainHelper.js';
|
|
82
82
|
import { PrimitiveType } from '../../../../../../../../graph/metamodel/pure/packageableElements/domain/PrimitiveType.js';
|
|
83
|
-
import {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
type V1_MappingTestSuite,
|
|
87
|
-
} from '../../../../model/packageableElements/mapping/V1_MappingTestSuite.js';
|
|
88
|
-
import {
|
|
89
|
-
MappingDataTestSuite,
|
|
90
|
-
MappingQueryTestSuite,
|
|
91
|
-
type MappingTestSuite,
|
|
92
|
-
} from '../../../../../../../../graph/metamodel/pure/packageableElements/mapping/MappingTestSuite.js';
|
|
93
|
-
import {
|
|
94
|
-
V1_MappingDataTest,
|
|
95
|
-
V1_MappingQueryTest,
|
|
96
|
-
type V1_MappingTest,
|
|
97
|
-
} from '../../../../model/packageableElements/mapping/V1_MappingTest.js';
|
|
83
|
+
import { type V1_MappingTestSuite } from '../../../../model/packageableElements/mapping/V1_MappingTestSuite.js';
|
|
84
|
+
import { MappingTestSuite } from '../../../../../../../../graph/metamodel/pure/packageableElements/mapping/MappingTestSuite.js';
|
|
85
|
+
import { V1_MappingTest } from '../../../../model/packageableElements/mapping/V1_MappingTest.js';
|
|
98
86
|
import type { TestSuite } from '../../../../../../../../graph/metamodel/pure/test/Test.js';
|
|
99
|
-
import {
|
|
100
|
-
MappingDataTest,
|
|
101
|
-
MappingQueryTest,
|
|
102
|
-
type MappingTest,
|
|
103
|
-
} from '../../../../../../../../graph/metamodel/pure/packageableElements/mapping/MappingTest.js';
|
|
87
|
+
import { MappingTest } from '../../../../../../../../graph/metamodel/pure/packageableElements/mapping/MappingTest.js';
|
|
104
88
|
import { V1_buildTestAssertion } from './V1_TestBuilderHelper.js';
|
|
105
89
|
import type { V1_MappingStoreTestData } from '../../../../model/packageableElements/mapping/V1_MappingStoreTestData.js';
|
|
106
90
|
import { StoreTestData } from '../../../../../../../../graph/metamodel/pure/packageableElements/mapping/MappingStoreTestData.js';
|
|
@@ -273,32 +257,12 @@ const buildMappingStoreTestData = (
|
|
|
273
257
|
return mappingStoreTestData;
|
|
274
258
|
};
|
|
275
259
|
|
|
276
|
-
export const
|
|
277
|
-
element:
|
|
278
|
-
parentSuite: TestSuite,
|
|
279
|
-
context: V1_GraphBuilderContext,
|
|
280
|
-
): MappingQueryTest => {
|
|
281
|
-
const mappingTest = new MappingQueryTest();
|
|
282
|
-
mappingTest.id = element.id;
|
|
283
|
-
mappingTest.doc = element.doc;
|
|
284
|
-
mappingTest.__parent = parentSuite;
|
|
285
|
-
mappingTest.assertions = element.assertions.map((assertion) =>
|
|
286
|
-
V1_buildTestAssertion(assertion, mappingTest, context),
|
|
287
|
-
);
|
|
288
|
-
mappingTest.func = V1_buildRawLambdaWithResolvedPaths(
|
|
289
|
-
element.func.parameters,
|
|
290
|
-
element.func.body,
|
|
291
|
-
context,
|
|
292
|
-
);
|
|
293
|
-
return mappingTest;
|
|
294
|
-
};
|
|
295
|
-
|
|
296
|
-
export const V1_buildMappingDataTest = (
|
|
297
|
-
element: V1_MappingDataTest,
|
|
260
|
+
export const V1_buildMappingTest = (
|
|
261
|
+
element: V1_MappingTest,
|
|
298
262
|
parentSuite: TestSuite,
|
|
299
263
|
context: V1_GraphBuilderContext,
|
|
300
|
-
):
|
|
301
|
-
const mappingTest = new
|
|
264
|
+
): MappingTest => {
|
|
265
|
+
const mappingTest = new MappingTest();
|
|
302
266
|
mappingTest.id = element.id;
|
|
303
267
|
mappingTest.__parent = parentSuite;
|
|
304
268
|
mappingTest.doc = element.doc;
|
|
@@ -311,65 +275,28 @@ export const V1_buildMappingDataTest = (
|
|
|
311
275
|
return mappingTest;
|
|
312
276
|
};
|
|
313
277
|
|
|
314
|
-
export const
|
|
315
|
-
element:
|
|
316
|
-
parentSuite: TestSuite,
|
|
317
|
-
context: V1_GraphBuilderContext,
|
|
318
|
-
): MappingTest => {
|
|
319
|
-
if (element instanceof V1_MappingDataTest) {
|
|
320
|
-
return V1_buildMappingDataTest(element, parentSuite, context);
|
|
321
|
-
} else if (element instanceof V1_MappingQueryTest) {
|
|
322
|
-
return V1_buildMappingQueryTest(element, parentSuite, context);
|
|
323
|
-
}
|
|
324
|
-
throw new UnsupportedOperationError(
|
|
325
|
-
'Unable to build mapping test: Unsupported mapping test type',
|
|
326
|
-
);
|
|
327
|
-
};
|
|
328
|
-
|
|
329
|
-
const V1_buildMappingDataTestSuite = (
|
|
330
|
-
element: V1_MappingDataTestSuite,
|
|
331
|
-
context: V1_GraphBuilderContext,
|
|
332
|
-
): MappingDataTestSuite => {
|
|
333
|
-
const mappingTestSuite = new MappingDataTestSuite();
|
|
334
|
-
mappingTestSuite.id = element.id;
|
|
335
|
-
mappingTestSuite.storeTestData = element.storeTestData.map((testData) =>
|
|
336
|
-
buildMappingStoreTestData(testData, context),
|
|
337
|
-
);
|
|
338
|
-
mappingTestSuite.tests = element.tests.map((test) =>
|
|
339
|
-
V1_buildMappingTest(test, mappingTestSuite, context),
|
|
340
|
-
);
|
|
341
|
-
return mappingTestSuite;
|
|
342
|
-
};
|
|
343
|
-
|
|
344
|
-
const V1_buildMappingQueryTestSuite = (
|
|
345
|
-
element: V1_MappingQueryTestSuite,
|
|
278
|
+
export const V1_buildMappingTestSuite = (
|
|
279
|
+
element: V1_MappingTestSuite,
|
|
346
280
|
context: V1_GraphBuilderContext,
|
|
347
|
-
):
|
|
348
|
-
const mappingTestSuite = new
|
|
281
|
+
): MappingTestSuite => {
|
|
282
|
+
const mappingTestSuite = new MappingTestSuite();
|
|
349
283
|
mappingTestSuite.id = element.id;
|
|
350
284
|
mappingTestSuite.func = V1_buildRawLambdaWithResolvedPaths(
|
|
351
285
|
element.func.parameters,
|
|
352
286
|
element.func.body,
|
|
353
287
|
context,
|
|
354
288
|
);
|
|
355
|
-
mappingTestSuite.tests = element.tests.map((test) =>
|
|
356
|
-
|
|
357
|
-
|
|
289
|
+
mappingTestSuite.tests = element.tests.map((test) => {
|
|
290
|
+
if (test instanceof V1_MappingTest) {
|
|
291
|
+
return V1_buildMappingTest(test, mappingTestSuite, context);
|
|
292
|
+
}
|
|
293
|
+
throw new UnsupportedOperationError(
|
|
294
|
+
'Unable to build mapping test: Unsupported mapping test type',
|
|
295
|
+
);
|
|
296
|
+
});
|
|
358
297
|
return mappingTestSuite;
|
|
359
298
|
};
|
|
360
299
|
|
|
361
|
-
export const V1_buildMappingTestSuite = (
|
|
362
|
-
element: V1_MappingTestSuite,
|
|
363
|
-
context: V1_GraphBuilderContext,
|
|
364
|
-
): MappingTestSuite => {
|
|
365
|
-
if (element instanceof V1_MappingDataTestSuite) {
|
|
366
|
-
return V1_buildMappingDataTestSuite(element, context);
|
|
367
|
-
} else if (element instanceof V1_MappingQueryTestSuite) {
|
|
368
|
-
return V1_buildMappingQueryTestSuite(element, context);
|
|
369
|
-
}
|
|
370
|
-
throw new UnsupportedOperationError('Unsupported mapping test suite type');
|
|
371
|
-
};
|
|
372
|
-
|
|
373
300
|
const V1_buildMappingTestInputData = (
|
|
374
301
|
inputData: V1_DEPRECATED__InputData,
|
|
375
302
|
context: V1_GraphBuilderContext,
|
|
@@ -72,6 +72,7 @@ import type { V1_GraphFetchTree } from '../../../../model/valueSpecification/raw
|
|
|
72
72
|
import type { V1_AppliedFunction } from '../../../../model/valueSpecification/application/V1_AppliedFunction.js';
|
|
73
73
|
import type { V1_AppliedProperty } from '../../../../model/valueSpecification/application/V1_AppliedProperty.js';
|
|
74
74
|
import type { V1_CBoolean } from '../../../../model/valueSpecification/raw/V1_CBoolean.js';
|
|
75
|
+
import type { V1_CByteArray } from '../../../../model/valueSpecification/raw/V1_CByteArray.js';
|
|
75
76
|
import type { V1_CDateTime } from '../../../../model/valueSpecification/raw/V1_CDateTime.js';
|
|
76
77
|
import type { V1_CStrictTime } from '../../../../model/valueSpecification/raw/V1_CStrictTime.js';
|
|
77
78
|
import type { V1_CDecimal } from '../../../../model/valueSpecification/raw/V1_CDecimal.js';
|
|
@@ -364,6 +365,16 @@ export class V1_ValueSpecificationBuilder
|
|
|
364
365
|
);
|
|
365
366
|
}
|
|
366
367
|
|
|
368
|
+
visit_CByteArray(valueSpecification: V1_CByteArray): ValueSpecification {
|
|
369
|
+
const res = buildPrimtiveInstanceValue(
|
|
370
|
+
PRIMITIVE_TYPE.BYTE,
|
|
371
|
+
[valueSpecification.value], // Store a Base64String as the value for BYTE
|
|
372
|
+
this.context,
|
|
373
|
+
);
|
|
374
|
+
|
|
375
|
+
return res;
|
|
376
|
+
}
|
|
377
|
+
|
|
367
378
|
visit_CFloat(valueSpecification: V1_CFloat): ValueSpecification {
|
|
368
379
|
return buildPrimtiveInstanceValue(
|
|
369
380
|
PRIMITIVE_TYPE.FLOAT,
|
|
@@ -73,6 +73,7 @@ import type { V1_GraphBuilderContext } from '../V1_GraphBuilderContext.js';
|
|
|
73
73
|
import type { V1_GenericTypeInstance } from '../../../../model/valueSpecification/raw/V1_GenericTypeInstance.js';
|
|
74
74
|
import type { V1_ClassInstance } from '../../../../model/valueSpecification/raw/V1_ClassInstance.js';
|
|
75
75
|
import type { V1_GraphFetchTree } from '../../../../model/valueSpecification/raw/classInstance/graph/V1_GraphFetchTree.js';
|
|
76
|
+
import type { V1_CByteArray } from '../../../../model/valueSpecification/raw/V1_CByteArray.js';
|
|
76
77
|
|
|
77
78
|
class V1_ValueSpecificationPathResolver
|
|
78
79
|
implements V1_ValueSpecificationVisitor<V1_ValueSpecification>
|
|
@@ -193,6 +194,10 @@ class V1_ValueSpecificationPathResolver
|
|
|
193
194
|
return spec;
|
|
194
195
|
}
|
|
195
196
|
|
|
197
|
+
visit_CByteArray(spec: V1_CByteArray): V1_ValueSpecification {
|
|
198
|
+
return spec;
|
|
199
|
+
}
|
|
200
|
+
|
|
196
201
|
visit_CFloat(spec: V1_CFloat): V1_ValueSpecification {
|
|
197
202
|
return spec;
|
|
198
203
|
}
|
|
@@ -292,10 +297,10 @@ function V1_resolveClassInstanceValueElementPaths(
|
|
|
292
297
|
} else if (spec instanceof V1_TDSColumnInformation) {
|
|
293
298
|
spec.columnFn.accept_ValueSpecificationVisitor(resolver);
|
|
294
299
|
return spec;
|
|
295
|
-
} else if (
|
|
296
|
-
spec
|
|
297
|
-
|
|
298
|
-
|
|
300
|
+
} else if (
|
|
301
|
+
spec instanceof V1_TDSOlapAggregation ||
|
|
302
|
+
spec instanceof V1_TDSOlapRank
|
|
303
|
+
) {
|
|
299
304
|
spec.function.accept_ValueSpecificationVisitor(resolver);
|
|
300
305
|
return spec;
|
|
301
306
|
} else if (spec instanceof V1_TDSSortInformation) {
|