-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unit tests for ConfigParser (close #51)
- Loading branch information
Showing
13 changed files
with
380 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
modules/runtime-common/src/test/resources/config_parser_test/config.hocon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"field1": "value1", | ||
"field2": 10, | ||
"field3": true, | ||
"field4": { | ||
"field41": "value41", | ||
"field42": "value42" | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
modules/runtime-common/src/test/resources/config_parser_test/config_correct_namespace.hocon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
snowplow { | ||
"field1": "value1", | ||
"field2": 10, | ||
"field3": true, | ||
"field4": { | ||
"field41": "value41", | ||
"field42": "value42" | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
modules/runtime-common/src/test/resources/config_parser_test/config_invalid.hocon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"field1": "value1", | ||
"field2": 10, | ||
"field3": true, | ||
"field4": | ||
"field41": "value41", | ||
"field42": "value42" | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
modules/runtime-common/src/test/resources/config_parser_test/config_missing_field.hocon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"field1": "value1", | ||
"field2": 10, | ||
"field3": true, | ||
"field4": { | ||
"field42": "value42" | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
modules/runtime-common/src/test/resources/config_parser_test/config_with_set_env.hocon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"field1": "value1", | ||
"field2": 10, | ||
"field3": true, | ||
"field4": { | ||
"field41": ${CONFIG_PARSER_TEST_ENV}, | ||
"field42": "value42" | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
modules/runtime-common/src/test/resources/config_parser_test/config_with_substitution.hocon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"field1": ${subfield.a}, | ||
"field2": 10, | ||
"field3": true, | ||
"field4": { | ||
"field41": ${subfield.b}, | ||
"field42": "value42" | ||
} | ||
"subfield": { | ||
"a": "sub1" | ||
"b": "sub2" | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
modules/runtime-common/src/test/resources/config_parser_test/config_with_unset_env.hocon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"field1": "value1", | ||
"field2": 10, | ||
"field3": true, | ||
"field4": { | ||
"field41": ${UNSET_ENV_VAR}, | ||
"field42": "value42" | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
modules/runtime-common/src/test/resources/config_parser_test/config_wrong_namespace.hocon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
wrongnamespace { | ||
"field1": "value1", | ||
"field2": 10, | ||
"field3": true, | ||
"field4": { | ||
"field41": "value41", | ||
"field42": "value42" | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
modules/runtime-common/src/test/resources/config_parser_test/iglu_resolver.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"schema": "iglu:com.snowplowanalytics.iglu/resolver-config/jsonschema/1-0-1", | ||
"data": { | ||
"cacheSize": 500, | ||
"repositories": [ | ||
{ | ||
"name": "Iglu Central", | ||
"priority": 0, | ||
"vendorPrefixes": [ "com.snowplowanalytics" ], | ||
"connection": { | ||
"http": { | ||
"uri": "http://iglucentral.com" | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "Iglu Central - GCP Mirror", | ||
"priority": 1, | ||
"vendorPrefixes": [ "com.snowplowanalytics" ], | ||
"connection": { | ||
"http": { | ||
"uri": "http://mirror01.iglucentral.com" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
modules/runtime-common/src/test/resources/config_parser_test/iglu_resolver_invalid.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"schema": "iglu:com.snowplowanalytics.iglu/resolver-config/jsonschema/1-0-1", | ||
"data": { | ||
"cacheSize": 500, | ||
"repositories": [ | ||
"name": "Iglu Central", | ||
"priority": 0, | ||
"vendorPrefixes": [ "com.snowplowanalytics" ], | ||
"connection": { | ||
"http": { | ||
"uri": "http://iglucentral.com" | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "Iglu Central - GCP Mirror", | ||
"priority": 1, | ||
"vendorPrefixes": [ "com.snowplowanalytics" ], | ||
"connection": { | ||
"http": { | ||
"uri": "http://mirror01.iglucentral.com" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...les/runtime-common/src/test/resources/config_parser_test/iglu_resolver_missing_field.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"schema": "iglu:com.snowplowanalytics.iglu/resolver-config/jsonschema/1-0-1", | ||
"data": { | ||
"repositories": [ | ||
{ | ||
"name": "Iglu Central", | ||
"priority": 0, | ||
"vendorPrefixes": [ "com.snowplowanalytics" ], | ||
"connection": { | ||
"http": { | ||
"uri": "http://iglucentral.com" | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "Iglu Central - GCP Mirror", | ||
"priority": 1, | ||
"vendorPrefixes": [ "com.snowplowanalytics" ], | ||
"connection": { | ||
"http": { | ||
"uri": "http://mirror01.iglucentral.com" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} |
Oops, something went wrong.