From 9b948718144e5d556cc6ea49d2ff6bbf05f00b0e Mon Sep 17 00:00:00 2001 From: Harald Musum Date: Thu, 10 Sep 2020 19:54:48 +0200 Subject: Use full name in config definition file names --- .../src/test/resources/configdefinitions/app.def | 8 -- .../resources/configdefinitions/foo.maptypes.def | 13 +++ .../configdefinitions/foo.structtypes.def | 21 +++++ .../resources/configdefinitions/function-test.def | 96 ---------------------- .../src/test/resources/configdefinitions/int.def | 4 - .../test/resources/configdefinitions/maptypes.def | 13 --- .../my.namespace.namespace-and-package.def | 7 ++ .../configdefinitions/my.namespace.namespace.def | 5 ++ .../configdefinitions/namespace-and-package.def | 7 -- .../test/resources/configdefinitions/namespace.def | 5 -- .../test/resources/configdefinitions/restart.def | 4 - .../resources/configdefinitions/structtypes.def | 21 ----- .../test/resources/configdefinitions/test.app.def | 8 ++ .../configdefinitions/test.function-test.def | 96 ++++++++++++++++++++++ .../test/resources/configdefinitions/test.int.def | 4 + .../resources/configdefinitions/test.restart.def | 4 + 16 files changed, 158 insertions(+), 158 deletions(-) delete mode 100644 config-lib/src/test/resources/configdefinitions/app.def create mode 100644 config-lib/src/test/resources/configdefinitions/foo.maptypes.def create mode 100644 config-lib/src/test/resources/configdefinitions/foo.structtypes.def delete mode 100644 config-lib/src/test/resources/configdefinitions/function-test.def delete mode 100755 config-lib/src/test/resources/configdefinitions/int.def delete mode 100644 config-lib/src/test/resources/configdefinitions/maptypes.def create mode 100644 config-lib/src/test/resources/configdefinitions/my.namespace.namespace-and-package.def create mode 100644 config-lib/src/test/resources/configdefinitions/my.namespace.namespace.def delete mode 100644 config-lib/src/test/resources/configdefinitions/namespace-and-package.def delete mode 100644 config-lib/src/test/resources/configdefinitions/namespace.def delete mode 100755 config-lib/src/test/resources/configdefinitions/restart.def delete mode 100644 config-lib/src/test/resources/configdefinitions/structtypes.def create mode 100644 config-lib/src/test/resources/configdefinitions/test.app.def create mode 100644 config-lib/src/test/resources/configdefinitions/test.function-test.def create mode 100755 config-lib/src/test/resources/configdefinitions/test.int.def create mode 100755 config-lib/src/test/resources/configdefinitions/test.restart.def (limited to 'config-lib') diff --git a/config-lib/src/test/resources/configdefinitions/app.def b/config-lib/src/test/resources/configdefinitions/app.def deleted file mode 100644 index 78388998ef3..00000000000 --- a/config-lib/src/test/resources/configdefinitions/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=test - -message string default="Hello!" - -times int default=1 - -a[].name string diff --git a/config-lib/src/test/resources/configdefinitions/foo.maptypes.def b/config-lib/src/test/resources/configdefinitions/foo.maptypes.def new file mode 100644 index 00000000000..0e39c7ccdb9 --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/foo.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-lib/src/test/resources/configdefinitions/foo.structtypes.def b/config-lib/src/test/resources/configdefinitions/foo.structtypes.def new file mode 100644 index 00000000000..fe9d879fb64 --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/foo.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-lib/src/test/resources/configdefinitions/function-test.def b/config-lib/src/test/resources/configdefinitions/function-test.def deleted file mode 100644 index 73681d95544..00000000000 --- a/config-lib/src/test/resources/configdefinitions/function-test.def +++ /dev/null @@ -1,96 +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=test - -# Some random bool without a default value. These comments exist to check - # that comment parsing works. -bool_val bool restart - ## A bool with a default value set. -bool_with_def bool default=false restart -# An int value -# Also test that multiline comments -# work. -int_val int restart -int_with_def int default=-545 restart -long_val long restart -long_with_def long default=-50000000000 restart -double_val double restart -double_with_def double default=-6.43 restart -# Another comment -string_val string restart -stringwithdef string default="foobar" restart -enum_val enum { FOO, BAR, FOOBAR } restart -enumwithdef enum { FOO2, BAR2, FOOBAR2 } default=BAR2 restart -onechoice enum { ONLYFOO } default=ONLYFOO restart -refval reference restart -refwithdef reference default=":parent:" restart -fileVal file restart -pathVal path restart -urlVal url - -boolarr[] bool restart -intarr[] int restart -longarr[] long restart -doublearr[] double restart -stringarr[] string restart -enumarr[] enum { ARRAY, VALUES } restart -refarr[] reference restart -fileArr[] file restart -pathArr[] path restart -urlArr[] url - -#This is a map of ints. -intMap{} int restart -stringMap{} string restart -filemap{} file restart -pathMap{} path restart -urlMap{} url - -# A basic struct -basicStruct.foo string default="basic" restart -basicStruct.bar int restart -basicStruct.intArr[] int restart - -# A struct of struct -rootStruct.inner0.name string default="inner0" restart -rootStruct.inner0.index int restart -rootStruct.inner1.name string default="inner1" restart -rootStruct.inner1.index int restart -rootStruct.innerArr[].boolVal bool default=false restart -rootStruct.innerArr[].stringVal string restart - -# This is my array -myarray[].intval int default=14 restart -myarray[].stringval[] string restart -myarray[].enumval enum { INNER, ENUM, TYPE } default=TYPE restart -myarray[].refval reference # Value in array without default restart -myarray[].fileVal file restart -myarray[].urlVal url -myarray[].anotherarray[].foo int default=-4 restart -myarray[].myStruct.a int restart -myarray[].myStruct.b int default=2 restart - -myStructMap{}.myInt int restart -myStructMap{}.myString string restart -myStructMap{}.myIntDef int default=56 restart -myStructMap{}.myStringDef string default="g" restart -myStructMap{}.anotherMap{}.anInt int restart -myStructMap{}.anotherMap{}.anIntDef int default=11 restart diff --git a/config-lib/src/test/resources/configdefinitions/int.def b/config-lib/src/test/resources/configdefinitions/int.def deleted file mode 100755 index ea29b911fc4..00000000000 --- a/config-lib/src/test/resources/configdefinitions/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=test - -intVal int default=1 diff --git a/config-lib/src/test/resources/configdefinitions/maptypes.def b/config-lib/src/test/resources/configdefinitions/maptypes.def deleted file mode 100644 index 0e39c7ccdb9..00000000000 --- a/config-lib/src/test/resources/configdefinitions/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-lib/src/test/resources/configdefinitions/my.namespace.namespace-and-package.def b/config-lib/src/test/resources/configdefinitions/my.namespace.namespace-and-package.def new file mode 100644 index 00000000000..4e61d25f05f --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/my.namespace.namespace-and-package.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=my.namespace + +package=com.github.myproject + +a int diff --git a/config-lib/src/test/resources/configdefinitions/my.namespace.namespace.def b/config-lib/src/test/resources/configdefinitions/my.namespace.namespace.def new file mode 100644 index 00000000000..b1406fc1bc4 --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/my.namespace.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=my.namespace + +a int diff --git a/config-lib/src/test/resources/configdefinitions/namespace-and-package.def b/config-lib/src/test/resources/configdefinitions/namespace-and-package.def deleted file mode 100644 index 4e61d25f05f..00000000000 --- a/config-lib/src/test/resources/configdefinitions/namespace-and-package.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=my.namespace - -package=com.github.myproject - -a int diff --git a/config-lib/src/test/resources/configdefinitions/namespace.def b/config-lib/src/test/resources/configdefinitions/namespace.def deleted file mode 100644 index b1406fc1bc4..00000000000 --- a/config-lib/src/test/resources/configdefinitions/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=my.namespace - -a int diff --git a/config-lib/src/test/resources/configdefinitions/restart.def b/config-lib/src/test/resources/configdefinitions/restart.def deleted file mode 100755 index 4b28e5a5d95..00000000000 --- a/config-lib/src/test/resources/configdefinitions/restart.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=test - -intVal int default=1 restart diff --git a/config-lib/src/test/resources/configdefinitions/structtypes.def b/config-lib/src/test/resources/configdefinitions/structtypes.def deleted file mode 100644 index fe9d879fb64..00000000000 --- a/config-lib/src/test/resources/configdefinitions/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-lib/src/test/resources/configdefinitions/test.app.def b/config-lib/src/test/resources/configdefinitions/test.app.def new file mode 100644 index 00000000000..78388998ef3 --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/test.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=test + +message string default="Hello!" + +times int default=1 + +a[].name string diff --git a/config-lib/src/test/resources/configdefinitions/test.function-test.def b/config-lib/src/test/resources/configdefinitions/test.function-test.def new file mode 100644 index 00000000000..73681d95544 --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/test.function-test.def @@ -0,0 +1,96 @@ +# 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=test + +# Some random bool without a default value. These comments exist to check + # that comment parsing works. +bool_val bool restart + ## A bool with a default value set. +bool_with_def bool default=false restart +# An int value +# Also test that multiline comments +# work. +int_val int restart +int_with_def int default=-545 restart +long_val long restart +long_with_def long default=-50000000000 restart +double_val double restart +double_with_def double default=-6.43 restart +# Another comment +string_val string restart +stringwithdef string default="foobar" restart +enum_val enum { FOO, BAR, FOOBAR } restart +enumwithdef enum { FOO2, BAR2, FOOBAR2 } default=BAR2 restart +onechoice enum { ONLYFOO } default=ONLYFOO restart +refval reference restart +refwithdef reference default=":parent:" restart +fileVal file restart +pathVal path restart +urlVal url + +boolarr[] bool restart +intarr[] int restart +longarr[] long restart +doublearr[] double restart +stringarr[] string restart +enumarr[] enum { ARRAY, VALUES } restart +refarr[] reference restart +fileArr[] file restart +pathArr[] path restart +urlArr[] url + +#This is a map of ints. +intMap{} int restart +stringMap{} string restart +filemap{} file restart +pathMap{} path restart +urlMap{} url + +# A basic struct +basicStruct.foo string default="basic" restart +basicStruct.bar int restart +basicStruct.intArr[] int restart + +# A struct of struct +rootStruct.inner0.name string default="inner0" restart +rootStruct.inner0.index int restart +rootStruct.inner1.name string default="inner1" restart +rootStruct.inner1.index int restart +rootStruct.innerArr[].boolVal bool default=false restart +rootStruct.innerArr[].stringVal string restart + +# This is my array +myarray[].intval int default=14 restart +myarray[].stringval[] string restart +myarray[].enumval enum { INNER, ENUM, TYPE } default=TYPE restart +myarray[].refval reference # Value in array without default restart +myarray[].fileVal file restart +myarray[].urlVal url +myarray[].anotherarray[].foo int default=-4 restart +myarray[].myStruct.a int restart +myarray[].myStruct.b int default=2 restart + +myStructMap{}.myInt int restart +myStructMap{}.myString string restart +myStructMap{}.myIntDef int default=56 restart +myStructMap{}.myStringDef string default="g" restart +myStructMap{}.anotherMap{}.anInt int restart +myStructMap{}.anotherMap{}.anIntDef int default=11 restart diff --git a/config-lib/src/test/resources/configdefinitions/test.int.def b/config-lib/src/test/resources/configdefinitions/test.int.def new file mode 100755 index 00000000000..ea29b911fc4 --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/test.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=test + +intVal int default=1 diff --git a/config-lib/src/test/resources/configdefinitions/test.restart.def b/config-lib/src/test/resources/configdefinitions/test.restart.def new file mode 100755 index 00000000000..4b28e5a5d95 --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/test.restart.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=test + +intVal int default=1 restart -- cgit v1.2.3