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 /configserver/src/test/resources |
Publish
Diffstat (limited to 'configserver/src/test/resources')
13 files changed, 192 insertions, 0 deletions
diff --git a/configserver/src/test/resources/configdefinitions/app.def b/configserver/src/test/resources/configdefinitions/app.def new file mode 100644 index 00000000000..cfc5041660c --- /dev/null +++ b/configserver/src/test/resources/configdefinitions/app.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. +version=1 +namespace=config + +message string default="Hello!" + +times int default=1 + +a[].name string diff --git a/configserver/src/test/resources/configdefinitions/datastructures.def b/configserver/src/test/resources/configdefinitions/datastructures.def new file mode 100644 index 00000000000..5ac8227bd13 --- /dev/null +++ b/configserver/src/test/resources/configdefinitions/datastructures.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. +version=3 +namespace=config + +date[] string + +stock[].ticker string +stock[].type enum { COMMON, ETF, ETC } default=COMMON +stock[].volume[] int diff --git a/configserver/src/test/resources/configdefinitions/function-test.def b/configserver/src/test/resources/configdefinitions/function-test.def new file mode 100644 index 00000000000..4ddccdd4ddf --- /dev/null +++ b/configserver/src/test/resources/configdefinitions/function-test.def @@ -0,0 +1,54 @@ +# 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=4 +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 +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 +refval reference +refwithdef reference default=":parent:" + +boolarr[] bool +intarr[] int +doublearr[] double +stringarr[] string +enumarr[] enum { ARRAY, VALUES } +refarr[] reference + + +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 + diff --git a/configserver/src/test/resources/configdefinitions/md5test.def b/configserver/src/test/resources/configdefinitions/md5test.def new file mode 100644 index 00000000000..100bc679b62 --- /dev/null +++ b/configserver/src/test/resources/configdefinitions/md5test.def @@ -0,0 +1,27 @@ +# 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 +version=3 +namespace=config + +#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/configserver/src/test/resources/configdefinitions/simpletypes.def b/configserver/src/test/resources/configdefinitions/simpletypes.def new file mode 100644 index 00000000000..4609afa9f62 --- /dev/null +++ b/configserver/src/test/resources/configdefinitions/simpletypes.def @@ -0,0 +1,12 @@ +# 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. +version=1 +namespace=config + +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/configserver/src/test/resources/configdefinitions/unicode.def b/configserver/src/test/resources/configdefinitions/unicode.def new file mode 100644 index 00000000000..41100582edc --- /dev/null +++ b/configserver/src/test/resources/configdefinitions/unicode.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. +version=2 +namespace=config + +unicodestring1 string +unicodestring2 string default="abc æøå 囲碁 ÆØÅ ABC" diff --git a/configserver/src/test/resources/deploy/advancedapp/external/foo/bar/lol b/configserver/src/test/resources/deploy/advancedapp/external/foo/bar/lol new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/configserver/src/test/resources/deploy/advancedapp/external/foo/bar/lol diff --git a/configserver/src/test/resources/deploy/advancedapp/hosts.xml b/configserver/src/test/resources/deploy/advancedapp/hosts.xml new file mode 100644 index 00000000000..3ab86a21aef --- /dev/null +++ b/configserver/src/test/resources/deploy/advancedapp/hosts.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!-- Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. --> +<hosts> + <host name="localhost"> + <alias>node1</alias> + </host> +</hosts> diff --git a/configserver/src/test/resources/deploy/advancedapp/searchdefinitions/keyvalue.sd b/configserver/src/test/resources/deploy/advancedapp/searchdefinitions/keyvalue.sd new file mode 100644 index 00000000000..29a22b8cf9f --- /dev/null +++ b/configserver/src/test/resources/deploy/advancedapp/searchdefinitions/keyvalue.sd @@ -0,0 +1,13 @@ +# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +search keyvalue { + document keyvalue { + field value type string { + indexing: summary + } + } + document-summary keyvaluesummary { + summary value type string { + source: value + } + } +} diff --git a/configserver/src/test/resources/deploy/advancedapp/services.xml b/configserver/src/test/resources/deploy/advancedapp/services.xml new file mode 100644 index 00000000000..d2711b7f054 --- /dev/null +++ b/configserver/src/test/resources/deploy/advancedapp/services.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!-- Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. --> +<services version="1.0"> + + <admin version="2.0"> + <adminserver hostalias="node1"/> + <logserver hostalias="node1"/> + <slobroks> + <slobrok hostalias="node1"/> + </slobroks> + </admin> + + <jdisc version="1.0"> + <search /> + <nodes> + <node hostalias="node1" baseport='8000'/> + </nodes> + </jdisc> + + <content version="1.0"> + <redundancy>1</redundancy> + <documents> + <document type="keyvalue" mode="index"/> + </documents> + <nodes>> + <node hostalias="node1" distribution-key="0"/> + </nodes> + </content> + +</services> diff --git a/configserver/src/test/resources/deploy/app/services.xml b/configserver/src/test/resources/deploy/app/services.xml new file mode 100644 index 00000000000..f425d2f35d2 --- /dev/null +++ b/configserver/src/test/resources/deploy/app/services.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!-- Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. --> +<services version="1.0"> + + <admin version="2.0"> + <adminserver hostalias="node1" /> + </admin> + +</services> diff --git a/configserver/src/test/resources/deploy/validapp/hosts.xml b/configserver/src/test/resources/deploy/validapp/hosts.xml new file mode 100644 index 00000000000..3ab86a21aef --- /dev/null +++ b/configserver/src/test/resources/deploy/validapp/hosts.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!-- Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. --> +<hosts> + <host name="localhost"> + <alias>node1</alias> + </host> +</hosts> diff --git a/configserver/src/test/resources/deploy/validapp/services.xml b/configserver/src/test/resources/deploy/validapp/services.xml new file mode 100644 index 00000000000..f425d2f35d2 --- /dev/null +++ b/configserver/src/test/resources/deploy/validapp/services.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!-- Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. --> +<services version="1.0"> + + <admin version="2.0"> + <adminserver hostalias="node1" /> + </admin> + +</services> |