# Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - name: test_add_catalog_resolves_later_create_surface description: A createSurface naming a catalog the processor does not hold fails with CatalogError, and succeeds once addCatalog has added that catalog. action: process_messages protocolVersion: "1.0" catalogPaths: - "conformance/test_data/catalogs/simplified_catalog_v1_0.json" steps: - messages: - version: "1.0" createSurface: surfaceId: "s_late" catalogId: "conformance/custom" expectError: category: "CatalogError" - addCatalogPaths: - "conformance/test_data/catalogs/custom_catalog_v1_0.json" messages: - version: "1.0" createSurface: surfaceId: "s_late" catalogId: "conformance/custom" expect: surfaces: s_late: exists: true - name: test_add_catalog_keeps_catalogs_of_earlier_surface description: A surface created before addCatalog keeps the catalogs it was created with, so a component on it that names the added catalog fails with CatalogError. A surface created afterwards can use the same component. action: process_messages protocolVersion: "1.0" catalogPaths: - "conformance/test_data/catalogs/simplified_catalog_v1_0.json" steps: - messages: - version: "1.0" createSurface: surfaceId: "s_early" catalogId: "conformance/simplified" - addCatalogPaths: - "conformance/test_data/catalogs/custom_catalog_v1_0.json" messages: - version: "1.0" updateComponents: surfaceId: "s_early" components: - id: "root" component: "Gauge" catalogId: "conformance/custom" value: 42 expectError: category: "CatalogError" - messages: - version: "1.0" createSurface: surfaceId: "s_late" catalogId: "conformance/custom" - version: "1.0" updateComponents: surfaceId: "s_late" components: - id: "root" component: "Gauge" value: 42 expect: surfaces: s_late: exists: true - name: test_add_catalog_rejects_held_catalog_id description: addCatalog fails with CatalogError for a catalog whose id the processor already holds. action: process_messages protocolVersion: "1.0" catalogPaths: - "conformance/test_data/catalogs/simplified_catalog_v1_0.json" steps: - addCatalogPaths: - "conformance/test_data/catalogs/simplified_catalog_v1_0.json" expectError: category: "CatalogError"