This repository has been archived by the owner on Jan 27, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add integration tests with expected exceptions for "strict" mode. (#210…
…, #140)
- Loading branch information
1 parent
6291ed5
commit e167bbe
Showing
10 changed files
with
94 additions
and
35 deletions.
There are no files selected for viewing
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
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
2 changes: 2 additions & 0 deletions
2
...ntegration/script/fromJson/toJson/strictnessAbortProcessOnExecutionException/expected.err
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,2 @@ | ||
^Exception in thread "main" org\.metafacture\.metafix\.FixExecutionException: Error while executing Fix expression \(at file:.*/metafix/src/test/resources/org/metafacture/metafix/integration/script/fromJson/toJson/strictnessAbortProcessOnExecutionException/test\.fix, line 2\): upcase\("data"\)$ | ||
^Caused by: java\.lang\.IllegalStateException: Expected String, got Array$ |
3 changes: 3 additions & 0 deletions
3
.../integration/script/fromJson/toJson/strictnessAbortProcessOnExecutionException/input.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,3 @@ | ||
{"data":"foo"} | ||
{"data":"foo","data":"bar"} | ||
{"data":"bar"} |
3 changes: 3 additions & 0 deletions
3
...ix/integration/script/fromJson/toJson/strictnessAbortProcessOnExecutionException/test.fix
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,3 @@ | ||
add_field("before", "") | ||
upcase("data") | ||
add_field("after", "") |
8 changes: 8 additions & 0 deletions
8
...x/integration/script/fromJson/toJson/strictnessAbortProcessOnExecutionException/test.flux
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 @@ | ||
FLUX_DIR + "input.json" | ||
|open-file | ||
|as-records | ||
|decode-json | ||
|fix(FLUX_DIR + "test.fix", strictness="process") | ||
|encode-json | ||
|write(FLUX_DIR + "output-metafix.json") | ||
; |
2 changes: 2 additions & 0 deletions
2
.../integration/script/fromJson/toJson/strictnessAbortProcessOnProcessException/expected.err
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,2 @@ | ||
^Exception in thread "main" org\.metafacture\.metafix\.FixProcessException: Error while executing Fix expression \(at file:.*/metafix/src/test/resources/org/metafacture/metafix/integration/script/fromJson/toJson/strictnessAbortProcessOnProcessException/test\.fix, line 2\): foo\(\)$ | ||
^Caused by: java\.lang\.IllegalArgumentException: No enum constant org\.metafacture\.metafix\.FixMethod.foo$ |
3 changes: 3 additions & 0 deletions
3
...ix/integration/script/fromJson/toJson/strictnessAbortProcessOnProcessException/input.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,3 @@ | ||
{"data":"foo"} | ||
{"data":"foo","data":"bar"} | ||
{"data":"bar"} |
3 changes: 3 additions & 0 deletions
3
...afix/integration/script/fromJson/toJson/strictnessAbortProcessOnProcessException/test.fix
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,3 @@ | ||
add_field("before", "") | ||
foo() | ||
add_field("after", "") |
8 changes: 8 additions & 0 deletions
8
...fix/integration/script/fromJson/toJson/strictnessAbortProcessOnProcessException/test.flux
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 @@ | ||
FLUX_DIR + "input.json" | ||
|open-file | ||
|as-records | ||
|decode-json | ||
|fix(FLUX_DIR + "test.fix", strictness="expression") | ||
|encode-json | ||
|write(FLUX_DIR + "output-metafix.json") | ||
; |