@itwin/core-backend 5.9.0-dev.4 → 5.9.0-dev.6
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/cjs/BackendHubAccess.js.map +1 -1
- package/lib/cjs/BackendLoggerCategory.js.map +1 -1
- package/lib/cjs/BisCoreSchema.js.map +1 -1
- package/lib/cjs/BlobContainerService.js.map +1 -1
- package/lib/cjs/BriefcaseManager.js +3 -3
- package/lib/cjs/BriefcaseManager.js.map +1 -1
- package/lib/cjs/CatalogDb.js.map +1 -1
- package/lib/cjs/Category.d.ts +37 -7
- package/lib/cjs/Category.d.ts.map +1 -1
- package/lib/cjs/Category.js +33 -42
- package/lib/cjs/Category.js.map +1 -1
- package/lib/cjs/ChangeSummaryManager.js +2 -2
- package/lib/cjs/ChangeSummaryManager.js.map +1 -1
- package/lib/cjs/ChangedElementsDb.js.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.js +253 -250
- package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
- package/lib/cjs/ChannelControl.d.ts +29 -0
- package/lib/cjs/ChannelControl.d.ts.map +1 -1
- package/lib/cjs/ChannelControl.js.map +1 -1
- package/lib/cjs/CheckpointManager.js +1 -1
- package/lib/cjs/CheckpointManager.js.map +1 -1
- package/lib/cjs/ClassRegistry.js +5 -5
- package/lib/cjs/ClassRegistry.js.map +1 -1
- package/lib/cjs/CloudSqlite.js.map +1 -1
- package/lib/cjs/CodeService.js.map +1 -1
- package/lib/cjs/CodeSpecs.d.ts +32 -3
- package/lib/cjs/CodeSpecs.d.ts.map +1 -1
- package/lib/cjs/CodeSpecs.js +48 -20
- package/lib/cjs/CodeSpecs.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
- package/lib/cjs/DevTools.js.map +1 -1
- package/lib/cjs/DisplayStyle.d.ts +18 -3
- package/lib/cjs/DisplayStyle.d.ts.map +1 -1
- package/lib/cjs/DisplayStyle.js +10 -21
- package/lib/cjs/DisplayStyle.js.map +1 -1
- package/lib/cjs/ECDb.js.map +1 -1
- package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
- package/lib/cjs/ECSqlRowExecutor.js.map +1 -1
- package/lib/cjs/ECSqlStatement.js.map +1 -1
- package/lib/cjs/ECSqlSyncReader.js.map +1 -1
- package/lib/cjs/EditTxn.d.ts +262 -0
- package/lib/cjs/EditTxn.d.ts.map +1 -0
- package/lib/cjs/EditTxn.js +548 -0
- package/lib/cjs/EditTxn.js.map +1 -0
- package/lib/cjs/Element.d.ts +74 -5
- package/lib/cjs/Element.d.ts.map +1 -1
- package/lib/cjs/Element.js +63 -75
- package/lib/cjs/Element.js.map +1 -1
- package/lib/cjs/ElementAspect.d.ts +10 -0
- package/lib/cjs/ElementAspect.d.ts.map +1 -1
- package/lib/cjs/ElementAspect.js +21 -12
- package/lib/cjs/ElementAspect.js.map +1 -1
- package/lib/cjs/ElementGraphics.js.map +1 -1
- package/lib/cjs/ElementTreeWalker.d.ts +56 -3
- package/lib/cjs/ElementTreeWalker.d.ts.map +1 -1
- package/lib/cjs/ElementTreeWalker.js +53 -40
- package/lib/cjs/ElementTreeWalker.js.map +1 -1
- package/lib/cjs/Entity.js.map +1 -1
- package/lib/cjs/EntityReferences.js.map +1 -1
- package/lib/cjs/ExportGraphics.js.map +1 -1
- package/lib/cjs/ExternalSource.d.ts +11 -2
- package/lib/cjs/ExternalSource.d.ts.map +1 -1
- package/lib/cjs/ExternalSource.js +10 -8
- package/lib/cjs/ExternalSource.js.map +1 -1
- package/lib/cjs/FontFile.js.map +1 -1
- package/lib/cjs/GeoCoordConfig.js.map +1 -1
- package/lib/cjs/GeographicCRSServices.js.map +1 -1
- package/lib/cjs/GeometrySummary.js +47 -47
- package/lib/cjs/GeometrySummary.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +66 -22
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +182 -296
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/IModelDbFonts.js.map +1 -1
- package/lib/cjs/IModelElementCloneContext.js.map +1 -1
- package/lib/cjs/IModelHost.d.ts +22 -0
- package/lib/cjs/IModelHost.d.ts.map +1 -1
- package/lib/cjs/IModelHost.js +9 -0
- package/lib/cjs/IModelHost.js.map +1 -1
- package/lib/cjs/IModelIncrementalSchemaLocater.js.map +1 -1
- package/lib/cjs/IModelJsFs.js.map +1 -1
- package/lib/cjs/ImageSourceConversion.js.map +1 -1
- package/lib/cjs/IpcHost.js +2 -2
- package/lib/cjs/IpcHost.js.map +1 -1
- package/lib/cjs/LineStyle.d.ts +47 -7
- package/lib/cjs/LineStyle.d.ts.map +1 -1
- package/lib/cjs/LineStyle.js +38 -33
- package/lib/cjs/LineStyle.js.map +1 -1
- package/lib/cjs/LocalHub.js +1 -1
- package/lib/cjs/LocalHub.js.map +1 -1
- package/lib/cjs/LocalhostIpcHost.js.map +1 -1
- package/lib/cjs/LockControl.js.map +1 -1
- package/lib/cjs/Material.d.ts +8 -1
- package/lib/cjs/Material.d.ts.map +1 -1
- package/lib/cjs/Material.js +6 -12
- package/lib/cjs/Material.js.map +1 -1
- package/lib/cjs/Model.d.ts +59 -20
- package/lib/cjs/Model.d.ts.map +1 -1
- package/lib/cjs/Model.js +38 -80
- package/lib/cjs/Model.js.map +1 -1
- package/lib/cjs/NativeAppStorage.js.map +1 -1
- package/lib/cjs/NativeHost.js.map +1 -1
- package/lib/cjs/NavigationRelationship.js.map +1 -1
- package/lib/cjs/PromiseMemoizer.js.map +1 -1
- package/lib/cjs/PropertyStore.js.map +1 -1
- package/lib/cjs/Relationship.d.ts +72 -7
- package/lib/cjs/Relationship.d.ts.map +1 -1
- package/lib/cjs/Relationship.js +39 -21
- package/lib/cjs/Relationship.js.map +1 -1
- package/lib/cjs/RpcBackend.js.map +1 -1
- package/lib/cjs/SQLiteDb.js.map +1 -1
- package/lib/cjs/Schema.js.map +1 -1
- package/lib/cjs/SchemaSync.js +4 -4
- package/lib/cjs/SchemaSync.js.map +1 -1
- package/lib/cjs/SchemaUtils.js.map +1 -1
- package/lib/cjs/SheetIndex.d.ts +9 -0
- package/lib/cjs/SheetIndex.d.ts.map +1 -1
- package/lib/cjs/SheetIndex.js +38 -35
- package/lib/cjs/SheetIndex.js.map +1 -1
- package/lib/cjs/SqliteChangesetReader.js.map +1 -1
- package/lib/cjs/SqliteStatement.js.map +1 -1
- package/lib/cjs/StashManager.js +1 -1
- package/lib/cjs/StashManager.js.map +1 -1
- package/lib/cjs/Texture.d.ts +6 -0
- package/lib/cjs/Texture.d.ts.map +1 -1
- package/lib/cjs/Texture.js +6 -14
- package/lib/cjs/Texture.js.map +1 -1
- package/lib/cjs/TileStorage.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts +5 -5
- package/lib/cjs/TxnManager.d.ts.map +1 -1
- package/lib/cjs/TxnManager.js +23 -7
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/cjs/ViewDefinition.d.ts +21 -1
- package/lib/cjs/ViewDefinition.d.ts.map +1 -1
- package/lib/cjs/ViewDefinition.js +27 -66
- package/lib/cjs/ViewDefinition.js.map +1 -1
- package/lib/cjs/ViewStateHydrator.js.map +1 -1
- package/lib/cjs/ViewStore.js.map +1 -1
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts +14 -6
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -1
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.js +33 -27
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.js.map +1 -1
- package/lib/cjs/annotations/FrameGeometry.js.map +1 -1
- package/lib/cjs/annotations/LeaderGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.d.ts.map +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.js +6 -5
- package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/cjs/annotations/TextAnnotationGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextBlockGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextBlockLayout.js.map +1 -1
- package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
- package/lib/cjs/assets/Settings/Schemas/Base.Schema.json +32 -32
- package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +27 -27
- package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +94 -94
- package/lib/cjs/assets/Settings/backend.setting.json5 +21 -21
- package/lib/cjs/core-backend.d.ts +1 -0
- package/lib/cjs/core-backend.d.ts.map +1 -1
- package/lib/cjs/core-backend.js +1 -0
- package/lib/cjs/core-backend.js.map +1 -1
- package/lib/cjs/domains/FunctionalElements.d.ts +6 -2
- package/lib/cjs/domains/FunctionalElements.d.ts.map +1 -1
- package/lib/cjs/domains/FunctionalElements.js +8 -13
- package/lib/cjs/domains/FunctionalElements.js.map +1 -1
- package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
- package/lib/cjs/domains/GenericElements.d.ts +11 -4
- package/lib/cjs/domains/GenericElements.d.ts.map +1 -1
- package/lib/cjs/domains/GenericElements.js +13 -24
- package/lib/cjs/domains/GenericElements.js.map +1 -1
- package/lib/cjs/domains/GenericSchema.js.map +1 -1
- package/lib/cjs/internal/ChangesetConflictArgs.js.map +1 -1
- package/lib/cjs/internal/ChannelAdmin.d.ts +15 -0
- package/lib/cjs/internal/ChannelAdmin.d.ts.map +1 -1
- package/lib/cjs/internal/ChannelAdmin.js +5 -3
- package/lib/cjs/internal/ChannelAdmin.js.map +1 -1
- package/lib/cjs/internal/ElementLRUCache.js.map +1 -1
- package/lib/cjs/internal/FontFileImpl.js.map +1 -1
- package/lib/cjs/internal/HubMock.js.map +1 -1
- package/lib/cjs/internal/IModelDbFontsImpl.js.map +1 -1
- package/lib/cjs/internal/IntegrityCheck.js.map +1 -1
- package/lib/cjs/internal/NativePlatform.js.map +1 -1
- package/lib/cjs/internal/NoLocks.js.map +1 -1
- package/lib/cjs/internal/OnlineStatus.js.map +1 -1
- package/lib/cjs/internal/ServerBasedLocks.js.map +1 -1
- package/lib/cjs/internal/Symbols.d.ts +4 -0
- package/lib/cjs/internal/Symbols.d.ts.map +1 -1
- package/lib/cjs/internal/Symbols.js +5 -1
- package/lib/cjs/internal/Symbols.js.map +1 -1
- package/lib/cjs/internal/annotations/fields.d.ts +3 -2
- package/lib/cjs/internal/annotations/fields.d.ts.map +1 -1
- package/lib/cjs/internal/annotations/fields.js +7 -6
- package/lib/cjs/internal/annotations/fields.js.map +1 -1
- package/lib/cjs/internal/cross-package.js.map +1 -1
- package/lib/cjs/internal/workspace/SettingsEditorImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/SettingsImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/SettingsSchemasImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
- package/lib/cjs/rpc/multipart.js.map +1 -1
- package/lib/cjs/rpc/tracing.js.map +1 -1
- package/lib/cjs/rpc/web/logging.js.map +1 -1
- package/lib/cjs/rpc/web/request.js.map +1 -1
- package/lib/cjs/rpc/web/response.js.map +1 -1
- package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts.map +1 -1
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
- package/lib/cjs/workspace/Settings.js.map +1 -1
- package/lib/cjs/workspace/SettingsDb.js.map +1 -1
- package/lib/cjs/workspace/SettingsEditor.js.map +1 -1
- package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
- package/lib/cjs/workspace/Workspace.js.map +1 -1
- package/lib/cjs/workspace/WorkspaceEditor.js.map +1 -1
- package/lib/esm/BackendHubAccess.js.map +1 -1
- package/lib/esm/BackendLoggerCategory.js.map +1 -1
- package/lib/esm/BisCoreSchema.js.map +1 -1
- package/lib/esm/BlobContainerService.js.map +1 -1
- package/lib/esm/BriefcaseManager.js +3 -3
- package/lib/esm/BriefcaseManager.js.map +1 -1
- package/lib/esm/CatalogDb.js.map +1 -1
- package/lib/esm/Category.d.ts +37 -7
- package/lib/esm/Category.d.ts.map +1 -1
- package/lib/esm/Category.js +33 -42
- package/lib/esm/Category.js.map +1 -1
- package/lib/esm/ChangeSummaryManager.js +2 -2
- package/lib/esm/ChangeSummaryManager.js.map +1 -1
- package/lib/esm/ChangedElementsDb.js.map +1 -1
- package/lib/esm/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/esm/ChangesetECAdaptor.js +253 -250
- package/lib/esm/ChangesetECAdaptor.js.map +1 -1
- package/lib/esm/ChannelControl.d.ts +29 -0
- package/lib/esm/ChannelControl.d.ts.map +1 -1
- package/lib/esm/ChannelControl.js.map +1 -1
- package/lib/esm/CheckpointManager.js +1 -1
- package/lib/esm/CheckpointManager.js.map +1 -1
- package/lib/esm/ClassRegistry.js +5 -5
- package/lib/esm/ClassRegistry.js.map +1 -1
- package/lib/esm/CloudSqlite.js.map +1 -1
- package/lib/esm/CodeService.js.map +1 -1
- package/lib/esm/CodeSpecs.d.ts +32 -3
- package/lib/esm/CodeSpecs.d.ts.map +1 -1
- package/lib/esm/CodeSpecs.js +49 -21
- package/lib/esm/CodeSpecs.js.map +1 -1
- package/lib/esm/ConcurrentQuery.js.map +1 -1
- package/lib/esm/CustomViewState3dCreator.js.map +1 -1
- package/lib/esm/DevTools.js.map +1 -1
- package/lib/esm/DisplayStyle.d.ts +18 -3
- package/lib/esm/DisplayStyle.d.ts.map +1 -1
- package/lib/esm/DisplayStyle.js +10 -21
- package/lib/esm/DisplayStyle.js.map +1 -1
- package/lib/esm/ECDb.js.map +1 -1
- package/lib/esm/ECSchemaXmlContext.js.map +1 -1
- package/lib/esm/ECSqlRowExecutor.js.map +1 -1
- package/lib/esm/ECSqlStatement.js.map +1 -1
- package/lib/esm/ECSqlSyncReader.js.map +1 -1
- package/lib/esm/EditTxn.d.ts +262 -0
- package/lib/esm/EditTxn.d.ts.map +1 -0
- package/lib/esm/EditTxn.js +543 -0
- package/lib/esm/EditTxn.js.map +1 -0
- package/lib/esm/Element.d.ts +74 -5
- package/lib/esm/Element.d.ts.map +1 -1
- package/lib/esm/Element.js +64 -76
- package/lib/esm/Element.js.map +1 -1
- package/lib/esm/ElementAspect.d.ts +10 -0
- package/lib/esm/ElementAspect.d.ts.map +1 -1
- package/lib/esm/ElementAspect.js +22 -13
- package/lib/esm/ElementAspect.js.map +1 -1
- package/lib/esm/ElementGraphics.js.map +1 -1
- package/lib/esm/ElementTreeWalker.d.ts +56 -3
- package/lib/esm/ElementTreeWalker.d.ts.map +1 -1
- package/lib/esm/ElementTreeWalker.js +53 -40
- package/lib/esm/ElementTreeWalker.js.map +1 -1
- package/lib/esm/Entity.js.map +1 -1
- package/lib/esm/EntityReferences.js.map +1 -1
- package/lib/esm/ExportGraphics.js.map +1 -1
- package/lib/esm/ExternalSource.d.ts +11 -2
- package/lib/esm/ExternalSource.d.ts.map +1 -1
- package/lib/esm/ExternalSource.js +10 -8
- package/lib/esm/ExternalSource.js.map +1 -1
- package/lib/esm/FontFile.js.map +1 -1
- package/lib/esm/GeoCoordConfig.js.map +1 -1
- package/lib/esm/GeographicCRSServices.js.map +1 -1
- package/lib/esm/GeometrySummary.js +47 -47
- package/lib/esm/GeometrySummary.js.map +1 -1
- package/lib/esm/IModelDb.d.ts +66 -22
- package/lib/esm/IModelDb.d.ts.map +1 -1
- package/lib/esm/IModelDb.js +184 -298
- package/lib/esm/IModelDb.js.map +1 -1
- package/lib/esm/IModelDbFonts.js.map +1 -1
- package/lib/esm/IModelElementCloneContext.js.map +1 -1
- package/lib/esm/IModelHost.d.ts +22 -0
- package/lib/esm/IModelHost.d.ts.map +1 -1
- package/lib/esm/IModelHost.js +9 -0
- package/lib/esm/IModelHost.js.map +1 -1
- package/lib/esm/IModelIncrementalSchemaLocater.js.map +1 -1
- package/lib/esm/IModelJsFs.js.map +1 -1
- package/lib/esm/ImageSourceConversion.js.map +1 -1
- package/lib/esm/IpcHost.js +3 -3
- package/lib/esm/IpcHost.js.map +1 -1
- package/lib/esm/LineStyle.d.ts +47 -7
- package/lib/esm/LineStyle.d.ts.map +1 -1
- package/lib/esm/LineStyle.js +38 -33
- package/lib/esm/LineStyle.js.map +1 -1
- package/lib/esm/LocalHub.js +1 -1
- package/lib/esm/LocalHub.js.map +1 -1
- package/lib/esm/LocalhostIpcHost.js.map +1 -1
- package/lib/esm/LockControl.js.map +1 -1
- package/lib/esm/Material.d.ts +8 -1
- package/lib/esm/Material.d.ts.map +1 -1
- package/lib/esm/Material.js +6 -12
- package/lib/esm/Material.js.map +1 -1
- package/lib/esm/Model.d.ts +59 -20
- package/lib/esm/Model.d.ts.map +1 -1
- package/lib/esm/Model.js +39 -81
- package/lib/esm/Model.js.map +1 -1
- package/lib/esm/NativeAppStorage.js.map +1 -1
- package/lib/esm/NativeHost.js.map +1 -1
- package/lib/esm/NavigationRelationship.js.map +1 -1
- package/lib/esm/PromiseMemoizer.js.map +1 -1
- package/lib/esm/PropertyStore.js.map +1 -1
- package/lib/esm/Relationship.d.ts +72 -7
- package/lib/esm/Relationship.d.ts.map +1 -1
- package/lib/esm/Relationship.js +40 -22
- package/lib/esm/Relationship.js.map +1 -1
- package/lib/esm/RpcBackend.js.map +1 -1
- package/lib/esm/SQLiteDb.js.map +1 -1
- package/lib/esm/Schema.js.map +1 -1
- package/lib/esm/SchemaSync.js +5 -5
- package/lib/esm/SchemaSync.js.map +1 -1
- package/lib/esm/SchemaUtils.js.map +1 -1
- package/lib/esm/SheetIndex.d.ts +9 -0
- package/lib/esm/SheetIndex.d.ts.map +1 -1
- package/lib/esm/SheetIndex.js +38 -35
- package/lib/esm/SheetIndex.js.map +1 -1
- package/lib/esm/SqliteChangesetReader.js.map +1 -1
- package/lib/esm/SqliteStatement.js.map +1 -1
- package/lib/esm/StashManager.js +1 -1
- package/lib/esm/StashManager.js.map +1 -1
- package/lib/esm/Texture.d.ts +6 -0
- package/lib/esm/Texture.d.ts.map +1 -1
- package/lib/esm/Texture.js +6 -14
- package/lib/esm/Texture.js.map +1 -1
- package/lib/esm/TileStorage.js.map +1 -1
- package/lib/esm/TxnManager.d.ts +5 -5
- package/lib/esm/TxnManager.d.ts.map +1 -1
- package/lib/esm/TxnManager.js +23 -7
- package/lib/esm/TxnManager.js.map +1 -1
- package/lib/esm/ViewDefinition.d.ts +21 -1
- package/lib/esm/ViewDefinition.d.ts.map +1 -1
- package/lib/esm/ViewDefinition.js +27 -66
- package/lib/esm/ViewDefinition.js.map +1 -1
- package/lib/esm/ViewStateHydrator.js.map +1 -1
- package/lib/esm/ViewStore.js.map +1 -1
- package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts +14 -6
- package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -1
- package/lib/esm/annotations/ElementDrivesTextAnnotation.js +33 -27
- package/lib/esm/annotations/ElementDrivesTextAnnotation.js.map +1 -1
- package/lib/esm/annotations/FrameGeometry.js.map +1 -1
- package/lib/esm/annotations/LeaderGeometry.js.map +1 -1
- package/lib/esm/annotations/TextAnnotationElement.d.ts.map +1 -1
- package/lib/esm/annotations/TextAnnotationElement.js +6 -5
- package/lib/esm/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/esm/annotations/TextAnnotationGeometry.js.map +1 -1
- package/lib/esm/annotations/TextBlockGeometry.js.map +1 -1
- package/lib/esm/annotations/TextBlockLayout.js.map +1 -1
- package/lib/esm/core-backend.d.ts +1 -0
- package/lib/esm/core-backend.d.ts.map +1 -1
- package/lib/esm/core-backend.js +1 -0
- package/lib/esm/core-backend.js.map +1 -1
- package/lib/esm/domains/FunctionalElements.d.ts +6 -2
- package/lib/esm/domains/FunctionalElements.d.ts.map +1 -1
- package/lib/esm/domains/FunctionalElements.js +8 -13
- package/lib/esm/domains/FunctionalElements.js.map +1 -1
- package/lib/esm/domains/FunctionalSchema.js.map +1 -1
- package/lib/esm/domains/GenericElements.d.ts +11 -4
- package/lib/esm/domains/GenericElements.d.ts.map +1 -1
- package/lib/esm/domains/GenericElements.js +13 -24
- package/lib/esm/domains/GenericElements.js.map +1 -1
- package/lib/esm/domains/GenericSchema.js.map +1 -1
- package/lib/esm/internal/ChangesetConflictArgs.js.map +1 -1
- package/lib/esm/internal/ChannelAdmin.d.ts +15 -0
- package/lib/esm/internal/ChannelAdmin.d.ts.map +1 -1
- package/lib/esm/internal/ChannelAdmin.js +6 -4
- package/lib/esm/internal/ChannelAdmin.js.map +1 -1
- package/lib/esm/internal/ElementLRUCache.js.map +1 -1
- package/lib/esm/internal/FontFileImpl.js.map +1 -1
- package/lib/esm/internal/HubMock.js.map +1 -1
- package/lib/esm/internal/IModelDbFontsImpl.js.map +1 -1
- package/lib/esm/internal/IntegrityCheck.js.map +1 -1
- package/lib/esm/internal/NativePlatform.js.map +1 -1
- package/lib/esm/internal/NoLocks.js.map +1 -1
- package/lib/esm/internal/OnlineStatus.js.map +1 -1
- package/lib/esm/internal/ServerBasedLocks.js.map +1 -1
- package/lib/esm/internal/Symbols.d.ts +4 -0
- package/lib/esm/internal/Symbols.d.ts.map +1 -1
- package/lib/esm/internal/Symbols.js +4 -0
- package/lib/esm/internal/Symbols.js.map +1 -1
- package/lib/esm/internal/annotations/fields.d.ts +3 -2
- package/lib/esm/internal/annotations/fields.d.ts.map +1 -1
- package/lib/esm/internal/annotations/fields.js +7 -6
- package/lib/esm/internal/annotations/fields.js.map +1 -1
- package/lib/esm/internal/cross-package.js.map +1 -1
- package/lib/esm/internal/workspace/SettingsEditorImpl.js.map +1 -1
- package/lib/esm/internal/workspace/SettingsImpl.js.map +1 -1
- package/lib/esm/internal/workspace/SettingsSchemasImpl.js.map +1 -1
- package/lib/esm/internal/workspace/WorkspaceImpl.js.map +1 -1
- package/lib/esm/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
- package/lib/esm/rpc/multipart.js.map +1 -1
- package/lib/esm/rpc/tracing.js.map +1 -1
- package/lib/esm/rpc/web/logging.js.map +1 -1
- package/lib/esm/rpc/web/request.js.map +1 -1
- package/lib/esm/rpc/web/response.js.map +1 -1
- package/lib/esm/rpc-impl/DevToolsRpcImpl.js.map +1 -1
- package/lib/esm/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/esm/rpc-impl/IModelTileRpcImpl.js.map +1 -1
- package/lib/esm/rpc-impl/RpcBriefcaseUtility.d.ts.map +1 -1
- package/lib/esm/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
- package/lib/esm/test/AdvancedEqual.js.map +1 -1
- package/lib/esm/test/AnnotationTestUtils.js.map +1 -1
- package/lib/esm/test/AttachDb.test.js +11 -11
- package/lib/esm/test/AttachDb.test.js.map +1 -1
- package/lib/esm/test/ElementDrivesElement.test.d.ts +20 -19
- package/lib/esm/test/ElementDrivesElement.test.d.ts.map +1 -1
- package/lib/esm/test/ElementDrivesElement.test.js +134 -119
- package/lib/esm/test/ElementDrivesElement.test.js.map +1 -1
- package/lib/esm/test/ElementLRUCache.test.js.map +1 -1
- package/lib/esm/test/GeometryTestUtil.js.map +1 -1
- package/lib/esm/test/IModelHost.test.js +56 -2
- package/lib/esm/test/IModelHost.test.js.map +1 -1
- package/lib/esm/test/IModelTestUtils.d.ts +23 -23
- package/lib/esm/test/IModelTestUtils.d.ts.map +1 -1
- package/lib/esm/test/IModelTestUtils.js +466 -449
- package/lib/esm/test/IModelTestUtils.js.map +1 -1
- package/lib/esm/test/ImageSourceConversion.test.js.map +1 -1
- package/lib/esm/test/IpcHost.test.js.map +1 -1
- package/lib/esm/test/KnownTestLocations.js.map +1 -1
- package/lib/esm/test/PrintElementTree.js.map +1 -1
- package/lib/esm/test/PropertyDb.test.js +2 -2
- package/lib/esm/test/PropertyDb.test.js.map +1 -1
- package/lib/esm/test/RevisionUtility.js.map +1 -1
- package/lib/esm/test/SchemaUtils.test.js +25 -25
- package/lib/esm/test/SchemaUtils.test.js.map +1 -1
- package/lib/esm/test/SequentialLogMatcher.js.map +1 -1
- package/lib/esm/test/SquashSchemaAndDataChanges.test.js +156 -147
- package/lib/esm/test/SquashSchemaAndDataChanges.test.js.map +1 -1
- package/lib/esm/test/TestChangeSetUtility.d.ts.map +1 -1
- package/lib/esm/test/TestChangeSetUtility.js +11 -7
- package/lib/esm/test/TestChangeSetUtility.js.map +1 -1
- package/lib/esm/test/TestEditTxn.d.ts +8 -0
- package/lib/esm/test/TestEditTxn.d.ts.map +1 -0
- package/lib/esm/test/TestEditTxn.js +34 -0
- package/lib/esm/test/TestEditTxn.js.map +1 -0
- package/lib/esm/test/TestUtils.d.ts +1 -0
- package/lib/esm/test/TestUtils.d.ts.map +1 -1
- package/lib/esm/test/TestUtils.js +8 -1
- package/lib/esm/test/TestUtils.js.map +1 -1
- package/lib/esm/test/annotations/Fields.test.js +135 -143
- package/lib/esm/test/annotations/Fields.test.js.map +1 -1
- package/lib/esm/test/annotations/FrameGeometry.test.js.map +1 -1
- package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
- package/lib/esm/test/annotations/TextAnnotation.test.js +156 -99
- package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
- package/lib/esm/test/annotations/TextBlock.test.js +5 -3
- package/lib/esm/test/annotations/TextBlock.test.js.map +1 -1
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.js.map +1 -1
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js.map +1 -1
- package/lib/esm/test/categories/Category.test.js +63 -3
- package/lib/esm/test/categories/Category.test.js.map +1 -1
- package/lib/esm/test/codespec/CodeSpec.test.js +88 -5
- package/lib/esm/test/codespec/CodeSpec.test.js.map +1 -1
- package/lib/esm/test/ecdb/CTE.test.js +88 -88
- package/lib/esm/test/ecdb/CTE.test.js.map +1 -1
- package/lib/esm/test/ecdb/ConcurrentQuery.test.js +19 -19
- package/lib/esm/test/ecdb/ConcurrentQuery.test.js.map +1 -1
- package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js +15 -15
- package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECDb.test.js +72 -72
- package/lib/esm/test/ecdb/ECDb.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECDbTestHelper.js.map +1 -1
- package/lib/esm/test/ecdb/ECSchemaXmlContext.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlAst.test.js +68 -67
- package/lib/esm/test/ecdb/ECSqlAst.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlQuery.test.js +6 -6
- package/lib/esm/test/ecdb/ECSqlQuery.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlStatement.test.js +332 -333
- package/lib/esm/test/ecdb/ECSqlStatement.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlSyncReader.test.js.map +1 -1
- package/lib/esm/test/ecdb/QueryReaders.test.js +47 -44
- package/lib/esm/test/ecdb/QueryReaders.test.js.map +1 -1
- package/lib/esm/test/ecdb/SqliteStatement.test.js +2 -2
- package/lib/esm/test/ecdb/SqliteStatement.test.js.map +1 -1
- package/lib/esm/test/ecsql/dataset/ECSqlDatasets.d.ts.map +1 -1
- package/lib/esm/test/ecsql/dataset/ECSqlDatasets.js +30 -28
- package/lib/esm/test/ecsql/dataset/ECSqlDatasets.js.map +1 -1
- package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js +21 -21
- package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js.map +1 -1
- package/lib/esm/test/ecsql/src/ECSqlTestParser.js.map +1 -1
- package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js.map +1 -1
- package/lib/esm/test/element/DeleteDefinitionElements.test.js +159 -143
- package/lib/esm/test/element/DeleteDefinitionElements.test.js.map +1 -1
- package/lib/esm/test/element/ElementAspect.test.js +90 -82
- package/lib/esm/test/element/ElementAspect.test.js.map +1 -1
- package/lib/esm/test/element/ElementDependencyGraph.test.d.ts.map +1 -1
- package/lib/esm/test/element/ElementDependencyGraph.test.js +51 -43
- package/lib/esm/test/element/ElementDependencyGraph.test.js.map +1 -1
- package/lib/esm/test/element/ElementRoundTrip.test.js +176 -177
- package/lib/esm/test/element/ElementRoundTrip.test.js.map +1 -1
- package/lib/esm/test/element/ExcludedElements.test.js +2 -2
- package/lib/esm/test/element/ExcludedElements.test.js.map +1 -1
- package/lib/esm/test/element/ExternalSource.test.js +40 -38
- package/lib/esm/test/element/ExternalSource.test.js.map +1 -1
- package/lib/esm/test/element/NullStructArray.test.js +23 -22
- package/lib/esm/test/element/NullStructArray.test.js.map +1 -1
- package/lib/esm/test/element/ProjectInformationRecord.test.js +5 -2
- package/lib/esm/test/element/ProjectInformationRecord.test.js.map +1 -1
- package/lib/esm/test/element/SheetInformationAspect.test.js +43 -11
- package/lib/esm/test/element/SheetInformationAspect.test.js.map +1 -1
- package/lib/esm/test/element/UrlLink.test.js +2 -2
- package/lib/esm/test/element/UrlLink.test.js.map +1 -1
- package/lib/esm/test/font/FontFile.test.js.map +1 -1
- package/lib/esm/test/font/IModelDbFonts.test.js +87 -73
- package/lib/esm/test/font/IModelDbFonts.test.js.map +1 -1
- package/lib/esm/test/hubaccess/ApplyChangeset.test.js +194 -155
- package/lib/esm/test/hubaccess/ApplyChangeset.test.js.map +1 -1
- package/lib/esm/test/hubaccess/BriefcaseManager.test.js +2 -4
- package/lib/esm/test/hubaccess/BriefcaseManager.test.js.map +1 -1
- package/lib/esm/test/hubaccess/CheckpointManager.test.js.map +1 -1
- package/lib/esm/test/hubaccess/Rebase.test.js +369 -303
- package/lib/esm/test/hubaccess/Rebase.test.js.map +1 -1
- package/lib/esm/test/hubaccess/SemanticRebase.test.js +467 -392
- package/lib/esm/test/hubaccess/SemanticRebase.test.js.map +1 -1
- package/lib/esm/test/imageData.js.map +1 -1
- package/lib/esm/test/imodel/Code.test.js +31 -31
- package/lib/esm/test/imodel/Code.test.js.map +1 -1
- package/lib/esm/test/imodel/ElementTreeWalker.test.js +57 -48
- package/lib/esm/test/imodel/ElementTreeWalker.test.js.map +1 -1
- package/lib/esm/test/imodel/GetTextureImage.test.js.map +1 -1
- package/lib/esm/test/imodel/IModel.test.js +463 -388
- package/lib/esm/test/imodel/IModel.test.js.map +1 -1
- package/lib/esm/test/imodel/ProjectExtents.test.js +2 -2
- package/lib/esm/test/imodel/ProjectExtents.test.js.map +1 -1
- package/lib/esm/test/imodel/SchemaXmlImport.test.js +13 -13
- package/lib/esm/test/imodel/SchemaXmlImport.test.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/TestContext.d.ts.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/TestContext.js +2 -2
- package/lib/esm/test/incrementalSchemaLocater/TestContext.js.map +1 -1
- package/lib/esm/test/index.d.ts +1 -0
- package/lib/esm/test/index.d.ts.map +1 -1
- package/lib/esm/test/index.js +1 -0
- package/lib/esm/test/index.js.map +1 -1
- package/lib/esm/test/misc/DevTools.test.js.map +1 -1
- package/lib/esm/test/misc/EntitySubClasses.test.js.map +1 -1
- package/lib/esm/test/misc/GeoServices.test.js.map +1 -1
- package/lib/esm/test/misc/PromiseMemoizer.test.js.map +1 -1
- package/lib/esm/test/native/DgnDbWorker.test.js.map +1 -1
- package/lib/esm/test/rpc/response.test.js.map +1 -1
- package/lib/esm/test/schema/ClassRegistry.test.js +122 -121
- package/lib/esm/test/schema/ClassRegistry.test.js.map +1 -1
- package/lib/esm/test/schema/FunctionalDomain.test.js +36 -34
- package/lib/esm/test/schema/FunctionalDomain.test.js.map +1 -1
- package/lib/esm/test/schema/GenericDomain.test.js +114 -94
- package/lib/esm/test/schema/GenericDomain.test.js.map +1 -1
- package/lib/esm/test/schema/IModelSchemaContext.test.js +11 -10
- package/lib/esm/test/schema/IModelSchemaContext.test.js.map +1 -1
- package/lib/esm/test/schema/SchemaImportCallbacks.test.js +226 -211
- package/lib/esm/test/schema/SchemaImportCallbacks.test.js.map +1 -1
- package/lib/esm/test/sheetindex/SheetIndex.test.d.ts +1 -3
- package/lib/esm/test/sheetindex/SheetIndex.test.d.ts.map +1 -1
- package/lib/esm/test/sheetindex/SheetIndex.test.js +312 -247
- package/lib/esm/test/sheetindex/SheetIndex.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangeMerge.test.js +101 -82
- package/lib/esm/test/standalone/ChangeMerge.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangesetReader.test.js +242 -213
- package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
- package/lib/esm/test/standalone/CustomViewState3dCreator.test.js.map +1 -1
- package/lib/esm/test/standalone/DisplayStyle.test.js +43 -40
- package/lib/esm/test/standalone/DisplayStyle.test.js.map +1 -1
- package/lib/esm/test/standalone/Drawing.test.js +4 -3
- package/lib/esm/test/standalone/Drawing.test.js.map +1 -1
- package/lib/esm/test/standalone/EditTxn.test.d.ts +2 -0
- package/lib/esm/test/standalone/EditTxn.test.d.ts.map +1 -0
- package/lib/esm/test/standalone/EditTxn.test.js +219 -0
- package/lib/esm/test/standalone/EditTxn.test.js.map +1 -0
- package/lib/esm/test/standalone/ElementGraphics.test.js.map +1 -1
- package/lib/esm/test/standalone/ElementMesh.test.js +16 -13
- package/lib/esm/test/standalone/ElementMesh.test.js.map +1 -1
- package/lib/esm/test/standalone/ExportGraphics.test.js +40 -34
- package/lib/esm/test/standalone/ExportGraphics.test.js.map +1 -1
- package/lib/esm/test/standalone/GeometryChangeEvents.test.js +11 -15
- package/lib/esm/test/standalone/GeometryChangeEvents.test.js.map +1 -1
- package/lib/esm/test/standalone/GeometryStream.test.js +212 -165
- package/lib/esm/test/standalone/GeometryStream.test.js.map +1 -1
- package/lib/esm/test/standalone/HubMock.test.js +31 -25
- package/lib/esm/test/standalone/HubMock.test.js.map +1 -1
- package/lib/esm/test/standalone/IModelLimits.test.js +11 -8
- package/lib/esm/test/standalone/IModelLimits.test.js.map +1 -1
- package/lib/esm/test/standalone/IModelWrite.test.d.ts +2 -2
- package/lib/esm/test/standalone/IModelWrite.test.d.ts.map +1 -1
- package/lib/esm/test/standalone/IModelWrite.test.js +211 -169
- package/lib/esm/test/standalone/IModelWrite.test.js.map +1 -1
- package/lib/esm/test/standalone/ITwinWorkspace.test.js.map +1 -1
- package/lib/esm/test/standalone/InlineGeometryPartReferences.test.js +25 -22
- package/lib/esm/test/standalone/InlineGeometryPartReferences.test.js.map +1 -1
- package/lib/esm/test/standalone/IntegrityCheck.test.js +20 -18
- package/lib/esm/test/standalone/IntegrityCheck.test.js.map +1 -1
- package/lib/esm/test/standalone/MergeConflict.test.d.ts +2 -2
- package/lib/esm/test/standalone/MergeConflict.test.d.ts.map +1 -1
- package/lib/esm/test/standalone/MergeConflict.test.js +49 -33
- package/lib/esm/test/standalone/MergeConflict.test.js.map +1 -1
- package/lib/esm/test/standalone/NativeAppStorage.test.js.map +1 -1
- package/lib/esm/test/standalone/RenderMaterialElement.test.js +5 -5
- package/lib/esm/test/standalone/RenderMaterialElement.test.js.map +1 -1
- package/lib/esm/test/standalone/RenderTimeline.test.js +3 -2
- package/lib/esm/test/standalone/RenderTimeline.test.js.map +1 -1
- package/lib/esm/test/standalone/SQLiteDb.test.js.map +1 -1
- package/lib/esm/test/standalone/SchemaUtils.test.js.map +1 -1
- package/lib/esm/test/standalone/SectionDrawing.test.js +7 -7
- package/lib/esm/test/standalone/SectionDrawing.test.js.map +1 -1
- package/lib/esm/test/standalone/ServerBasedLocks.test.js +21 -19
- package/lib/esm/test/standalone/ServerBasedLocks.test.js.map +1 -1
- package/lib/esm/test/standalone/Setting.test.js.map +1 -1
- package/lib/esm/test/standalone/Settings.test.js +7 -4
- package/lib/esm/test/standalone/Settings.test.js.map +1 -1
- package/lib/esm/test/standalone/SettingsSchemas.test.js +2 -1
- package/lib/esm/test/standalone/SettingsSchemas.test.js.map +1 -1
- package/lib/esm/test/standalone/SnapshotDb.test.js +3 -1
- package/lib/esm/test/standalone/SnapshotDb.test.js.map +1 -1
- package/lib/esm/test/standalone/StandaloneDb.test.js +27 -26
- package/lib/esm/test/standalone/StandaloneDb.test.js.map +1 -1
- package/lib/esm/test/standalone/Texture.test.js +5 -4
- package/lib/esm/test/standalone/Texture.test.js.map +1 -1
- package/lib/esm/test/standalone/TileCache.test.d.ts.map +1 -1
- package/lib/esm/test/standalone/TileCache.test.js +5 -3
- package/lib/esm/test/standalone/TileCache.test.js.map +1 -1
- package/lib/esm/test/standalone/TileTree.test.js +35 -31
- package/lib/esm/test/standalone/TileTree.test.js.map +1 -1
- package/lib/esm/test/standalone/TxnManager.test.js +700 -653
- package/lib/esm/test/standalone/TxnManager.test.js.map +1 -1
- package/lib/esm/test/standalone/ViewDefinition.test.js +295 -229
- package/lib/esm/test/standalone/ViewDefinition.test.js.map +1 -1
- package/lib/esm/test/standalone/ViewStoreDb.test.js.map +1 -1
- package/lib/esm/test/standalone/Workspace.test.js +25 -23
- package/lib/esm/test/standalone/Workspace.test.js.map +1 -1
- package/lib/esm/test/standalone/iModelDb.test.js.map +1 -1
- package/lib/esm/test/workspace/SettingsDb.test.js.map +1 -1
- package/lib/esm/workspace/Settings.js.map +1 -1
- package/lib/esm/workspace/SettingsDb.js.map +1 -1
- package/lib/esm/workspace/SettingsEditor.js.map +1 -1
- package/lib/esm/workspace/SettingsSchemas.js.map +1 -1
- package/lib/esm/workspace/Workspace.js.map +1 -1
- package/lib/esm/workspace/WorkspaceEditor.js.map +1 -1
- package/package.json +13 -13
|
@@ -7,9 +7,34 @@ import { Code, IModel, SubCategoryAppearance } from "@itwin/core-common";
|
|
|
7
7
|
import * as chai from "chai";
|
|
8
8
|
import { HubWrappers, IModelTestUtils, KnownTestLocations } from "..";
|
|
9
9
|
import { BriefcaseManager, ChannelControl, DrawingCategory, IModelJsFs } from "../../core-backend";
|
|
10
|
+
import { EditTxn, withEditTxn } from "../../EditTxn";
|
|
10
11
|
import { HubMock } from "../../internal/HubMock";
|
|
11
12
|
import { EntityClass } from "@itwin/ecschema-metadata";
|
|
12
13
|
import { TestUtils } from "../TestUtils";
|
|
14
|
+
function startTestTxn(iModel, description = "semantic rebase") {
|
|
15
|
+
const txn = new EditTxn(iModel, description);
|
|
16
|
+
txn.start();
|
|
17
|
+
return txn;
|
|
18
|
+
}
|
|
19
|
+
function endTestTxn(txn) {
|
|
20
|
+
if (txn.isActive)
|
|
21
|
+
txn.end("abandon");
|
|
22
|
+
}
|
|
23
|
+
async function importSchemaStrings(txn, schemas) {
|
|
24
|
+
if (txn.isActive)
|
|
25
|
+
txn.saveChanges();
|
|
26
|
+
await txn.iModel.importSchemaStrings(schemas);
|
|
27
|
+
}
|
|
28
|
+
async function pushChanges(txn, description) {
|
|
29
|
+
const briefcase = txn.iModel;
|
|
30
|
+
endTestTxn(txn);
|
|
31
|
+
await briefcase.pushChanges({ description });
|
|
32
|
+
}
|
|
33
|
+
async function pullChanges(txn) {
|
|
34
|
+
const briefcase = txn.iModel;
|
|
35
|
+
endTestTxn(txn);
|
|
36
|
+
await briefcase.pullChanges();
|
|
37
|
+
}
|
|
13
38
|
/**
|
|
14
39
|
* Test infrastructure for rebase tests in this file.
|
|
15
40
|
* Manages two briefcases (far and local)
|
|
@@ -30,167 +55,167 @@ class TestIModel {
|
|
|
30
55
|
/** Reusable schema definitions for testing rebase with schema transformations */
|
|
31
56
|
static schemas = {
|
|
32
57
|
/** Base schema v01.00.00 with classes A, C, D */
|
|
33
|
-
v01x00x00: `<?xml version="1.0" encoding="UTF-8"?>
|
|
34
|
-
<ECSchema schemaName="TestDomain" alias="td" version="01.00.00" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
|
|
35
|
-
<ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
|
|
36
|
-
<ECEntityClass typeName="A">
|
|
37
|
-
<BaseClass>bis:GraphicalElement2d</BaseClass>
|
|
38
|
-
<ECProperty propertyName="PropA" typeName="string"/>
|
|
39
|
-
</ECEntityClass>
|
|
40
|
-
<ECEntityClass typeName="C">
|
|
41
|
-
<BaseClass>A</BaseClass>
|
|
42
|
-
<ECProperty propertyName="PropC" typeName="string"/>
|
|
43
|
-
</ECEntityClass>
|
|
44
|
-
<ECEntityClass typeName="D">
|
|
45
|
-
<BaseClass>A</BaseClass>
|
|
46
|
-
<ECProperty propertyName="PropD" typeName="string"/>
|
|
47
|
-
</ECEntityClass>
|
|
58
|
+
v01x00x00: `<?xml version="1.0" encoding="UTF-8"?>
|
|
59
|
+
<ECSchema schemaName="TestDomain" alias="td" version="01.00.00" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
|
|
60
|
+
<ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
|
|
61
|
+
<ECEntityClass typeName="A">
|
|
62
|
+
<BaseClass>bis:GraphicalElement2d</BaseClass>
|
|
63
|
+
<ECProperty propertyName="PropA" typeName="string"/>
|
|
64
|
+
</ECEntityClass>
|
|
65
|
+
<ECEntityClass typeName="C">
|
|
66
|
+
<BaseClass>A</BaseClass>
|
|
67
|
+
<ECProperty propertyName="PropC" typeName="string"/>
|
|
68
|
+
</ECEntityClass>
|
|
69
|
+
<ECEntityClass typeName="D">
|
|
70
|
+
<BaseClass>A</BaseClass>
|
|
71
|
+
<ECProperty propertyName="PropD" typeName="string"/>
|
|
72
|
+
</ECEntityClass>
|
|
48
73
|
</ECSchema>`,
|
|
49
74
|
/** v01.00.01 - Adds PropC2 to class C (trivial additive change) */
|
|
50
|
-
v01x00x01AddPropC2: `<?xml version="1.0" encoding="UTF-8"?>
|
|
51
|
-
<ECSchema schemaName="TestDomain" alias="td" version="01.00.01" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
|
|
52
|
-
<ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
|
|
53
|
-
<ECEntityClass typeName="A">
|
|
54
|
-
<BaseClass>bis:GraphicalElement2d</BaseClass>
|
|
55
|
-
<ECProperty propertyName="PropA" typeName="string"/>
|
|
56
|
-
</ECEntityClass>
|
|
57
|
-
<ECEntityClass typeName="C">
|
|
58
|
-
<BaseClass>A</BaseClass>
|
|
59
|
-
<ECProperty propertyName="PropC" typeName="string"/>
|
|
60
|
-
<ECProperty propertyName="PropC2" typeName="string"/>
|
|
61
|
-
</ECEntityClass>
|
|
62
|
-
<ECEntityClass typeName="D">
|
|
63
|
-
<BaseClass>A</BaseClass>
|
|
64
|
-
<ECProperty propertyName="PropD" typeName="string"/>
|
|
65
|
-
</ECEntityClass>
|
|
75
|
+
v01x00x01AddPropC2: `<?xml version="1.0" encoding="UTF-8"?>
|
|
76
|
+
<ECSchema schemaName="TestDomain" alias="td" version="01.00.01" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
|
|
77
|
+
<ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
|
|
78
|
+
<ECEntityClass typeName="A">
|
|
79
|
+
<BaseClass>bis:GraphicalElement2d</BaseClass>
|
|
80
|
+
<ECProperty propertyName="PropA" typeName="string"/>
|
|
81
|
+
</ECEntityClass>
|
|
82
|
+
<ECEntityClass typeName="C">
|
|
83
|
+
<BaseClass>A</BaseClass>
|
|
84
|
+
<ECProperty propertyName="PropC" typeName="string"/>
|
|
85
|
+
<ECProperty propertyName="PropC2" typeName="string"/>
|
|
86
|
+
</ECEntityClass>
|
|
87
|
+
<ECEntityClass typeName="D">
|
|
88
|
+
<BaseClass>A</BaseClass>
|
|
89
|
+
<ECProperty propertyName="PropD" typeName="string"/>
|
|
90
|
+
</ECEntityClass>
|
|
66
91
|
</ECSchema>`,
|
|
67
92
|
/** v01.00.02 - Adds PropD2 to class D (trivial additive change) */
|
|
68
|
-
v01x00x02AddPropD2: `<?xml version="1.0" encoding="UTF-8"?>
|
|
69
|
-
<ECSchema schemaName="TestDomain" alias="td" version="01.00.02" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
|
|
70
|
-
<ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
|
|
71
|
-
<ECEntityClass typeName="A">
|
|
72
|
-
<BaseClass>bis:GraphicalElement2d</BaseClass>
|
|
73
|
-
<ECProperty propertyName="PropA" typeName="string"/>
|
|
74
|
-
</ECEntityClass>
|
|
75
|
-
<ECEntityClass typeName="C">
|
|
76
|
-
<BaseClass>A</BaseClass>
|
|
77
|
-
<ECProperty propertyName="PropC" typeName="string"/>
|
|
78
|
-
<ECProperty propertyName="PropC2" typeName="string"/>
|
|
79
|
-
</ECEntityClass>
|
|
80
|
-
<ECEntityClass typeName="D">
|
|
81
|
-
<BaseClass>A</BaseClass>
|
|
82
|
-
<ECProperty propertyName="PropD" typeName="string"/>
|
|
83
|
-
<ECProperty propertyName="PropD2" typeName="string"/>
|
|
84
|
-
</ECEntityClass>
|
|
93
|
+
v01x00x02AddPropD2: `<?xml version="1.0" encoding="UTF-8"?>
|
|
94
|
+
<ECSchema schemaName="TestDomain" alias="td" version="01.00.02" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
|
|
95
|
+
<ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
|
|
96
|
+
<ECEntityClass typeName="A">
|
|
97
|
+
<BaseClass>bis:GraphicalElement2d</BaseClass>
|
|
98
|
+
<ECProperty propertyName="PropA" typeName="string"/>
|
|
99
|
+
</ECEntityClass>
|
|
100
|
+
<ECEntityClass typeName="C">
|
|
101
|
+
<BaseClass>A</BaseClass>
|
|
102
|
+
<ECProperty propertyName="PropC" typeName="string"/>
|
|
103
|
+
<ECProperty propertyName="PropC2" typeName="string"/>
|
|
104
|
+
</ECEntityClass>
|
|
105
|
+
<ECEntityClass typeName="D">
|
|
106
|
+
<BaseClass>A</BaseClass>
|
|
107
|
+
<ECProperty propertyName="PropD" typeName="string"/>
|
|
108
|
+
<ECProperty propertyName="PropD2" typeName="string"/>
|
|
109
|
+
</ECEntityClass>
|
|
85
110
|
</ECSchema>`,
|
|
86
111
|
/** v01.00.02 - Moves PropC from C to A (requires data transformation) on top of v01.00.01 */
|
|
87
|
-
v01x00x02MovePropCToA: `<?xml version="1.0" encoding="UTF-8"?>
|
|
88
|
-
<ECSchema schemaName="TestDomain" alias="td" version="01.00.02" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
|
|
89
|
-
<ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
|
|
90
|
-
<ECEntityClass typeName="A">
|
|
91
|
-
<BaseClass>bis:GraphicalElement2d</BaseClass>
|
|
92
|
-
<ECProperty propertyName="PropA" typeName="string"/>
|
|
93
|
-
<ECProperty propertyName="PropC" typeName="string"/>
|
|
94
|
-
</ECEntityClass>
|
|
95
|
-
<ECEntityClass typeName="C">
|
|
96
|
-
<BaseClass>A</BaseClass>
|
|
97
|
-
<ECProperty propertyName="PropC2" typeName="string"/>
|
|
98
|
-
</ECEntityClass>
|
|
99
|
-
<ECEntityClass typeName="D">
|
|
100
|
-
<BaseClass>A</BaseClass>
|
|
101
|
-
<ECProperty propertyName="PropD" typeName="string"/>
|
|
102
|
-
</ECEntityClass>
|
|
112
|
+
v01x00x02MovePropCToA: `<?xml version="1.0" encoding="UTF-8"?>
|
|
113
|
+
<ECSchema schemaName="TestDomain" alias="td" version="01.00.02" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
|
|
114
|
+
<ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
|
|
115
|
+
<ECEntityClass typeName="A">
|
|
116
|
+
<BaseClass>bis:GraphicalElement2d</BaseClass>
|
|
117
|
+
<ECProperty propertyName="PropA" typeName="string"/>
|
|
118
|
+
<ECProperty propertyName="PropC" typeName="string"/>
|
|
119
|
+
</ECEntityClass>
|
|
120
|
+
<ECEntityClass typeName="C">
|
|
121
|
+
<BaseClass>A</BaseClass>
|
|
122
|
+
<ECProperty propertyName="PropC2" typeName="string"/>
|
|
123
|
+
</ECEntityClass>
|
|
124
|
+
<ECEntityClass typeName="D">
|
|
125
|
+
<BaseClass>A</BaseClass>
|
|
126
|
+
<ECProperty propertyName="PropD" typeName="string"/>
|
|
127
|
+
</ECEntityClass>
|
|
103
128
|
</ECSchema>`,
|
|
104
129
|
/** v01.00.03 - Builds on top of v01.00.02 and in addition moves PropD to base, so we can have incoming and local transforming changes */
|
|
105
|
-
v01x00x03MovePropCAndD: `<?xml version="1.0" encoding="UTF-8"?>
|
|
106
|
-
<ECSchema schemaName="TestDomain" alias="td" version="01.00.03" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
|
|
107
|
-
<ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
|
|
108
|
-
<ECEntityClass typeName="A">
|
|
109
|
-
<BaseClass>bis:GraphicalElement2d</BaseClass>
|
|
110
|
-
<ECProperty propertyName="PropA" typeName="string"/>
|
|
111
|
-
<ECProperty propertyName="PropC" typeName="string"/>
|
|
112
|
-
<ECProperty propertyName="PropD" typeName="string"/>
|
|
113
|
-
</ECEntityClass>
|
|
114
|
-
<ECEntityClass typeName="C">
|
|
115
|
-
<BaseClass>A</BaseClass>
|
|
116
|
-
<ECProperty propertyName="PropC2" typeName="string"/>
|
|
117
|
-
</ECEntityClass>
|
|
118
|
-
<ECEntityClass typeName="D">
|
|
119
|
-
<BaseClass>A</BaseClass>
|
|
120
|
-
<ECProperty propertyName="PropD2" typeName="string"/>
|
|
121
|
-
</ECEntityClass>
|
|
130
|
+
v01x00x03MovePropCAndD: `<?xml version="1.0" encoding="UTF-8"?>
|
|
131
|
+
<ECSchema schemaName="TestDomain" alias="td" version="01.00.03" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
|
|
132
|
+
<ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
|
|
133
|
+
<ECEntityClass typeName="A">
|
|
134
|
+
<BaseClass>bis:GraphicalElement2d</BaseClass>
|
|
135
|
+
<ECProperty propertyName="PropA" typeName="string"/>
|
|
136
|
+
<ECProperty propertyName="PropC" typeName="string"/>
|
|
137
|
+
<ECProperty propertyName="PropD" typeName="string"/>
|
|
138
|
+
</ECEntityClass>
|
|
139
|
+
<ECEntityClass typeName="C">
|
|
140
|
+
<BaseClass>A</BaseClass>
|
|
141
|
+
<ECProperty propertyName="PropC2" typeName="string"/>
|
|
142
|
+
</ECEntityClass>
|
|
143
|
+
<ECEntityClass typeName="D">
|
|
144
|
+
<BaseClass>A</BaseClass>
|
|
145
|
+
<ECProperty propertyName="PropD2" typeName="string"/>
|
|
146
|
+
</ECEntityClass>
|
|
122
147
|
</ECSchema>`,
|
|
123
148
|
/** v01.00.01 (incompatible variant) - Adds PropC3 instead of PropC2 to class C (same version) */
|
|
124
|
-
v01x00x01AddPropC3Incompatible: `<?xml version="1.0" encoding="UTF-8"?>
|
|
125
|
-
<ECSchema schemaName="TestDomain" alias="td" version="01.00.01" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
|
|
126
|
-
<ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
|
|
127
|
-
<ECEntityClass typeName="A">
|
|
128
|
-
<BaseClass>bis:GraphicalElement2d</BaseClass>
|
|
129
|
-
<ECProperty propertyName="PropA" typeName="string"/>
|
|
130
|
-
</ECEntityClass>
|
|
131
|
-
<ECEntityClass typeName="C">
|
|
132
|
-
<BaseClass>A</BaseClass>
|
|
133
|
-
<ECProperty propertyName="PropC" typeName="string"/>
|
|
134
|
-
<ECProperty propertyName="PropC3" typeName="string"/>
|
|
135
|
-
</ECEntityClass>
|
|
136
|
-
<ECEntityClass typeName="D">
|
|
137
|
-
<BaseClass>A</BaseClass>
|
|
138
|
-
<ECProperty propertyName="PropD" typeName="string"/>
|
|
139
|
-
</ECEntityClass>
|
|
149
|
+
v01x00x01AddPropC3Incompatible: `<?xml version="1.0" encoding="UTF-8"?>
|
|
150
|
+
<ECSchema schemaName="TestDomain" alias="td" version="01.00.01" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
|
|
151
|
+
<ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
|
|
152
|
+
<ECEntityClass typeName="A">
|
|
153
|
+
<BaseClass>bis:GraphicalElement2d</BaseClass>
|
|
154
|
+
<ECProperty propertyName="PropA" typeName="string"/>
|
|
155
|
+
</ECEntityClass>
|
|
156
|
+
<ECEntityClass typeName="C">
|
|
157
|
+
<BaseClass>A</BaseClass>
|
|
158
|
+
<ECProperty propertyName="PropC" typeName="string"/>
|
|
159
|
+
<ECProperty propertyName="PropC3" typeName="string"/>
|
|
160
|
+
</ECEntityClass>
|
|
161
|
+
<ECEntityClass typeName="D">
|
|
162
|
+
<BaseClass>A</BaseClass>
|
|
163
|
+
<ECProperty propertyName="PropD" typeName="string"/>
|
|
164
|
+
</ECEntityClass>
|
|
140
165
|
</ECSchema>`,
|
|
141
166
|
/** v01.00.02 (incompatible variant) - Adds PropC3 instead of PropC2 to class C (higher version) */
|
|
142
|
-
v01x00x02AddPropC3Incompatible: `<?xml version="1.0" encoding="UTF-8"?>
|
|
143
|
-
<ECSchema schemaName="TestDomain" alias="td" version="01.00.02" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
|
|
144
|
-
<ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
|
|
145
|
-
<ECEntityClass typeName="A">
|
|
146
|
-
<BaseClass>bis:GraphicalElement2d</BaseClass>
|
|
147
|
-
<ECProperty propertyName="PropA" typeName="string"/>
|
|
148
|
-
</ECEntityClass>
|
|
149
|
-
<ECEntityClass typeName="C">
|
|
150
|
-
<BaseClass>A</BaseClass>
|
|
151
|
-
<ECProperty propertyName="PropC" typeName="string"/>
|
|
152
|
-
<ECProperty propertyName="PropC3" typeName="string"/>
|
|
153
|
-
</ECEntityClass>
|
|
154
|
-
<ECEntityClass typeName="D">
|
|
155
|
-
<BaseClass>A</BaseClass>
|
|
156
|
-
<ECProperty propertyName="PropD" typeName="string"/>
|
|
157
|
-
</ECEntityClass>
|
|
167
|
+
v01x00x02AddPropC3Incompatible: `<?xml version="1.0" encoding="UTF-8"?>
|
|
168
|
+
<ECSchema schemaName="TestDomain" alias="td" version="01.00.02" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
|
|
169
|
+
<ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
|
|
170
|
+
<ECEntityClass typeName="A">
|
|
171
|
+
<BaseClass>bis:GraphicalElement2d</BaseClass>
|
|
172
|
+
<ECProperty propertyName="PropA" typeName="string"/>
|
|
173
|
+
</ECEntityClass>
|
|
174
|
+
<ECEntityClass typeName="C">
|
|
175
|
+
<BaseClass>A</BaseClass>
|
|
176
|
+
<ECProperty propertyName="PropC" typeName="string"/>
|
|
177
|
+
<ECProperty propertyName="PropC3" typeName="string"/>
|
|
178
|
+
</ECEntityClass>
|
|
179
|
+
<ECEntityClass typeName="D">
|
|
180
|
+
<BaseClass>A</BaseClass>
|
|
181
|
+
<ECProperty propertyName="PropD" typeName="string"/>
|
|
182
|
+
</ECEntityClass>
|
|
158
183
|
</ECSchema>`,
|
|
159
184
|
/** v01.00.02 (incompatible variant) - Adds PropC2 (higher version, different type) */
|
|
160
|
-
v01x00x02AddPropC2Incompatible: `<?xml version="1.0" encoding="UTF-8"?>
|
|
161
|
-
<ECSchema schemaName="TestDomain" alias="td" version="01.00.02" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
|
|
162
|
-
<ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
|
|
163
|
-
<ECEntityClass typeName="A">
|
|
164
|
-
<BaseClass>bis:GraphicalElement2d</BaseClass>
|
|
165
|
-
<ECProperty propertyName="PropA" typeName="string"/>
|
|
166
|
-
</ECEntityClass>
|
|
167
|
-
<ECEntityClass typeName="C">
|
|
168
|
-
<BaseClass>A</BaseClass>
|
|
169
|
-
<ECProperty propertyName="PropC" typeName="string"/>
|
|
170
|
-
<ECProperty propertyName="PropC2" typeName="int"/>
|
|
171
|
-
</ECEntityClass>
|
|
172
|
-
<ECEntityClass typeName="D">
|
|
173
|
-
<BaseClass>A</BaseClass>
|
|
174
|
-
<ECProperty propertyName="PropD" typeName="string"/>
|
|
175
|
-
</ECEntityClass>
|
|
185
|
+
v01x00x02AddPropC2Incompatible: `<?xml version="1.0" encoding="UTF-8"?>
|
|
186
|
+
<ECSchema schemaName="TestDomain" alias="td" version="01.00.02" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
|
|
187
|
+
<ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
|
|
188
|
+
<ECEntityClass typeName="A">
|
|
189
|
+
<BaseClass>bis:GraphicalElement2d</BaseClass>
|
|
190
|
+
<ECProperty propertyName="PropA" typeName="string"/>
|
|
191
|
+
</ECEntityClass>
|
|
192
|
+
<ECEntityClass typeName="C">
|
|
193
|
+
<BaseClass>A</BaseClass>
|
|
194
|
+
<ECProperty propertyName="PropC" typeName="string"/>
|
|
195
|
+
<ECProperty propertyName="PropC2" typeName="int"/>
|
|
196
|
+
</ECEntityClass>
|
|
197
|
+
<ECEntityClass typeName="D">
|
|
198
|
+
<BaseClass>A</BaseClass>
|
|
199
|
+
<ECProperty propertyName="PropD" typeName="string"/>
|
|
200
|
+
</ECEntityClass>
|
|
176
201
|
</ECSchema>`,
|
|
177
202
|
/** v01.00.03 - Adds PropC2 as string (used to test incompatibility when reinstated on top of v01.00.02 with PropC2:int) */
|
|
178
|
-
v01x00x03AddPropC2: `<?xml version="1.0" encoding="UTF-8"?>
|
|
179
|
-
<ECSchema schemaName="TestDomain" alias="td" version="01.00.03" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
|
|
180
|
-
<ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
|
|
181
|
-
<ECEntityClass typeName="A">
|
|
182
|
-
<BaseClass>bis:GraphicalElement2d</BaseClass>
|
|
183
|
-
<ECProperty propertyName="PropA" typeName="string"/>
|
|
184
|
-
</ECEntityClass>
|
|
185
|
-
<ECEntityClass typeName="C">
|
|
186
|
-
<BaseClass>A</BaseClass>
|
|
187
|
-
<ECProperty propertyName="PropC" typeName="string"/>
|
|
188
|
-
<ECProperty propertyName="PropC2" typeName="string"/>
|
|
189
|
-
</ECEntityClass>
|
|
190
|
-
<ECEntityClass typeName="D">
|
|
191
|
-
<BaseClass>A</BaseClass>
|
|
192
|
-
<ECProperty propertyName="PropD" typeName="string"/>
|
|
193
|
-
</ECEntityClass>
|
|
203
|
+
v01x00x03AddPropC2: `<?xml version="1.0" encoding="UTF-8"?>
|
|
204
|
+
<ECSchema schemaName="TestDomain" alias="td" version="01.00.03" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
|
|
205
|
+
<ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
|
|
206
|
+
<ECEntityClass typeName="A">
|
|
207
|
+
<BaseClass>bis:GraphicalElement2d</BaseClass>
|
|
208
|
+
<ECProperty propertyName="PropA" typeName="string"/>
|
|
209
|
+
</ECEntityClass>
|
|
210
|
+
<ECEntityClass typeName="C">
|
|
211
|
+
<BaseClass>A</BaseClass>
|
|
212
|
+
<ECProperty propertyName="PropC" typeName="string"/>
|
|
213
|
+
<ECProperty propertyName="PropC2" typeName="string"/>
|
|
214
|
+
</ECEntityClass>
|
|
215
|
+
<ECEntityClass typeName="D">
|
|
216
|
+
<BaseClass>A</BaseClass>
|
|
217
|
+
<ECProperty propertyName="PropD" typeName="string"/>
|
|
218
|
+
</ECEntityClass>
|
|
194
219
|
</ECSchema>`,
|
|
195
220
|
};
|
|
196
221
|
/**
|
|
@@ -200,41 +225,54 @@ class TestIModel {
|
|
|
200
225
|
*/
|
|
201
226
|
static async initialize(testName) {
|
|
202
227
|
HubMock.startup(testName, KnownTestLocations.outputDir);
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
228
|
+
let far;
|
|
229
|
+
let local;
|
|
230
|
+
try {
|
|
231
|
+
const iModelId = await HubMock.createNewIModel({
|
|
232
|
+
accessToken: "far-user",
|
|
233
|
+
iTwinId: HubMock.iTwinId,
|
|
234
|
+
iModelName: testName,
|
|
235
|
+
description: `Rebase schema update with data transform tests: ${testName}`,
|
|
236
|
+
});
|
|
237
|
+
// Open far briefcase and use it for initialization
|
|
238
|
+
far = await HubWrappers.downloadAndOpenBriefcase({
|
|
239
|
+
iTwinId: HubMock.iTwinId,
|
|
240
|
+
iModelId,
|
|
241
|
+
accessToken: "far-user",
|
|
242
|
+
});
|
|
243
|
+
far.channels.addAllowedChannel(ChannelControl.sharedChannelName);
|
|
244
|
+
// Initialize with base schema
|
|
245
|
+
await far.importSchemaStrings([TestIModel.schemas.v01x00x00]);
|
|
246
|
+
await far.pushChanges({ description: "import base schema" });
|
|
247
|
+
// Create model and category
|
|
248
|
+
const modelCode = IModelTestUtils.getUniqueModelCode(far, "DrawingModel");
|
|
249
|
+
await far.locks.acquireLocks({ shared: IModel.dictionaryId });
|
|
250
|
+
const [drawingModelId, drawingCategoryId] = withEditTxn(far, "create model and category", (txn) => {
|
|
251
|
+
const [, newDrawingModelId] = IModelTestUtils.createAndInsertDrawingPartitionAndModel(txn, modelCode);
|
|
252
|
+
const newDrawingCategoryId = DrawingCategory.insert(txn, IModel.dictionaryId, "DrawingCategory", new SubCategoryAppearance());
|
|
253
|
+
return [newDrawingModelId, newDrawingCategoryId];
|
|
254
|
+
});
|
|
255
|
+
await far.pushChanges({ description: "create model and category" });
|
|
256
|
+
// Open local briefcase
|
|
257
|
+
local = await HubWrappers.downloadAndOpenBriefcase({
|
|
258
|
+
iTwinId: HubMock.iTwinId,
|
|
259
|
+
iModelId,
|
|
260
|
+
accessToken: "local-user",
|
|
261
|
+
});
|
|
262
|
+
local.channels.addAllowedChannel(ChannelControl.sharedChannelName);
|
|
263
|
+
return new TestIModel(iModelId, drawingModelId, drawingCategoryId, far, local);
|
|
264
|
+
}
|
|
265
|
+
catch (error) {
|
|
266
|
+
if (local?.isOpen)
|
|
267
|
+
local.close();
|
|
268
|
+
if (far?.isOpen)
|
|
269
|
+
far.close();
|
|
270
|
+
HubMock.shutdown();
|
|
271
|
+
throw error;
|
|
272
|
+
}
|
|
236
273
|
}
|
|
237
|
-
insertElement(
|
|
274
|
+
insertElement(txn, className, properties) {
|
|
275
|
+
const briefcase = txn.iModel;
|
|
238
276
|
const elementProps = {
|
|
239
277
|
classFullName: className,
|
|
240
278
|
model: this.drawingModelId,
|
|
@@ -243,12 +281,13 @@ class TestIModel {
|
|
|
243
281
|
...properties,
|
|
244
282
|
};
|
|
245
283
|
const element = briefcase.elements.createElement(elementProps);
|
|
246
|
-
return
|
|
284
|
+
return txn.insertElement(element.toJSON());
|
|
247
285
|
}
|
|
248
|
-
updateElement(
|
|
286
|
+
updateElement(txn, elementId, updates) {
|
|
287
|
+
const briefcase = txn.iModel;
|
|
249
288
|
const element = briefcase.elements.getElement(elementId);
|
|
250
289
|
Object.assign(element, updates);
|
|
251
|
-
|
|
290
|
+
txn.updateElement(element.toJSON());
|
|
252
291
|
}
|
|
253
292
|
getElement(briefcase, elementId) {
|
|
254
293
|
return briefcase.elements.getElement(elementId);
|
|
@@ -290,17 +329,21 @@ describe("Semantic Rebase", function () {
|
|
|
290
329
|
});
|
|
291
330
|
it("local data changes onto incoming trivial schema change", async () => {
|
|
292
331
|
t = await TestIModel.initialize("TrivialSchemaIncoming");
|
|
332
|
+
let localTxn = startTestTxn(t.local, "local data changes onto incoming trivial schema change local");
|
|
333
|
+
let farTxn = startTestTxn(t.far, "local data changes onto incoming trivial schema change far");
|
|
293
334
|
// Local creates an element
|
|
294
335
|
await t.local.locks.acquireLocks({ shared: t.drawingModelId });
|
|
295
|
-
const elementId = t.insertElement(
|
|
336
|
+
const elementId = t.insertElement(localTxn, "TestDomain:C", {
|
|
296
337
|
propA: "value_a",
|
|
297
338
|
propC: "value_c",
|
|
298
339
|
});
|
|
299
|
-
|
|
300
|
-
await
|
|
340
|
+
localTxn.saveChanges("create element");
|
|
341
|
+
await pushChanges(localTxn, "create test element");
|
|
342
|
+
localTxn = startTestTxn(t.local, "local data changes onto incoming trivial schema change local");
|
|
301
343
|
// Far imports updated schema with new property PropC2
|
|
302
|
-
await
|
|
303
|
-
|
|
344
|
+
await pullChanges(farTxn);
|
|
345
|
+
farTxn = startTestTxn(t.far, "local data changes onto incoming trivial schema change far");
|
|
346
|
+
await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
|
|
304
347
|
// Verify that we're holding a shared lock (not exclusive) for semantic rebase
|
|
305
348
|
chai.expect(t.far.locks.holdsSharedLock(IModel.repositoryModelId)).to.be.true;
|
|
306
349
|
chai.expect(t.far.holdsSchemaLock).to.be.false;
|
|
@@ -308,15 +351,14 @@ describe("Semantic Rebase", function () {
|
|
|
308
351
|
chai.expect(txnProps).to.not.be.undefined;
|
|
309
352
|
chai.expect(txnProps.type).to.equal("Schema");
|
|
310
353
|
chai.expect(t.checkIfFolderExists(t.far, txnProps.id, true)).to.be.true;
|
|
311
|
-
|
|
312
|
-
await t.far.pushChanges({ description: "add PropC2 to class C" });
|
|
354
|
+
await pushChanges(farTxn, "add PropC2 to class C");
|
|
313
355
|
chai.expect(t.checkIfFolderExists(t.far, txnProps.id, true)).to.be.false; // after push the folder should not be there
|
|
314
356
|
// Local makes local changes to the element
|
|
315
357
|
await t.local.locks.acquireLocks({ exclusive: elementId });
|
|
316
|
-
t.updateElement(
|
|
317
|
-
|
|
358
|
+
t.updateElement(localTxn, elementId, { propA: "local_update_a" });
|
|
359
|
+
localTxn.saveChanges("local update to propA");
|
|
318
360
|
// Local pulls and rebases local changes onto incoming schema change
|
|
319
|
-
await
|
|
361
|
+
await pullChanges(localTxn);
|
|
320
362
|
// Verify: local changes preserved, schema updated
|
|
321
363
|
const element = t.getElement(t.local, elementId);
|
|
322
364
|
chai.expect(element.propA).to.equal("local_update_a", "Local property update should be preserved");
|
|
@@ -326,16 +368,19 @@ describe("Semantic Rebase", function () {
|
|
|
326
368
|
});
|
|
327
369
|
it("local trivial schema change onto incoming data changes", async () => {
|
|
328
370
|
t = await TestIModel.initialize("TrivialSchemaLocal");
|
|
371
|
+
let localTxn = startTestTxn(t.local, "local trivial schema change onto incoming data changes local");
|
|
372
|
+
let farTxn = startTestTxn(t.far, "local trivial schema change onto incoming data changes far");
|
|
329
373
|
// Local creates an element
|
|
330
374
|
await t.local.locks.acquireLocks({ shared: t.drawingModelId });
|
|
331
|
-
const elementId = t.insertElement(
|
|
375
|
+
const elementId = t.insertElement(localTxn, "TestDomain:C", {
|
|
332
376
|
propA: "value_a",
|
|
333
377
|
propC: "value_c",
|
|
334
378
|
});
|
|
335
|
-
|
|
336
|
-
await
|
|
379
|
+
localTxn.saveChanges("create element");
|
|
380
|
+
await pushChanges(localTxn, "create test element");
|
|
381
|
+
localTxn = startTestTxn(t.local, "local trivial schema change onto incoming data changes local");
|
|
337
382
|
// Local imports updated schema locally
|
|
338
|
-
await
|
|
383
|
+
await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
|
|
339
384
|
// Verify that we're holding a shared lock (not exclusive) for semantic rebase
|
|
340
385
|
chai.expect(t.local.locks.holdsSharedLock(IModel.repositoryModelId)).to.be.true;
|
|
341
386
|
chai.expect(t.local.holdsSchemaLock).to.be.false;
|
|
@@ -343,15 +388,15 @@ describe("Semantic Rebase", function () {
|
|
|
343
388
|
chai.expect(txnProps).to.not.be.undefined;
|
|
344
389
|
chai.expect(txnProps.type).to.equal("Schema");
|
|
345
390
|
chai.expect(t.checkIfFolderExists(t.local, txnProps.id, true)).to.be.true;
|
|
346
|
-
t.local.saveChanges("local schema update");
|
|
347
391
|
// Far pulls element, then updates it
|
|
348
|
-
await
|
|
392
|
+
await pullChanges(farTxn);
|
|
393
|
+
farTxn = startTestTxn(t.far, "local trivial schema change onto incoming data changes far");
|
|
349
394
|
await t.far.locks.acquireLocks({ exclusive: elementId });
|
|
350
|
-
t.updateElement(
|
|
351
|
-
|
|
352
|
-
await
|
|
395
|
+
t.updateElement(farTxn, elementId, { propA: "far_update_a" });
|
|
396
|
+
farTxn.saveChanges("far update to propA");
|
|
397
|
+
await pushChanges(farTxn, "update element propA");
|
|
353
398
|
// Local pulls and rebases local schema change onto incoming data changes
|
|
354
|
-
await
|
|
399
|
+
await pullChanges(localTxn);
|
|
355
400
|
chai.expect(t.checkIfFolderExists(t.local, txnProps.id, true)).to.be.true; // after rebase the folder should be there until push is called
|
|
356
401
|
// Verify: incoming data changes applied, local schema preserved
|
|
357
402
|
const element = t.getElement(t.local, elementId);
|
|
@@ -362,35 +407,39 @@ describe("Semantic Rebase", function () {
|
|
|
362
407
|
});
|
|
363
408
|
it("local data changes onto incoming data changes", async () => {
|
|
364
409
|
t = await TestIModel.initialize("DataOntoData");
|
|
410
|
+
let localTxn = startTestTxn(t.local, "local data changes onto incoming data changes local");
|
|
411
|
+
let farTxn = startTestTxn(t.far, "local data changes onto incoming data changes far");
|
|
365
412
|
// Local creates two elements
|
|
366
413
|
await t.local.locks.acquireLocks({ shared: t.drawingModelId });
|
|
367
|
-
const elementId1 = t.insertElement(
|
|
414
|
+
const elementId1 = t.insertElement(localTxn, "TestDomain:C", {
|
|
368
415
|
propA: "value_a1",
|
|
369
416
|
propC: "value_c1",
|
|
370
417
|
});
|
|
371
|
-
const elementId2 = t.insertElement(
|
|
418
|
+
const elementId2 = t.insertElement(localTxn, "TestDomain:C", {
|
|
372
419
|
propA: "value_a2",
|
|
373
420
|
propC: "value_c2",
|
|
374
421
|
});
|
|
375
|
-
|
|
422
|
+
localTxn.saveChanges("create elements");
|
|
376
423
|
chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // its data changes on both sides semantic rebase is not used
|
|
377
|
-
await
|
|
424
|
+
await pushChanges(localTxn, "create test elements");
|
|
425
|
+
localTxn = startTestTxn(t.local, "local data changes onto incoming data changes local");
|
|
378
426
|
chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // its data changes on both sides semantic rebase is not used
|
|
379
427
|
// Far updates first element
|
|
380
|
-
await
|
|
428
|
+
await pullChanges(farTxn);
|
|
429
|
+
farTxn = startTestTxn(t.far, "local data changes onto incoming data changes far");
|
|
381
430
|
await t.far.locks.acquireLocks({ exclusive: elementId1 });
|
|
382
|
-
t.updateElement(
|
|
383
|
-
|
|
431
|
+
t.updateElement(farTxn, elementId1, { propC: "far_update_c" });
|
|
432
|
+
farTxn.saveChanges("far update to propC");
|
|
384
433
|
chai.expect(t.checkifRebaseFolderExists(t.far)).to.be.false; // its data changes on both sides semantic rebase is not used
|
|
385
|
-
await
|
|
434
|
+
await pushChanges(farTxn, "update element propC");
|
|
386
435
|
chai.expect(t.checkifRebaseFolderExists(t.far)).to.be.false; // its data changes on both sides semantic rebase is not used
|
|
387
436
|
// Local makes local changes to second element
|
|
388
437
|
await t.local.locks.acquireLocks({ exclusive: elementId2 });
|
|
389
|
-
t.updateElement(
|
|
390
|
-
|
|
438
|
+
t.updateElement(localTxn, elementId2, { propA: "local_update_a" });
|
|
439
|
+
localTxn.saveChanges("local update to propA");
|
|
391
440
|
chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // its data changes on both sides semantic rebase is not used
|
|
392
441
|
// Local pulls and rebases
|
|
393
|
-
await
|
|
442
|
+
await pullChanges(localTxn);
|
|
394
443
|
chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // its data changes on both sides semantic rebase is not used
|
|
395
444
|
// Verify: both changes applied to their respective elements
|
|
396
445
|
const element1 = t.getElement(t.local, elementId1);
|
|
@@ -402,24 +451,24 @@ describe("Semantic Rebase", function () {
|
|
|
402
451
|
});
|
|
403
452
|
it("local trivial schema changes onto incoming trivial schema changes (local newer)", async () => {
|
|
404
453
|
t = await TestIModel.initialize("TrivialSchemaLocalNewer");
|
|
454
|
+
const localTxn = startTestTxn(t.local, "local trivial schema changes onto incoming trivial schema changes local newer local");
|
|
455
|
+
const farTxn = startTestTxn(t.far, "local trivial schema changes onto incoming trivial schema changes local newer far");
|
|
405
456
|
// Far imports v01.00.01 (adds PropC2)
|
|
406
|
-
await
|
|
457
|
+
await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
|
|
407
458
|
const txnProps = t.far.txns.getLastSavedTxnProps();
|
|
408
459
|
chai.expect(txnProps).to.not.be.undefined;
|
|
409
460
|
chai.expect(txnProps.type).to.equal("Schema");
|
|
410
461
|
chai.expect(t.checkIfFolderExists(t.far, txnProps.id, true)).to.be.true;
|
|
411
|
-
|
|
412
|
-
await t.far.pushChanges({ description: "add PropC2 to class C" });
|
|
462
|
+
await pushChanges(farTxn, "add PropC2 to class C");
|
|
413
463
|
chai.expect(t.checkIfFolderExists(t.far, txnProps.id, true)).to.be.false; // after push the folder should not be there
|
|
414
464
|
// Local imports v01.00.02 (adds PropC2 and PropD2 - newer)
|
|
415
|
-
await
|
|
465
|
+
await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x02AddPropD2]);
|
|
416
466
|
const txnPropsLocal = t.local.txns.getLastSavedTxnProps();
|
|
417
467
|
chai.expect(txnPropsLocal).to.not.be.undefined;
|
|
418
468
|
chai.expect(txnPropsLocal.type).to.equal("Schema");
|
|
419
469
|
chai.expect(t.checkIfFolderExists(t.local, txnPropsLocal.id, true)).to.be.true;
|
|
420
|
-
t.local.saveChanges("local schema update to v01.00.02");
|
|
421
470
|
// Local pulls and rebases
|
|
422
|
-
await
|
|
471
|
+
await pullChanges(localTxn);
|
|
423
472
|
chai.expect(t.checkIfFolderExists(t.local, txnPropsLocal.id, true)).to.be.true; // after rebase the folder should be there because local is newer until push is called
|
|
424
473
|
// Verify: local schema preserved (newer version)
|
|
425
474
|
const schema = t.local.getSchemaProps("TestDomain");
|
|
@@ -427,24 +476,24 @@ describe("Semantic Rebase", function () {
|
|
|
427
476
|
});
|
|
428
477
|
it("local trivial schema changes onto incoming trivial schema changes (incoming newer)", async () => {
|
|
429
478
|
t = await TestIModel.initialize("TrivialSchemaIncomingNewer");
|
|
479
|
+
const localTxn = startTestTxn(t.local, "local trivial schema changes onto incoming trivial schema changes incoming newer local");
|
|
480
|
+
const farTxn = startTestTxn(t.far, "local trivial schema changes onto incoming trivial schema changes incoming newer far");
|
|
430
481
|
// Far imports v01.00.02 (adds PropC2 and PropD2 - newer)
|
|
431
|
-
await
|
|
482
|
+
await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x02AddPropD2]);
|
|
432
483
|
const txnProps = t.far.txns.getLastSavedTxnProps();
|
|
433
484
|
chai.expect(txnProps).to.not.be.undefined;
|
|
434
485
|
chai.expect(txnProps.type).to.equal("Schema");
|
|
435
486
|
chai.expect(t.checkIfFolderExists(t.far, txnProps.id, true)).to.be.true;
|
|
436
|
-
|
|
437
|
-
await t.far.pushChanges({ description: "update schema to v01.00.02" });
|
|
487
|
+
await pushChanges(farTxn, "update schema to v01.00.02");
|
|
438
488
|
chai.expect(t.checkIfFolderExists(t.far, txnProps.id, true)).to.be.false; // after push the folder should not be there
|
|
439
489
|
// Local imports v01.00.01 (adds only PropC2 - older)
|
|
440
|
-
await
|
|
490
|
+
await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
|
|
441
491
|
const txnPropsLocal = t.local.txns.getLastSavedTxnProps();
|
|
442
492
|
chai.expect(txnPropsLocal).to.not.be.undefined;
|
|
443
493
|
chai.expect(txnPropsLocal.type).to.equal("Schema");
|
|
444
494
|
chai.expect(t.checkIfFolderExists(t.local, txnPropsLocal.id, true)).to.be.true;
|
|
445
|
-
t.local.saveChanges("local schema update to v01.00.01");
|
|
446
495
|
// Local pulls and rebases
|
|
447
|
-
await
|
|
496
|
+
await pullChanges(localTxn);
|
|
448
497
|
chai.expect(t.checkIfFolderExists(t.local, txnPropsLocal.id, true)).to.be.false; // after rebase the folder should not be there because incoming is newer so while rebasing it should be a no op
|
|
449
498
|
chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // there should not be a rebase folder because the rebase folder is deleted after rebase if it contains nothing
|
|
450
499
|
// Verify: incoming schema preserved (newer version, local should not override)
|
|
@@ -453,8 +502,10 @@ describe("Semantic Rebase", function () {
|
|
|
453
502
|
});
|
|
454
503
|
it("local trivial schema changes onto incoming identical schema changes", async () => {
|
|
455
504
|
t = await TestIModel.initialize("TrivialSchemaIdentical");
|
|
505
|
+
const localTxn = startTestTxn(t.local, "local trivial schema changes onto incoming identical schema changes local");
|
|
506
|
+
const farTxn = startTestTxn(t.far, "local trivial schema changes onto incoming identical schema changes far");
|
|
456
507
|
// Far imports v01.00.01 (adds PropC2)
|
|
457
|
-
await
|
|
508
|
+
await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
|
|
458
509
|
// Verify that we're holding a shared lock (not exclusive) for semantic rebase
|
|
459
510
|
chai.expect(t.far.locks.holdsSharedLock(IModel.repositoryModelId)).to.be.true;
|
|
460
511
|
chai.expect(t.far.holdsSchemaLock).to.be.false;
|
|
@@ -462,18 +513,16 @@ describe("Semantic Rebase", function () {
|
|
|
462
513
|
chai.expect(txnProps).to.not.be.undefined;
|
|
463
514
|
chai.expect(txnProps.type).to.equal("Schema");
|
|
464
515
|
chai.expect(t.checkIfFolderExists(t.far, txnProps.id, true)).to.be.true;
|
|
465
|
-
|
|
466
|
-
await t.far.pushChanges({ description: "add PropC2 to class C" });
|
|
516
|
+
await pushChanges(farTxn, "add PropC2 to class C");
|
|
467
517
|
chai.expect(t.checkIfFolderExists(t.far, txnProps.id, true)).to.be.false; // after push the folder should not be there
|
|
468
518
|
// Local imports the same v01.00.01 (adds PropC2)
|
|
469
|
-
await
|
|
519
|
+
await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
|
|
470
520
|
const txnPropsLocal = t.local.txns.getLastSavedTxnProps();
|
|
471
521
|
chai.expect(txnPropsLocal).to.not.be.undefined;
|
|
472
522
|
chai.expect(txnPropsLocal.type).to.equal("Schema");
|
|
473
523
|
chai.expect(t.checkIfFolderExists(t.local, txnPropsLocal.id, true)).to.be.true;
|
|
474
|
-
t.local.saveChanges("local schema update to v01.00.01");
|
|
475
524
|
// Local pulls and rebases
|
|
476
|
-
await
|
|
525
|
+
await pullChanges(localTxn);
|
|
477
526
|
chai.expect(t.checkIfFolderExists(t.local, txnPropsLocal.id, true)).to.be.false; // after rebase the folder should not be there as both are identical
|
|
478
527
|
chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // there should not be a rebase folder because the rebase folder is deleted if it contains nothing after rebase
|
|
479
528
|
// Verify: schema preserved (both sides identical)
|
|
@@ -482,39 +531,40 @@ describe("Semantic Rebase", function () {
|
|
|
482
531
|
});
|
|
483
532
|
it("local trivial schema changes onto incoming identical schema changes with data changes on both sides", async () => {
|
|
484
533
|
t = await TestIModel.initialize("TrivialSchemaIdenticalWithData");
|
|
534
|
+
const localTxn = startTestTxn(t.local, "local trivial schema changes onto incoming identical schema changes with data local");
|
|
535
|
+
let farTxn = startTestTxn(t.far, "local trivial schema changes onto incoming identical schema changes with data far");
|
|
485
536
|
// Far imports v01.00.01 (adds PropC2) and creates an element
|
|
486
|
-
await
|
|
537
|
+
await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
|
|
487
538
|
const txnProps = t.far.txns.getLastSavedTxnProps();
|
|
488
539
|
chai.expect(txnProps).to.not.be.undefined;
|
|
489
540
|
chai.expect(txnProps.type).to.equal("Schema");
|
|
490
541
|
chai.expect(t.checkIfFolderExists(t.far, txnProps.id, true)).to.be.true;
|
|
491
|
-
|
|
492
|
-
|
|
542
|
+
await pushChanges(farTxn, "add PropC2 to class C");
|
|
543
|
+
farTxn = startTestTxn(t.far, "local trivial schema changes onto incoming identical schema changes with data far");
|
|
493
544
|
chai.expect(t.checkIfFolderExists(t.far, txnProps.id, true)).to.be.false; // after push the folder should not be there
|
|
494
545
|
await t.far.locks.acquireLocks({ shared: t.drawingModelId });
|
|
495
|
-
const farElementId = t.insertElement(
|
|
546
|
+
const farElementId = t.insertElement(farTxn, "TestDomain:C", {
|
|
496
547
|
propA: "far_value_a",
|
|
497
548
|
propC: "far_value_c",
|
|
498
549
|
propC2: "far_value_c2",
|
|
499
550
|
});
|
|
500
|
-
|
|
501
|
-
await
|
|
551
|
+
farTxn.saveChanges("far creates element with new property");
|
|
552
|
+
await pushChanges(farTxn, "far creates element");
|
|
502
553
|
// Local imports the same v01.00.01 (adds PropC2) and creates an element
|
|
503
|
-
await
|
|
554
|
+
await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
|
|
504
555
|
const txnPropsLocal = t.local.txns.getLastSavedTxnProps();
|
|
505
556
|
chai.expect(txnPropsLocal).to.not.be.undefined;
|
|
506
557
|
chai.expect(txnPropsLocal.type).to.equal("Schema");
|
|
507
558
|
chai.expect(t.checkIfFolderExists(t.local, txnPropsLocal.id, true)).to.be.true;
|
|
508
|
-
t.local.saveChanges("local schema update to v01.00.01");
|
|
509
559
|
await t.local.locks.acquireLocks({ shared: t.drawingModelId });
|
|
510
|
-
const localElementId = t.insertElement(
|
|
560
|
+
const localElementId = t.insertElement(localTxn, "TestDomain:C", {
|
|
511
561
|
propA: "local_value_a",
|
|
512
562
|
propC: "local_value_c",
|
|
513
563
|
propC2: "local_value_c2",
|
|
514
564
|
});
|
|
515
|
-
|
|
565
|
+
localTxn.saveChanges("local creates element with new property");
|
|
516
566
|
// Local pulls and rebases
|
|
517
|
-
await
|
|
567
|
+
await pullChanges(localTxn);
|
|
518
568
|
chai.expect(t.checkIfFolderExists(t.local, txnPropsLocal.id, true)).to.be.false; // after rebase the folder should not be there as both are identical
|
|
519
569
|
chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // there should not be a rebase folder because the rebase folder is deleted after rebase if it contains nothing
|
|
520
570
|
// Verify: schema preserved (both sides identical)
|
|
@@ -532,27 +582,27 @@ describe("Semantic Rebase", function () {
|
|
|
532
582
|
});
|
|
533
583
|
it("both add different properties, increment to same version number", async () => {
|
|
534
584
|
t = await TestIModel.initialize("TrivialSchemaIncompatible");
|
|
535
|
-
|
|
536
|
-
t.far
|
|
537
|
-
await
|
|
538
|
-
await
|
|
539
|
-
|
|
540
|
-
await
|
|
585
|
+
const localTxn = startTestTxn(t.local, "both add different properties increment to same version local");
|
|
586
|
+
const farTxn = startTestTxn(t.far, "both add different properties increment to same version far");
|
|
587
|
+
await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
|
|
588
|
+
await pushChanges(farTxn, "add PropC2 to class C");
|
|
589
|
+
await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x01AddPropC3Incompatible]);
|
|
590
|
+
await pullChanges(localTxn); // TODO: this currently passes, because same version number means no upgrade is attempted
|
|
541
591
|
//TODO: this should probably fail instead as both sides made incompatible changes to the same version, but this is unrelated to semantic rebase itself
|
|
542
592
|
const schema = t.local.getSchemaProps("TestDomain");
|
|
543
593
|
chai.expect(schema.version).to.equal("01.00.01", "Schema should be v01.00.01");
|
|
544
594
|
});
|
|
545
595
|
it("both add compatible properties, local version number higher", async () => {
|
|
546
596
|
t = await TestIModel.initialize("CompatibleSchemaLocalHigher");
|
|
597
|
+
const localTxn = startTestTxn(t.local, "both add compatible properties local version higher local");
|
|
598
|
+
const farTxn = startTestTxn(t.far, "both add compatible properties local version higher far");
|
|
547
599
|
// Far imports v01.00.01 (adds PropC2)
|
|
548
|
-
await
|
|
549
|
-
|
|
550
|
-
await t.far.pushChanges({ description: "add PropC2 to class C" });
|
|
600
|
+
await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
|
|
601
|
+
await pushChanges(farTxn, "add PropC2 to class C");
|
|
551
602
|
// Local imports v01.00.02 (adds PropC2 and PropD2 - compatible higher version)
|
|
552
|
-
await
|
|
553
|
-
t.local.saveChanges("local schema update to v01.00.02 with PropD2");
|
|
603
|
+
await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x02AddPropD2]);
|
|
554
604
|
// Local pulls and rebases
|
|
555
|
-
await
|
|
605
|
+
await pullChanges(localTxn);
|
|
556
606
|
// Verify: Local schema wins (higher version)
|
|
557
607
|
const schema = t.local.getSchemaProps("TestDomain");
|
|
558
608
|
chai.expect(schema.version).to.equal("01.00.02", "Schema should be v01.00.02 (higher version wins)");
|
|
@@ -565,15 +615,15 @@ describe("Semantic Rebase", function () {
|
|
|
565
615
|
});
|
|
566
616
|
it("both add compatible properties, incoming version number higher", async () => {
|
|
567
617
|
t = await TestIModel.initialize("CompatibleSchemaIncomingHigher");
|
|
618
|
+
const localTxn = startTestTxn(t.local, "both add compatible properties incoming version higher local");
|
|
619
|
+
const farTxn = startTestTxn(t.far, "both add compatible properties incoming version higher far");
|
|
568
620
|
// Far imports v01.00.02 (adds PropC2 and PropD2 - higher version)
|
|
569
|
-
await
|
|
570
|
-
|
|
571
|
-
await t.far.pushChanges({ description: "update schema to v01.00.02" });
|
|
621
|
+
await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x02AddPropD2]);
|
|
622
|
+
await pushChanges(farTxn, "update schema to v01.00.02");
|
|
572
623
|
// Local imports v01.00.01 (adds only PropC2 - compatible lower version)
|
|
573
|
-
await
|
|
574
|
-
t.local.saveChanges("local schema update to v01.00.01 with PropC2");
|
|
624
|
+
await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
|
|
575
625
|
// Local pulls and rebases
|
|
576
|
-
await
|
|
626
|
+
await pullChanges(localTxn);
|
|
577
627
|
// Verify: Incoming schema wins (higher version)
|
|
578
628
|
const schema = t.local.getSchemaProps("TestDomain");
|
|
579
629
|
chai.expect(schema.version).to.equal("01.00.02", "Schema should be v01.00.02 (higher version wins)");
|
|
@@ -586,58 +636,58 @@ describe("Semantic Rebase", function () {
|
|
|
586
636
|
});
|
|
587
637
|
it("both add same but incompatible property, local version number higher", async () => {
|
|
588
638
|
t = await TestIModel.initialize("TrivialSchemaIncompatible");
|
|
589
|
-
|
|
590
|
-
t.far
|
|
591
|
-
await
|
|
592
|
-
await
|
|
593
|
-
|
|
639
|
+
const localTxn = startTestTxn(t.local, "both add same but incompatible property local version higher local");
|
|
640
|
+
const farTxn = startTestTxn(t.far, "both add same but incompatible property local version higher far");
|
|
641
|
+
await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
|
|
642
|
+
await pushChanges(farTxn, "add PropC2 to class C");
|
|
643
|
+
await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x02AddPropC2Incompatible]);
|
|
594
644
|
// Local pulls and rebases - this should detect the incompatibility and fail
|
|
595
|
-
await chai.expect(
|
|
645
|
+
await chai.expect(pullChanges(localTxn)).to.be.rejectedWith("ECSchema Upgrade failed");
|
|
596
646
|
});
|
|
597
647
|
it("both add same but incompatible property, incoming version number higher", async () => {
|
|
598
648
|
t = await TestIModel.initialize("TrivialSchemaIncompatible");
|
|
599
|
-
|
|
600
|
-
t.far
|
|
601
|
-
await
|
|
649
|
+
const localTxn = startTestTxn(t.local, "both add same but incompatible property incoming version higher local");
|
|
650
|
+
const farTxn = startTestTxn(t.far, "both add same but incompatible property incoming version higher far");
|
|
651
|
+
await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x02AddPropC2Incompatible]);
|
|
652
|
+
await pushChanges(farTxn, "import v01.00.02 with PropC2 as int");
|
|
602
653
|
// Local uses v01.00.03 with PropC2:string — higher version ensures the upgrade is attempted
|
|
603
654
|
// during reinstatement, which detects the type mismatch (string vs int)
|
|
604
|
-
await
|
|
605
|
-
t.local.saveChanges("local schema update to v01.00.03 with PropC2 as string");
|
|
655
|
+
await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x03AddPropC2]);
|
|
606
656
|
// Local pulls and rebases - this should detect the incompatibility and fail
|
|
607
|
-
await chai.expect(
|
|
657
|
+
await chai.expect(pullChanges(localTxn)).to.be.rejectedWith("ECSchema Upgrade failed");
|
|
608
658
|
});
|
|
609
659
|
it("local transforming schema change onto incoming trivial schema change", async () => {
|
|
610
660
|
t = await TestIModel.initialize("LocalTransformIncomingTrivial");
|
|
661
|
+
const farTxn = startTestTxn(t.far, "local transforming schema change onto incoming trivial schema change far");
|
|
662
|
+
const localTxn = startTestTxn(t.local, "local transforming schema change onto incoming trivial schema change local");
|
|
611
663
|
// Far: Insert Element and import trivial schema change
|
|
612
664
|
await t.far.locks.acquireLocks({ shared: t.drawingModelId });
|
|
613
|
-
const farElementId = t.insertElement(
|
|
665
|
+
const farElementId = t.insertElement(farTxn, "TestDomain:C", {
|
|
614
666
|
propA: "far_value_a",
|
|
615
667
|
propC: "far_value_c",
|
|
616
668
|
});
|
|
617
|
-
|
|
618
|
-
await
|
|
669
|
+
farTxn.saveChanges("far create element");
|
|
670
|
+
await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
|
|
619
671
|
const txnPropsFar = t.far.txns.getLastSavedTxnProps();
|
|
620
672
|
chai.expect(txnPropsFar).to.not.be.undefined;
|
|
621
673
|
chai.expect(txnPropsFar.type).to.equal("Schema");
|
|
622
674
|
chai.expect(t.checkIfFolderExists(t.far, txnPropsFar.id, true)).to.be.true; // schema folder should exist
|
|
623
|
-
|
|
624
|
-
await t.far.pushChanges({ description: "far add PropC2" });
|
|
675
|
+
await pushChanges(farTxn, "far add PropC2");
|
|
625
676
|
chai.expect(t.checkifRebaseFolderExists(t.far)).to.be.false; // after push the folder should not be there
|
|
626
677
|
// Local: Insert Element and import transforming schema change
|
|
627
678
|
await t.local.locks.acquireLocks({ shared: t.drawingModelId });
|
|
628
|
-
const localElementId = t.insertElement(
|
|
679
|
+
const localElementId = t.insertElement(localTxn, "TestDomain:C", {
|
|
629
680
|
propA: "local_value_a",
|
|
630
681
|
propC: "local_value_c",
|
|
631
682
|
});
|
|
632
|
-
|
|
633
|
-
await
|
|
683
|
+
localTxn.saveChanges("local create element");
|
|
684
|
+
await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x02MovePropCToA]);
|
|
634
685
|
const txnPropsLocal = t.local.txns.getLastSavedTxnProps();
|
|
635
686
|
chai.expect(txnPropsLocal).to.not.be.undefined;
|
|
636
687
|
chai.expect(txnPropsLocal.type).to.equal("Schema");
|
|
637
688
|
chai.expect(t.checkIfFolderExists(t.local, txnPropsLocal.id, true)).to.be.true; // schema folder should exist
|
|
638
|
-
t.local.saveChanges("local transforming schema update");
|
|
639
689
|
// Local pulls and rebases transforming change onto incoming trivial change
|
|
640
|
-
await
|
|
690
|
+
await pushChanges(localTxn, "local move PropC to A");
|
|
641
691
|
chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // after push the folder should not be there
|
|
642
692
|
// Verify: both elements have PropC intact, schema transformed locally
|
|
643
693
|
t.local.clearCaches(); // Clear caches to ensure we read transformed properties from iModel
|
|
@@ -650,31 +700,31 @@ describe("Semantic Rebase", function () {
|
|
|
650
700
|
});
|
|
651
701
|
it("local trivial schema change onto incoming transforming schema change", async () => {
|
|
652
702
|
t = await TestIModel.initialize("LocalTrivialIncomingTransform");
|
|
703
|
+
const farTxn = startTestTxn(t.far, "local trivial schema change onto incoming transforming schema change far");
|
|
704
|
+
const localTxn = startTestTxn(t.local, "local trivial schema change onto incoming transforming schema change local");
|
|
653
705
|
// Far: Insert Element and import transforming schema change
|
|
654
706
|
await t.far.locks.acquireLocks({ shared: t.drawingModelId });
|
|
655
|
-
const farElementId = t.insertElement(
|
|
707
|
+
const farElementId = t.insertElement(farTxn, "TestDomain:C", {
|
|
656
708
|
propA: "far_value_a",
|
|
657
709
|
propC: "far_value_c",
|
|
658
710
|
});
|
|
659
|
-
|
|
660
|
-
await
|
|
661
|
-
|
|
662
|
-
await t.far.pushChanges({ description: "far move PropC to A" });
|
|
711
|
+
farTxn.saveChanges("far create element");
|
|
712
|
+
await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x02MovePropCToA]);
|
|
713
|
+
await pushChanges(farTxn, "far move PropC to A");
|
|
663
714
|
// Local: Insert Element and import trivial schema change
|
|
664
715
|
await t.local.locks.acquireLocks({ shared: t.drawingModelId });
|
|
665
|
-
const localElementId = t.insertElement(
|
|
716
|
+
const localElementId = t.insertElement(localTxn, "TestDomain:C", {
|
|
666
717
|
propA: "local_value_a",
|
|
667
718
|
propC: "local_value_c",
|
|
668
719
|
});
|
|
669
|
-
|
|
670
|
-
await
|
|
720
|
+
localTxn.saveChanges("local create element");
|
|
721
|
+
await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
|
|
671
722
|
const txnPropsLocal = t.local.txns.getLastSavedTxnProps();
|
|
672
723
|
chai.expect(txnPropsLocal).to.not.be.undefined;
|
|
673
724
|
chai.expect(txnPropsLocal.type).to.equal("Schema");
|
|
674
725
|
chai.expect(t.checkIfFolderExists(t.local, txnPropsLocal.id, true)).to.be.true; // schema folder should exist
|
|
675
|
-
t.local.saveChanges("local trivial schema update");
|
|
676
726
|
// Local pulls and rebases trivial change onto incoming transforming change
|
|
677
|
-
await
|
|
727
|
+
await pushChanges(localTxn, "local add PropC2");
|
|
678
728
|
chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // after push the folder should not be there
|
|
679
729
|
t.local.clearCaches(); // Clear caches to ensure we read transformed properties from iModel
|
|
680
730
|
// Verify: both elements have PropC intact after incoming transform
|
|
@@ -687,44 +737,46 @@ describe("Semantic Rebase", function () {
|
|
|
687
737
|
});
|
|
688
738
|
it("local transforming schema change onto incoming transforming schema change", async () => {
|
|
689
739
|
t = await TestIModel.initialize("BothTransforming");
|
|
740
|
+
const farTxn = startTestTxn(t.far, "local transforming schema change onto incoming transforming schema change far");
|
|
741
|
+
const localTxn = startTestTxn(t.local, "local transforming schema change onto incoming transforming schema change local");
|
|
690
742
|
// Far: Create elements with PropC and PropD, import transforming schema (moves PropC to A)
|
|
691
743
|
await t.far.locks.acquireLocks({ shared: t.drawingModelId });
|
|
692
|
-
const farElementC = t.insertElement(
|
|
744
|
+
const farElementC = t.insertElement(farTxn, "TestDomain:C", {
|
|
693
745
|
propA: "far_value_a_c",
|
|
694
746
|
propC: "far_value_c",
|
|
695
747
|
});
|
|
696
|
-
const farElementD = t.insertElement(
|
|
748
|
+
const farElementD = t.insertElement(farTxn, "TestDomain:D", {
|
|
697
749
|
propA: "far_value_a_d",
|
|
698
750
|
propD: "far_value_d",
|
|
699
751
|
});
|
|
700
|
-
|
|
701
|
-
await
|
|
752
|
+
farTxn.saveChanges("far create elements");
|
|
753
|
+
await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x02MovePropCToA]);
|
|
702
754
|
const txnPropsFar = t.far.txns.getLastSavedTxnProps();
|
|
703
755
|
chai.expect(txnPropsFar).to.not.be.undefined;
|
|
704
756
|
chai.expect(txnPropsFar.type).to.equal("Schema");
|
|
705
757
|
chai.expect(t.checkIfFolderExists(t.far, txnPropsFar.id, true)).to.be.true; // schema folder should exist
|
|
706
|
-
|
|
707
|
-
await
|
|
758
|
+
farTxn.saveChanges("far move PropC to A");
|
|
759
|
+
await pushChanges(farTxn, "far transform PropC");
|
|
708
760
|
chai.expect(t.checkifRebaseFolderExists(t.far)).to.be.false; // after push the folder should not be there
|
|
709
761
|
// Local: Create elements with PropC and PropD, import transforming schema (moves both PropC and PropD to A)
|
|
710
762
|
await t.local.locks.acquireLocks({ shared: t.drawingModelId });
|
|
711
|
-
const localElementC = t.insertElement(
|
|
763
|
+
const localElementC = t.insertElement(localTxn, "TestDomain:C", {
|
|
712
764
|
propA: "local_value_a_c",
|
|
713
765
|
propC: "local_value_c",
|
|
714
766
|
});
|
|
715
|
-
const localElementD = t.insertElement(
|
|
767
|
+
const localElementD = t.insertElement(localTxn, "TestDomain:D", {
|
|
716
768
|
propA: "local_value_a_d",
|
|
717
769
|
propD: "local_value_d",
|
|
718
770
|
});
|
|
719
|
-
|
|
720
|
-
await
|
|
771
|
+
localTxn.saveChanges("local create elements");
|
|
772
|
+
await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x03MovePropCAndD]);
|
|
721
773
|
const txnPropsLocal = t.local.txns.getLastSavedTxnProps();
|
|
722
774
|
chai.expect(txnPropsLocal).to.not.be.undefined;
|
|
723
775
|
chai.expect(txnPropsLocal.type).to.equal("Schema");
|
|
724
776
|
chai.expect(t.checkIfFolderExists(t.local, txnPropsLocal.id, true)).to.be.true; // schema folder should exist
|
|
725
|
-
|
|
777
|
+
localTxn.saveChanges("local move PropC and PropD to A");
|
|
726
778
|
// Local pulls and rebases both transforming changes
|
|
727
|
-
await
|
|
779
|
+
await pushChanges(localTxn, "local transform PropC and PropD");
|
|
728
780
|
chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // after push the folder should not be there
|
|
729
781
|
t.far.clearCaches(); // Clear caches to ensure we read transformed properties from iModel
|
|
730
782
|
t.local.clearCaches(); // Clear caches to ensure we read transformed properties from iModel
|
|
@@ -744,35 +796,38 @@ describe("Semantic Rebase", function () {
|
|
|
744
796
|
});
|
|
745
797
|
it("local data update onto incoming transforming schema change", async () => {
|
|
746
798
|
t = await TestIModel.initialize("LocalDataIncomingTransform");
|
|
799
|
+
let farTxn = startTestTxn(t.far, "local data update onto incoming transforming schema change far");
|
|
800
|
+
let localTxn = startTestTxn(t.local, "local data update onto incoming transforming schema change local");
|
|
747
801
|
// Insert one instance and populate to both far and local
|
|
748
802
|
await t.far.locks.acquireLocks({ shared: t.drawingModelId });
|
|
749
|
-
const elementId = t.insertElement(
|
|
803
|
+
const elementId = t.insertElement(farTxn, "TestDomain:C", {
|
|
750
804
|
propA: "initial_value_a",
|
|
751
805
|
propC: "initial_value_c",
|
|
752
806
|
});
|
|
753
|
-
|
|
754
|
-
await
|
|
807
|
+
farTxn.saveChanges("far create element");
|
|
808
|
+
await pushChanges(farTxn, "create shared element");
|
|
809
|
+
farTxn = startTestTxn(t.far, "local data update onto incoming transforming schema change far");
|
|
755
810
|
// Local pulls to get the element
|
|
756
|
-
await
|
|
811
|
+
await pullChanges(localTxn);
|
|
812
|
+
localTxn = startTestTxn(t.local, "local data update onto incoming transforming schema change local");
|
|
757
813
|
// Far imports transforming schema (moves PropC from C to A)
|
|
758
|
-
await
|
|
814
|
+
await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x02MovePropCToA]);
|
|
759
815
|
const txnPropsFar = t.far.txns.getLastSavedTxnProps();
|
|
760
816
|
chai.expect(txnPropsFar).to.not.be.undefined;
|
|
761
817
|
chai.expect(txnPropsFar.type).to.equal("Schema");
|
|
762
818
|
chai.expect(t.checkIfFolderExists(t.far, txnPropsFar.id, true)).to.be.true; // schema folder should exist
|
|
763
|
-
|
|
764
|
-
await t.far.pushChanges({ description: "far move PropC to A" });
|
|
819
|
+
await pushChanges(farTxn, "far move PropC to A");
|
|
765
820
|
chai.expect(t.checkifRebaseFolderExists(t.far)).to.be.false; // after push the folder should not be there
|
|
766
821
|
// Local updates PropC on the element
|
|
767
822
|
await t.local.locks.acquireLocks({ exclusive: elementId });
|
|
768
|
-
t.updateElement(
|
|
769
|
-
|
|
823
|
+
t.updateElement(localTxn, elementId, { propC: "local_modified_c" });
|
|
824
|
+
localTxn.saveChanges("local update propC");
|
|
770
825
|
let element = t.getElement(t.local, elementId);
|
|
771
826
|
chai.expect(element.propA).to.equal("initial_value_a", "PropA should be unchanged");
|
|
772
827
|
chai.expect(element.propC).to.equal("local_modified_c", "PropC should have the local modified value before incoming transform");
|
|
773
828
|
chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // no schema change yet on local so no rebase folder
|
|
774
829
|
// Local pulls and rebases data change onto incoming transforming schema change
|
|
775
|
-
await
|
|
830
|
+
await pullChanges(localTxn);
|
|
776
831
|
// after rebase the folder should not be there because data change folder is created on the fly and removed once rebased and rebase folder is also removed if it contains nothing
|
|
777
832
|
chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false;
|
|
778
833
|
t.local.clearCaches(); // Clear caches to ensure we read transformed properties from iModel
|
|
@@ -785,31 +840,32 @@ describe("Semantic Rebase", function () {
|
|
|
785
840
|
});
|
|
786
841
|
it("Incoming data update onto local transforming schema change", async () => {
|
|
787
842
|
t = await TestIModel.initialize("IncomingDataLocalTransform");
|
|
843
|
+
const farTxn = startTestTxn(t.far, "Incoming data update onto local transforming schema change far");
|
|
844
|
+
const localTxn = startTestTxn(t.local, "Incoming data update onto local transforming schema change local");
|
|
788
845
|
// Insert one instance and populate to both far and local
|
|
789
846
|
await t.far.locks.acquireLocks({ shared: t.drawingModelId });
|
|
790
|
-
const elementIdFar = t.insertElement(
|
|
847
|
+
const elementIdFar = t.insertElement(farTxn, "TestDomain:C", {
|
|
791
848
|
propA: "far_value_a",
|
|
792
849
|
propC: "far_value_c",
|
|
793
850
|
});
|
|
794
|
-
|
|
851
|
+
farTxn.saveChanges("far create element");
|
|
795
852
|
chai.expect(t.checkifRebaseFolderExists(t.far)).to.be.false; // no schema change yet on far so no rebase folder
|
|
796
|
-
await
|
|
853
|
+
await pushChanges(farTxn, "create shared element");
|
|
797
854
|
chai.expect(t.checkifRebaseFolderExists(t.far)).to.be.false; // after push the folder should not be there
|
|
798
855
|
await t.local.locks.acquireLocks({ shared: t.drawingModelId });
|
|
799
|
-
const elementIdLocal = t.insertElement(
|
|
856
|
+
const elementIdLocal = t.insertElement(localTxn, "TestDomain:C", {
|
|
800
857
|
propA: "local_value_a",
|
|
801
858
|
propC: "local_value_c",
|
|
802
859
|
});
|
|
803
|
-
|
|
860
|
+
localTxn.saveChanges("local create element");
|
|
804
861
|
// Far imports transforming schema (moves PropC from C to A)
|
|
805
|
-
await
|
|
862
|
+
await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x02MovePropCToA]);
|
|
806
863
|
const txnPropsLocal = t.local.txns.getLastSavedTxnProps();
|
|
807
864
|
chai.expect(txnPropsLocal).to.not.be.undefined;
|
|
808
865
|
chai.expect(txnPropsLocal.type).to.equal("Schema");
|
|
809
866
|
chai.expect(t.checkIfFolderExists(t.local, txnPropsLocal.id, true)).to.be.true; // schema folder should exist
|
|
810
|
-
t.local.saveChanges("local transforming schema update");
|
|
811
867
|
// local pulls and rebases and then pushes
|
|
812
|
-
await
|
|
868
|
+
await pushChanges(localTxn, "far move PropC to A");
|
|
813
869
|
chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // after push the folder should not be there
|
|
814
870
|
t.local.clearCaches(); // Clear caches to ensure we read transformed properties from iModel
|
|
815
871
|
const elementFar = t.getElement(t.local, elementIdFar);
|
|
@@ -838,32 +894,35 @@ describe("Semantic Rebase", function () {
|
|
|
838
894
|
});
|
|
839
895
|
it("local multiple data transactions onto incoming transforming schema change", async () => {
|
|
840
896
|
t = await TestIModel.initialize("LocalMultipleDataIncomingTransform");
|
|
897
|
+
let farTxn = startTestTxn(t.far, "local multiple data transactions onto incoming transforming schema change far");
|
|
898
|
+
let localTxn = startTestTxn(t.local, "local multiple data transactions onto incoming transforming schema change local");
|
|
841
899
|
// Insert initial element and push
|
|
842
900
|
await t.local.locks.acquireLocks({ shared: t.drawingModelId });
|
|
843
|
-
const elementId1 = t.insertElement(
|
|
901
|
+
const elementId1 = t.insertElement(localTxn, "TestDomain:C", {
|
|
844
902
|
propA: "initial_a",
|
|
845
903
|
propC: "initial_c",
|
|
846
904
|
});
|
|
847
|
-
|
|
848
|
-
await
|
|
905
|
+
localTxn.saveChanges("create first element");
|
|
906
|
+
await pushChanges(localTxn, "create initial element");
|
|
907
|
+
localTxn = startTestTxn(t.local, "local multiple data transactions onto incoming transforming schema change local");
|
|
849
908
|
// Far imports transforming schema (moves PropC from C to A)
|
|
850
|
-
await
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
await
|
|
909
|
+
await pullChanges(farTxn);
|
|
910
|
+
farTxn = startTestTxn(t.far, "local multiple data transactions onto incoming transforming schema change far");
|
|
911
|
+
await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x02MovePropCToA]);
|
|
912
|
+
await pushChanges(farTxn, "far move PropC to A");
|
|
854
913
|
// Local makes first data change
|
|
855
914
|
await t.local.locks.acquireLocks({ exclusive: elementId1 });
|
|
856
|
-
t.updateElement(
|
|
857
|
-
|
|
915
|
+
t.updateElement(localTxn, elementId1, { propA: "first_update_a" });
|
|
916
|
+
localTxn.saveChanges("first data change");
|
|
858
917
|
// Local makes second data change - create new element
|
|
859
918
|
await t.local.locks.acquireLocks({ shared: t.drawingModelId });
|
|
860
|
-
const elementId2 = t.insertElement(
|
|
919
|
+
const elementId2 = t.insertElement(localTxn, "TestDomain:C", {
|
|
861
920
|
propA: "second_element_a",
|
|
862
921
|
propC: "second_element_c",
|
|
863
922
|
});
|
|
864
|
-
|
|
923
|
+
localTxn.saveChanges("second data change - new element");
|
|
865
924
|
// Local pulls and rebases both transactions onto incoming transforming schema
|
|
866
|
-
await
|
|
925
|
+
await pullChanges(localTxn);
|
|
867
926
|
t.local.clearCaches();
|
|
868
927
|
// Verify: both local data changes preserved after incoming transform
|
|
869
928
|
const element1 = t.getElement(t.local, elementId1);
|
|
@@ -877,32 +936,35 @@ describe("Semantic Rebase", function () {
|
|
|
877
936
|
});
|
|
878
937
|
it("local transforming schema change onto incoming multiple data transactions", async () => {
|
|
879
938
|
t = await TestIModel.initialize("LocalTransformIncomingMultipleData");
|
|
939
|
+
let farTxn = startTestTxn(t.far, "local transforming schema change onto incoming multiple data transactions far");
|
|
940
|
+
let localTxn = startTestTxn(t.local, "local transforming schema change onto incoming multiple data transactions local");
|
|
880
941
|
// Create initial element
|
|
881
942
|
await t.far.locks.acquireLocks({ shared: t.drawingModelId });
|
|
882
|
-
const elementId1 = t.insertElement(
|
|
943
|
+
const elementId1 = t.insertElement(farTxn, "TestDomain:C", {
|
|
883
944
|
propA: "initial_a",
|
|
884
945
|
propC: "initial_c",
|
|
885
946
|
});
|
|
886
|
-
|
|
887
|
-
await
|
|
947
|
+
farTxn.saveChanges("create first element");
|
|
948
|
+
await pushChanges(farTxn, "create initial element");
|
|
949
|
+
farTxn = startTestTxn(t.far, "local transforming schema change onto incoming multiple data transactions far");
|
|
888
950
|
// Local pulls and imports transforming schema
|
|
889
|
-
await
|
|
890
|
-
|
|
891
|
-
|
|
951
|
+
await pullChanges(localTxn);
|
|
952
|
+
localTxn = startTestTxn(t.local, "local transforming schema change onto incoming multiple data transactions local");
|
|
953
|
+
await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x02MovePropCToA]);
|
|
892
954
|
// Far makes first data change
|
|
893
955
|
await t.far.locks.acquireLocks({ exclusive: elementId1 });
|
|
894
|
-
t.updateElement(
|
|
895
|
-
|
|
956
|
+
t.updateElement(farTxn, elementId1, { propA: "far_first_update_a" });
|
|
957
|
+
farTxn.saveChanges("far first data change");
|
|
896
958
|
// Far makes second data change - create new element
|
|
897
959
|
await t.far.locks.acquireLocks({ shared: t.drawingModelId });
|
|
898
|
-
const elementId2 = t.insertElement(
|
|
960
|
+
const elementId2 = t.insertElement(farTxn, "TestDomain:C", {
|
|
899
961
|
propA: "far_second_element_a",
|
|
900
962
|
propC: "far_second_element_c",
|
|
901
963
|
});
|
|
902
|
-
|
|
903
|
-
await
|
|
964
|
+
farTxn.saveChanges("far second data change - new element");
|
|
965
|
+
await pushChanges(farTxn, "far multiple data changes");
|
|
904
966
|
// Local pulls and rebases local transforming schema onto incoming data changes
|
|
905
|
-
await
|
|
967
|
+
await pullChanges(localTxn);
|
|
906
968
|
t.local.clearCaches();
|
|
907
969
|
// Verify: both incoming data changes applied, local schema transformation preserved
|
|
908
970
|
const element1 = t.getElement(t.local, elementId1);
|
|
@@ -916,15 +978,16 @@ describe("Semantic Rebase", function () {
|
|
|
916
978
|
});
|
|
917
979
|
it("should fail when importing schema with unsaved data changes", async () => {
|
|
918
980
|
t = await TestIModel.initialize("UnsavedDataChangesSchemaImport");
|
|
981
|
+
const localTxn = startTestTxn(t.local, "should fail when importing schema with unsaved data changes local");
|
|
919
982
|
// Create element but DO NOT save changes
|
|
920
983
|
await t.local.locks.acquireLocks({ shared: t.drawingModelId });
|
|
921
|
-
t.insertElement(
|
|
984
|
+
t.insertElement(localTxn, "TestDomain:C", {
|
|
922
985
|
propA: "unsaved_a",
|
|
923
986
|
propC: "unsaved_c",
|
|
924
987
|
});
|
|
925
|
-
// Intentionally
|
|
988
|
+
// Intentionally not saving the active local transaction before schema import.
|
|
926
989
|
// Try to import schema - this should fail
|
|
927
|
-
await chai.expect(
|
|
990
|
+
await chai.expect(localTxn.iModel.importSchemaStrings([TestIModel.schemas.v01x00x01AddPropC2])).to.be.rejectedWith("Cannot import schemas with unsaved changes when useSemanticRebase flag is on");
|
|
928
991
|
// Verify: element was not saved, schema was not imported
|
|
929
992
|
const schema = t.local.getSchemaProps("TestDomain");
|
|
930
993
|
chai.expect(schema.version).to.equal("01.00.00", "Schema should remain at v01.00.00");
|
|
@@ -952,27 +1015,29 @@ describe("Semantic Rebase with indirect changes", function () {
|
|
|
952
1015
|
});
|
|
953
1016
|
it("Incoming data update onto local data change", async () => {
|
|
954
1017
|
t = await TestIModel.initialize("IncomingDataLocalDataChange");
|
|
1018
|
+
const farTxn = startTestTxn(t.far, "Incoming data update onto local data change far");
|
|
1019
|
+
const localTxn = startTestTxn(t.local, "Incoming data update onto local data change local");
|
|
955
1020
|
let elementIdFar = "";
|
|
956
1021
|
await t.far.txns.withIndirectTxnModeAsync(async () => {
|
|
957
1022
|
// Insert one instance and populate to both far and local
|
|
958
|
-
elementIdFar = t.insertElement(
|
|
1023
|
+
elementIdFar = t.insertElement(farTxn, "TestDomain:C", {
|
|
959
1024
|
propA: "far_value_a",
|
|
960
1025
|
propC: "far_value_c",
|
|
961
1026
|
});
|
|
962
1027
|
});
|
|
963
|
-
|
|
964
|
-
await
|
|
1028
|
+
farTxn.saveChanges("far create indirect element");
|
|
1029
|
+
await pushChanges(farTxn, "create indirect element");
|
|
965
1030
|
let elementIdLocal = "";
|
|
966
1031
|
await t.local.txns.withIndirectTxnModeAsync(async () => {
|
|
967
1032
|
// Insert one instance and populate to both far and local
|
|
968
|
-
elementIdLocal = t.insertElement(
|
|
1033
|
+
elementIdLocal = t.insertElement(localTxn, "TestDomain:C", {
|
|
969
1034
|
propA: "local_value_a",
|
|
970
1035
|
propC: "local_value_c",
|
|
971
1036
|
});
|
|
972
1037
|
});
|
|
973
|
-
|
|
1038
|
+
localTxn.saveChanges("local create indirect element");
|
|
974
1039
|
chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // there should not be a rebase folder because no schema change on either side
|
|
975
|
-
await
|
|
1040
|
+
await pushChanges(localTxn, "local pulls andcreate indirect element");
|
|
976
1041
|
chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // there should not be a rebase folder because no schema change on either side
|
|
977
1042
|
chai.expect(Id64.isValidId64(elementIdFar) && Id64.isValidId64(elementIdLocal)).to.be.true;
|
|
978
1043
|
t.local.clearCaches(); // Clear caches to ensure we read transformed properties from iModel
|
|
@@ -985,7 +1050,9 @@ describe("Semantic Rebase with indirect changes", function () {
|
|
|
985
1050
|
});
|
|
986
1051
|
it("Incoming data and schema update onto local data change", async () => {
|
|
987
1052
|
t = await TestIModel.initialize("IncomingDataAndSchemaLocalDataChange");
|
|
988
|
-
|
|
1053
|
+
const farTxn = startTestTxn(t.far, "Incoming data and schema update onto local data change far");
|
|
1054
|
+
const localTxn = startTestTxn(t.local, "Incoming data and schema update onto local data change local");
|
|
1055
|
+
await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
|
|
989
1056
|
const farTxnProps = t.far.txns.getLastSavedTxnProps();
|
|
990
1057
|
chai.expect(farTxnProps).to.not.be.undefined;
|
|
991
1058
|
chai.expect(farTxnProps.type).to.equal("Schema");
|
|
@@ -993,26 +1060,26 @@ describe("Semantic Rebase with indirect changes", function () {
|
|
|
993
1060
|
let elementIdFar = "";
|
|
994
1061
|
await t.far.txns.withIndirectTxnModeAsync(async () => {
|
|
995
1062
|
// Insert one instance and populate to both far and local
|
|
996
|
-
elementIdFar = t.insertElement(
|
|
1063
|
+
elementIdFar = t.insertElement(farTxn, "TestDomain:C", {
|
|
997
1064
|
propA: "far_value_a",
|
|
998
1065
|
propC: "far_value_c",
|
|
999
1066
|
});
|
|
1000
1067
|
});
|
|
1001
|
-
|
|
1002
|
-
await
|
|
1068
|
+
farTxn.saveChanges("far create indirect element");
|
|
1069
|
+
await pushChanges(farTxn, "create indirect element");
|
|
1003
1070
|
chai.expect(t.checkIfFolderExists(t.far, farTxnProps.id, true)).to.be.false; // after push the schema folder should not be there
|
|
1004
1071
|
chai.expect(t.checkifRebaseFolderExists(t.far)).to.be.false; // after push the folder should not be there
|
|
1005
1072
|
let elementIdLocal = "";
|
|
1006
1073
|
await t.local.txns.withIndirectTxnModeAsync(async () => {
|
|
1007
1074
|
// Insert one instance and populate to both far and local
|
|
1008
|
-
elementIdLocal = t.insertElement(
|
|
1075
|
+
elementIdLocal = t.insertElement(localTxn, "TestDomain:C", {
|
|
1009
1076
|
propA: "local_value_a",
|
|
1010
1077
|
propC: "local_value_c",
|
|
1011
1078
|
});
|
|
1012
1079
|
});
|
|
1013
|
-
|
|
1080
|
+
localTxn.saveChanges("local create indirect element");
|
|
1014
1081
|
chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // there should not be a rebase folder because no schema change on local side
|
|
1015
|
-
await
|
|
1082
|
+
await pushChanges(localTxn, "local pulls andcreate indirect element");
|
|
1016
1083
|
chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false;
|
|
1017
1084
|
chai.expect(Id64.isValidId64(elementIdFar) && Id64.isValidId64(elementIdLocal)).to.be.true;
|
|
1018
1085
|
t.local.clearCaches(); // Clear caches to ensure we read transformed properties from iModel
|
|
@@ -1027,7 +1094,9 @@ describe("Semantic Rebase with indirect changes", function () {
|
|
|
1027
1094
|
});
|
|
1028
1095
|
it("Incoming data and schema update onto local data and schema change", async () => {
|
|
1029
1096
|
t = await TestIModel.initialize("IncomingDataLocalDataAndSchemaChange");
|
|
1030
|
-
|
|
1097
|
+
const farTxn = startTestTxn(t.far, "Incoming data and schema update onto local data and schema change far");
|
|
1098
|
+
const localTxn = startTestTxn(t.local, "Incoming data and schema update onto local data and schema change local");
|
|
1099
|
+
await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
|
|
1031
1100
|
const farTxnProps = t.far.txns.getLastSavedTxnProps();
|
|
1032
1101
|
chai.expect(farTxnProps).to.not.be.undefined;
|
|
1033
1102
|
chai.expect(farTxnProps.type).to.equal("Schema");
|
|
@@ -1035,16 +1104,16 @@ describe("Semantic Rebase with indirect changes", function () {
|
|
|
1035
1104
|
let elementIdFar = "";
|
|
1036
1105
|
await t.far.txns.withIndirectTxnModeAsync(async () => {
|
|
1037
1106
|
// Insert one instance and populate to both far and local
|
|
1038
|
-
elementIdFar = t.insertElement(
|
|
1107
|
+
elementIdFar = t.insertElement(farTxn, "TestDomain:C", {
|
|
1039
1108
|
propA: "far_value_a",
|
|
1040
1109
|
propC: "far_value_c",
|
|
1041
1110
|
});
|
|
1042
1111
|
});
|
|
1043
|
-
|
|
1044
|
-
await
|
|
1112
|
+
farTxn.saveChanges("far create indirect element");
|
|
1113
|
+
await pushChanges(farTxn, "create indirect element");
|
|
1045
1114
|
chai.expect(t.checkIfFolderExists(t.far, farTxnProps.id, true)).to.be.false; // after push the schema folder should not be there
|
|
1046
1115
|
chai.expect(t.checkifRebaseFolderExists(t.far)).to.be.false; // after push the folder should not be there
|
|
1047
|
-
await
|
|
1116
|
+
await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x02AddPropD2]);
|
|
1048
1117
|
const localTxnProps = t.local.txns.getLastSavedTxnProps();
|
|
1049
1118
|
chai.expect(localTxnProps).to.not.be.undefined;
|
|
1050
1119
|
chai.expect(localTxnProps.type).to.equal("Schema");
|
|
@@ -1052,14 +1121,14 @@ describe("Semantic Rebase with indirect changes", function () {
|
|
|
1052
1121
|
let elementIdLocal = "";
|
|
1053
1122
|
await t.local.txns.withIndirectTxnModeAsync(async () => {
|
|
1054
1123
|
// Insert one instance and populate to both far and local
|
|
1055
|
-
elementIdLocal = t.insertElement(
|
|
1124
|
+
elementIdLocal = t.insertElement(localTxn, "TestDomain:C", {
|
|
1056
1125
|
propA: "local_value_a",
|
|
1057
1126
|
propC: "local_value_c",
|
|
1058
1127
|
});
|
|
1059
1128
|
});
|
|
1060
|
-
|
|
1129
|
+
localTxn.saveChanges("local create indirect element");
|
|
1061
1130
|
chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.true; // there should be a rebase folder because schema change on local side
|
|
1062
|
-
await
|
|
1131
|
+
await pushChanges(localTxn, "local pulls andcreate indirect element");
|
|
1063
1132
|
chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // after push the folder should not be there
|
|
1064
1133
|
chai.expect(Id64.isValidId64(elementIdFar) && Id64.isValidId64(elementIdLocal)).to.be.true;
|
|
1065
1134
|
t.local.clearCaches(); // Clear caches to ensure we read transformed properties from iModel
|
|
@@ -1074,34 +1143,36 @@ describe("Semantic Rebase with indirect changes", function () {
|
|
|
1074
1143
|
});
|
|
1075
1144
|
it("Incoming data and Transforming schema update onto local data change", async () => {
|
|
1076
1145
|
t = await TestIModel.initialize("IncomingDataAndTransformingSchemaLocalDataChange");
|
|
1146
|
+
const farTxn = startTestTxn(t.far, "Incoming data and Transforming schema update onto local data change far");
|
|
1147
|
+
const localTxn = startTestTxn(t.local, "Incoming data and Transforming schema update onto local data change local");
|
|
1077
1148
|
let elementIdFar = "";
|
|
1078
1149
|
await t.far.txns.withIndirectTxnModeAsync(async () => {
|
|
1079
1150
|
// Insert one instance and populate to both far and local
|
|
1080
|
-
elementIdFar = t.insertElement(
|
|
1151
|
+
elementIdFar = t.insertElement(farTxn, "TestDomain:C", {
|
|
1081
1152
|
propA: "far_value_a",
|
|
1082
1153
|
propC: "far_value_c",
|
|
1083
1154
|
});
|
|
1084
1155
|
});
|
|
1085
|
-
|
|
1086
|
-
await
|
|
1156
|
+
farTxn.saveChanges("far create indirect element");
|
|
1157
|
+
await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x02MovePropCToA]);
|
|
1087
1158
|
const farTxnProps = t.far.txns.getLastSavedTxnProps();
|
|
1088
1159
|
chai.expect(farTxnProps).to.not.be.undefined;
|
|
1089
1160
|
chai.expect(farTxnProps.type).to.equal("Schema");
|
|
1090
1161
|
chai.expect(t.checkIfFolderExists(t.far, farTxnProps.id, true)).to.be.true; // schema folder should exist
|
|
1091
|
-
await
|
|
1162
|
+
await pushChanges(farTxn, "create indirect element");
|
|
1092
1163
|
chai.expect(t.checkIfFolderExists(t.far, farTxnProps.id, true)).to.be.false; // after push the schema folder should not be there
|
|
1093
1164
|
chai.expect(t.checkifRebaseFolderExists(t.far)).to.be.false; // after push the folder should not be there
|
|
1094
1165
|
let elementIdLocal = "";
|
|
1095
1166
|
await t.local.txns.withIndirectTxnModeAsync(async () => {
|
|
1096
1167
|
// Insert one instance and populate to both far and local
|
|
1097
|
-
elementIdLocal = t.insertElement(
|
|
1168
|
+
elementIdLocal = t.insertElement(localTxn, "TestDomain:C", {
|
|
1098
1169
|
propA: "local_value_a",
|
|
1099
1170
|
propC: "local_value_c",
|
|
1100
1171
|
});
|
|
1101
1172
|
});
|
|
1102
|
-
|
|
1173
|
+
localTxn.saveChanges("local create indirect element");
|
|
1103
1174
|
chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // there should not be a rebase folder because no schema change on local side
|
|
1104
|
-
await
|
|
1175
|
+
await pushChanges(localTxn, "local pulls andcreate indirect element");
|
|
1105
1176
|
chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false;
|
|
1106
1177
|
chai.expect(Id64.isValidId64(elementIdFar) && Id64.isValidId64(elementIdLocal)).to.be.true;
|
|
1107
1178
|
t.local.clearCaches(); // Clear caches to ensure we read transformed properties from iModel
|
|
@@ -1116,7 +1187,9 @@ describe("Semantic Rebase with indirect changes", function () {
|
|
|
1116
1187
|
});
|
|
1117
1188
|
it("Incoming data and transforming schema update onto local data and transforming schema change", async () => {
|
|
1118
1189
|
t = await TestIModel.initialize("IncomingDataAndTransformingSchemaLocalDataAndTransformingSchemaChange");
|
|
1119
|
-
|
|
1190
|
+
const farTxn = startTestTxn(t.far, "Incoming data and transforming schema update onto local data and transforming schema change far");
|
|
1191
|
+
const localTxn = startTestTxn(t.local, "Incoming data and transforming schema update onto local data and transforming schema change local");
|
|
1192
|
+
await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x02MovePropCToA]);
|
|
1120
1193
|
const farTxnProps = t.far.txns.getLastSavedTxnProps();
|
|
1121
1194
|
chai.expect(farTxnProps).to.not.be.undefined;
|
|
1122
1195
|
chai.expect(farTxnProps.type).to.equal("Schema");
|
|
@@ -1124,16 +1197,16 @@ describe("Semantic Rebase with indirect changes", function () {
|
|
|
1124
1197
|
let elementIdFar = "";
|
|
1125
1198
|
await t.far.txns.withIndirectTxnModeAsync(async () => {
|
|
1126
1199
|
// Insert one instance and populate to both far and local
|
|
1127
|
-
elementIdFar = t.insertElement(
|
|
1200
|
+
elementIdFar = t.insertElement(farTxn, "TestDomain:C", {
|
|
1128
1201
|
propA: "far_value_a",
|
|
1129
1202
|
propC: "far_value_c",
|
|
1130
1203
|
});
|
|
1131
1204
|
});
|
|
1132
|
-
|
|
1133
|
-
await
|
|
1205
|
+
farTxn.saveChanges("far create indirect element");
|
|
1206
|
+
await pushChanges(farTxn, "create indirect element");
|
|
1134
1207
|
chai.expect(t.checkIfFolderExists(t.far, farTxnProps.id, true)).to.be.false; // after push the schema folder should not be there
|
|
1135
1208
|
chai.expect(t.checkifRebaseFolderExists(t.far)).to.be.false; // after push the folder should not be there
|
|
1136
|
-
await
|
|
1209
|
+
await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x02MovePropCToA]);
|
|
1137
1210
|
const localTxnProps = t.local.txns.getLastSavedTxnProps();
|
|
1138
1211
|
chai.expect(localTxnProps).to.not.be.undefined;
|
|
1139
1212
|
chai.expect(localTxnProps.type).to.equal("Schema");
|
|
@@ -1141,13 +1214,13 @@ describe("Semantic Rebase with indirect changes", function () {
|
|
|
1141
1214
|
let elementIdLocal = "";
|
|
1142
1215
|
await t.local.txns.withIndirectTxnModeAsync(async () => {
|
|
1143
1216
|
// Insert one instance and populate to both far and local
|
|
1144
|
-
elementIdLocal = t.insertElement(
|
|
1217
|
+
elementIdLocal = t.insertElement(localTxn, "TestDomain:C", {
|
|
1145
1218
|
propA: "local_value_a",
|
|
1146
1219
|
propC: "local_value_c",
|
|
1147
1220
|
});
|
|
1148
1221
|
});
|
|
1149
|
-
|
|
1150
|
-
await
|
|
1222
|
+
localTxn.saveChanges("local create indirect element");
|
|
1223
|
+
await pullChanges(localTxn);
|
|
1151
1224
|
chai.expect(t.checkIfFolderExists(t.local, localTxnProps.id, true)).to.be.false; // because it is a no op change we are importing similar schema
|
|
1152
1225
|
chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // schema change is no op and data changes are generated on the fly and removed once rebased so rebase folder should not be there
|
|
1153
1226
|
chai.expect(Id64.isValidId64(elementIdFar) && Id64.isValidId64(elementIdLocal)).to.be.true;
|
|
@@ -1164,17 +1237,19 @@ describe("Semantic Rebase with indirect changes", function () {
|
|
|
1164
1237
|
it("Incoming data update onto local data and transforming schema change", async () => {
|
|
1165
1238
|
// This test fails but should not fail actually - needs investigation
|
|
1166
1239
|
t = await TestIModel.initialize("IncomingDataAndSchemaLocalDataChange");
|
|
1240
|
+
const farTxn = startTestTxn(t.far, "Incoming data update onto local data and transforming schema change far");
|
|
1241
|
+
const localTxn = startTestTxn(t.local, "Incoming data update onto local data and transforming schema change local");
|
|
1167
1242
|
let elementIdFar = "";
|
|
1168
1243
|
await t.far.txns.withIndirectTxnModeAsync(async () => {
|
|
1169
1244
|
// Insert one instance and populate to both far and local
|
|
1170
|
-
elementIdFar = t.insertElement(
|
|
1245
|
+
elementIdFar = t.insertElement(farTxn, "TestDomain:C", {
|
|
1171
1246
|
propA: "far_value_a",
|
|
1172
1247
|
propC: "far_value_c",
|
|
1173
1248
|
});
|
|
1174
1249
|
});
|
|
1175
|
-
|
|
1176
|
-
await
|
|
1177
|
-
await
|
|
1250
|
+
farTxn.saveChanges("far create indirect element");
|
|
1251
|
+
await pushChanges(farTxn, "create indirect element");
|
|
1252
|
+
await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x02MovePropCToA]);
|
|
1178
1253
|
const localTxnProps = t.local.txns.getLastSavedTxnProps();
|
|
1179
1254
|
chai.expect(localTxnProps).to.not.be.undefined;
|
|
1180
1255
|
chai.expect(localTxnProps.type).to.equal("Schema");
|
|
@@ -1182,14 +1257,14 @@ describe("Semantic Rebase with indirect changes", function () {
|
|
|
1182
1257
|
let elementIdLocal = "";
|
|
1183
1258
|
await t.local.txns.withIndirectTxnModeAsync(async () => {
|
|
1184
1259
|
// Insert one instance and populate to both far and local
|
|
1185
|
-
elementIdLocal = t.insertElement(
|
|
1260
|
+
elementIdLocal = t.insertElement(localTxn, "TestDomain:C", {
|
|
1186
1261
|
propA: "local_value_a",
|
|
1187
1262
|
propC: "local_value_c",
|
|
1188
1263
|
});
|
|
1189
1264
|
});
|
|
1190
|
-
|
|
1265
|
+
localTxn.saveChanges("local create indirect element");
|
|
1191
1266
|
chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.true; // there should be a rebase folder because schema change on local side
|
|
1192
|
-
await
|
|
1267
|
+
await pushChanges(localTxn, "local pulls andcreate indirect element");
|
|
1193
1268
|
chai.expect(t.checkIfFolderExists(t.local, localTxnProps.id, true)).to.be.false; // after push the schema folder should not be there
|
|
1194
1269
|
chai.expect(Id64.isValidId64(elementIdFar) && Id64.isValidId64(elementIdLocal)).to.be.true;
|
|
1195
1270
|
t.local.clearCaches(); // Clear caches to ensure we read transformed properties from iModel
|