History log of /libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/SerializationStressTest.java
Revision Date Author Comments
c96651d01dc87a20aa718d60feaff6611451852e 09-Apr-2014 Neil Fuller <nfuller@google.com> Change DecimalFormat.setRoundingMode() behavior to stay in spec

The serialization tests revealed that some DecimalFormat instances
could not be round-tripped. The reason is that the setRoundingMode()
method was setting a non-zero rounding increment, which cannot
be persisted, and also creates patterns that are outside of the
DecimalFormat spec.

Addressed the fact that ICU4C appears to support
RoundingMode.UNNECESSARY now by deleting special-case code.

Changed SerializationStressTest to use canonical DecimalFormat
patterns:

The ones chosen had a couple things that were not ideal:
1) Putting '-' in quotes causes ICU (for non-obvious reasons)
treat the negative pattern prefix as not being default. Default
in this case means "the positive prefix with a preceding '-'.
Removing the quotes meant it would recognize the pattern as
not needing everything after ;., so the pattern would be shrunk.
2) The positive pattern was also not one ICU could deal with
fully. ICU changed "#.#" to "#0.#" at parse time (which can be
corrected with a setMinimumIntegerDigits(0)). It's not clear why
ICU cannot deal with parsing "#.#" when it can produce it, but
there is a long comment in decimfmt.cc suggesting it is
intentional and to avoid format producing empty strings.

The pattern has been changed to one that ICU can handle and would
choose when the various serialized fields are read back. This is
necessary because NativeDecimalFormat compares the patterns and
not just the serialized fields. Leaving the pattern check part of
equals() means that two non-spec patterns will not be considered
equal(), which is important while Android allows non-spec patterns.
Restricting support in DecimalFormat to the documented subset of
characters is not worth the effort and may cause problems
elsewhere.

Change-Id: I2de588458b86619733c0dc1692d526f179059910
Bug: 11668227
ab762bb740405d0fefcccf4a0899a234f995be13 15-Nov-2013 Narayan Kamath <narayan@google.com> Move tests from tests/api to harmony-tests. (Take 2)

This reverts commit d5e281743e55e1daa297fd8043b2d9b6e8e1bed2.

The makefile issue that caused the original build break
has been resolved.
d5e281743e55e1daa297fd8043b2d9b6e8e1bed2 15-Nov-2013 Narayan Kamath <narayan@google.com> Revert "Move tests from tests/api to harmony-tests."

This reverts commit 81bf28ad31131815d0a36a43a0eca3c29aefdfcd.

Breaks build

Change-Id: I3f1562921ffe8fdbec36971dd65db398c27c92db
81bf28ad31131815d0a36a43a0eca3c29aefdfcd 15-Nov-2013 Narayan Kamath <narayan@google.com> Move tests from tests/api to harmony-tests.

The vast majority of cleaned up harmony tests
are now in harmony-tests/src/test/org/apache/harmony/tests/

Change-Id: I56c2e484ff434b5618cf6751d602ae9f0db96b30