diff options
author | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-06-15 23:09:44 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-06-15 23:09:44 +0200 |
commit | 72231250ed81e10d66bfe70701e64fa5fe50f712 (patch) | |
tree | 2728bba1131a6f6e5bdf95afec7d7ff9358dac50 /config-lib/src/test/resources |
Publish
Diffstat (limited to 'config-lib/src/test/resources')
21 files changed, 310 insertions, 0 deletions
diff --git a/config-lib/src/test/resources/configdefinitions/app.def b/config-lib/src/test/resources/configdefinitions/app.def new file mode 100644 index 00000000000..40db5310927 --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/app.def @@ -0,0 +1,8 @@ +# Copyright 2016 Yahoo Inc. 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/arraytypes.def b/config-lib/src/test/resources/configdefinitions/arraytypes.def new file mode 100644 index 00000000000..3529b906c4a --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/arraytypes.def @@ -0,0 +1,11 @@ +# Copyright 2016 Yahoo Inc. 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=test + +boolarr[] bool +doublearr[] double +enumarr[] enum { VAL1, VAL2 } +intarr[] int +longarr[] long +stringarr[] string diff --git a/config-lib/src/test/resources/configdefinitions/chains-test.def b/config-lib/src/test/resources/configdefinitions/chains-test.def new file mode 100644 index 00000000000..5cc593b1443 --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/chains-test.def @@ -0,0 +1,42 @@ +# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +# Chains configuration +namespace=test + +component[].id string + +# Configured functionality provided by this - comes in addition to those set in the code +component[].dependencies.provides[] string + +# Configured "before" dependencies provided by this - comes in addition to those set in the code +component[].dependencies.before[] string + +# Configured "after" dependencies provided by this - comes in addition to those set in the code +component[].dependencies.after[] string + +# The id of this chain. The id has the form name(:version)? +# where the version has the form 1(.2(.3(.identifier)?)?)?. +# The default chain must be called "default". +chain[].id string + +#The type of this chain +chain[].type enum {DOCPROC, SEARCH} default=SEARCH + +# The id of a component to include in this chain. +# The id has the form fullclassname(:version)? +# where the version has the form 1(.2(.3(.identifier)?)?)?. +chain[].component[] string + +# The optional list of chain ids this inherits. +# The ids has the form name(:version)? +# where the version has the form 1(.2(.3(.identifier)?)?)?. +# If the version is not specified the newest version is used. +chain[].inherit[] string + +# The optional list of component ids to exclude from this chain even if they exists in inherited chains +# If versions are specified in these ids, they are ignored. +chain[].exclude[] string + +# The phases for a chain +chain[].phase[].id string +chain[].phase[].before[] string +chain[].phase[].after[] string diff --git a/config-lib/src/test/resources/configdefinitions/datastructures.def b/config-lib/src/test/resources/configdefinitions/datastructures.def new file mode 100644 index 00000000000..648fe569020 --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/datastructures.def @@ -0,0 +1,11 @@ +# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=test + +date[] string + +stock[].ticker string +stock[].type enum { COMMON, ETF, ETC } default=COMMON +stock[].volume[] int + +basicstruct.foo string default="foo" +basicstruct.bar int default=0 diff --git a/config-lib/src/test/resources/configdefinitions/defaulttest.def b/config-lib/src/test/resources/configdefinitions/defaulttest.def new file mode 100644 index 00000000000..eec012ffbb9 --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/defaulttest.def @@ -0,0 +1,8 @@ +# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=test + +nondefaultstring string +defaultstring string default="thedefault" + +nondefaultreference reference +defaultreference reference default="thedefault" diff --git a/config-lib/src/test/resources/configdefinitions/function-test.def b/config-lib/src/test/resources/configdefinitions/function-test.def new file mode 100644 index 00000000000..935efe9ca21 --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/function-test.def @@ -0,0 +1,93 @@ +# Copyright 2016 Yahoo Inc. 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. + +version=8 # deprecated, remove in Vespa 7 +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 + +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 + +#This is a map of ints. +intMap{} int restart +stringMap{} string restart +filemap{} file restart +pathMap{} path restart + +# 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[].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 new file mode 100755 index 00000000000..0bf82ed9987 --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/int.def @@ -0,0 +1,4 @@ +# Copyright 2016 Yahoo Inc. 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 new file mode 100644 index 00000000000..389a9b71012 --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/maptypes.def @@ -0,0 +1,13 @@ +# Copyright 2016 Yahoo Inc. 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/md5test.def b/config-lib/src/test/resources/configdefinitions/md5test.def new file mode 100644 index 00000000000..86a199ea785 --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/md5test.def @@ -0,0 +1,24 @@ +# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +# version=4 , version in comment does not count. + +# Added empty line to see if we can confuse +# the server's md5 calculation +namespace=test + +#even adding a variable name starting with 'version' +versiontag int default=3 + +blabla string default="" +tabs string default=" " +test int + +# test multiple spaces/tabs +spaces int +singletab string +multitabs double + +# test enum +normal enum { VAL1, VAL2 } default=VAL1 +spacevalues enum { V1 , V2 , V3 , V4 } default=V3 + +# Comments and empty lines at the end diff --git a/config-lib/src/test/resources/configdefinitions/namespace.def b/config-lib/src/test/resources/configdefinitions/namespace.def new file mode 100644 index 00000000000..e51a06e87b8 --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/namespace.def @@ -0,0 +1,6 @@ +# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=test + +namespace=myproject.config + +a int diff --git a/config-lib/src/test/resources/configdefinitions/restart.def b/config-lib/src/test/resources/configdefinitions/restart.def new file mode 100755 index 00000000000..417a015a3d0 --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/restart.def @@ -0,0 +1,4 @@ +# Copyright 2016 Yahoo Inc. 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/simpletypes.def b/config-lib/src/test/resources/configdefinitions/simpletypes.def new file mode 100644 index 00000000000..314c67ae709 --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/simpletypes.def @@ -0,0 +1,11 @@ +# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +# Config containing only simple leaf types with default values, that can be used +# for testing individual types in detail. +namespace=test + +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-lib/src/test/resources/configdefinitions/specialtypes.def b/config-lib/src/test/resources/configdefinitions/specialtypes.def new file mode 100644 index 00000000000..3243288f0af --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/specialtypes.def @@ -0,0 +1,5 @@ +# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=test + +myfile file +myref reference diff --git a/config-lib/src/test/resources/configdefinitions/standard.def b/config-lib/src/test/resources/configdefinitions/standard.def new file mode 100644 index 00000000000..e065535f97d --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/standard.def @@ -0,0 +1,8 @@ +# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +# Config containing only simple leaf types with default values, that can be used +# for testing individual types in detail. +namespace=test + +basicStruct.intVal int default=0 +basicStruct.stringVal string default="s" +stringArr[] string diff --git a/config-lib/src/test/resources/configdefinitions/string.def b/config-lib/src/test/resources/configdefinitions/string.def new file mode 100755 index 00000000000..80ac3f4b1e6 --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/string.def @@ -0,0 +1,4 @@ +# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=test + +stringVal string default="_default_" diff --git a/config-lib/src/test/resources/configdefinitions/structtypes.def b/config-lib/src/test/resources/configdefinitions/structtypes.def new file mode 100644 index 00000000000..0a3c8e23a45 --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/structtypes.def @@ -0,0 +1,21 @@ +# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +# Config containing only structs in various forms +namespace=test + +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-nodefs.def b/config-lib/src/test/resources/configdefinitions/test-nodefs.def new file mode 100644 index 00000000000..4a80231d709 --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/test-nodefs.def @@ -0,0 +1,16 @@ +# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=test + +# 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-lib/src/test/resources/configdefinitions/test-nonstring.def b/config-lib/src/test/resources/configdefinitions/test-nonstring.def new file mode 100644 index 00000000000..3e54a3bb8bd --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/test-nonstring.def @@ -0,0 +1,9 @@ +# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=test + +# 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-lib/src/test/resources/configdefinitions/test-reference.def b/config-lib/src/test/resources/configdefinitions/test-reference.def new file mode 100644 index 00000000000..96c5f62030a --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/test-reference.def @@ -0,0 +1,4 @@ +# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=test + +configId reference default=":parent:" diff --git a/config-lib/src/test/resources/configdefinitions/testnamespace.def b/config-lib/src/test/resources/configdefinitions/testnamespace.def new file mode 100644 index 00000000000..b77eb5d81da --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/testnamespace.def @@ -0,0 +1,3 @@ +# Copyright 2016 Yahoo Inc. 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-lib/src/test/resources/configdefinitions/unicode.def b/config-lib/src/test/resources/configdefinitions/unicode.def new file mode 100644 index 00000000000..52b2353e60e --- /dev/null +++ b/config-lib/src/test/resources/configdefinitions/unicode.def @@ -0,0 +1,5 @@ +# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=test + +unicodestring1 string +unicodestring2 string default="abc æøå 囲碁 ÆØÅ ABC" |