diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/join_fieldSimpleAndChangeToArray/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/join_fieldSimpleAndChangeToArray/expected.json new file mode 100644 index 00000000..00f64362 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/join_fieldSimpleAndChangeToArray/expected.json @@ -0,0 +1,3 @@ +{ + "investigators" : "Justus?Peter?Bob" +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/join_fieldSimpleAndChangeToArray/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/join_fieldSimpleAndChangeToArray/input.json new file mode 100644 index 00000000..6004ff7c --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/join_fieldSimpleAndChangeToArray/input.json @@ -0,0 +1,3 @@ +{ + "investigators" : [ "Justus", "Peter", "Bob" ] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/join_fieldSimpleAndChangeToArray/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/join_fieldSimpleAndChangeToArray/test.fix new file mode 100644 index 00000000..fdaf9966 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/join_fieldSimpleAndChangeToArray/test.fix @@ -0,0 +1,2 @@ +join_field("investigators[]","?") +move_field("investigators[]","investigators") diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/replace_AllFromArrayOfStringsWithAsterisk/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/join_fieldSimpleAndChangeToArray/test.flux similarity index 100% rename from metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/replace_AllFromArrayOfStringsWithAsterisk/test.flux rename to metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/join_fieldSimpleAndChangeToArray/test.flux diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/renameInObject/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/renameInObject/expected.json new file mode 100644 index 00000000..53adebb3 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/renameInObject/expected.json @@ -0,0 +1,18 @@ +{ + "object" : { + "__key" : "word", + "key" : "word", + "key_2" : "word_2", + "__bject" : { + "key_3" : "word_3", + "array##fStrings" : [ "test", "test_2", "test_3" ] + }, + "array##f##bjects" : [ { + "key_4" : "word_4", + "array##fStrings_2" : [ "test", "test_2", "test_3" ] + }, { + "__key_2" : "word_2", + "array##fStrings" : [ "test", "test_2", "test_3" ] + } ] + } +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/renameInObject/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/renameInObject/input.json new file mode 100644 index 00000000..7cdc3b5e --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/renameInObject/input.json @@ -0,0 +1,18 @@ +{ + "object" : { + "okey" : "word", + "key" : "word", + "key_2" : "word_2", + "object" : { + "key_3" : "word_3", + "arrayOfStrings" : [ "test", "test_2", "test_3" ] + }, + "arrayOfObjects" : [ { + "key_4" : "word_4", + "arrayOfStrings_2" : [ "test", "test_2", "test_3" ] + }, { + "okey_2" : "word_2", + "arrayOfStrings" : [ "test", "test_2", "test_3" ] + } ] + } +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/renameInObject/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/renameInObject/test.fix new file mode 100644 index 00000000..62ed97bc --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/renameInObject/test.fix @@ -0,0 +1,2 @@ +rename("object", "o", "__") +rename("object", "O", "##") diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/renameInObject/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/renameInObject/test.flux new file mode 100644 index 00000000..7c3575fa --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/renameInObject/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/replace_AllFromArrayOfStringsWithAsterisk/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allInArrayOfStringsWithAsterisk/expected.json similarity index 100% rename from metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/replace_AllFromArrayOfStringsWithAsterisk/expected.json rename to metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allInArrayOfStringsWithAsterisk/expected.json diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/replace_AllFromArrayOfStringsWithAsterisk/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allInArrayOfStringsWithAsterisk/input.json similarity index 100% rename from metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/replace_AllFromArrayOfStringsWithAsterisk/input.json rename to metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allInArrayOfStringsWithAsterisk/input.json diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allInArrayOfStringsWithAsterisk/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allInArrayOfStringsWithAsterisk/test.fix new file mode 100644 index 00000000..1643a90a --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allInArrayOfStringsWithAsterisk/test.fix @@ -0,0 +1 @@ +replace_all("key[].*", "o", "__") diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allInArrayOfStringsWithAsterisk/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allInArrayOfStringsWithAsterisk/test.flux new file mode 100644 index 00000000..7c3575fa --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allInArrayOfStringsWithAsterisk/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/method/fromJson/toJson/replace_allInSubfieldOfArrayOfObjectsWithAsterisk/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allInSubfieldOfArrayOfObjectsWithAsterisk/expected.json new file mode 100644 index 00000000..4c888af3 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allInSubfieldOfArrayOfObjectsWithAsterisk/expected.json @@ -0,0 +1,12 @@ +{ + "key" : [ { + "foo" : "bar", + "word" : "value" + }, { + "foo" : "bar", + "word" : "m__re_value" + }, { + "foo" : "bar", + "word" : "even_m__re_value" + } ] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allInSubfieldOfArrayOfObjectsWithAsterisk/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allInSubfieldOfArrayOfObjectsWithAsterisk/input.json new file mode 100644 index 00000000..aeba8bf7 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allInSubfieldOfArrayOfObjectsWithAsterisk/input.json @@ -0,0 +1,12 @@ +{ + "key" : [ { + "word" : "value", + "foo" : "bar" + }, { + "word" : "more_value", + "foo" : "bar" + }, { + "word" : "even_more_value", + "foo" : "bar" + } ] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allInSubfieldOfArrayOfObjectsWithAsterisk/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allInSubfieldOfArrayOfObjectsWithAsterisk/test.fix new file mode 100644 index 00000000..4e8f6c17 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allInSubfieldOfArrayOfObjectsWithAsterisk/test.fix @@ -0,0 +1 @@ +replace_all("key[].*.word", "o", "__") diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allInSubfieldOfArrayOfObjectsWithAsterisk/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allInSubfieldOfArrayOfObjectsWithAsterisk/test.flux new file mode 100644 index 00000000..7c3575fa --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allInSubfieldOfArrayOfObjectsWithAsterisk/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/method/fromJson/toJson/replace_allSimple/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allSimple/expected.json new file mode 100644 index 00000000..ca88cd1c --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allSimple/expected.json @@ -0,0 +1,3 @@ +{ + "key" : "b__ard" +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allSimple/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allSimple/input.json new file mode 100644 index 00000000..cae33cb0 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allSimple/input.json @@ -0,0 +1,3 @@ +{ + "key" : "board" +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allSimple/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allSimple/test.fix new file mode 100644 index 00000000..1c2c099e --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allSimple/test.fix @@ -0,0 +1 @@ +replace_all("key", "o", "__") diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allSimple/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allSimple/test.flux new file mode 100644 index 00000000..7c3575fa --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/replace_allSimple/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/method/fromJson/toJson/reverseArrayOfStrings/disabled.txt b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseArrayOfStrings/disabled.txt new file mode 100644 index 00000000..0b9661d2 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseArrayOfStrings/disabled.txt @@ -0,0 +1 @@ +See issue #121 diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseArrayOfStrings/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseArrayOfStrings/expected.json new file mode 100644 index 00000000..516ffb50 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseArrayOfStrings/expected.json @@ -0,0 +1,3 @@ +{ + "animals" : [ "zebra", "cat", "dog" ] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseArrayOfStrings/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseArrayOfStrings/input.json new file mode 100644 index 00000000..12733202 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseArrayOfStrings/input.json @@ -0,0 +1,3 @@ +{ + "animals" : [ "dog", "cat", "zebra" ] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseArrayOfStrings/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseArrayOfStrings/test.fix new file mode 100644 index 00000000..1b418b26 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseArrayOfStrings/test.fix @@ -0,0 +1 @@ +reverse("animals[]") diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseArrayOfStrings/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseArrayOfStrings/test.flux new file mode 100644 index 00000000..7c3575fa --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseArrayOfStrings/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/method/fromJson/toJson/reverseSimpleField/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseSimpleField/expected.json new file mode 100644 index 00000000..2749dc0a --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseSimpleField/expected.json @@ -0,0 +1,7 @@ +{ + "animal" : "ynnub", + "animal_2" : { + "name" : "bird", + "type" : "TSET" + } +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseSimpleField/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseSimpleField/input.json new file mode 100644 index 00000000..0c72e14b --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseSimpleField/input.json @@ -0,0 +1,7 @@ +{ + "animal": "bunny", + "animal_2": { + "name": "bird", + "type": "TEST" + } +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseSimpleField/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseSimpleField/test.fix new file mode 100644 index 00000000..e3ab033e --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseSimpleField/test.fix @@ -0,0 +1,2 @@ +reverse("animal") +reverse("animal_2.test") diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseSimpleField/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseSimpleField/test.flux new file mode 100644 index 00000000..7c3575fa --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseSimpleField/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/method/fromJson/toJson/reverseSubfieldInArrayOfObjects/disabled.txt b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseSubfieldInArrayOfObjects/disabled.txt new file mode 100644 index 00000000..0b9661d2 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseSubfieldInArrayOfObjects/disabled.txt @@ -0,0 +1 @@ +See issue #121 diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseSubfieldInArrayOfObjects/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseSubfieldInArrayOfObjects/expected.json new file mode 100644 index 00000000..4075c2a5 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseSubfieldInArrayOfObjects/expected.json @@ -0,0 +1,12 @@ +{ + "test": [{ + "key": "1_eulav", + "test": "test_1" + },{ + "key": "2_eulav", + "test": "test_2" + },{ + "key": "3_eulav", + "test": "test_3" + }] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseSubfieldInArrayOfObjects/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseSubfieldInArrayOfObjects/input.json new file mode 100644 index 00000000..84d0da50 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseSubfieldInArrayOfObjects/input.json @@ -0,0 +1,12 @@ +{ + "test": [{ + "key": "value_1", + "test": "test_1" + },{ + "key": "value_2", + "test": "test_2" + },{ + "key": "value_3", + "test": "test_3" + }] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseSubfieldInArrayOfObjects/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseSubfieldInArrayOfObjects/test.fix new file mode 100644 index 00000000..f3bfc0bb --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseSubfieldInArrayOfObjects/test.fix @@ -0,0 +1 @@ +reverse("test[].*.key") diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseSubfieldInArrayOfObjects/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseSubfieldInArrayOfObjects/test.flux new file mode 100644 index 00000000..7c3575fa --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseSubfieldInArrayOfObjects/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/method/fromJson/toJson/reverseValuesInArrayOfStrings/disabled.txt b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseValuesInArrayOfStrings/disabled.txt new file mode 100644 index 00000000..0b9661d2 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseValuesInArrayOfStrings/disabled.txt @@ -0,0 +1 @@ +See issue #121 diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseValuesInArrayOfStrings/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseValuesInArrayOfStrings/expected.json new file mode 100644 index 00000000..9e7b8148 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseValuesInArrayOfStrings/expected.json @@ -0,0 +1,3 @@ +{ + "animals" : [ "god", "tac", "arbez" ] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseValuesInArrayOfStrings/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseValuesInArrayOfStrings/input.json new file mode 100644 index 00000000..0218f89c --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseValuesInArrayOfStrings/input.json @@ -0,0 +1,3 @@ +{ + "animals": [ "dog", "cat", "zebra" ] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseValuesInArrayOfStrings/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseValuesInArrayOfStrings/test.fix new file mode 100644 index 00000000..5c655bc7 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseValuesInArrayOfStrings/test.fix @@ -0,0 +1 @@ +reverse("animals[].*") diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseValuesInArrayOfStrings/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseValuesInArrayOfStrings/test.flux new file mode 100644 index 00000000..7c3575fa --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/reverseValuesInArrayOfStrings/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/method/fromJson/toJson/split_fieldSimple/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSimple/expected.json new file mode 100644 index 00000000..4efa30ad --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSimple/expected.json @@ -0,0 +1,5 @@ +{ + "tools" : "magic", + "tools" : "arms", + "tools" : "shapeShifting" +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSimple/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSimple/input.json new file mode 100644 index 00000000..3ef275ad --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSimple/input.json @@ -0,0 +1,3 @@ +{ + "tools" : "magic--arms--shapeShifting" +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSimple/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSimple/test.fix new file mode 100644 index 00000000..d443afdf --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSimple/test.fix @@ -0,0 +1 @@ +split_field("tools", "--") diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSimple/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSimple/test.flux new file mode 100644 index 00000000..7c3575fa --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSimple/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/method/fromJson/toJson/split_fieldSubfieldInArrayOfObjectsWithAsterisk/disabled.txt b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSubfieldInArrayOfObjectsWithAsterisk/disabled.txt new file mode 100644 index 00000000..0b9661d2 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSubfieldInArrayOfObjectsWithAsterisk/disabled.txt @@ -0,0 +1 @@ +See issue #121 diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSubfieldInArrayOfObjectsWithAsterisk/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSubfieldInArrayOfObjectsWithAsterisk/expected.json new file mode 100644 index 00000000..60629f1d --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSubfieldInArrayOfObjectsWithAsterisk/expected.json @@ -0,0 +1,15 @@ +{ + "adventureDuo" : [ { + "name" : "Jake", + "animal" : "dog", + "tools" : "magic", + "tools" : "arms", + "tools" : "shapeShifting" + }, { + "name" : "Finn", + "animal" : "human", + "tools" : "sword", + "tools" : "anotherSword", + "tools" : "arm" + } ] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSubfieldInArrayOfObjectsWithAsterisk/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSubfieldInArrayOfObjectsWithAsterisk/input.json new file mode 100644 index 00000000..b29cc094 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSubfieldInArrayOfObjectsWithAsterisk/input.json @@ -0,0 +1,11 @@ +{ + "adventureDuo": [ { + "name" : "Jake", + "animal" : "dog", + "tools" : "magic--arms--shapeShifting" + }, { + "name" : "Finn", + "animal" : "human", + "tools" : "sword--anotherSword--arm" + } ] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSubfieldInArrayOfObjectsWithAsterisk/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSubfieldInArrayOfObjectsWithAsterisk/test.fix new file mode 100644 index 00000000..d50fde61 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSubfieldInArrayOfObjectsWithAsterisk/test.fix @@ -0,0 +1 @@ +split_field("adventureDuo[].*.tools", "--") diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSubfieldInArrayOfObjectsWithAsterisk/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSubfieldInArrayOfObjectsWithAsterisk/test.flux new file mode 100644 index 00000000..7c3575fa --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSubfieldInArrayOfObjectsWithAsterisk/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/method/fromJson/toJson/split_fieldSubfieldInObject/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSubfieldInObject/expected.json new file mode 100644 index 00000000..0a69d6b7 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSubfieldInObject/expected.json @@ -0,0 +1,7 @@ +{ + "people" : { + "investigators" : "Justus", + "investigators" : "Peter", + "investigators" : "Bob" + } +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSubfieldInObject/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSubfieldInObject/input.json new file mode 100644 index 00000000..00b7a05a --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSubfieldInObject/input.json @@ -0,0 +1,5 @@ +{ + "people" : { + "investigators" : "Justus?Peter?Bob" + } +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSubfieldInObject/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSubfieldInObject/test.fix new file mode 100644 index 00000000..9775183c --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSubfieldInObject/test.fix @@ -0,0 +1 @@ +split_field("people.investigators","\\?") diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSubfieldInObject/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSubfieldInObject/test.flux new file mode 100644 index 00000000..7c3575fa --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/split_fieldSubfieldInObject/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/add_fieldAsteriskIntoArrayOfObjects/disabled.txt b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/add_fieldAsteriskIntoArrayOfObjects/disabled.txt index 5d692bde..26adbe67 100644 --- a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/add_fieldAsteriskIntoArrayOfObjects/disabled.txt +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/add_fieldAsteriskIntoArrayOfObjects/disabled.txt @@ -1 +1 @@ -See issue #156 +See issue #156 and #121 diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObject/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObject/expected.json new file mode 100644 index 00000000..0d343c0e --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObject/expected.json @@ -0,0 +1,16 @@ +{ + "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_fieldArrayOfObject/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObject/input.json new file mode 100644 index 00000000..d4e78667 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObject/input.json @@ -0,0 +1,9 @@ +{ + "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_fieldArrayOfObject/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObject/test.fix new file mode 100644 index 00000000..ca2fbaf9 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObject/test.fix @@ -0,0 +1 @@ +copy_field("test[]", "test_2[]") diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObject/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObject/test.flux new file mode 100644 index 00000000..7c3575fa --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObject/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_fieldArrayOfObjectAsRepeatedObject/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObject/expected.json new file mode 100644 index 00000000..c5eb79b8 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObject/expected.json @@ -0,0 +1,18 @@ +{ + "test" : [ { + "key" : "value_1" + }, { + "key" : "value_2" + }, { + "key" : "value_3" + } ], + "repeatedTest" : { + "key" : "value_1" + }, + "repeatedTest" : { + "key" : "value_2" + }, + "repeatedTest" : { + "key" : "value_3" + } +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObject/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObject/input.json new file mode 100644 index 00000000..d4e78667 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObject/input.json @@ -0,0 +1,9 @@ +{ + "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_fieldArrayOfObjectAsRepeatedObject/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObject/test.fix new file mode 100644 index 00000000..148fd867 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObject/test.fix @@ -0,0 +1 @@ +copy_field("test[]", "repeatedTest") diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObject/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObject/test.flux new file mode 100644 index 00000000..7c3575fa --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldArrayOfObjectAsRepeatedObject/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_fieldFromArrayOfStringsInArrayOfObjectsWithAsterisk/disabled.txt b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldFromArrayOfStringsInArrayOfObjectsWithAsterisk/disabled.txt index 50dfbeee..4c62acfe 100644 --- a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldFromArrayOfStringsInArrayOfObjectsWithAsterisk/disabled.txt +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldFromArrayOfStringsInArrayOfObjectsWithAsterisk/disabled.txt @@ -1 +1 @@ -See issue #155 +See issue #155 also #121 diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldFromSubfieldInArrayOfObjectsWithAsterisk/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldFromSubfieldInArrayOfObjectsWithAsterisk/expected.json new file mode 100644 index 00000000..160e7e5c --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldFromSubfieldInArrayOfObjectsWithAsterisk/expected.json @@ -0,0 +1,13 @@ +{ + "key" : [ { + "word" : "value", + "foo" : "bar" + }, { + "word" : "more_value", + "foo" : "bar" + }, { + "word" : "even_more_value", + "foo" : "bar" + } ], + "words" : [ "value", "more_value", "even_more_value" ] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldFromSubfieldInArrayOfObjectsWithAsterisk/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldFromSubfieldInArrayOfObjectsWithAsterisk/input.json new file mode 100644 index 00000000..0ad1ca49 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldFromSubfieldInArrayOfObjectsWithAsterisk/input.json @@ -0,0 +1,13 @@ +{ + "key" : [ { + "word" : "value", + "foo" : "bar" + }, { + "word" : "more_value", + "foo" : "bar" + }, { + "word" : "even_more_value", + "foo" : "bar" + } ], + "words" : [ ] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldFromSubfieldInArrayOfObjectsWithAsterisk/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldFromSubfieldInArrayOfObjectsWithAsterisk/test.fix new file mode 100644 index 00000000..772651d3 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldFromSubfieldInArrayOfObjectsWithAsterisk/test.fix @@ -0,0 +1 @@ +copy_field("key[].*.word", "words[].$append") diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldFromSubfieldInArrayOfObjectsWithAsterisk/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldFromSubfieldInArrayOfObjectsWithAsterisk/test.flux new file mode 100644 index 00000000..7c3575fa --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldFromSubfieldInArrayOfObjectsWithAsterisk/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_fieldSimple/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldSimple/expected.json new file mode 100644 index 00000000..a6f359df --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldSimple/expected.json @@ -0,0 +1,4 @@ +{ + "animal" : "bunny", + "type" : "bunny" +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldSimple/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldSimple/input.json new file mode 100644 index 00000000..b3abb029 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldSimple/input.json @@ -0,0 +1,3 @@ +{ + "animal": "bunny" +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldSimple/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldSimple/test.fix new file mode 100644 index 00000000..4d7b68fb --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldSimple/test.fix @@ -0,0 +1 @@ +copy_field("animal", "type") diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldSimple/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldSimple/test.flux new file mode 100644 index 00000000..7c3575fa --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldSimple/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/replace_AllFromArrayOfStringsWithAsterisk/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/replace_AllFromArrayOfStringsWithAsterisk/test.fix deleted file mode 100644 index 0f50b7d8..00000000 --- a/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/replace_AllFromArrayOfStringsWithAsterisk/test.fix +++ /dev/null @@ -1 +0,0 @@ -replace_all("test[].*", "o", "__")