diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfObjects/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfObjects/expected.json new file mode 100644 index 00000000..8e371b20 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfObjects/expected.json @@ -0,0 +1,9 @@ +{ + "animals" : [ { + "name" : "Jake", + "type" : "mammal" + }, { + "name" : "Blacky", + "type" : "bird" + } ] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfObjects/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfObjects/input.json new file mode 100644 index 00000000..467e7ef2 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfObjects/input.json @@ -0,0 +1,9 @@ +{ + "animals": [{ + "name": "Jake", + "type": "dog" + },{ + "name": "Blacky", + "type": "parrot" + }] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfObjects/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfObjects/test.fix new file mode 100644 index 00000000..02b587da --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfObjects/test.fix @@ -0,0 +1,10 @@ +put_map("map", +"dog":"mammal", +"cat":"mammal", +"parrot":"bird", +"shark":"fish", +"dragon":"ficational animal", +"unicorn":"ficational animal" + ) + +lookup("animals[].*.type", "map") diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfObjects/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfObjects/test.flux new file mode 100644 index 00000000..7c3575fa --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfObjects/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/lookupInArrayOfObjectsWithListBind/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfObjectsWithListBind/expected.json new file mode 100644 index 00000000..8e371b20 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfObjectsWithListBind/expected.json @@ -0,0 +1,9 @@ +{ + "animals" : [ { + "name" : "Jake", + "type" : "mammal" + }, { + "name" : "Blacky", + "type" : "bird" + } ] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfObjectsWithListBind/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfObjectsWithListBind/input.json new file mode 100644 index 00000000..467e7ef2 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfObjectsWithListBind/input.json @@ -0,0 +1,9 @@ +{ + "animals": [{ + "name": "Jake", + "type": "dog" + },{ + "name": "Blacky", + "type": "parrot" + }] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfObjectsWithListBind/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfObjectsWithListBind/test.fix new file mode 100644 index 00000000..a7e9c5bb --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfObjectsWithListBind/test.fix @@ -0,0 +1,12 @@ +put_map("map", +"dog":"mammal", +"cat":"mammal", +"parrot":"bird", +"shark":"fish", +"dragon":"ficational animal", +"unicorn":"ficational animal" + ) + +do list(path: "animals[]") + lookup("type", "map") +end diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfObjectsWithListBind/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfObjectsWithListBind/test.flux new file mode 100644 index 00000000..7c3575fa --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfObjectsWithListBind/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/lookupInArrayOfStrings/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfStrings/expected.json new file mode 100644 index 00000000..392ddb0b --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfStrings/expected.json @@ -0,0 +1,3 @@ +{ + "animals" : [ "mammal", "bird", "fish" ] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfStrings/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfStrings/input.json new file mode 100644 index 00000000..e65dda09 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfStrings/input.json @@ -0,0 +1,3 @@ +{ + "animals" : [ "dog", "parrot", "shark" ] +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfStrings/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfStrings/test.fix new file mode 100644 index 00000000..068ce1a2 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfStrings/test.fix @@ -0,0 +1,10 @@ +put_map("map", +"dog":"mammal", +"cat":"mammal", +"parrot":"bird", +"shark":"fish", +"dragon":"ficational animal", +"unicorn":"ficational animal" + ) + +lookup("animals[].*", "map") diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfStrings/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfStrings/test.flux new file mode 100644 index 00000000..7c3575fa --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/method/fromJson/toJson/lookupInArrayOfStrings/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") +;