diff --git a/metafix/integrationTest.sh b/metafix/integrationTest.sh index 82e5371b..7533c33c 100755 --- a/metafix/integrationTest.sh +++ b/metafix/integrationTest.sh @@ -74,7 +74,8 @@ function rm_temp() { } function run_metafix() { - $gradle_command --console=plain -p "$root_directory" :metafix-runner:run --args="$1" -P${noprofile}profile="${1%.*}" + local file=$1; shift + $gradle_command --console=plain -p "$root_directory" :metafix-runner:run --args="$file" -P${noprofile}profile="${file%.*}" $@ } function run_catmandu() { @@ -224,10 +225,11 @@ function run_tests() { metafix_command_output="$test_directory/metafix.out" metafix_command_error="$test_directory/metafix.err" + metafix_command_args="$test_directory/metafix.args" metafix_start_time=$(current_time) - run_metafix "$test_directory/$metafix_file" >"$metafix_command_output" 2>"$metafix_command_error" + run_metafix "$test_directory/$metafix_file" $(cat "$metafix_command_args" 2>/dev/null || true) >"$metafix_command_output" 2>"$metafix_command_error" metafix_exit_status=$? metafix_elapsed_time=$(elapsed_time "$metafix_start_time") diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/script/fromJson/toJson/maxEntityCount/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/script/fromJson/toJson/maxEntityCount/expected.json new file mode 100644 index 00000000..3a2407ce --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/script/fromJson/toJson/maxEntityCount/expected.json @@ -0,0 +1,3 @@ +{"key1":"value1","key2":"value2","key3":"value3","key4":"value4"} +{"key1":"value1","key2":["v1","v2"]} +{"key1":"value1","key2":["v1","v2"],"key3":"value3","key4":"value4"} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/script/fromJson/toJson/maxEntityCount/input.json b/metafix/src/test/resources/org/metafacture/metafix/integration/script/fromJson/toJson/maxEntityCount/input.json new file mode 100644 index 00000000..42c84b5a --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/script/fromJson/toJson/maxEntityCount/input.json @@ -0,0 +1,3 @@ +{"key1":"value1","key2":"value2","key3":"value3","key4":"value4"} +{"key1":"value1","key2":["v1","v2"],"key3":["v3"],"key4":"value4"} +{"key1":"value1","key2":["v1","v2"],"key3":"value3","key4":"value4"} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/script/fromJson/toJson/maxEntityCount/metafix.args b/metafix/src/test/resources/org/metafacture/metafix/integration/script/fromJson/toJson/maxEntityCount/metafix.args new file mode 100644 index 00000000..d59d5387 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/script/fromJson/toJson/maxEntityCount/metafix.args @@ -0,0 +1 @@ +-Dorg.metafacture.metafix.maxEntityCount=1 diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/script/fromJson/toJson/maxEntityCount/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/script/fromJson/toJson/maxEntityCount/test.fix new file mode 100644 index 00000000..174b9a02 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/script/fromJson/toJson/maxEntityCount/test.fix @@ -0,0 +1 @@ +nothing() diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/script/fromJson/toJson/maxEntityCount/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/script/fromJson/toJson/maxEntityCount/test.flux new file mode 100644 index 00000000..ec507521 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/script/fromJson/toJson/maxEntityCount/test.flux @@ -0,0 +1,8 @@ +FLUX_DIR + "input.json" +|open-file +|as-lines +|decode-json +|fix(FLUX_DIR + "test.fix") +|encode-json +|write(FLUX_DIR + "output-metafix.json") +;