Commit Graph

13 Commits

Author SHA1 Message Date
Maicol be87c3fd0e
Port Junit test to Truth in the package `com.google.gson` of the module `gson` (#2299)
* Add the Truth dependency

* Port Junit test to Truth in the package `com.google.gson` of the module `gson`

* Replace the `assertThat(e.getMessage()).isEqualTo(...)"` with `assertThat(e).hasMessageThat().isEqualTo(...)`

* Minor fixes
2023-01-17 07:59:10 -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
Jesse Wilson aa2f61b7d8 Rename GsonExclusionStrategy to Excluder. The new class is its own factory, which simplifies its caller in GsonBuilder. It no longer implements ExclusionStrategy, which allows the callers to pass in a boolean for serialize/deserialize. This allows us to use one excluder for both code paths. The delegate ExclusionStrategy instances might end up not being shared so it has two lists internally. 2011-11-22 07:37:13 +00:00
Jesse Wilson fed332906d Create a single, monolithic class to manage all exclusion strategies. This gets our file size within target of 177KiB.
I intend to follow this up with a builder for our new class to avoid multiple-argument constructor calls.
2011-11-22 06:07:18 +00:00
Jesse Wilson 7def596775 Begin to tighten the ExclusionStrategy code. This replaces named classes with anonymous classes wherever we have a single instance of a type. 2011-11-21 06:14:23 +00:00
Jesse Wilson e23973afec Smash together ReflectiveTypeAdapterFactory and its subclass. The separation was useful earlier when we were contemplating keeping Gson and MiniGson separate. 2011-11-21 05:42:30 +00:00
Jesse Wilson de727d8c48 Delete dead code found by coverage 2011-10-01 02:04:48 +00:00
Inderjeet Singh 05ae10a144 removed the constructor in FieldAttributes that was only used in tests. 2011-04-06 00:51:01 +00:00
Joel Leitch 114633fbf9 Provide a means to add serialization or deserialization specific exclusion strategies. 2011-02-04 03:09:41 +00:00
Joel Leitch b883f8f4aa Add new "Mode" enum and carry mode through Gson so exclusion strategies know whether it is currently serializing or deserializing.
Deprecate old ExclusionStrategy code since this new approach is more powerful.
2011-01-22 22:15:06 +00:00
Joel Leitch 9816426bba Add new Cache interface and LRU Cache implementation to cache field annotations per "Class" (rather than per instance). This results in a significant speed-up (approx. 3X) when serializing/deserializing the same classes over and over again. 2010-01-10 00:32:21 +00:00
Joel Leitch 839b0c2f94 Refactored exclusion strategies so that they can easily be exposed as part of the public API. 2009-10-07 09:23:14 +00:00
Joel Leitch 54a480774d Add the ability to configure Gson to exclude serializing and deserializing of all "Inner Classes". 2008-12-28 02:00:31 +00:00