From 3edd595c077a1f4d4f3f9ed1935d9694f7a99f2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20B=C3=BClte?= Date: Tue, 1 Mar 2022 14:21:07 +0100 Subject: [PATCH] Add integration test for #132 Also one for #121 --- .../disabled.txt | 1 + .../expected.json | 11 ++++++++++ .../input.json | 10 ++++++++++ .../test.fix | 2 ++ .../test.flux | 8 ++++++++ .../copy_fieldArrayOfStrings/expected.json | 4 ++++ .../copy_fieldArrayOfStrings/input.json | 7 +++++++ .../toJson/copy_fieldArrayOfStrings/test.fix | 1 + .../toJson/copy_fieldArrayOfStrings/test.flux | 8 ++++++++ .../expected.json | 6 ++++++ .../input.json | 7 +++++++ .../test.fix | 1 + .../test.flux | 8 ++++++++ .../disabled.txt | 1 + .../expected.json | 20 +++++++++++++++++++ .../input.json | 17 ++++++++++++++++ .../test.fix | 1 + .../test.flux | 8 ++++++++ .../expected.json | 18 +++++++++++++++++ .../input.json | 17 ++++++++++++++++ .../test.fix | 2 ++ .../test.flux | 8 ++++++++ .../expected.json | 20 +++++++++++++++++++ .../input.json | 17 ++++++++++++++++ .../test.fix | 2 ++ .../test.flux | 8 ++++++++ .../expected.json | 11 ++++++++++ .../input.json | 10 ++++++++++ .../test.fix | 1 + .../test.flux | 8 ++++++++ .../record/fromJson/toJson/input_old.json | 10 ++++++++++ .../move_fieldArrayOfStrings/expected.json | 3 +++ .../move_fieldArrayOfStrings/input.json | 7 +++++++ .../toJson/move_fieldArrayOfStrings/test.fix | 1 + .../toJson/move_fieldArrayOfStrings/test.flux | 8 ++++++++ .../expected.json | 5 +++++ .../input.json | 7 +++++++ .../test.fix | 1 + .../test.flux | 8 ++++++++ 39 files changed, 293 insertions(+) create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObjectAndThenArrayOfStringsIntoTheArrayOfObjectsWithLastWildcard/disabled.txt create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObjectAndThenArrayOfStringsIntoTheArrayOfObjectsWithLastWildcard/expected.json create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObjectAndThenArrayOfStringsIntoTheArrayOfObjectsWithLastWildcard/input.json create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObjectAndThenArrayOfStringsIntoTheArrayOfObjectsWithLastWildcard/test.fix create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObjectAndThenArrayOfStringsIntoTheArrayOfObjectsWithLastWildcard/test.flux create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStrings/expected.json create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStrings/input.json create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStrings/test.fix create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStrings/test.flux create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsAsRepeatedField/expected.json create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsAsRepeatedField/input.json create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsAsRepeatedField/test.fix create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsAsRepeatedField/test.flux create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithAsteriskWildcard/disabled.txt create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithAsteriskWildcard/expected.json create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithAsteriskWildcard/input.json create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithAsteriskWildcard/test.fix create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithAsteriskWildcard/test.flux create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcard/expected.json create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcard/input.json create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcard/test.fix create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcard/test.flux create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcardAsRepeatedField/expected.json create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcardAsRepeatedField/input.json create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcardAsRepeatedField/test.fix create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcardAsRepeatedField/test.flux create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithLastWildcard/expected.json create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithLastWildcard/input.json create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithLastWildcard/test.fix create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithLastWildcard/test.flux create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/input_old.json create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStrings/expected.json create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStrings/input.json create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStrings/test.fix create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStrings/test.flux create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStringsToRepeatedField/expected.json create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStringsToRepeatedField/input.json create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStringsToRepeatedField/test.fix create mode 100644 metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStringsToRepeatedField/test.flux diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObjectAndThenArrayOfStringsIntoTheArrayOfObjectsWithLastWildcard/disabled.txt b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObjectAndThenArrayOfStringsIntoTheArrayOfObjectsWithLastWildcard/disabled.txt new file mode 100644 index 00000000..b19226bb --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObjectAndThenArrayOfStringsIntoTheArrayOfObjectsWithLastWildcard/disabled.txt @@ -0,0 +1 @@ +See issue #132 may also be related to #113 diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObjectAndThenArrayOfStringsIntoTheArrayOfObjectsWithLastWildcard/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObjectAndThenArrayOfStringsIntoTheArrayOfObjectsWithLastWildcard/expected.json new file mode 100644 index 00000000..bb87614b --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObjectAndThenArrayOfStringsIntoTheArrayOfObjectsWithLastWildcard/expected.json @@ -0,0 +1,11 @@ +{ + "animal_string_Array" : [ "dog", "elefant", "shark" ], + "test" : [ { + "key" : "value_1" + }, { + "key" : "value_2" + }, { + "key" : "value_3", + "animal_string_Array" : [ "dog", "elefant", "shark" ] + } ] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObjectAndThenArrayOfStringsIntoTheArrayOfObjectsWithLastWildcard/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObjectAndThenArrayOfStringsIntoTheArrayOfObjectsWithLastWildcard/input.json new file mode 100644 index 00000000..a42c848b --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObjectAndThenArrayOfStringsIntoTheArrayOfObjectsWithLastWildcard/input.json @@ -0,0 +1,10 @@ +{ + "animal_string_Array" : [ "dog", "elefant", "shark" ], + "test": [{ + "key": "value_1" + },{ + "key": "value_2" + },{ + "key": "value_3" + }] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObjectAndThenArrayOfStringsIntoTheArrayOfObjectsWithLastWildcard/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObjectAndThenArrayOfStringsIntoTheArrayOfObjectsWithLastWildcard/test.fix new file mode 100644 index 00000000..9496e0b3 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObjectAndThenArrayOfStringsIntoTheArrayOfObjectsWithLastWildcard/test.fix @@ -0,0 +1,2 @@ +copy_field("test[]", "repeatedTest") +copy_field("animal_string_Array[]", "test[].$last.animal_string_Array[]") diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObjectAndThenArrayOfStringsIntoTheArrayOfObjectsWithLastWildcard/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObjectAndThenArrayOfStringsIntoTheArrayOfObjectsWithLastWildcard/test.flux new file mode 100644 index 00000000..7c3575fa --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObjectAndThenArrayOfStringsIntoTheArrayOfObjectsWithLastWildcard/test.flux @@ -0,0 +1,8 @@ +FLUX_DIR + "input.json" +|open-file +|as-records +|decode-json +|fix(FLUX_DIR + "test.fix") +|encode-json(prettyPrinting="true") +|write(FLUX_DIR + "output-metafix.json") +; diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStrings/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStrings/expected.json new file mode 100644 index 00000000..f1bc2c3b --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStrings/expected.json @@ -0,0 +1,4 @@ +{ + "animal_string_Array" : [ "dog", "elefant", "shark" ], + "test" : [ "dog", "elefant", "shark" ] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStrings/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStrings/input.json new file mode 100644 index 00000000..be72ba9c --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStrings/input.json @@ -0,0 +1,7 @@ +{ + "animal_string_Array" : [ + "dog", + "elefant", + "shark" + ] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStrings/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStrings/test.fix new file mode 100644 index 00000000..3e201958 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStrings/test.fix @@ -0,0 +1 @@ +copy_field("animal_string_Array[]", "test[]") diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStrings/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStrings/test.flux new file mode 100644 index 00000000..7c3575fa --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStrings/test.flux @@ -0,0 +1,8 @@ +FLUX_DIR + "input.json" +|open-file +|as-records +|decode-json +|fix(FLUX_DIR + "test.fix") +|encode-json(prettyPrinting="true") +|write(FLUX_DIR + "output-metafix.json") +; diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsAsRepeatedField/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsAsRepeatedField/expected.json new file mode 100644 index 00000000..9228cf7c --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsAsRepeatedField/expected.json @@ -0,0 +1,6 @@ +{ + "animal_string_Array" : [ "dog", "elefant", "shark" ], + "animals_repeated_SimpleField" : "dog", + "animals_repeated_SimpleField" : "elefant", + "animals_repeated_SimpleField" : "shark" +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsAsRepeatedField/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsAsRepeatedField/input.json new file mode 100644 index 00000000..be72ba9c --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsAsRepeatedField/input.json @@ -0,0 +1,7 @@ +{ + "animal_string_Array" : [ + "dog", + "elefant", + "shark" + ] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsAsRepeatedField/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsAsRepeatedField/test.fix new file mode 100644 index 00000000..762353b5 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsAsRepeatedField/test.fix @@ -0,0 +1 @@ +copy_field("animal_string_Array[]", "animals_repeated_SimpleField") diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsAsRepeatedField/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsAsRepeatedField/test.flux new file mode 100644 index 00000000..7c3575fa --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsAsRepeatedField/test.flux @@ -0,0 +1,8 @@ +FLUX_DIR + "input.json" +|open-file +|as-records +|decode-json +|fix(FLUX_DIR + "test.fix") +|encode-json(prettyPrinting="true") +|write(FLUX_DIR + "output-metafix.json") +; diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithAsteriskWildcard/disabled.txt b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithAsteriskWildcard/disabled.txt new file mode 100644 index 00000000..0b9661d2 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithAsteriskWildcard/disabled.txt @@ -0,0 +1 @@ +See issue #121 diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithAsteriskWildcard/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithAsteriskWildcard/expected.json new file mode 100644 index 00000000..75a21bdd --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithAsteriskWildcard/expected.json @@ -0,0 +1,20 @@ +{ + "animal_string_Array" : [ "dog", "elefant", "shark" ], + "test" : [ { + "key": "value_1", + "animal_string_Array" : [ "dog", "elefant", "shark" ] + }, { + "key": "value_2", + "animal_string_Array" : [ "dog", "elefant", "shark" ] + }, { + "key": "value_3", + "animal_string_Array" : [ "dog", "elefant", "shark" ] + } ], + "test_2" : [ { + "key" : "value_1" + }, { + "key" : "value_2" + }, { + "key" : "value_3" + } ] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithAsteriskWildcard/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithAsteriskWildcard/input.json new file mode 100644 index 00000000..c09dc28a --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithAsteriskWildcard/input.json @@ -0,0 +1,17 @@ +{ + "animal_string_Array" : [ "dog", "elefant", "shark" ], + "test": [{ + "key" : "value_1" + },{ + "key" : "value_2" + },{ + "key" : "value_3" + }], + "test_2": [{ + "key" : "value_1" + },{ + "key" : "value_2" + },{ + "key" : "value_3" + }] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithAsteriskWildcard/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithAsteriskWildcard/test.fix new file mode 100644 index 00000000..0d650f46 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithAsteriskWildcard/test.fix @@ -0,0 +1 @@ +copy_field("animal_string_Array[]", "test[].*.animal_string_Array[]") diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithAsteriskWildcard/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithAsteriskWildcard/test.flux new file mode 100644 index 00000000..7c3575fa --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithAsteriskWildcard/test.flux @@ -0,0 +1,8 @@ +FLUX_DIR + "input.json" +|open-file +|as-records +|decode-json +|fix(FLUX_DIR + "test.fix") +|encode-json(prettyPrinting="true") +|write(FLUX_DIR + "output-metafix.json") +; diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcard/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcard/expected.json new file mode 100644 index 00000000..5eda0578 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcard/expected.json @@ -0,0 +1,18 @@ +{ + "animal_string_Array" : [ "dog", "elefant", "shark" ], + "test" : [ { + "key" : "value_1", + "animal_string_Array" : [ "dog", "elefant", "shark" ] + }, { + "key" : "value_2" + }, { + "key" : "value_3" + } ], + "test_2" : [ { + "key" : "value_1" + }, { + "key" : "value_2" + }, { + "key" : "value_3" + } ] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcard/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcard/input.json new file mode 100644 index 00000000..e0b2282f --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcard/input.json @@ -0,0 +1,17 @@ +{ + "animal_string_Array" : [ "dog", "elefant", "shark" ], + "test": [{ + "key": "value_1" + },{ + "key": "value_2" + },{ + "key": "value_3" + }], + "test_2" : [ { + "key" : "value_1" + }, { + "key" : "value_2" + }, { + "key" : "value_3" + } ] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcard/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcard/test.fix new file mode 100644 index 00000000..b7da49c1 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcard/test.fix @@ -0,0 +1,2 @@ +copy_field("animal_string_Array[]", "test[].$first.animal_string_Array[]") + diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcard/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcard/test.flux new file mode 100644 index 00000000..7c3575fa --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcard/test.flux @@ -0,0 +1,8 @@ +FLUX_DIR + "input.json" +|open-file +|as-records +|decode-json +|fix(FLUX_DIR + "test.fix") +|encode-json(prettyPrinting="true") +|write(FLUX_DIR + "output-metafix.json") +; diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcardAsRepeatedField/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcardAsRepeatedField/expected.json new file mode 100644 index 00000000..d539ce3c --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcardAsRepeatedField/expected.json @@ -0,0 +1,20 @@ +{ + "animal_string_Array" : [ "dog", "elefant", "shark" ], + "test" : [ { + "key" : "value_1", + "animals_repeated_SimpleField" : "dog", + "animals_repeated_SimpleField" : "elefant", + "animals_repeated_SimpleField" : "shark" + }, { + "key" : "value_2" + }, { + "key" : "value_3" + } ], + "test_2" : [ { + "key" : "value_1" + }, { + "key" : "value_2" + }, { + "key" : "value_3" + } ] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcardAsRepeatedField/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcardAsRepeatedField/input.json new file mode 100644 index 00000000..db20b46a --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcardAsRepeatedField/input.json @@ -0,0 +1,17 @@ +{ + "animal_string_Array" : [ "dog", "elefant", "shark" ], + "test": [{ + "key": "value_1" + },{ + "key": "value_2" + },{ + "key": "value_3" + }], + "test_2": [{ + "key" : "value_1" + },{ + "key" : "value_2" + },{ + "key" : "value_3" + }] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcardAsRepeatedField/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcardAsRepeatedField/test.fix new file mode 100644 index 00000000..5ae92fb4 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcardAsRepeatedField/test.fix @@ -0,0 +1,2 @@ +copy_field("animal_string_Array[]", "test[].$first.animals_repeated_SimpleField") + diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcardAsRepeatedField/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcardAsRepeatedField/test.flux new file mode 100644 index 00000000..7c3575fa --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithFirstWildcardAsRepeatedField/test.flux @@ -0,0 +1,8 @@ +FLUX_DIR + "input.json" +|open-file +|as-records +|decode-json +|fix(FLUX_DIR + "test.fix") +|encode-json(prettyPrinting="true") +|write(FLUX_DIR + "output-metafix.json") +; diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithLastWildcard/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithLastWildcard/expected.json new file mode 100644 index 00000000..bb87614b --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithLastWildcard/expected.json @@ -0,0 +1,11 @@ +{ + "animal_string_Array" : [ "dog", "elefant", "shark" ], + "test" : [ { + "key" : "value_1" + }, { + "key" : "value_2" + }, { + "key" : "value_3", + "animal_string_Array" : [ "dog", "elefant", "shark" ] + } ] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithLastWildcard/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithLastWildcard/input.json new file mode 100644 index 00000000..a42c848b --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithLastWildcard/input.json @@ -0,0 +1,10 @@ +{ + "animal_string_Array" : [ "dog", "elefant", "shark" ], + "test": [{ + "key": "value_1" + },{ + "key": "value_2" + },{ + "key": "value_3" + }] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithLastWildcard/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithLastWildcard/test.fix new file mode 100644 index 00000000..7bee131b --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithLastWildcard/test.fix @@ -0,0 +1 @@ +copy_field("animal_string_Array[]", "test[].$last.animal_string_Array[]") diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithLastWildcard/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithLastWildcard/test.flux new file mode 100644 index 00000000..7c3575fa --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfStringsIntoArrayOfObjectsWithLastWildcard/test.flux @@ -0,0 +1,8 @@ +FLUX_DIR + "input.json" +|open-file +|as-records +|decode-json +|fix(FLUX_DIR + "test.fix") +|encode-json(prettyPrinting="true") +|write(FLUX_DIR + "output-metafix.json") +; diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/input_old.json b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/input_old.json new file mode 100644 index 00000000..b47ffb57 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/input_old.json @@ -0,0 +1,10 @@ +{ + "animal_string_Array": [ + "dog", + "elefant" + ], + "animal_object_Array": [ + {"name":"dog"}, + {"name":"elefant"} + ] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStrings/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStrings/expected.json new file mode 100644 index 00000000..29335adc --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStrings/expected.json @@ -0,0 +1,3 @@ +{ + "test" : [ "dog", "elefant", "shark" ] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStrings/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStrings/input.json new file mode 100644 index 00000000..be72ba9c --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStrings/input.json @@ -0,0 +1,7 @@ +{ + "animal_string_Array" : [ + "dog", + "elefant", + "shark" + ] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStrings/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStrings/test.fix new file mode 100644 index 00000000..ba14a716 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStrings/test.fix @@ -0,0 +1 @@ +move_field("animal_string_Array[]", "test[]") diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStrings/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStrings/test.flux new file mode 100644 index 00000000..7c3575fa --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStrings/test.flux @@ -0,0 +1,8 @@ +FLUX_DIR + "input.json" +|open-file +|as-records +|decode-json +|fix(FLUX_DIR + "test.fix") +|encode-json(prettyPrinting="true") +|write(FLUX_DIR + "output-metafix.json") +; diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStringsToRepeatedField/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStringsToRepeatedField/expected.json new file mode 100644 index 00000000..7e7d48e1 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStringsToRepeatedField/expected.json @@ -0,0 +1,5 @@ +{ + "animals_repeated_SimpleField" : "dog", + "animals_repeated_SimpleField" : "elefant", + "animals_repeated_SimpleField" : "shark" +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStringsToRepeatedField/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStringsToRepeatedField/input.json new file mode 100644 index 00000000..be72ba9c --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStringsToRepeatedField/input.json @@ -0,0 +1,7 @@ +{ + "animal_string_Array" : [ + "dog", + "elefant", + "shark" + ] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStringsToRepeatedField/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStringsToRepeatedField/test.fix new file mode 100644 index 00000000..63a4b08e --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStringsToRepeatedField/test.fix @@ -0,0 +1 @@ +move_field("animal_string_Array[]", "animals_repeated_SimpleField") diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStringsToRepeatedField/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStringsToRepeatedField/test.flux new file mode 100644 index 00000000..7c3575fa --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/move_fieldArrayOfStringsToRepeatedField/test.flux @@ -0,0 +1,8 @@ +FLUX_DIR + "input.json" +|open-file +|as-records +|decode-json +|fix(FLUX_DIR + "test.fix") +|encode-json(prettyPrinting="true") +|write(FLUX_DIR + "output-metafix.json") +;