@finos/legend-graph 20.1.6 → 21.0.0
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/DSL_Mapping_Exports.d.ts +2 -0
- package/lib/DSL_Mapping_Exports.d.ts.map +1 -1
- package/lib/DSL_Mapping_Exports.js +2 -0
- package/lib/DSL_Mapping_Exports.js.map +1 -1
- package/lib/graph/BasicModel.d.ts.map +1 -1
- package/lib/graph/BasicModel.js +1 -5
- package/lib/graph/BasicModel.js.map +1 -1
- package/lib/graph/Core_HashUtils.d.ts +3 -0
- package/lib/graph/Core_HashUtils.d.ts.map +1 -1
- package/lib/graph/Core_HashUtils.js +3 -0
- package/lib/graph/Core_HashUtils.js.map +1 -1
- package/lib/graph/MetaModelConst.d.ts +4 -0
- package/lib/graph/MetaModelConst.d.ts.map +1 -1
- package/lib/graph/MetaModelConst.js +5 -0
- package/lib/graph/MetaModelConst.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/fileGeneration/ConfigurationProperty.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/fileGeneration/ConfigurationProperty.js +4 -2
- package/lib/graph/metamodel/pure/packageableElements/fileGeneration/ConfigurationProperty.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/mapping/DEPRECATED__MappingTest.d.ts +38 -0
- package/lib/graph/metamodel/pure/packageableElements/mapping/DEPRECATED__MappingTest.d.ts.map +1 -0
- package/lib/graph/metamodel/pure/packageableElements/mapping/DEPRECATED__MappingTest.js +49 -0
- package/lib/graph/metamodel/pure/packageableElements/mapping/DEPRECATED__MappingTest.js.map +1 -0
- package/lib/graph/metamodel/pure/packageableElements/mapping/Mapping.d.ts +6 -3
- package/lib/graph/metamodel/pure/packageableElements/mapping/Mapping.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/mapping/Mapping.js +3 -1
- package/lib/graph/metamodel/pure/packageableElements/mapping/Mapping.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/mapping/MappingTest.d.ts +2 -13
- package/lib/graph/metamodel/pure/packageableElements/mapping/MappingTest.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/mapping/MappingTest.js +5 -20
- package/lib/graph/metamodel/pure/packageableElements/mapping/MappingTest.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/mapping/MappingTestSuite.d.ts +23 -0
- package/lib/graph/metamodel/pure/packageableElements/mapping/MappingTestSuite.d.ts.map +1 -0
- package/lib/graph/metamodel/pure/packageableElements/mapping/MappingTestSuite.js +30 -0
- package/lib/graph/metamodel/pure/packageableElements/mapping/MappingTestSuite.js.map +1 -0
- package/lib/graph/metamodel/pure/packageableElements/mapping/StoreTestData.d.ts +25 -0
- package/lib/graph/metamodel/pure/packageableElements/mapping/StoreTestData.d.ts.map +1 -0
- package/lib/graph/metamodel/pure/packageableElements/mapping/StoreTestData.js +29 -0
- package/lib/graph/metamodel/pure/packageableElements/mapping/StoreTestData.js.map +1 -0
- package/lib/graph/metamodel/pure/packageableElements/service/ServiceTest.d.ts +1 -0
- package/lib/graph/metamodel/pure/packageableElements/service/ServiceTest.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/service/ServiceTest.js +2 -0
- package/lib/graph/metamodel/pure/packageableElements/service/ServiceTest.js.map +1 -1
- package/lib/graphManager/action/changeDetection/DSL_Mapping_ObserverHelper.d.ts +8 -2
- package/lib/graphManager/action/changeDetection/DSL_Mapping_ObserverHelper.d.ts.map +1 -1
- package/lib/graphManager/action/changeDetection/DSL_Mapping_ObserverHelper.js +37 -2
- package/lib/graphManager/action/changeDetection/DSL_Mapping_ObserverHelper.js.map +1 -1
- package/lib/graphManager/action/changeDetection/DSL_Service_ObserverHelper.d.ts.map +1 -1
- package/lib/graphManager/action/changeDetection/DSL_Service_ObserverHelper.js +1 -0
- package/lib/graphManager/action/changeDetection/DSL_Service_ObserverHelper.js.map +1 -1
- package/lib/graphManager/action/changeDetection/Testable_ObserverHelper.d.ts.map +1 -1
- package/lib/graphManager/action/changeDetection/Testable_ObserverHelper.js +9 -0
- package/lib/graphManager/action/changeDetection/Testable_ObserverHelper.js.map +1 -1
- package/lib/graphManager/action/validation/DSL_Mapping_ValidationHelper.d.ts +2 -2
- package/lib/graphManager/action/validation/DSL_Mapping_ValidationHelper.d.ts.map +1 -1
- package/lib/graphManager/action/validation/DSL_Mapping_ValidationHelper.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/fileGeneration/V1_ConfigurationProperty.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/fileGeneration/V1_ConfigurationProperty.js +4 -2
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/fileGeneration/V1_ConfigurationProperty.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_DEPRECATED__MappingTest.d.ts +32 -0
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_DEPRECATED__MappingTest.d.ts.map +1 -0
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_DEPRECATED__MappingTest.js +38 -0
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_DEPRECATED__MappingTest.js.map +1 -0
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_Mapping.d.ts +4 -2
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_Mapping.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_Mapping.js +2 -0
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_Mapping.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTest.d.ts +3 -12
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTest.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTest.js +4 -12
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTest.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTestSuite.d.ts +23 -0
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTestSuite.d.ts.map +1 -0
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTestSuite.js +30 -0
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTestSuite.js.map +1 -0
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_StoreTestData.d.ts +23 -0
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_StoreTestData.d.ts.map +1 -0
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_StoreTestData.js +29 -0
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_StoreTestData.js.map +1 -0
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/service/V1_ServiceTest.d.ts +1 -0
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/service/V1_ServiceTest.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/service/V1_ServiceTest.js +2 -0
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/service/V1_ServiceTest.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.d.ts +6 -0
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.js +30 -4
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_ServiceTransformer.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_ServiceTransformer.js +1 -0
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_ServiceTransformer.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_TestTransformer.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_TestTransformer.js +9 -0
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_TestTransformer.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFourthPassBuilder.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFourthPassBuilder.js +8 -3
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFourthPassBuilder.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_MappingBuilderHelper.d.ts +10 -3
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_MappingBuilderHelper.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_MappingBuilderHelper.js +38 -4
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_MappingBuilderHelper.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ServiceBuilderHelper.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ServiceBuilderHelper.js +1 -0
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ServiceBuilderHelper.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_TestBuilderHelper.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_TestBuilderHelper.js +5 -0
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_TestBuilderHelper.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.d.ts +6 -0
- package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.js +30 -4
- package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ServiceSerializationHelper.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ServiceSerializationHelper.js +4 -2
- package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ServiceSerializationHelper.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TestSerializationHelper.d.ts +2 -4
- package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TestSerializationHelper.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TestSerializationHelper.js +16 -5
- package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TestSerializationHelper.js.map +1 -1
- package/lib/package.json +1 -1
- package/package.json +4 -4
- package/src/DSL_Mapping_Exports.ts +2 -0
- package/src/graph/BasicModel.ts +1 -5
- package/src/graph/Core_HashUtils.ts +3 -0
- package/src/graph/MetaModelConst.ts +5 -0
- package/src/graph/metamodel/pure/packageableElements/fileGeneration/ConfigurationProperty.ts +10 -2
- package/src/graph/metamodel/pure/packageableElements/mapping/DEPRECATED__MappingTest.ts +61 -0
- package/src/graph/metamodel/pure/packageableElements/mapping/Mapping.ts +8 -4
- package/src/graph/metamodel/pure/packageableElements/mapping/MappingTest.ts +6 -30
- package/src/graph/metamodel/pure/packageableElements/mapping/MappingTestSuite.ts +33 -0
- package/src/graph/metamodel/pure/packageableElements/mapping/StoreTestData.ts +34 -0
- package/src/graph/metamodel/pure/packageableElements/service/ServiceTest.ts +2 -0
- package/src/graphManager/action/changeDetection/DSL_Mapping_ObserverHelper.ts +66 -5
- package/src/graphManager/action/changeDetection/DSL_Service_ObserverHelper.ts +1 -0
- package/src/graphManager/action/changeDetection/Testable_ObserverHelper.ts +10 -0
- package/src/graphManager/action/validation/DSL_Mapping_ValidationHelper.ts +2 -2
- package/src/graphManager/protocol/pure/v1/model/packageableElements/fileGeneration/V1_ConfigurationProperty.ts +10 -2
- package/src/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_DEPRECATED__MappingTest.ts +43 -0
- package/src/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_Mapping.ts +5 -2
- package/src/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTest.ts +5 -15
- package/src/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTestSuite.ts +33 -0
- package/src/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_StoreTestData.ts +32 -0
- package/src/graphManager/protocol/pure/v1/model/packageableElements/service/V1_ServiceTest.ts +2 -0
- package/src/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.ts +63 -8
- package/src/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_ServiceTransformer.ts +1 -0
- package/src/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_TestTransformer.ts +10 -0
- package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFourthPassBuilder.ts +9 -4
- package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_MappingBuilderHelper.ts +80 -7
- package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ServiceBuilderHelper.ts +1 -0
- package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_TestBuilderHelper.ts +4 -0
- package/src/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.ts +85 -12
- package/src/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ServiceSerializationHelper.ts +3 -2
- package/src/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TestSerializationHelper.ts +17 -5
- package/tsconfig.json +6 -0
|
@@ -0,0 +1,33 @@
|
|
|
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 { hashArray, type Hashable } from '@finos/legend-shared';
|
|
18
|
+
import { CORE_HASH_STRUCTURE } from '../../../../../graph/Core_HashUtils.js';
|
|
19
|
+
import { TestSuite } from '../../test/Test.js';
|
|
20
|
+
import type { StoreTestData } from './StoreTestData.js';
|
|
21
|
+
|
|
22
|
+
export class MappingTestSuite extends TestSuite implements Hashable {
|
|
23
|
+
storeTestDatas: StoreTestData[] = [];
|
|
24
|
+
|
|
25
|
+
get hashCode(): string {
|
|
26
|
+
return hashArray([
|
|
27
|
+
CORE_HASH_STRUCTURE.MAPPING_TEST_SUITE,
|
|
28
|
+
hashArray(this.storeTestDatas),
|
|
29
|
+
this.id,
|
|
30
|
+
hashArray(this.tests),
|
|
31
|
+
]);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
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 { hashArray, type Hashable } from '@finos/legend-shared';
|
|
18
|
+
import { CORE_HASH_STRUCTURE } from '../../../../../graph/Core_HashUtils.js';
|
|
19
|
+
import type { EmbeddedData } from '../../data/EmbeddedData.js';
|
|
20
|
+
import type { PackageableElementReference } from '../PackageableElementReference.js';
|
|
21
|
+
import type { Store } from '../store/Store.js';
|
|
22
|
+
|
|
23
|
+
export class StoreTestData implements Hashable {
|
|
24
|
+
store!: PackageableElementReference<Store>;
|
|
25
|
+
data!: EmbeddedData;
|
|
26
|
+
|
|
27
|
+
get hashCode(): string {
|
|
28
|
+
return hashArray([
|
|
29
|
+
CORE_HASH_STRUCTURE.STORE_TEST_DATA,
|
|
30
|
+
this.store.valueForSerialization ?? '',
|
|
31
|
+
this.data,
|
|
32
|
+
]);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -22,6 +22,7 @@ import type { ParameterValue } from './ParameterValue.js';
|
|
|
22
22
|
export class ServiceTest extends AtomicTest implements Hashable {
|
|
23
23
|
serializationFormat: string | undefined;
|
|
24
24
|
parameters: ParameterValue[] = [];
|
|
25
|
+
keys: string[] = [];
|
|
25
26
|
|
|
26
27
|
get hashCode(): string {
|
|
27
28
|
return hashArray([
|
|
@@ -29,6 +30,7 @@ export class ServiceTest extends AtomicTest implements Hashable {
|
|
|
29
30
|
this.id,
|
|
30
31
|
hashArray(this.assertions),
|
|
31
32
|
hashArray(this.parameters),
|
|
33
|
+
hashArray(this.keys),
|
|
32
34
|
this.serializationFormat ?? '',
|
|
33
35
|
]);
|
|
34
36
|
}
|
|
@@ -39,7 +39,7 @@ import type { LocalMappingPropertyInfo } from '../../../graph/metamodel/pure/pac
|
|
|
39
39
|
import type { Mapping } from '../../../graph/metamodel/pure/packageableElements/mapping/Mapping.js';
|
|
40
40
|
import type { MappingClass } from '../../../graph/metamodel/pure/packageableElements/mapping/MappingClass.js';
|
|
41
41
|
import type { MappingInclude } from '../../../graph/metamodel/pure/packageableElements/mapping/MappingInclude.js';
|
|
42
|
-
import type {
|
|
42
|
+
import type { DEPRECATED__MappingTest } from '../../../graph/metamodel/pure/packageableElements/mapping/DEPRECATED__MappingTest.js';
|
|
43
43
|
import type { MappingTestAssert } from '../../../graph/metamodel/pure/packageableElements/mapping/MappingTestAssert.js';
|
|
44
44
|
import type { MergeOperationSetImplementation } from '../../../graph/metamodel/pure/packageableElements/mapping/MergeOperationSetImplementation.js';
|
|
45
45
|
import type { OperationSetImplementation } from '../../../graph/metamodel/pure/packageableElements/mapping/OperationSetImplementation.js';
|
|
@@ -116,6 +116,15 @@ import {
|
|
|
116
116
|
observe_RootRelationalInstanceSetImplementation,
|
|
117
117
|
} from './STO_Relational_ObserverHelper.js';
|
|
118
118
|
import type { FlatDataAssociationPropertyMapping } from '../../../graph/metamodel/pure/packageableElements/store/flatData/mapping/FlatDataAssociationPropertyMapping.js';
|
|
119
|
+
import type { MappingTest } from '../../../graph/metamodel/pure/packageableElements/mapping/MappingTest.js';
|
|
120
|
+
import {
|
|
121
|
+
observe_AtomicTest,
|
|
122
|
+
observe_TestAssertion,
|
|
123
|
+
observe_TestSuite,
|
|
124
|
+
} from './Testable_ObserverHelper.js';
|
|
125
|
+
import type { MappingTestSuite } from '../../../graph/metamodel/pure/packageableElements/mapping/MappingTestSuite.js';
|
|
126
|
+
import type { StoreTestData } from '../../../graph/metamodel/pure/packageableElements/mapping/StoreTestData.js';
|
|
127
|
+
import { observe_EmbeddedData } from './DSL_Data_ObserverHelper.js';
|
|
119
128
|
|
|
120
129
|
// ------------------------------------- Store -------------------------------------
|
|
121
130
|
|
|
@@ -129,6 +138,55 @@ export const observe_Abstract_Store = (metamodel: Store): void => {
|
|
|
129
138
|
metamodel.includes.forEach(observe_PackageableElementReference);
|
|
130
139
|
};
|
|
131
140
|
|
|
141
|
+
// ------------------------------------- TestSuite -----------------------------------
|
|
142
|
+
|
|
143
|
+
export const observe_StoreTestData = skipObservedWithContext(
|
|
144
|
+
(metamodel: StoreTestData, context: ObserverContext): StoreTestData => {
|
|
145
|
+
makeObservable(metamodel, {
|
|
146
|
+
store: observable,
|
|
147
|
+
data: observable,
|
|
148
|
+
hashCode: computed,
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
observe_EmbeddedData(metamodel.data, context);
|
|
152
|
+
|
|
153
|
+
return metamodel;
|
|
154
|
+
},
|
|
155
|
+
);
|
|
156
|
+
|
|
157
|
+
export const observe_MappingTest = skipObserved(
|
|
158
|
+
(metamodel: MappingTest): MappingTest => {
|
|
159
|
+
makeObservable(metamodel, {
|
|
160
|
+
id: observable,
|
|
161
|
+
query: observable,
|
|
162
|
+
assertions: observable,
|
|
163
|
+
hashCode: computed,
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
metamodel.assertions.forEach(observe_TestAssertion);
|
|
167
|
+
|
|
168
|
+
return metamodel;
|
|
169
|
+
},
|
|
170
|
+
);
|
|
171
|
+
|
|
172
|
+
export const observe_MappingTestSuite = skipObservedWithContext(
|
|
173
|
+
(metamodel: MappingTestSuite, context: ObserverContext): MappingTestSuite => {
|
|
174
|
+
makeObservable(metamodel, {
|
|
175
|
+
id: observable,
|
|
176
|
+
tests: observable,
|
|
177
|
+
storeTestDatas: observable,
|
|
178
|
+
hashCode: computed,
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
metamodel.tests.forEach((test) => observe_AtomicTest(test, context));
|
|
182
|
+
metamodel.storeTestDatas.forEach((testData) =>
|
|
183
|
+
observe_StoreTestData(testData, context),
|
|
184
|
+
);
|
|
185
|
+
|
|
186
|
+
return metamodel;
|
|
187
|
+
},
|
|
188
|
+
);
|
|
189
|
+
|
|
132
190
|
// ------------------------------------- Mapping -------------------------------------
|
|
133
191
|
|
|
134
192
|
export const observe_EnumerationMappingReference = skipObserved(
|
|
@@ -699,8 +757,8 @@ export const observe_MappingTestAssert = (
|
|
|
699
757
|
return metamodel;
|
|
700
758
|
};
|
|
701
759
|
|
|
702
|
-
export const
|
|
703
|
-
(metamodel:
|
|
760
|
+
export const observe_MappingTest_Legacy = skipObservedWithContext(
|
|
761
|
+
(metamodel: DEPRECATED__MappingTest, context): DEPRECATED__MappingTest => {
|
|
704
762
|
makeObservable(metamodel, {
|
|
705
763
|
name: observable,
|
|
706
764
|
query: observable,
|
|
@@ -728,6 +786,7 @@ export const observe_Mapping = skipObservedWithContext(
|
|
|
728
786
|
classMappings: observable,
|
|
729
787
|
enumerationMappings: observable,
|
|
730
788
|
associationMappings: observable,
|
|
789
|
+
test: observable,
|
|
731
790
|
tests: observable,
|
|
732
791
|
_elementHashCode: override,
|
|
733
792
|
});
|
|
@@ -740,8 +799,10 @@ export const observe_Mapping = skipObservedWithContext(
|
|
|
740
799
|
metamodel.associationMappings.forEach((associationMapping) =>
|
|
741
800
|
observe_AssociationImplementation(associationMapping, context),
|
|
742
801
|
);
|
|
743
|
-
metamodel.
|
|
744
|
-
|
|
802
|
+
metamodel.test.forEach((t) => observe_MappingTest_Legacy(t, context));
|
|
803
|
+
metamodel.tests.forEach((testSuite) =>
|
|
804
|
+
observe_TestSuite(testSuite, context),
|
|
805
|
+
);
|
|
745
806
|
return metamodel;
|
|
746
807
|
},
|
|
747
808
|
);
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
import { computed, makeObservable, observable } from 'mobx';
|
|
18
18
|
import { ServiceTest } from '../../../DSL_Service_Exports.js';
|
|
19
|
+
import { MappingTest } from '../../../graph/metamodel/pure/packageableElements/mapping/MappingTest.js';
|
|
20
|
+
import { MappingTestSuite } from '../../../graph/metamodel/pure/packageableElements/mapping/MappingTestSuite.js';
|
|
19
21
|
import { ServiceTestSuite } from '../../../graph/metamodel/pure/packageableElements/service/ServiceTestSuite.js';
|
|
20
22
|
import { EqualTo } from '../../../graph/metamodel/pure/test/assertion/EqualTo.js';
|
|
21
23
|
import { EqualToJson } from '../../../graph/metamodel/pure/test/assertion/EqualToJson.js';
|
|
@@ -28,6 +30,10 @@ import type {
|
|
|
28
30
|
import type { Testable_PureGraphManagerPlugin_Extension } from '../../Testable_PureGraphManagerPlugin_Extension.js';
|
|
29
31
|
import { type ObserverContext, skipObserved } from './CoreObserverHelper.js';
|
|
30
32
|
import { observe_ExternalFormatData } from './DSL_Data_ObserverHelper.js';
|
|
33
|
+
import {
|
|
34
|
+
observe_MappingTest,
|
|
35
|
+
observe_MappingTestSuite,
|
|
36
|
+
} from './DSL_Mapping_ObserverHelper.js';
|
|
31
37
|
import {
|
|
32
38
|
observe_ServiceTest,
|
|
33
39
|
observe_ServiceTestSuite,
|
|
@@ -75,6 +81,8 @@ export function observe_AtomicTest(
|
|
|
75
81
|
): AtomicTest {
|
|
76
82
|
if (metamodel instanceof ServiceTest) {
|
|
77
83
|
return observe_ServiceTest(metamodel);
|
|
84
|
+
} else if (metamodel instanceof MappingTest) {
|
|
85
|
+
return observe_MappingTest(metamodel);
|
|
78
86
|
}
|
|
79
87
|
const extraAtomicTestBuilder = context.plugins.flatMap(
|
|
80
88
|
(plugin) =>
|
|
@@ -110,6 +118,8 @@ export function observe_TestSuite(
|
|
|
110
118
|
): TestSuite {
|
|
111
119
|
if (metamodel instanceof ServiceTestSuite) {
|
|
112
120
|
return observe_ServiceTestSuite(metamodel, context);
|
|
121
|
+
} else if (metamodel instanceof MappingTestSuite) {
|
|
122
|
+
return observe_MappingTestSuite(metamodel, context);
|
|
113
123
|
}
|
|
114
124
|
return metamodel;
|
|
115
125
|
}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import { fromGrammarString, isValidJSONString } from '@finos/legend-shared';
|
|
18
18
|
import { ExpectedOutputMappingTestAssert } from '../../../graph/metamodel/pure/packageableElements/mapping/ExpectedOutputMappingTestAssert.js';
|
|
19
19
|
import type { InputData } from '../../../graph/metamodel/pure/packageableElements/mapping/InputData.js';
|
|
20
|
-
import type {
|
|
20
|
+
import type { DEPRECATED__MappingTest } from '../../../graph/metamodel/pure/packageableElements/mapping/DEPRECATED__MappingTest.js';
|
|
21
21
|
import type { MappingTestAssert } from '../../../graph/metamodel/pure/packageableElements/mapping/MappingTestAssert.js';
|
|
22
22
|
import { FlatDataInputData } from '../../../graph/metamodel/pure/packageableElements/store/flatData/mapping/FlatDataInputData.js';
|
|
23
23
|
import {
|
|
@@ -88,7 +88,7 @@ export const DEPRECATED__validate_InputData = (
|
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
export const DEPRECATED__validate_MappingTest = (
|
|
91
|
-
metamodel:
|
|
91
|
+
metamodel: DEPRECATED__MappingTest,
|
|
92
92
|
): ValidationIssue[] | undefined => {
|
|
93
93
|
let problems: ValidationIssue[] = [];
|
|
94
94
|
// query
|
|
@@ -14,7 +14,13 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
hashArray,
|
|
19
|
+
hashObject,
|
|
20
|
+
hashUnknownValue,
|
|
21
|
+
isObject,
|
|
22
|
+
type Hashable,
|
|
23
|
+
} from '@finos/legend-shared';
|
|
18
24
|
import { CORE_HASH_STRUCTURE } from '../../../../../../../graph/Core_HashUtils.js';
|
|
19
25
|
|
|
20
26
|
export class V1_ConfigurationProperty implements Hashable {
|
|
@@ -25,7 +31,9 @@ export class V1_ConfigurationProperty implements Hashable {
|
|
|
25
31
|
return hashArray([
|
|
26
32
|
CORE_HASH_STRUCTURE.CONFIGURATION_PROPERTY,
|
|
27
33
|
this.name,
|
|
28
|
-
|
|
34
|
+
isObject(this.value)
|
|
35
|
+
? hashObject(this.value)
|
|
36
|
+
: hashUnknownValue(this.value),
|
|
29
37
|
]);
|
|
30
38
|
}
|
|
31
39
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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 { hashArray, type Hashable } from '@finos/legend-shared';
|
|
18
|
+
import { CORE_HASH_STRUCTURE } from '../../../../../../../graph/Core_HashUtils.js';
|
|
19
|
+
import type { V1_RawLambda } from '../../rawValueSpecification/V1_RawLambda.js';
|
|
20
|
+
import type { V1_MappingTestAssert } from './V1_MappingTestAssert.js';
|
|
21
|
+
import type { V1_InputData } from './V1_InputData.js';
|
|
22
|
+
|
|
23
|
+
export class V1_DEPRECATED__MappingTest implements Hashable {
|
|
24
|
+
name!: string;
|
|
25
|
+
/**
|
|
26
|
+
* Studio does not process value specification, they are left in raw JSON form
|
|
27
|
+
*
|
|
28
|
+
* @discrepancy model
|
|
29
|
+
*/
|
|
30
|
+
query!: V1_RawLambda;
|
|
31
|
+
inputData: V1_InputData[] = [];
|
|
32
|
+
assert!: V1_MappingTestAssert;
|
|
33
|
+
|
|
34
|
+
get hashCode(): string {
|
|
35
|
+
return hashArray([
|
|
36
|
+
CORE_HASH_STRUCTURE.MAPPING_TEST_LEGACY,
|
|
37
|
+
this.name,
|
|
38
|
+
this.query,
|
|
39
|
+
hashArray(this.inputData),
|
|
40
|
+
this.assert,
|
|
41
|
+
]);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -24,14 +24,16 @@ import {
|
|
|
24
24
|
type V1_PackageableElementVisitor,
|
|
25
25
|
V1_PackageableElement,
|
|
26
26
|
} from '../../../model/packageableElements/V1_PackageableElement.js';
|
|
27
|
-
import type {
|
|
27
|
+
import type { V1_DEPRECATED__MappingTest } from './V1_DEPRECATED__MappingTest.js';
|
|
28
|
+
import type { V1_TestSuite } from '../../test/V1_TestSuite.js';
|
|
28
29
|
|
|
29
30
|
export class V1_Mapping extends V1_PackageableElement implements Hashable {
|
|
30
31
|
includedMappings: V1_MappingInclude[] = [];
|
|
31
32
|
enumerationMappings: V1_EnumerationMapping[] = [];
|
|
32
33
|
classMappings: V1_ClassMapping[] = [];
|
|
33
34
|
associationMappings: V1_AssociationMapping[] = [];
|
|
34
|
-
tests:
|
|
35
|
+
tests: V1_DEPRECATED__MappingTest[] = [];
|
|
36
|
+
testSuites: V1_TestSuite[] = [];
|
|
35
37
|
|
|
36
38
|
override get hashCode(): string {
|
|
37
39
|
return hashArray([
|
|
@@ -42,6 +44,7 @@ export class V1_Mapping extends V1_PackageableElement implements Hashable {
|
|
|
42
44
|
hashArray(this.associationMappings),
|
|
43
45
|
hashArray(this.tests),
|
|
44
46
|
hashArray(this.includedMappings),
|
|
47
|
+
hashArray(this.testSuites),
|
|
45
48
|
]);
|
|
46
49
|
}
|
|
47
50
|
|
package/src/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTest.ts
CHANGED
|
@@ -16,28 +16,18 @@
|
|
|
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 '
|
|
20
|
-
import
|
|
21
|
-
import type { V1_InputData } from './V1_InputData.js';
|
|
19
|
+
import type { V1_RawLambda } from '../../rawValueSpecification/V1_RawLambda.js';
|
|
20
|
+
import { V1_AtomicTest } from '../../test/V1_AtomicTest.js';
|
|
22
21
|
|
|
23
|
-
export class V1_MappingTest implements Hashable {
|
|
24
|
-
name!: string;
|
|
25
|
-
/**
|
|
26
|
-
* Studio does not process value specification, they are left in raw JSON form
|
|
27
|
-
*
|
|
28
|
-
* @discrepancy model
|
|
29
|
-
*/
|
|
22
|
+
export class V1_MappingTest extends V1_AtomicTest implements Hashable {
|
|
30
23
|
query!: V1_RawLambda;
|
|
31
|
-
inputData: V1_InputData[] = [];
|
|
32
|
-
assert!: V1_MappingTestAssert;
|
|
33
24
|
|
|
34
25
|
get hashCode(): string {
|
|
35
26
|
return hashArray([
|
|
36
27
|
CORE_HASH_STRUCTURE.MAPPING_TEST,
|
|
37
|
-
this.name,
|
|
38
28
|
this.query,
|
|
39
|
-
|
|
40
|
-
this.
|
|
29
|
+
this.id,
|
|
30
|
+
hashArray(this.assertions),
|
|
41
31
|
]);
|
|
42
32
|
}
|
|
43
33
|
}
|
package/src/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTestSuite.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
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 { hashArray, type Hashable } from '@finos/legend-shared';
|
|
18
|
+
import { CORE_HASH_STRUCTURE } from '../../../../../../../graph/Core_HashUtils.js';
|
|
19
|
+
import { V1_TestSuite } from '../../test/V1_TestSuite.js';
|
|
20
|
+
import type { V1_StoreTestData } from './V1_StoreTestData.js';
|
|
21
|
+
|
|
22
|
+
export class V1_MappingTestSuite extends V1_TestSuite implements Hashable {
|
|
23
|
+
storeTestDatas: V1_StoreTestData[] = [];
|
|
24
|
+
|
|
25
|
+
get hashCode(): string {
|
|
26
|
+
return hashArray([
|
|
27
|
+
CORE_HASH_STRUCTURE.MAPPING_TEST_SUITE,
|
|
28
|
+
hashArray(this.storeTestDatas),
|
|
29
|
+
this.id,
|
|
30
|
+
hashArray(this.tests),
|
|
31
|
+
]);
|
|
32
|
+
}
|
|
33
|
+
}
|
package/src/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_StoreTestData.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
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 { hashArray, type Hashable } from '@finos/legend-shared';
|
|
18
|
+
import { CORE_HASH_STRUCTURE } from '../../../../../../../graph/Core_HashUtils.js';
|
|
19
|
+
import type { V1_EmbeddedData } from '../../data/V1_EmbeddedData.js';
|
|
20
|
+
|
|
21
|
+
export class V1_StoreTestData implements Hashable {
|
|
22
|
+
store!: string;
|
|
23
|
+
data!: V1_EmbeddedData;
|
|
24
|
+
|
|
25
|
+
get hashCode(): string {
|
|
26
|
+
return hashArray([
|
|
27
|
+
CORE_HASH_STRUCTURE.STORE_TEST_DATA,
|
|
28
|
+
this.store,
|
|
29
|
+
this.data,
|
|
30
|
+
]);
|
|
31
|
+
}
|
|
32
|
+
}
|
package/src/graphManager/protocol/pure/v1/model/packageableElements/service/V1_ServiceTest.ts
CHANGED
|
@@ -22,6 +22,7 @@ import type { V1_ParameterValue } from './V1_ParameterValue.js';
|
|
|
22
22
|
export class V1_ServiceTest extends V1_AtomicTest implements Hashable {
|
|
23
23
|
serializationFormat: string | undefined;
|
|
24
24
|
parameters: V1_ParameterValue[] = [];
|
|
25
|
+
keys: string[] = [];
|
|
25
26
|
|
|
26
27
|
get hashCode(): string {
|
|
27
28
|
return hashArray([
|
|
@@ -29,6 +30,7 @@ export class V1_ServiceTest extends V1_AtomicTest implements Hashable {
|
|
|
29
30
|
this.id,
|
|
30
31
|
hashArray(this.assertions),
|
|
31
32
|
hashArray(this.parameters),
|
|
33
|
+
hashArray(this.keys),
|
|
32
34
|
this.serializationFormat ?? '',
|
|
33
35
|
]);
|
|
34
36
|
}
|
package/src/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.ts
CHANGED
|
@@ -58,7 +58,7 @@ import type { InlineEmbeddedRelationalInstanceSetImplementation } from '../../..
|
|
|
58
58
|
import type { OtherwiseEmbeddedRelationalInstanceSetImplementation } from '../../../../../../../graph/metamodel/pure/packageableElements/store/relational/mapping/OtherwiseEmbeddedRelationalInstanceSetImplementation.js';
|
|
59
59
|
import type { InferableMappingElementIdValue } from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/InferableMappingElementId.js';
|
|
60
60
|
import type { MappingInclude } from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/MappingInclude.js';
|
|
61
|
-
import type {
|
|
61
|
+
import type { DEPRECATED__MappingTest } from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/DEPRECATED__MappingTest.js';
|
|
62
62
|
import type { AssociationImplementation } from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/AssociationImplementation.js';
|
|
63
63
|
import { RelationalAssociationImplementation } from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/RelationalAssociationImplementation.js';
|
|
64
64
|
import type { PropertyReference } from '../../../../../../../graph/metamodel/pure/packageableElements/domain/PropertyReference.js';
|
|
@@ -93,7 +93,7 @@ import {
|
|
|
93
93
|
} from '../../../model/packageableElements/store/modelToModel/mapping/V1_ObjectInputData.js';
|
|
94
94
|
import { V1_FlatDataInputData } from '../../../model/packageableElements/store/flatData/mapping/V1_FlatDataInputData.js';
|
|
95
95
|
import { V1_ExpectedOutputMappingTestAssert } from '../../../model/packageableElements/mapping/V1_ExpectedOutputMappingTestAssert.js';
|
|
96
|
-
import {
|
|
96
|
+
import { V1_DEPRECATED__MappingTest } from '../../../model/packageableElements/mapping/V1_DEPRECATED__MappingTest.js';
|
|
97
97
|
import { V1_RawValueSpecificationTransformer } from './V1_RawValueSpecificationTransformer.js';
|
|
98
98
|
import { V1_MappingInclude } from '../../../model/packageableElements/mapping/V1_MappingInclude.js';
|
|
99
99
|
import { V1_EnumerationMapping } from '../../../model/packageableElements/mapping/V1_EnumerationMapping.js';
|
|
@@ -152,6 +152,18 @@ import { FlatDataAssociationImplementation } from '../../../../../../../graph/me
|
|
|
152
152
|
import { V1_FlatDataAssociationMapping } from '../../../model/packageableElements/store/flatData/mapping/V1_FlatDataAssociationMapping.js';
|
|
153
153
|
import type { FlatDataAssociationPropertyMapping } from '../../../../../../../graph/metamodel/pure/packageableElements/store/flatData/mapping/FlatDataAssociationPropertyMapping.js';
|
|
154
154
|
import { V1_FlatDataAssociationPropertyMapping } from '../../../model/packageableElements/store/flatData/mapping/V1_FlatDataAssociationPropertyMapping.js';
|
|
155
|
+
import { V1_MappingTest } from '../../../model/packageableElements/mapping/V1_MappingTest.js';
|
|
156
|
+
import {
|
|
157
|
+
V1_transformAtomicTest,
|
|
158
|
+
V1_transformTestAssertion,
|
|
159
|
+
V1_transformTestSuite,
|
|
160
|
+
} from './V1_TestTransformer.js';
|
|
161
|
+
import type { MappingTest } from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/MappingTest.js';
|
|
162
|
+
import type { MappingTestSuite } from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/MappingTestSuite.js';
|
|
163
|
+
import { V1_MappingTestSuite } from '../../../model/packageableElements/mapping/V1_MappingTestSuite.js';
|
|
164
|
+
import type { StoreTestData } from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/StoreTestData.js';
|
|
165
|
+
import { V1_StoreTestData } from '../../../model/packageableElements/mapping/V1_StoreTestData.js';
|
|
166
|
+
import { V1_transformEmbeddedData } from './V1_DataElementTransformer.js';
|
|
155
167
|
|
|
156
168
|
export const V1_transformPropertyReference = (
|
|
157
169
|
element: PropertyReference,
|
|
@@ -310,11 +322,11 @@ const transformTestAssert = (
|
|
|
310
322
|
);
|
|
311
323
|
};
|
|
312
324
|
|
|
313
|
-
const
|
|
314
|
-
element:
|
|
325
|
+
const transformMappingTestLegacy = (
|
|
326
|
+
element: DEPRECATED__MappingTest,
|
|
315
327
|
context: V1_GraphTransformerContext,
|
|
316
|
-
):
|
|
317
|
-
const test = new
|
|
328
|
+
): V1_DEPRECATED__MappingTest => {
|
|
329
|
+
const test = new V1_DEPRECATED__MappingTest();
|
|
318
330
|
test.assert = transformTestAssert(element.assert);
|
|
319
331
|
test.inputData = element.inputData.map(transformMappingTestInputData);
|
|
320
332
|
test.name = element.name;
|
|
@@ -324,6 +336,46 @@ const transformMappingTest = (
|
|
|
324
336
|
return test;
|
|
325
337
|
};
|
|
326
338
|
|
|
339
|
+
const transformStoreTestData = (
|
|
340
|
+
element: StoreTestData,
|
|
341
|
+
context: V1_GraphTransformerContext,
|
|
342
|
+
): V1_StoreTestData => {
|
|
343
|
+
const testData = new V1_StoreTestData();
|
|
344
|
+
testData.data = V1_transformEmbeddedData(element.data, context);
|
|
345
|
+
testData.store = element.store.valueForSerialization ?? '';
|
|
346
|
+
return testData;
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
export const V1_transformMappingTest = (
|
|
350
|
+
element: MappingTest,
|
|
351
|
+
context: V1_GraphTransformerContext,
|
|
352
|
+
): V1_MappingTest => {
|
|
353
|
+
const mappingTest = new V1_MappingTest();
|
|
354
|
+
mappingTest.id = element.id;
|
|
355
|
+
mappingTest.assertions = element.assertions.map((assertion) =>
|
|
356
|
+
V1_transformTestAssertion(assertion),
|
|
357
|
+
);
|
|
358
|
+
mappingTest.query = element.query.accept_RawValueSpecificationVisitor(
|
|
359
|
+
new V1_RawValueSpecificationTransformer(context),
|
|
360
|
+
) as V1_RawLambda;
|
|
361
|
+
return mappingTest;
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
export const V1_transformMappingTestSuite = (
|
|
365
|
+
element: MappingTestSuite,
|
|
366
|
+
context: V1_GraphTransformerContext,
|
|
367
|
+
): V1_MappingTestSuite => {
|
|
368
|
+
const mappingTestSuite = new V1_MappingTestSuite();
|
|
369
|
+
mappingTestSuite.id = element.id;
|
|
370
|
+
mappingTestSuite.storeTestDatas = element.storeTestDatas.map((testData) =>
|
|
371
|
+
transformStoreTestData(testData, context),
|
|
372
|
+
);
|
|
373
|
+
mappingTestSuite.tests = element.tests.map((test) =>
|
|
374
|
+
V1_transformAtomicTest(test, context),
|
|
375
|
+
);
|
|
376
|
+
return mappingTestSuite;
|
|
377
|
+
};
|
|
378
|
+
|
|
327
379
|
// Include Mapping
|
|
328
380
|
|
|
329
381
|
const transformMappingInclude = (
|
|
@@ -1269,8 +1321,11 @@ export const V1_transformMapping = (
|
|
|
1269
1321
|
(associationMapping) =>
|
|
1270
1322
|
transformAssociationImplementation(associationMapping, context),
|
|
1271
1323
|
);
|
|
1272
|
-
mapping.tests = element.
|
|
1273
|
-
|
|
1324
|
+
mapping.tests = element.test.map((test) =>
|
|
1325
|
+
transformMappingTestLegacy(test, context),
|
|
1326
|
+
);
|
|
1327
|
+
mapping.testSuites = element.tests.map((testSuite) =>
|
|
1328
|
+
V1_transformTestSuite(testSuite, context),
|
|
1274
1329
|
);
|
|
1275
1330
|
return mapping;
|
|
1276
1331
|
};
|
package/src/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_ServiceTransformer.ts
CHANGED
|
@@ -109,6 +109,7 @@ export const V1_transformServiceTest = (
|
|
|
109
109
|
serviceTest.parameters = element.parameters.map((parameter) =>
|
|
110
110
|
V1_transformParameterValue(parameter),
|
|
111
111
|
);
|
|
112
|
+
serviceTest.keys = element.keys;
|
|
112
113
|
serviceTest.assertions = element.assertions.map((assertion) =>
|
|
113
114
|
V1_transformTestAssertion(assertion),
|
|
114
115
|
);
|
package/src/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_TestTransformer.ts
CHANGED
|
@@ -38,6 +38,12 @@ import type {
|
|
|
38
38
|
import { EqualToTDS } from '../../../../../../../graph/metamodel/pure/test/assertion/EqualToTDS.js';
|
|
39
39
|
import { V1_EqualToTDS } from '../../../model/test/assertion/V1_EqualToTDS.js';
|
|
40
40
|
import type { Testable_PureProtocolProcessorPlugin_Extension } from '../../../../Testable_PureProtocolProcessorPlugin_Extension.js';
|
|
41
|
+
import {
|
|
42
|
+
V1_transformMappingTest,
|
|
43
|
+
V1_transformMappingTestSuite,
|
|
44
|
+
} from './V1_MappingTransformer.js';
|
|
45
|
+
import { MappingTestSuite } from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/MappingTestSuite.js';
|
|
46
|
+
import { MappingTest } from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/MappingTest.js';
|
|
41
47
|
|
|
42
48
|
const transformEqualTo = (element: EqualTo): V1_EqualTo => {
|
|
43
49
|
const equalTo = new V1_EqualTo();
|
|
@@ -66,6 +72,8 @@ export const V1_transformAtomicTest = (
|
|
|
66
72
|
): V1_AtomicTest => {
|
|
67
73
|
if (value instanceof ServiceTest) {
|
|
68
74
|
return V1_transformServiceTest(value);
|
|
75
|
+
} else if (value instanceof MappingTest) {
|
|
76
|
+
return V1_transformMappingTest(value, context);
|
|
69
77
|
}
|
|
70
78
|
|
|
71
79
|
const extraAtomicTestTransformers = context.plugins.flatMap(
|
|
@@ -106,6 +114,8 @@ export const V1_transformTestSuite = (
|
|
|
106
114
|
): V1_TestSuite => {
|
|
107
115
|
if (value instanceof ServiceTestSuite) {
|
|
108
116
|
return V1_transformServiceTestSuite(value, context);
|
|
117
|
+
} else if (value instanceof MappingTestSuite) {
|
|
118
|
+
return V1_transformMappingTestSuite(value, context);
|
|
109
119
|
}
|
|
110
120
|
throw new UnsupportedOperationError(`Can't transform test suite`, value);
|
|
111
121
|
};
|