diff options
author | Arne H Juul <arnej@yahooinc.com> | 2022-01-04 17:23:34 +0000 |
---|---|---|
committer | Arne H Juul <arnej@yahooinc.com> | 2022-01-06 15:24:03 +0000 |
commit | bba2f4139058e75526df4241b61176cbd7467696 (patch) | |
tree | d407ebac120950546d62f1eb80f9f60339b61c75 /config-application-package/src/test | |
parent | 2c88a54c47539558ea77010fd523febe52cc954c (diff) |
pick up "legacy" XML tags from services.xml
Diffstat (limited to 'config-application-package/src/test')
4 files changed, 44 insertions, 0 deletions
diff --git a/config-application-package/src/test/java/com/yahoo/config/model/application/provider/FilesApplicationPackageTest.java b/config-application-package/src/test/java/com/yahoo/config/model/application/provider/FilesApplicationPackageTest.java index ec68ed73864..ae6f9373e16 100644 --- a/config-application-package/src/test/java/com/yahoo/config/model/application/provider/FilesApplicationPackageTest.java +++ b/config-application-package/src/test/java/com/yahoo/config/model/application/provider/FilesApplicationPackageTest.java @@ -103,6 +103,16 @@ public class FilesApplicationPackageTest { } @Test + public void testLegacyOverrides() throws IOException { + File appDir = new File("src/test/resources/app-legacy-overrides"); + ApplicationPackage app = FilesApplicationPackage.fromFile(appDir); + var overrides = app.legacyOverrides(); + assertEquals(2, overrides.size()); + assertEquals("something here", overrides.get("foo-bar")); + assertEquals("false", overrides.get("v7-geo-positions")); + } + + @Test public void failOnEmptyServicesXml() throws IOException { File appDir = temporaryFolder.newFolder(); IOUtils.copyDirectory(new File("src/test/resources/multienvapp"), appDir); diff --git a/config-application-package/src/test/resources/app-legacy-overrides/hosts.xml b/config-application-package/src/test/resources/app-legacy-overrides/hosts.xml new file mode 100644 index 00000000000..64a07644038 --- /dev/null +++ b/config-application-package/src/test/resources/app-legacy-overrides/hosts.xml @@ -0,0 +1,10 @@ +<!-- Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. --> +<hosts xmlns:deploy="vespa" xmlns:preprocess="properties"> + <preprocess:properties> + <node1.hostname>foo.yahoo.com</node1.hostname> + <node1.hostname deploy:environment="dev">bar.yahoo.com</node1.hostname> + </preprocess:properties> + <host name="${node1.hostname}"> + <alias>node1</alias> + </host> +</hosts> diff --git a/config-application-package/src/test/resources/app-legacy-overrides/schemas/music.sd b/config-application-package/src/test/resources/app-legacy-overrides/schemas/music.sd new file mode 100644 index 00000000000..7da7c49c162 --- /dev/null +++ b/config-application-package/src/test/resources/app-legacy-overrides/schemas/music.sd @@ -0,0 +1,8 @@ +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +search music { + document music { + field f type string { + indexing: index | summary + } + } +} diff --git a/config-application-package/src/test/resources/app-legacy-overrides/services.xml b/config-application-package/src/test/resources/app-legacy-overrides/services.xml new file mode 100644 index 00000000000..5f8201336ef --- /dev/null +++ b/config-application-package/src/test/resources/app-legacy-overrides/services.xml @@ -0,0 +1,16 @@ +<!-- Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. --> +<services version='1.0'> + <legacy> + <foo-bar>something here</foo-bar> + <v7-geo-positions>false</v7-geo-positions> + </legacy> + <admin version='2.0'> + <adminserver hostalias='node0'/> + </admin> + <content version='1.0' id='foo'> + <redundancy>1</redundancy> + <documents> + <document type="music.sd" mode="index" /> + </documents> + </content> +</services> |