-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds read-write API generation support for Java classes generation (#100
) * Adds class template changes for read API generation * Modifies current `is_built_in_type` filter for `JavaLanguage` to change float to double * Adds write API generation support * Adds roundtrip tests in CodeGenTest.java and Rust project * Add setter support for Java classes * Renamed `value` property of field to `value_type` * Changes Rust and Java demo project tests to run throughbad/invalid input Ion files and assert Exception is thrown * Changes Rust and java dmeo projects tests to run through each good/valid input Ion files and assert equivelnce for roundtrip test * Adds valid and invalid input Ion files for tests
- Loading branch information
Showing
20 changed files
with
447 additions
and
69 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
code-gen-projects/input/bad/nested_struct/mismatched_type.ion
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 @@ | ||
// nested struct with type mismatched fields | ||
{ | ||
A: "hello", | ||
B: 12, | ||
C: { | ||
D: 1e0, // expected type: bool | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
code-gen-projects/input/bad/struct_with_fields/mismatched_sequence_element.ion
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 @@ | ||
// struct with mismatched sequence element | ||
{ | ||
A: "hello", | ||
B: 12, | ||
C: [1, 2, 3], | ||
D: 10e2 | ||
} | ||
|
8 changes: 8 additions & 0 deletions
8
code-gen-projects/input/bad/struct_with_fields/mismatched_type.ion
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 @@ | ||
// simple struct with type mismatched fields | ||
{ | ||
A: "hello", | ||
B: false, // expected field type: int | ||
C: ["foo", "bar", "baz"], | ||
D: 10e2 | ||
} | ||
|
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 @@ | ||
// nested struct with empty string and zeros | ||
{ | ||
C: { | ||
D: false, | ||
}, | ||
A: "", | ||
B: 0, | ||
} |
3 changes: 2 additions & 1 deletion
3
code-gen-projects/input/nested_struct.ion → ...input/good/nested_struct/valid_fields.ion
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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
// nested struct with all valid fields | ||
{ | ||
A: "hello", | ||
B: 12, | ||
C: { | ||
D: false, | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
code-gen-projects/input/good/nested_struct/valid_unordered_fields.ion
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,9 @@ | ||
// nested struct with unordered fields | ||
{ | ||
B: 12, | ||
A: "hello", | ||
C: { | ||
D: false, | ||
} | ||
} | ||
|
7 changes: 7 additions & 0 deletions
7
code-gen-projects/input/good/struct_with_fields/empty_values.ion
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,7 @@ | ||
// struct with empty list, empty string and zeros | ||
{ | ||
C: [], | ||
A: "", | ||
B: 0, | ||
D: 0e0, | ||
} |
7 changes: 7 additions & 0 deletions
7
code-gen-projects/input/good/struct_with_fields/valid_fields.ion
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,7 @@ | ||
// simple struct with all valid fields | ||
{ | ||
A: "hello", | ||
B: 12, | ||
C: ["foo", "bar", "baz"], | ||
D: 10e2 | ||
} |
7 changes: 5 additions & 2 deletions
7
...gen-projects/input/struct_with_fields.ion → ...ct_with_fields/valid_unordered_fields.ion
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 |
---|---|---|
@@ -1,5 +1,8 @@ | ||
|
||
// struct with unordered fields | ||
{ | ||
C: ["foo", "bar", "baz"], | ||
A: "hello", | ||
B: 12, | ||
C: ["foo", "bar", "baz"], | ||
} | ||
D: 10e2, | ||
} |
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
Oops, something went wrong.