From 379baf8281a30601f83aaa70dfe10f54ae40e5e3 Mon Sep 17 00:00:00 2001 From: Harald Musum Date: Fri, 11 Sep 2020 12:18:47 +0200 Subject: Move back files used by C++ code --- .../subscription/CfgConfigPayloadBuilderTest.java | 2 +- .../subscription/ConfigInstancePayloadTest.java | 2 +- .../subscription/ConfigInstanceUtilTest.java | 2 +- .../vespa/config/ConfigDefinitionBuilderTest.java | 2 +- .../yahoo/vespa/config/util/ConfigUtilsTest.java | 8 +- .../src/test/resources/configdefinitions/bar.def | 4 + .../src/test/resources/configdefinitions/baz.def | 4 + .../test/resources/configdefinitions/bootstrap.def | 6 ++ .../resources/configdefinitions/config.bar.def | 4 - .../resources/configdefinitions/config.baz.def | 4 - .../configdefinitions/config.bootstrap.def | 6 -- .../resources/configdefinitions/config.foo.def | 7 -- .../resources/configdefinitions/config.foobar.def | 4 - .../configdefinitions/config.foodefault.def | 4 - .../configdefinitions/config.function-test.def | 74 ------------------ .../resources/configdefinitions/config.motd.def | 84 --------------------- .../test/resources/configdefinitions/config.my.def | 4 - .../src/test/resources/configdefinitions/foo.def | 7 ++ .../test/resources/configdefinitions/foobar.def | 4 + .../resources/configdefinitions/foodefault.def | 4 + .../resources/configdefinitions/function-test.def | 74 ++++++++++++++++++ .../src/test/resources/configdefinitions/motd.def | 84 +++++++++++++++++++++ config/src/test/resources/configdefinitions/my.def | 4 + .../test/resources/configs/def-files-nogen/app.def | 8 ++ .../configs/def-files-nogen/foo.bar.app.def | 8 -- .../src/test/resources/configs/def-files/app.def | 8 ++ .../resources/configs/def-files/arraytypes.def | 11 +++ .../resources/configs/def-files/defaulttest.def | 8 ++ .../test/resources/configs/def-files/foo.app.def | 8 -- .../resources/configs/def-files/foo.arraytypes.def | 11 --- .../configs/def-files/foo.defaulttest.def | 8 -- .../configs/def-files/foo.function-test.def | 88 ---------------------- .../test/resources/configs/def-files/foo.int.def | 4 - .../resources/configs/def-files/foo.maptypes.def | 13 ---- .../configs/def-files/foo.simpletypes.def | 11 --- .../configs/def-files/foo.specialtypes.def | 4 - .../resources/configs/def-files/foo.string.def | 4 - .../configs/def-files/foo.structtypes.def | 21 ------ .../configs/def-files/foo.test-nodefs.def | 16 ---- .../configs/def-files/foo.test-nonstring.def | 9 --- .../configs/def-files/foo.test-reference.def | 4 - .../configs/def-files/foo.testnamespace.def | 3 - .../resources/configs/def-files/foo.unicode.def | 5 -- .../resources/configs/def-files/function-test.def | 88 ++++++++++++++++++++++ .../src/test/resources/configs/def-files/int.def | 4 + .../test/resources/configs/def-files/maptypes.def | 13 ++++ .../def-files/myproject.config.namespace.def | 5 -- .../test/resources/configs/def-files/namespace.def | 5 ++ .../resources/configs/def-files/simpletypes.def | 11 +++ .../resources/configs/def-files/specialtypes.def | 4 + .../test/resources/configs/def-files/string.def | 4 + .../resources/configs/def-files/structtypes.def | 21 ++++++ .../resources/configs/def-files/test-nodefs.def | 16 ++++ .../resources/configs/def-files/test-nonstring.def | 9 +++ .../resources/configs/def-files/test-reference.def | 4 + .../resources/configs/def-files/testnamespace.def | 3 + .../test/resources/configs/def-files/unicode.def | 5 ++ ...agebus.protocol.documentrouteselectorpolicy.def | 11 --- .../documentrouteselectorpolicy.def | 11 +++ ....config.filedistribution.filedistributorrpc.def | 3 - .../configdefinitions/filedistributorrpc.def | 3 + .../configdefinitions/cloud.config.log.logd.def | 44 ----------- logd/src/main/resources/configdefinitions/logd.def | 44 +++++++++++ messagebus/src/main/config/messagebus.def | 29 +++++++ .../src/main/config/messagebus.messagebus.def | 29 ------- 65 files changed, 508 insertions(+), 508 deletions(-) create mode 100644 config/src/test/resources/configdefinitions/bar.def create mode 100644 config/src/test/resources/configdefinitions/baz.def create mode 100644 config/src/test/resources/configdefinitions/bootstrap.def delete mode 100644 config/src/test/resources/configdefinitions/config.bar.def delete mode 100644 config/src/test/resources/configdefinitions/config.baz.def delete mode 100644 config/src/test/resources/configdefinitions/config.bootstrap.def delete mode 100644 config/src/test/resources/configdefinitions/config.foo.def delete mode 100644 config/src/test/resources/configdefinitions/config.foobar.def delete mode 100644 config/src/test/resources/configdefinitions/config.foodefault.def delete mode 100644 config/src/test/resources/configdefinitions/config.function-test.def delete mode 100644 config/src/test/resources/configdefinitions/config.motd.def delete mode 100644 config/src/test/resources/configdefinitions/config.my.def create mode 100644 config/src/test/resources/configdefinitions/foo.def create mode 100644 config/src/test/resources/configdefinitions/foobar.def create mode 100644 config/src/test/resources/configdefinitions/foodefault.def create mode 100644 config/src/test/resources/configdefinitions/function-test.def create mode 100644 config/src/test/resources/configdefinitions/motd.def create mode 100644 config/src/test/resources/configdefinitions/my.def create mode 100644 config/src/test/resources/configs/def-files-nogen/app.def delete mode 100644 config/src/test/resources/configs/def-files-nogen/foo.bar.app.def create mode 100644 config/src/test/resources/configs/def-files/app.def create mode 100644 config/src/test/resources/configs/def-files/arraytypes.def create mode 100644 config/src/test/resources/configs/def-files/defaulttest.def delete mode 100644 config/src/test/resources/configs/def-files/foo.app.def delete mode 100644 config/src/test/resources/configs/def-files/foo.arraytypes.def delete mode 100644 config/src/test/resources/configs/def-files/foo.defaulttest.def delete mode 100644 config/src/test/resources/configs/def-files/foo.function-test.def delete mode 100755 config/src/test/resources/configs/def-files/foo.int.def delete mode 100644 config/src/test/resources/configs/def-files/foo.maptypes.def delete mode 100644 config/src/test/resources/configs/def-files/foo.simpletypes.def delete mode 100644 config/src/test/resources/configs/def-files/foo.specialtypes.def delete mode 100755 config/src/test/resources/configs/def-files/foo.string.def delete mode 100644 config/src/test/resources/configs/def-files/foo.structtypes.def delete mode 100644 config/src/test/resources/configs/def-files/foo.test-nodefs.def delete mode 100644 config/src/test/resources/configs/def-files/foo.test-nonstring.def delete mode 100644 config/src/test/resources/configs/def-files/foo.test-reference.def delete mode 100644 config/src/test/resources/configs/def-files/foo.testnamespace.def delete mode 100644 config/src/test/resources/configs/def-files/foo.unicode.def create mode 100644 config/src/test/resources/configs/def-files/function-test.def create mode 100755 config/src/test/resources/configs/def-files/int.def create mode 100644 config/src/test/resources/configs/def-files/maptypes.def delete mode 100644 config/src/test/resources/configs/def-files/myproject.config.namespace.def create mode 100644 config/src/test/resources/configs/def-files/namespace.def create mode 100644 config/src/test/resources/configs/def-files/simpletypes.def create mode 100644 config/src/test/resources/configs/def-files/specialtypes.def create mode 100755 config/src/test/resources/configs/def-files/string.def create mode 100644 config/src/test/resources/configs/def-files/structtypes.def create mode 100644 config/src/test/resources/configs/def-files/test-nodefs.def create mode 100644 config/src/test/resources/configs/def-files/test-nonstring.def create mode 100644 config/src/test/resources/configs/def-files/test-reference.def create mode 100644 config/src/test/resources/configs/def-files/testnamespace.def create mode 100644 config/src/test/resources/configs/def-files/unicode.def delete mode 100644 documentapi/src/main/resources/configdefinitions/documentapi.messagebus.protocol.documentrouteselectorpolicy.def create mode 100644 documentapi/src/main/resources/configdefinitions/documentrouteselectorpolicy.def delete mode 100644 fileacquirer/src/main/resources/configdefinitions/cloud.config.filedistribution.filedistributorrpc.def create mode 100644 fileacquirer/src/main/resources/configdefinitions/filedistributorrpc.def delete mode 100644 logd/src/main/resources/configdefinitions/cloud.config.log.logd.def create mode 100644 logd/src/main/resources/configdefinitions/logd.def create mode 100644 messagebus/src/main/config/messagebus.def delete mode 100644 messagebus/src/main/config/messagebus.messagebus.def diff --git a/config/src/test/java/com/yahoo/config/subscription/CfgConfigPayloadBuilderTest.java b/config/src/test/java/com/yahoo/config/subscription/CfgConfigPayloadBuilderTest.java index 1c36fdcfed3..c8693227920 100644 --- a/config/src/test/java/com/yahoo/config/subscription/CfgConfigPayloadBuilderTest.java +++ b/config/src/test/java/com/yahoo/config/subscription/CfgConfigPayloadBuilderTest.java @@ -33,7 +33,7 @@ public class CfgConfigPayloadBuilderTest { " ':parent',", " 'parent:'", " ],", - " 'pathVal': 'src/test/resources/configs/def-files/foo.function-test.def',", + " 'pathVal': 'src/test/resources/configs/def-files/function-test.def',", " 'string_val': 'foo',", " 'myStructMap': {", " 'one': {", diff --git a/config/src/test/java/com/yahoo/config/subscription/ConfigInstancePayloadTest.java b/config/src/test/java/com/yahoo/config/subscription/ConfigInstancePayloadTest.java index b031e3b985a..49fd25b6476 100644 --- a/config/src/test/java/com/yahoo/config/subscription/ConfigInstancePayloadTest.java +++ b/config/src/test/java/com/yahoo/config/subscription/ConfigInstancePayloadTest.java @@ -46,7 +46,7 @@ public class ConfigInstancePayloadTest { refval(":parent:"). refwithdef(":parent:"). fileVal("etc"). - pathVal(FileReference.mockFileReferenceForUnitTesting(new File("src/test/resources/configs/def-files/foo.function-test.def"))). + pathVal(FileReference.mockFileReferenceForUnitTesting(new File("src/test/resources/configs/def-files/function-test.def"))). boolarr(false). longarr(9223372036854775807L). longarr(-9223372036854775808L). diff --git a/config/src/test/java/com/yahoo/config/subscription/ConfigInstanceUtilTest.java b/config/src/test/java/com/yahoo/config/subscription/ConfigInstanceUtilTest.java index 8464a2a0067..fa24988709a 100644 --- a/config/src/test/java/com/yahoo/config/subscription/ConfigInstanceUtilTest.java +++ b/config/src/test/java/com/yahoo/config/subscription/ConfigInstanceUtilTest.java @@ -94,7 +94,7 @@ public class ConfigInstanceUtilTest { refval(":parent:"). refwithdef(":parent:"). fileVal("etc"). - pathVal(FileReference.mockFileReferenceForUnitTesting(new File("src/test/resources/configs/def-files/foo.function-test.def"))). + pathVal(FileReference.mockFileReferenceForUnitTesting(new File("src/test/resources/configs/def-files/function-test.def"))). boolarr(false). longarr(9223372036854775807L). longarr(-9223372036854775808L). diff --git a/config/src/test/java/com/yahoo/vespa/config/ConfigDefinitionBuilderTest.java b/config/src/test/java/com/yahoo/vespa/config/ConfigDefinitionBuilderTest.java index 42b7958161a..810b9f58829 100644 --- a/config/src/test/java/com/yahoo/vespa/config/ConfigDefinitionBuilderTest.java +++ b/config/src/test/java/com/yahoo/vespa/config/ConfigDefinitionBuilderTest.java @@ -20,7 +20,7 @@ import static org.junit.Assert.*; public class ConfigDefinitionBuilderTest { private static final String TEST_DIR = "src/test/resources/configs/def-files"; - private static final String DEF_NAME = TEST_DIR + "/foo.function-test.def"; + private static final String DEF_NAME = TEST_DIR + "/function-test.def"; @Test diff --git a/config/src/test/java/com/yahoo/vespa/config/util/ConfigUtilsTest.java b/config/src/test/java/com/yahoo/vespa/config/util/ConfigUtilsTest.java index 821a351dd89..0276f3c4f1c 100644 --- a/config/src/test/java/com/yahoo/vespa/config/util/ConfigUtilsTest.java +++ b/config/src/test/java/com/yahoo/vespa/config/util/ConfigUtilsTest.java @@ -187,7 +187,7 @@ public class ConfigUtilsTest { public void testCreateConfigDefinitionKeyFromDefFile() { ConfigDefinitionKey def = null; try { - def = ConfigUtils.createConfigDefinitionKeyFromDefFile(new File("src/test/resources/configs/def-files/foo.app.def")); + def = ConfigUtils.createConfigDefinitionKeyFromDefFile(new File("src/test/resources/configs/def-files/app.def")); } catch (IOException e) { e.printStackTrace(); fail(); @@ -196,7 +196,7 @@ public class ConfigUtilsTest { assertThat(def.getNamespace(), is("foo")); try { - def = ConfigUtils.createConfigDefinitionKeyFromDefFile(new File("src/test/resources/configs/def-files/foo.testnamespace.def")); + def = ConfigUtils.createConfigDefinitionKeyFromDefFile(new File("src/test/resources/configs/def-files/testnamespace.def")); } catch (IOException e) { e.printStackTrace(); fail(); @@ -205,7 +205,7 @@ public class ConfigUtilsTest { assertThat(def.getNamespace(), is("foo")); try { - byte[] content = IOUtils.readFileBytes(new File("src/test/resources/configs/def-files/foo.app.def")); + byte[] content = IOUtils.readFileBytes(new File("src/test/resources/configs/def-files/app.def")); def = ConfigUtils.createConfigDefinitionKeyFromDefContent("app", content); } catch (IOException e) { fail(); @@ -214,7 +214,7 @@ public class ConfigUtilsTest { assertThat(def.getNamespace(), is("foo")); try { - byte[] content = IOUtils.readFileBytes(new File("src/test/resources/configs/def-files-nogen/foo.bar.app.def")); + byte[] content = IOUtils.readFileBytes(new File("src/test/resources/configs/def-files-nogen/app.def")); def = ConfigUtils.createConfigDefinitionKeyFromDefContent("app", content); } catch (IOException e) { fail(); diff --git a/config/src/test/resources/configdefinitions/bar.def b/config/src/test/resources/configdefinitions/bar.def new file mode 100644 index 00000000000..8e97154d3d5 --- /dev/null +++ b/config/src/test/resources/configdefinitions/bar.def @@ -0,0 +1,4 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=config + +barValue string default="defaultBar" diff --git a/config/src/test/resources/configdefinitions/baz.def b/config/src/test/resources/configdefinitions/baz.def new file mode 100644 index 00000000000..ff3101e52a6 --- /dev/null +++ b/config/src/test/resources/configdefinitions/baz.def @@ -0,0 +1,4 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=config + +bazValue string default="defaultBaz" diff --git a/config/src/test/resources/configdefinitions/bootstrap.def b/config/src/test/resources/configdefinitions/bootstrap.def new file mode 100644 index 00000000000..f0e5b3db71a --- /dev/null +++ b/config/src/test/resources/configdefinitions/bootstrap.def @@ -0,0 +1,6 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=config + +component[].name string +component[].configid string + diff --git a/config/src/test/resources/configdefinitions/config.bar.def b/config/src/test/resources/configdefinitions/config.bar.def deleted file mode 100644 index 8e97154d3d5..00000000000 --- a/config/src/test/resources/configdefinitions/config.bar.def +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -namespace=config - -barValue string default="defaultBar" diff --git a/config/src/test/resources/configdefinitions/config.baz.def b/config/src/test/resources/configdefinitions/config.baz.def deleted file mode 100644 index ff3101e52a6..00000000000 --- a/config/src/test/resources/configdefinitions/config.baz.def +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -namespace=config - -bazValue string default="defaultBaz" diff --git a/config/src/test/resources/configdefinitions/config.bootstrap.def b/config/src/test/resources/configdefinitions/config.bootstrap.def deleted file mode 100644 index f0e5b3db71a..00000000000 --- a/config/src/test/resources/configdefinitions/config.bootstrap.def +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -namespace=config - -component[].name string -component[].configid string - diff --git a/config/src/test/resources/configdefinitions/config.foo.def b/config/src/test/resources/configdefinitions/config.foo.def deleted file mode 100644 index d7357822e7e..00000000000 --- a/config/src/test/resources/configdefinitions/config.foo.def +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -namespace=config - -fooValue string -fooArray[] int -fooStruct[].innerStruct[].bar int -fooMap{} int diff --git a/config/src/test/resources/configdefinitions/config.foobar.def b/config/src/test/resources/configdefinitions/config.foobar.def deleted file mode 100644 index 59f0bbd9913..00000000000 --- a/config/src/test/resources/configdefinitions/config.foobar.def +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -namespace=config - -fooBarValue string default="defaultFooBar" diff --git a/config/src/test/resources/configdefinitions/config.foodefault.def b/config/src/test/resources/configdefinitions/config.foodefault.def deleted file mode 100644 index 4b9014b9274..00000000000 --- a/config/src/test/resources/configdefinitions/config.foodefault.def +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -namespace=config - -fooValue string default = "per" diff --git a/config/src/test/resources/configdefinitions/config.function-test.def b/config/src/test/resources/configdefinitions/config.function-test.def deleted file mode 100644 index 2e18fb2ee8c..00000000000 --- a/config/src/test/resources/configdefinitions/config.function-test.def +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -# -# This def file should test most aspects of def files that makes a difference -# for the autogenerated config classes. The goal is to trigger all blocks of -# code in the code generators. This includes: -# -# - Use all legal special characters in the def file name, to ensure that those -# that needs to be replaced in type names are actually replaced. -# - Use the same enum type twice to verify that we dont declare or define it -# twice. -# - Use the same struct type twice for the same reason. -# - Include arrays of primitives and structs. -# - Include enum primitives and array of enums. Arrays of enums must be handled -# specially by the C++ code. -# - Include enums both with and without default values. -# - Include primitive string, numbers & doubles both with and without default -# values. -# - Have an array within a struct, to verify that we correctly recurse. -# - Reuse type name further within to ensure that this works. - -namespace=config - -# Some random bool without a default value. These comments exist to check - # that comment parsing works. -bool_val bool - ## A bool with a default value set. -bool_with_def bool default=false -int_val int -int_with_def int default=-545 -long_val long -long_with_def long default=-50000000000 -double_val double -double_with_def double default=-6.43 -# Another comment -string_val string -stringwithdef string default="foobar" -enum_val enum { FOO, BAR, FOOBAR } -enumwithdef enum { FOO2, BAR2, FOOBAR2 } default=BAR2 -onechoice enum { ONLYFOO } default=ONLYFOO -refval reference -refwithdef reference default=":parent:" -fileVal file - -boolarr[] bool -intarr[] int -longarr[] long -doublearr[] double -stringarr[] string -enumarr[] enum { ARRAY, VALUES } -refarr[] reference -fileArr[] file - -# A basic struct -basicStruct.foo string default="basic" -basicStruct.bar int -basicStruct.intArr[] int - -# A struct of struct -rootStruct.inner0.name string default="inner0" -rootStruct.inner0.index int -rootStruct.inner1.name string default="inner1" -rootStruct.inner1.index int -rootStruct.inner2.array[] int -rootStruct.innerArr[].boolVal bool default=false -rootStruct.innerArr[].stringVal string - -myarray[].intval int default=14 -myarray[].stringval[] string -myarray[].enumval enum { INNER, ENUM, TYPE } default=TYPE -myarray[].refval reference # Value in array without default -myarray[].fileVal file -myarray[].anotherarray[].foo int default=-4 -myarray[].myStruct.a int -myarray[].myStruct.b int default=2 diff --git a/config/src/test/resources/configdefinitions/config.motd.def b/config/src/test/resources/configdefinitions/config.motd.def deleted file mode 100644 index 95ac367560d..00000000000 --- a/config/src/test/resources/configdefinitions/config.motd.def +++ /dev/null @@ -1,84 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -# -# This def file should test most aspects of def files that makes a difference -# for the autogenerated config classes. The goal is to trigger all blocks of -# code in the code generators. This includes: -# -# - Use all legal special characters in the def file name, to ensure that those -# that needs to be replaced in type names are actually replaced. -# - Use the same enum type twice to verify that we dont declare or define it -# twice. -# - Use the same struct type twice for the same reason. -# - Include arrays of primitives and structs. -# - Include enum primitives and array of enums. Arrays of enums must be handled -# specially by the C++ code. -# - Include enums both with and without default values. -# - Include primitive string, numbers & doubles both with and without default -# values. -# - Have an array within a struct, to verify that we correctly recurse. -# - Reuse type name further within to ensure that this works. - -namespace=config - -# Some random bool without a default value. These comments exist to check - # that comment parsing works.e -boolVal bool - ## A bool with a default value set. -bool_with_def bool default=false -intVal int -intWithDef int default=-545 -longVal long -longWithDef long default=1234567890123 -doubleVal double -double_with_def double default=-6.43 -# Another comment -stringVal string -stringwithdef string default="foobar" -stringnulldef string default="null" -enumVal enum { FOO, BAR, FOOBAR } -enumwithdef enum { FOO2, BAR2, FOOBAR2 } default=BAR2 -refVal reference -refwithdef reference default=":parent:" -fileVal file - -boolarr[] bool -intarr[] int -longarr[] long -doublearr[] double -stringarr[] string -enumarr[] enum { ARRAY, VALUES } -refarr[] reference -filearr[] file - -boolmap{} bool -intmap{} int -longmap{} long -doublemap{} double -stringmap{} string -enummap{} enum { LOL1, LOL2 } -refmap{} reference -filemap{} file - -structmap{}.foo int -mapmap{}.map{}.bar int - -# A basic struct -basic_struct.foo string default="foo" -basic_struct.bar int default=0 - -# A struct of struct -struct_of_struct.inner0.name string default="inner0" -struct_of_struct.inner0.index int default=0 -struct_of_struct.inner1.name string default="inner1" -struct_of_struct.inner1.index int default=1 - -myArray[].intVal int default=14 -myArray[].stringVal[] string -myArray[].enumVal enum { INNER, ENUM, TYPE } default=TYPE -myArray[].refVal reference # Value in array without default -myArray[].anotherArray[].foo int default=-4 - -value string default="value" -buffer int default=-1 -rhs string default="rhs" -lines string default="lines" diff --git a/config/src/test/resources/configdefinitions/config.my.def b/config/src/test/resources/configdefinitions/config.my.def deleted file mode 100644 index 3999cc46273..00000000000 --- a/config/src/test/resources/configdefinitions/config.my.def +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -namespace=config - -myField string diff --git a/config/src/test/resources/configdefinitions/foo.def b/config/src/test/resources/configdefinitions/foo.def new file mode 100644 index 00000000000..d7357822e7e --- /dev/null +++ b/config/src/test/resources/configdefinitions/foo.def @@ -0,0 +1,7 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=config + +fooValue string +fooArray[] int +fooStruct[].innerStruct[].bar int +fooMap{} int diff --git a/config/src/test/resources/configdefinitions/foobar.def b/config/src/test/resources/configdefinitions/foobar.def new file mode 100644 index 00000000000..59f0bbd9913 --- /dev/null +++ b/config/src/test/resources/configdefinitions/foobar.def @@ -0,0 +1,4 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=config + +fooBarValue string default="defaultFooBar" diff --git a/config/src/test/resources/configdefinitions/foodefault.def b/config/src/test/resources/configdefinitions/foodefault.def new file mode 100644 index 00000000000..4b9014b9274 --- /dev/null +++ b/config/src/test/resources/configdefinitions/foodefault.def @@ -0,0 +1,4 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=config + +fooValue string default = "per" diff --git a/config/src/test/resources/configdefinitions/function-test.def b/config/src/test/resources/configdefinitions/function-test.def new file mode 100644 index 00000000000..2e18fb2ee8c --- /dev/null +++ b/config/src/test/resources/configdefinitions/function-test.def @@ -0,0 +1,74 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +# +# This def file should test most aspects of def files that makes a difference +# for the autogenerated config classes. The goal is to trigger all blocks of +# code in the code generators. This includes: +# +# - Use all legal special characters in the def file name, to ensure that those +# that needs to be replaced in type names are actually replaced. +# - Use the same enum type twice to verify that we dont declare or define it +# twice. +# - Use the same struct type twice for the same reason. +# - Include arrays of primitives and structs. +# - Include enum primitives and array of enums. Arrays of enums must be handled +# specially by the C++ code. +# - Include enums both with and without default values. +# - Include primitive string, numbers & doubles both with and without default +# values. +# - Have an array within a struct, to verify that we correctly recurse. +# - Reuse type name further within to ensure that this works. + +namespace=config + +# Some random bool without a default value. These comments exist to check + # that comment parsing works. +bool_val bool + ## A bool with a default value set. +bool_with_def bool default=false +int_val int +int_with_def int default=-545 +long_val long +long_with_def long default=-50000000000 +double_val double +double_with_def double default=-6.43 +# Another comment +string_val string +stringwithdef string default="foobar" +enum_val enum { FOO, BAR, FOOBAR } +enumwithdef enum { FOO2, BAR2, FOOBAR2 } default=BAR2 +onechoice enum { ONLYFOO } default=ONLYFOO +refval reference +refwithdef reference default=":parent:" +fileVal file + +boolarr[] bool +intarr[] int +longarr[] long +doublearr[] double +stringarr[] string +enumarr[] enum { ARRAY, VALUES } +refarr[] reference +fileArr[] file + +# A basic struct +basicStruct.foo string default="basic" +basicStruct.bar int +basicStruct.intArr[] int + +# A struct of struct +rootStruct.inner0.name string default="inner0" +rootStruct.inner0.index int +rootStruct.inner1.name string default="inner1" +rootStruct.inner1.index int +rootStruct.inner2.array[] int +rootStruct.innerArr[].boolVal bool default=false +rootStruct.innerArr[].stringVal string + +myarray[].intval int default=14 +myarray[].stringval[] string +myarray[].enumval enum { INNER, ENUM, TYPE } default=TYPE +myarray[].refval reference # Value in array without default +myarray[].fileVal file +myarray[].anotherarray[].foo int default=-4 +myarray[].myStruct.a int +myarray[].myStruct.b int default=2 diff --git a/config/src/test/resources/configdefinitions/motd.def b/config/src/test/resources/configdefinitions/motd.def new file mode 100644 index 00000000000..95ac367560d --- /dev/null +++ b/config/src/test/resources/configdefinitions/motd.def @@ -0,0 +1,84 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +# +# This def file should test most aspects of def files that makes a difference +# for the autogenerated config classes. The goal is to trigger all blocks of +# code in the code generators. This includes: +# +# - Use all legal special characters in the def file name, to ensure that those +# that needs to be replaced in type names are actually replaced. +# - Use the same enum type twice to verify that we dont declare or define it +# twice. +# - Use the same struct type twice for the same reason. +# - Include arrays of primitives and structs. +# - Include enum primitives and array of enums. Arrays of enums must be handled +# specially by the C++ code. +# - Include enums both with and without default values. +# - Include primitive string, numbers & doubles both with and without default +# values. +# - Have an array within a struct, to verify that we correctly recurse. +# - Reuse type name further within to ensure that this works. + +namespace=config + +# Some random bool without a default value. These comments exist to check + # that comment parsing works.e +boolVal bool + ## A bool with a default value set. +bool_with_def bool default=false +intVal int +intWithDef int default=-545 +longVal long +longWithDef long default=1234567890123 +doubleVal double +double_with_def double default=-6.43 +# Another comment +stringVal string +stringwithdef string default="foobar" +stringnulldef string default="null" +enumVal enum { FOO, BAR, FOOBAR } +enumwithdef enum { FOO2, BAR2, FOOBAR2 } default=BAR2 +refVal reference +refwithdef reference default=":parent:" +fileVal file + +boolarr[] bool +intarr[] int +longarr[] long +doublearr[] double +stringarr[] string +enumarr[] enum { ARRAY, VALUES } +refarr[] reference +filearr[] file + +boolmap{} bool +intmap{} int +longmap{} long +doublemap{} double +stringmap{} string +enummap{} enum { LOL1, LOL2 } +refmap{} reference +filemap{} file + +structmap{}.foo int +mapmap{}.map{}.bar int + +# A basic struct +basic_struct.foo string default="foo" +basic_struct.bar int default=0 + +# A struct of struct +struct_of_struct.inner0.name string default="inner0" +struct_of_struct.inner0.index int default=0 +struct_of_struct.inner1.name string default="inner1" +struct_of_struct.inner1.index int default=1 + +myArray[].intVal int default=14 +myArray[].stringVal[] string +myArray[].enumVal enum { INNER, ENUM, TYPE } default=TYPE +myArray[].refVal reference # Value in array without default +myArray[].anotherArray[].foo int default=-4 + +value string default="value" +buffer int default=-1 +rhs string default="rhs" +lines string default="lines" diff --git a/config/src/test/resources/configdefinitions/my.def b/config/src/test/resources/configdefinitions/my.def new file mode 100644 index 00000000000..3999cc46273 --- /dev/null +++ b/config/src/test/resources/configdefinitions/my.def @@ -0,0 +1,4 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=config + +myField string diff --git a/config/src/test/resources/configs/def-files-nogen/app.def b/config/src/test/resources/configs/def-files-nogen/app.def new file mode 100644 index 00000000000..6082072695a --- /dev/null +++ b/config/src/test/resources/configs/def-files-nogen/app.def @@ -0,0 +1,8 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=mynamespace + +message string default="Hello!" + +times int default=1 + +a[].name string diff --git a/config/src/test/resources/configs/def-files-nogen/foo.bar.app.def b/config/src/test/resources/configs/def-files-nogen/foo.bar.app.def deleted file mode 100644 index 6082072695a..00000000000 --- a/config/src/test/resources/configs/def-files-nogen/foo.bar.app.def +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -namespace=mynamespace - -message string default="Hello!" - -times int default=1 - -a[].name string diff --git a/config/src/test/resources/configs/def-files/app.def b/config/src/test/resources/configs/def-files/app.def new file mode 100644 index 00000000000..37c3dd75e26 --- /dev/null +++ b/config/src/test/resources/configs/def-files/app.def @@ -0,0 +1,8 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=foo + +message string default="Hello!" + +times int default=1 + +a[].name string diff --git a/config/src/test/resources/configs/def-files/arraytypes.def b/config/src/test/resources/configs/def-files/arraytypes.def new file mode 100644 index 00000000000..ad18c4e5386 --- /dev/null +++ b/config/src/test/resources/configs/def-files/arraytypes.def @@ -0,0 +1,11 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +# Config containing only simple array types that can be used for testing +# individual types in detail. +namespace=foo + +boolarr[] bool +doublearr[] double +enumarr[] enum { VAL1, VAL2 } +intarr[] int +longarr[] long +stringarr[] string diff --git a/config/src/test/resources/configs/def-files/defaulttest.def b/config/src/test/resources/configs/def-files/defaulttest.def new file mode 100644 index 00000000000..fa8005b77c3 --- /dev/null +++ b/config/src/test/resources/configs/def-files/defaulttest.def @@ -0,0 +1,8 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=foo + +nondefaultstring string +defaultstring string default="thedefault" + +nondefaultreference reference +defaultreference reference default="thedefault" diff --git a/config/src/test/resources/configs/def-files/foo.app.def b/config/src/test/resources/configs/def-files/foo.app.def deleted file mode 100644 index 37c3dd75e26..00000000000 --- a/config/src/test/resources/configs/def-files/foo.app.def +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -namespace=foo - -message string default="Hello!" - -times int default=1 - -a[].name string diff --git a/config/src/test/resources/configs/def-files/foo.arraytypes.def b/config/src/test/resources/configs/def-files/foo.arraytypes.def deleted file mode 100644 index ad18c4e5386..00000000000 --- a/config/src/test/resources/configs/def-files/foo.arraytypes.def +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -# Config containing only simple array types that can be used for testing -# individual types in detail. -namespace=foo - -boolarr[] bool -doublearr[] double -enumarr[] enum { VAL1, VAL2 } -intarr[] int -longarr[] long -stringarr[] string diff --git a/config/src/test/resources/configs/def-files/foo.defaulttest.def b/config/src/test/resources/configs/def-files/foo.defaulttest.def deleted file mode 100644 index fa8005b77c3..00000000000 --- a/config/src/test/resources/configs/def-files/foo.defaulttest.def +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -namespace=foo - -nondefaultstring string -defaultstring string default="thedefault" - -nondefaultreference reference -defaultreference reference default="thedefault" diff --git a/config/src/test/resources/configs/def-files/foo.function-test.def b/config/src/test/resources/configs/def-files/foo.function-test.def deleted file mode 100644 index 24eeb81ab7a..00000000000 --- a/config/src/test/resources/configs/def-files/foo.function-test.def +++ /dev/null @@ -1,88 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -# -# This def file should test most aspects of def files that makes a difference -# for the autogenerated config classes. The goal is to trigger all blocks of -# code in the code generators. This includes: -# -# - Use all legal special characters in the def file name, to ensure that those -# that needs to be replaced in type names are actually replaced. -# - Use the same enum type twice to verify that we dont declare or define it -# twice. -# - Use the same struct type twice for the same reason. -# - Include arrays of primitives and structs. -# - Include enum primitives and array of enums. Arrays of enums must be handled -# specially by the C++ code. -# - Include enums both with and without default values. -# - Include primitive string, numbers & doubles both with and without default -# values. -# - Have an array within a struct, to verify that we correctly recurse. -# - Reuse type name further within to ensure that this works. - - -namespace=foo - -# Some random bool without a default value. These comments exist to check - # that comment parsing works. -bool_val bool - ## A bool with a default value set. -bool_with_def bool default=false -int_val int -int_with_def int default=-545 -long_val long -long_with_def long default=-50000000000 -double_val double -double_with_def double default=-6.43 -# Another comment -string_val string -stringwithdef string default="foobar" -enum_val enum { FOO, BAR, FOOBAR } -enumwithdef enum { FOO2, BAR2, FOOBAR2 } default=BAR2 -onechoice enum { ONLYFOO } default=ONLYFOO -refval reference -refwithdef reference default=":parent:" -fileVal file -pathVal path - -boolarr[] bool -intarr[] int -longarr[] long -doublearr[] double -stringarr[] string -enumarr[] enum { ARRAY, VALUES } -refarr[] reference -fileArr[] file -pathArr[] path - -intMap{} int -stringMap{} string -filemap{} file -pathMap{} path - -# A basic struct -basicStruct.foo string default="basic" -basicStruct.bar int -basicStruct.intArr[] int - -# A struct of struct -rootStruct.inner0.name string default="inner0" -rootStruct.inner0.index int -rootStruct.inner1.name string default="inner1" -rootStruct.inner1.index int -rootStruct.innerArr[].boolVal bool default=false -rootStruct.innerArr[].stringVal string - -myarray[].intval int default=14 -myarray[].stringval[] string -myarray[].enumval enum { INNER, ENUM, TYPE } default=TYPE -myarray[].refval reference # Value in array without default -myarray[].fileVal file -myarray[].anotherarray[].foo int default=-4 -myarray[].myStruct.a int -myarray[].myStruct.b int default=2 - -myStructMap{}.myInt int -myStructMap{}.myString string -myStructMap{}.myIntDef int default=56 -myStructMap{}.myStringDef string default="g" -myStructMap{}.anotherMap{}.anInt int -myStructMap{}.anotherMap{}.anIntDef int default=11 diff --git a/config/src/test/resources/configs/def-files/foo.int.def b/config/src/test/resources/configs/def-files/foo.int.def deleted file mode 100755 index c1a1241c413..00000000000 --- a/config/src/test/resources/configs/def-files/foo.int.def +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -namespace=foo - -intVal int default=1 diff --git a/config/src/test/resources/configs/def-files/foo.maptypes.def b/config/src/test/resources/configs/def-files/foo.maptypes.def deleted file mode 100644 index 0e39c7ccdb9..00000000000 --- a/config/src/test/resources/configs/def-files/foo.maptypes.def +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -# Config containing only structs in various forms -namespace=foo - -boolmap{} bool -intmap{} int -longmap{} long -doublemap{} double -stringmap{} string -filemap{} file - -innermap{}.foo int -nestedmap{}.inner{} int diff --git a/config/src/test/resources/configs/def-files/foo.simpletypes.def b/config/src/test/resources/configs/def-files/foo.simpletypes.def deleted file mode 100644 index 2603e2f4100..00000000000 --- a/config/src/test/resources/configs/def-files/foo.simpletypes.def +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -namespace=foo -# Config containing only simple leaf types with default values, that can be used -# for testing individual types in detail. - -boolval bool default=false -doubleval double default=0.0 -enumval enum { VAL1, VAL2 } default=VAL1 -intval int default=0 -longval long default=0 -stringval string default="s" diff --git a/config/src/test/resources/configs/def-files/foo.specialtypes.def b/config/src/test/resources/configs/def-files/foo.specialtypes.def deleted file mode 100644 index 06fdd0d4348..00000000000 --- a/config/src/test/resources/configs/def-files/foo.specialtypes.def +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -namespace=foo -myfile file -myref reference diff --git a/config/src/test/resources/configs/def-files/foo.string.def b/config/src/test/resources/configs/def-files/foo.string.def deleted file mode 100755 index 78596515b7c..00000000000 --- a/config/src/test/resources/configs/def-files/foo.string.def +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -namespace=foo - -stringVal string default="_default_" diff --git a/config/src/test/resources/configs/def-files/foo.structtypes.def b/config/src/test/resources/configs/def-files/foo.structtypes.def deleted file mode 100644 index fe9d879fb64..00000000000 --- a/config/src/test/resources/configs/def-files/foo.structtypes.def +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -# Config containing only structs in various forms -namespace=foo - -simple.name string default="_default_" -simple.gender enum { MALE, FEMALE } default=MALE -simple.emails[] string - -nested.inner.name string default="_default_" -nested.inner.gender enum { MALE, FEMALE } default=MALE -nested.inner.emails[] string - -simplearr[].name string -simplearr[].gender enum { MALE, FEMALE } - -nestedarr[].inner.name string -nestedarr[].inner.gender enum { MALE, FEMALE } -nestedarr[].inner.emails[] string - -complexarr[].innerarr[].name string -complexarr[].innerarr[].gender enum { MALE, FEMALE } diff --git a/config/src/test/resources/configs/def-files/foo.test-nodefs.def b/config/src/test/resources/configs/def-files/foo.test-nodefs.def deleted file mode 100644 index e3b700c5732..00000000000 --- a/config/src/test/resources/configs/def-files/foo.test-nodefs.def +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -namespace=foo - -# test config vars with no defaults - -s string -j int -b bool -f double -e enum { AA, BB, CC } - -basicstruct.foo string -basicstruct.bar int - -arr[].s string -arr[].i int diff --git a/config/src/test/resources/configs/def-files/foo.test-nonstring.def b/config/src/test/resources/configs/def-files/foo.test-nonstring.def deleted file mode 100644 index eaa6fafe87d..00000000000 --- a/config/src/test/resources/configs/def-files/foo.test-nonstring.def +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -namespace=foo - -# Test non-string config vars with defaults - -i int default=0 -b bool default=false -d double default=0.0 -e enum { AA, BB, CC } default=AA diff --git a/config/src/test/resources/configs/def-files/foo.test-reference.def b/config/src/test/resources/configs/def-files/foo.test-reference.def deleted file mode 100644 index b5bbb5f4462..00000000000 --- a/config/src/test/resources/configs/def-files/foo.test-reference.def +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -namespace=foo - -configId reference default=":parent:" diff --git a/config/src/test/resources/configs/def-files/foo.testnamespace.def b/config/src/test/resources/configs/def-files/foo.testnamespace.def deleted file mode 100644 index 6e58c691097..00000000000 --- a/config/src/test/resources/configs/def-files/foo.testnamespace.def +++ /dev/null @@ -1,3 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -namespace=foo -basicStruct.stringVal string diff --git a/config/src/test/resources/configs/def-files/foo.unicode.def b/config/src/test/resources/configs/def-files/foo.unicode.def deleted file mode 100644 index 493e3e37630..00000000000 --- a/config/src/test/resources/configs/def-files/foo.unicode.def +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -namespace=foo - -unicodestring1 string -unicodestring2 string default="abc æøå 囲碁 ÆØÅ ABC" diff --git a/config/src/test/resources/configs/def-files/function-test.def b/config/src/test/resources/configs/def-files/function-test.def new file mode 100644 index 00000000000..24eeb81ab7a --- /dev/null +++ b/config/src/test/resources/configs/def-files/function-test.def @@ -0,0 +1,88 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +# +# This def file should test most aspects of def files that makes a difference +# for the autogenerated config classes. The goal is to trigger all blocks of +# code in the code generators. This includes: +# +# - Use all legal special characters in the def file name, to ensure that those +# that needs to be replaced in type names are actually replaced. +# - Use the same enum type twice to verify that we dont declare or define it +# twice. +# - Use the same struct type twice for the same reason. +# - Include arrays of primitives and structs. +# - Include enum primitives and array of enums. Arrays of enums must be handled +# specially by the C++ code. +# - Include enums both with and without default values. +# - Include primitive string, numbers & doubles both with and without default +# values. +# - Have an array within a struct, to verify that we correctly recurse. +# - Reuse type name further within to ensure that this works. + + +namespace=foo + +# Some random bool without a default value. These comments exist to check + # that comment parsing works. +bool_val bool + ## A bool with a default value set. +bool_with_def bool default=false +int_val int +int_with_def int default=-545 +long_val long +long_with_def long default=-50000000000 +double_val double +double_with_def double default=-6.43 +# Another comment +string_val string +stringwithdef string default="foobar" +enum_val enum { FOO, BAR, FOOBAR } +enumwithdef enum { FOO2, BAR2, FOOBAR2 } default=BAR2 +onechoice enum { ONLYFOO } default=ONLYFOO +refval reference +refwithdef reference default=":parent:" +fileVal file +pathVal path + +boolarr[] bool +intarr[] int +longarr[] long +doublearr[] double +stringarr[] string +enumarr[] enum { ARRAY, VALUES } +refarr[] reference +fileArr[] file +pathArr[] path + +intMap{} int +stringMap{} string +filemap{} file +pathMap{} path + +# A basic struct +basicStruct.foo string default="basic" +basicStruct.bar int +basicStruct.intArr[] int + +# A struct of struct +rootStruct.inner0.name string default="inner0" +rootStruct.inner0.index int +rootStruct.inner1.name string default="inner1" +rootStruct.inner1.index int +rootStruct.innerArr[].boolVal bool default=false +rootStruct.innerArr[].stringVal string + +myarray[].intval int default=14 +myarray[].stringval[] string +myarray[].enumval enum { INNER, ENUM, TYPE } default=TYPE +myarray[].refval reference # Value in array without default +myarray[].fileVal file +myarray[].anotherarray[].foo int default=-4 +myarray[].myStruct.a int +myarray[].myStruct.b int default=2 + +myStructMap{}.myInt int +myStructMap{}.myString string +myStructMap{}.myIntDef int default=56 +myStructMap{}.myStringDef string default="g" +myStructMap{}.anotherMap{}.anInt int +myStructMap{}.anotherMap{}.anIntDef int default=11 diff --git a/config/src/test/resources/configs/def-files/int.def b/config/src/test/resources/configs/def-files/int.def new file mode 100755 index 00000000000..c1a1241c413 --- /dev/null +++ b/config/src/test/resources/configs/def-files/int.def @@ -0,0 +1,4 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=foo + +intVal int default=1 diff --git a/config/src/test/resources/configs/def-files/maptypes.def b/config/src/test/resources/configs/def-files/maptypes.def new file mode 100644 index 00000000000..0e39c7ccdb9 --- /dev/null +++ b/config/src/test/resources/configs/def-files/maptypes.def @@ -0,0 +1,13 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +# Config containing only structs in various forms +namespace=foo + +boolmap{} bool +intmap{} int +longmap{} long +doublemap{} double +stringmap{} string +filemap{} file + +innermap{}.foo int +nestedmap{}.inner{} int diff --git a/config/src/test/resources/configs/def-files/myproject.config.namespace.def b/config/src/test/resources/configs/def-files/myproject.config.namespace.def deleted file mode 100644 index a8b55fb315e..00000000000 --- a/config/src/test/resources/configs/def-files/myproject.config.namespace.def +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -namespace=myproject.config - -a int diff --git a/config/src/test/resources/configs/def-files/namespace.def b/config/src/test/resources/configs/def-files/namespace.def new file mode 100644 index 00000000000..a8b55fb315e --- /dev/null +++ b/config/src/test/resources/configs/def-files/namespace.def @@ -0,0 +1,5 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +namespace=myproject.config + +a int diff --git a/config/src/test/resources/configs/def-files/simpletypes.def b/config/src/test/resources/configs/def-files/simpletypes.def new file mode 100644 index 00000000000..2603e2f4100 --- /dev/null +++ b/config/src/test/resources/configs/def-files/simpletypes.def @@ -0,0 +1,11 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=foo +# Config containing only simple leaf types with default values, that can be used +# for testing individual types in detail. + +boolval bool default=false +doubleval double default=0.0 +enumval enum { VAL1, VAL2 } default=VAL1 +intval int default=0 +longval long default=0 +stringval string default="s" diff --git a/config/src/test/resources/configs/def-files/specialtypes.def b/config/src/test/resources/configs/def-files/specialtypes.def new file mode 100644 index 00000000000..06fdd0d4348 --- /dev/null +++ b/config/src/test/resources/configs/def-files/specialtypes.def @@ -0,0 +1,4 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=foo +myfile file +myref reference diff --git a/config/src/test/resources/configs/def-files/string.def b/config/src/test/resources/configs/def-files/string.def new file mode 100755 index 00000000000..78596515b7c --- /dev/null +++ b/config/src/test/resources/configs/def-files/string.def @@ -0,0 +1,4 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=foo + +stringVal string default="_default_" diff --git a/config/src/test/resources/configs/def-files/structtypes.def b/config/src/test/resources/configs/def-files/structtypes.def new file mode 100644 index 00000000000..fe9d879fb64 --- /dev/null +++ b/config/src/test/resources/configs/def-files/structtypes.def @@ -0,0 +1,21 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +# Config containing only structs in various forms +namespace=foo + +simple.name string default="_default_" +simple.gender enum { MALE, FEMALE } default=MALE +simple.emails[] string + +nested.inner.name string default="_default_" +nested.inner.gender enum { MALE, FEMALE } default=MALE +nested.inner.emails[] string + +simplearr[].name string +simplearr[].gender enum { MALE, FEMALE } + +nestedarr[].inner.name string +nestedarr[].inner.gender enum { MALE, FEMALE } +nestedarr[].inner.emails[] string + +complexarr[].innerarr[].name string +complexarr[].innerarr[].gender enum { MALE, FEMALE } diff --git a/config/src/test/resources/configs/def-files/test-nodefs.def b/config/src/test/resources/configs/def-files/test-nodefs.def new file mode 100644 index 00000000000..e3b700c5732 --- /dev/null +++ b/config/src/test/resources/configs/def-files/test-nodefs.def @@ -0,0 +1,16 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=foo + +# test config vars with no defaults + +s string +j int +b bool +f double +e enum { AA, BB, CC } + +basicstruct.foo string +basicstruct.bar int + +arr[].s string +arr[].i int diff --git a/config/src/test/resources/configs/def-files/test-nonstring.def b/config/src/test/resources/configs/def-files/test-nonstring.def new file mode 100644 index 00000000000..eaa6fafe87d --- /dev/null +++ b/config/src/test/resources/configs/def-files/test-nonstring.def @@ -0,0 +1,9 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=foo + +# Test non-string config vars with defaults + +i int default=0 +b bool default=false +d double default=0.0 +e enum { AA, BB, CC } default=AA diff --git a/config/src/test/resources/configs/def-files/test-reference.def b/config/src/test/resources/configs/def-files/test-reference.def new file mode 100644 index 00000000000..b5bbb5f4462 --- /dev/null +++ b/config/src/test/resources/configs/def-files/test-reference.def @@ -0,0 +1,4 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=foo + +configId reference default=":parent:" diff --git a/config/src/test/resources/configs/def-files/testnamespace.def b/config/src/test/resources/configs/def-files/testnamespace.def new file mode 100644 index 00000000000..6e58c691097 --- /dev/null +++ b/config/src/test/resources/configs/def-files/testnamespace.def @@ -0,0 +1,3 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=foo +basicStruct.stringVal string diff --git a/config/src/test/resources/configs/def-files/unicode.def b/config/src/test/resources/configs/def-files/unicode.def new file mode 100644 index 00000000000..493e3e37630 --- /dev/null +++ b/config/src/test/resources/configs/def-files/unicode.def @@ -0,0 +1,5 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=foo + +unicodestring1 string +unicodestring2 string default="abc æøå 囲碁 ÆØÅ ABC" diff --git a/documentapi/src/main/resources/configdefinitions/documentapi.messagebus.protocol.documentrouteselectorpolicy.def b/documentapi/src/main/resources/configdefinitions/documentapi.messagebus.protocol.documentrouteselectorpolicy.def deleted file mode 100644 index f6f4461d220..00000000000 --- a/documentapi/src/main/resources/configdefinitions/documentapi.messagebus.protocol.documentrouteselectorpolicy.def +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -namespace=documentapi.messagebus.protocol - -# The name of the route. -route[].name string - -# The document selector for this route. -route[].selector string - -# The feeds that this route accepts. -route[].feed string default="" diff --git a/documentapi/src/main/resources/configdefinitions/documentrouteselectorpolicy.def b/documentapi/src/main/resources/configdefinitions/documentrouteselectorpolicy.def new file mode 100644 index 00000000000..f6f4461d220 --- /dev/null +++ b/documentapi/src/main/resources/configdefinitions/documentrouteselectorpolicy.def @@ -0,0 +1,11 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=documentapi.messagebus.protocol + +# The name of the route. +route[].name string + +# The document selector for this route. +route[].selector string + +# The feeds that this route accepts. +route[].feed string default="" diff --git a/fileacquirer/src/main/resources/configdefinitions/cloud.config.filedistribution.filedistributorrpc.def b/fileacquirer/src/main/resources/configdefinitions/cloud.config.filedistribution.filedistributorrpc.def deleted file mode 100644 index 3de65e632ee..00000000000 --- a/fileacquirer/src/main/resources/configdefinitions/cloud.config.filedistribution.filedistributorrpc.def +++ /dev/null @@ -1,3 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -namespace=cloud.config.filedistribution -connectionspec string diff --git a/fileacquirer/src/main/resources/configdefinitions/filedistributorrpc.def b/fileacquirer/src/main/resources/configdefinitions/filedistributorrpc.def new file mode 100644 index 00000000000..3de65e632ee --- /dev/null +++ b/fileacquirer/src/main/resources/configdefinitions/filedistributorrpc.def @@ -0,0 +1,3 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=cloud.config.filedistribution +connectionspec string diff --git a/logd/src/main/resources/configdefinitions/cloud.config.log.logd.def b/logd/src/main/resources/configdefinitions/cloud.config.log.logd.def deleted file mode 100644 index bb5f487c47e..00000000000 --- a/logd/src/main/resources/configdefinitions/cloud.config.log.logd.def +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -namespace=cloud.config.log - -## Port to serve status and metrics on -stateport int default=0 - -## Host to contact the logserver on. -logserver.host string default="localhost" - -## RPC port of logserver. -logserver.rpcport int default=5822 - -## Legacy port to contact the logserver on. -## Deprecated (not used). TODO: Remove on Vespa 8. -logserver.port int default=5821 - -## Use RPC protocol -## Deprecated (always true). TODO: Remove on Vespa 8. -logserver.userpc bool default=true - -## Forward to a logserver. Other logserver configuration is irrelevant if false. -logserver.use bool default=true - -## Loglevel config whether they should be stored and/or forwarded -loglevel.fatal.forward bool default=true -loglevel.error.forward bool default=true -loglevel.warning.forward bool default=true -loglevel.config.forward bool default=true -loglevel.info.forward bool default=true -loglevel.event.forward bool default=false -loglevel.debug.forward bool default=false -loglevel.spam.forward bool default=false - -## when the logfile reaches this size, rotate it -rotate.size int default=10000000 - -## when the logfile reaches this age (in seconds), rotate it -rotate.age int default=86400 - -## remove old logfiles so total size does not exceed this (in megabytes) -remove.totalmegabytes int default=1000 - -## remove old logfiles older than this (in days) -remove.age int default=30 diff --git a/logd/src/main/resources/configdefinitions/logd.def b/logd/src/main/resources/configdefinitions/logd.def new file mode 100644 index 00000000000..bb5f487c47e --- /dev/null +++ b/logd/src/main/resources/configdefinitions/logd.def @@ -0,0 +1,44 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=cloud.config.log + +## Port to serve status and metrics on +stateport int default=0 + +## Host to contact the logserver on. +logserver.host string default="localhost" + +## RPC port of logserver. +logserver.rpcport int default=5822 + +## Legacy port to contact the logserver on. +## Deprecated (not used). TODO: Remove on Vespa 8. +logserver.port int default=5821 + +## Use RPC protocol +## Deprecated (always true). TODO: Remove on Vespa 8. +logserver.userpc bool default=true + +## Forward to a logserver. Other logserver configuration is irrelevant if false. +logserver.use bool default=true + +## Loglevel config whether they should be stored and/or forwarded +loglevel.fatal.forward bool default=true +loglevel.error.forward bool default=true +loglevel.warning.forward bool default=true +loglevel.config.forward bool default=true +loglevel.info.forward bool default=true +loglevel.event.forward bool default=false +loglevel.debug.forward bool default=false +loglevel.spam.forward bool default=false + +## when the logfile reaches this size, rotate it +rotate.size int default=10000000 + +## when the logfile reaches this age (in seconds), rotate it +rotate.age int default=86400 + +## remove old logfiles so total size does not exceed this (in megabytes) +remove.totalmegabytes int default=1000 + +## remove old logfiles older than this (in days) +remove.age int default=30 diff --git a/messagebus/src/main/config/messagebus.def b/messagebus/src/main/config/messagebus.def new file mode 100644 index 00000000000..b750530ec5f --- /dev/null +++ b/messagebus/src/main/config/messagebus.def @@ -0,0 +1,29 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=messagebus + +# Name of the protocol that uses this routing table. All +# instances of message bus must support all named protocols. +routingtable[].protocol string + +# A protocol-unique name for a hop. +routingtable[].hop[].name string + +# The selector string of a hop, this string typically contains +# routing policy references on the form [policy-name:parameter]. +# The protocol for the routing table must support all named +# policies. +routingtable[].hop[].selector string + +# List of recipients for a hop. These strings may contain +# wildcards to allow the network layer to choose any single +# matching service. +routingtable[].hop[].recipient[] string + +# Whether or not to ignore the result from this hop. +routingtable[].hop[].ignoreresult bool default=false + +# A protocol-unique name for a route. +routingtable[].route[].name string + +# An array of hop names that together make up the route. +routingtable[].route[].hop[] string diff --git a/messagebus/src/main/config/messagebus.messagebus.def b/messagebus/src/main/config/messagebus.messagebus.def deleted file mode 100644 index b750530ec5f..00000000000 --- a/messagebus/src/main/config/messagebus.messagebus.def +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -namespace=messagebus - -# Name of the protocol that uses this routing table. All -# instances of message bus must support all named protocols. -routingtable[].protocol string - -# A protocol-unique name for a hop. -routingtable[].hop[].name string - -# The selector string of a hop, this string typically contains -# routing policy references on the form [policy-name:parameter]. -# The protocol for the routing table must support all named -# policies. -routingtable[].hop[].selector string - -# List of recipients for a hop. These strings may contain -# wildcards to allow the network layer to choose any single -# matching service. -routingtable[].hop[].recipient[] string - -# Whether or not to ignore the result from this hop. -routingtable[].hop[].ignoreresult bool default=false - -# A protocol-unique name for a route. -routingtable[].route[].name string - -# An array of hop names that together make up the route. -routingtable[].route[].hop[] string -- cgit v1.2.3