Commit Graph

10 Commits

Author SHA1 Message Date
Maicol
49b00d1a86
Port all Junit assert to Truth asserts (#2304)
* Port Junit assert to Truth in `com.google.gson.stream`

* Port Junit assert to Truth in `com.google.gson.regression`

* Port Junit assert to Truth in `om.google.gson.reflect`

* Port Junit assert to Truth in `com.google.gson.metrics`

* Port Junit assert to Truth in `com.google.gson.internal`

* Port Junit assert to Truth in `com.google.gson.internal.sql`

* Port Junit assert to Truth in `com.google.gson.internal.reflect`

* Port Junit assert to Truth in `com.google.gson.internal.bind`

* Port Junit assert to Truth in `com.google.gson.internal.bind.util`

* Port Junit assert to Truth in `com.google.gson.functional`

* Replaces `List.of` with `Arrays.asList` to grant legacy

* Simplify `==` asserts

* Simplify `.contain()` asserts + Minor fixes

* Simplify asserts
2023-01-31 11:20:54 -08:00
Maicol
1a2170b99c
Port tests from JUnit 3 to JUnit 4 (#2294)
* Port tests from JUnit 3 to JUnit 4

* Port tests from JUnit 3 to JUnit 4

* Add `@Test` above `@Ignore`
2022-12-22 06:04:16 -08:00
Marcono1234
4dda4ec5ba
Use diamond operator when creating generic instances (#2104) 2022-04-17 15:27:21 -07:00
Lorenz Nickel
b75e1bbc79 Code cleanup (Removed spaces) (#1474)
* Removed double spaces in comments

* Unified comments

* Removed space

* Removed spaces in code
2019-03-03 11:18:06 -08:00
Joel Leitch
040bae34d7 Allowing instance creators to be registered with the raw type only (without specifying type parameters). 2012-10-24 20:40:44 +00:00
Inderjeet Singh
64dc53ffc4 Added support for runtime type determination while serializing collections and its subclasses.
This currently doesn't work since Gson register a hierarchy type adapter for Collections that takes precedence over this.
2011-08-04 23:55:52 +00:00
Inderjeet Singh
005c93e383 removed unused no-args constructors 2011-03-23 18:48:03 +00:00
Inderjeet Singh
e9c156b016 Added inheritance tests using toJson() method as well. 2009-10-08 19:32:15 +00:00
Inderjeet Singh
b634804533 Ensured that a base class custom serializer is run when the type is specified explicitly during serialization. For all other situations, ensured that the actual type of the object is taken into consideration while serializing. First a custom handler corresponding to the actual type is looked up, then a custom handler for the specified type.
Created some serialization specific tests regarding custom serializers. Revised some tests to use toJsonTree for better asserts instead of string matching.
2009-10-08 19:28:53 +00:00
Inderjeet Singh
3e7ebf8556 Fixed issue 156.
Added support for serializing an object field (or array elements) as per its actual type.
Refactored inheritance related tests into its own test class. Added regression tests for issue 156.
2009-09-25 19:54:25 +00:00