summaryrefslogtreecommitdiffstats
path: root/config-model/src/test/resources
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2016-06-15 23:09:44 +0200
committerJon Bratseth <bratseth@yahoo-inc.com>2016-06-15 23:09:44 +0200
commit72231250ed81e10d66bfe70701e64fa5fe50f712 (patch)
tree2728bba1131a6f6e5bdf95afec7d7ff9358dac50 /config-model/src/test/resources
Publish
Diffstat (limited to 'config-model/src/test/resources')
-rw-r--r--config-model/src/test/resources/configdefinitions/anotherrestart.def5
-rw-r--r--config-model/src/test/resources/configdefinitions/arraytypes.def11
-rw-r--r--config-model/src/test/resources/configdefinitions/function-test.def73
-rw-r--r--config-model/src/test/resources/configdefinitions/nonrestart.def5
-rw-r--r--config-model/src/test/resources/configdefinitions/restart.def5
-rw-r--r--config-model/src/test/resources/configdefinitions/simpletypes.def11
-rw-r--r--config-model/src/test/resources/configdefinitions/standard.def10
7 files changed, 120 insertions, 0 deletions
diff --git a/config-model/src/test/resources/configdefinitions/anotherrestart.def b/config-model/src/test/resources/configdefinitions/anotherrestart.def
new file mode 100644
index 00000000000..44862adce79
--- /dev/null
+++ b/config-model/src/test/resources/configdefinitions/anotherrestart.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.
+# Test config for ConfigValueChangeValidatorTest
+namespace=test
+
+anothervalue int restart
diff --git a/config-model/src/test/resources/configdefinitions/arraytypes.def b/config-model/src/test/resources/configdefinitions/arraytypes.def
new file mode 100644
index 00000000000..3529b906c4a
--- /dev/null
+++ b/config-model/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-model/src/test/resources/configdefinitions/function-test.def b/config-model/src/test/resources/configdefinitions/function-test.def
new file mode 100644
index 00000000000..5391ee1dc3c
--- /dev/null
+++ b/config-model/src/test/resources/configdefinitions/function-test.def
@@ -0,0 +1,73 @@
+# 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.
+
+namespace=test
+
+# 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.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-model/src/test/resources/configdefinitions/nonrestart.def b/config-model/src/test/resources/configdefinitions/nonrestart.def
new file mode 100644
index 00000000000..a5dd2e37ca0
--- /dev/null
+++ b/config-model/src/test/resources/configdefinitions/nonrestart.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.
+# Test config for ConfigValueChangeValidatorTest
+namespace=test
+
+plainvalue int
diff --git a/config-model/src/test/resources/configdefinitions/restart.def b/config-model/src/test/resources/configdefinitions/restart.def
new file mode 100644
index 00000000000..a7a7b55237e
--- /dev/null
+++ b/config-model/src/test/resources/configdefinitions/restart.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.
+# Test config for ConfigValueChangeValidatorTest
+namespace=test
+
+value int restart
diff --git a/config-model/src/test/resources/configdefinitions/simpletypes.def b/config-model/src/test/resources/configdefinitions/simpletypes.def
new file mode 100644
index 00000000000..314c67ae709
--- /dev/null
+++ b/config-model/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-model/src/test/resources/configdefinitions/standard.def b/config-model/src/test/resources/configdefinitions/standard.def
new file mode 100644
index 00000000000..c44740b8f92
--- /dev/null
+++ b/config-model/src/test/resources/configdefinitions/standard.def
@@ -0,0 +1,10 @@
+# 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
+astring string default=""
+baseport int default=-1