Due to assertions that assume that Charset.defaultCharset() will return UTF-8.
For example (testToJsonObjectTypeWriter) fails with the following when run on z/OS with a default character encoding of IBM-1047:
Failed to marshal using Jsonb.toJson method with Object, Type and Writer arguments.
Expected: a string matching the pattern '\{\s*"instance"\s*:\s*"Test"\s*}'
but: was "���������zㅢ��"
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
at ee.jakarta.tck.json.bind.api.jsonb.JsonbTest.testToJsonObjectTypeWriter(JsonbTest.java:221)
new OutputStreamWriter(stream) will return a Writer with a character encoding of IBM-1047.
Then we try to create a string where the bytes are encoded using IBM-1047 but we decode it using UTF-8 resulting in:
���������zㅢ��
When running the TCK on an OS/JDK combination that uses a different character encoding other than UTF-8 the following tests fail:
Due to assertions that assume that Charset.defaultCharset() will return
UTF-8
. For example (testToJsonObjectTypeWriter) fails with the following when run on z/OS with a default character encoding ofIBM-1047
:If we look at this test: https://github.com/jakartaee/jsonb-api/blob/master/tck/src/main/java/ee/jakarta/tck/json/bind/api/jsonb/JsonbTest.java#L215-L224
new OutputStreamWriter(stream)
will return a Writer with a character encoding ofIBM-1047
. Then we try to create a string where the bytes are encoded usingIBM-1047
but we decode it usingUTF-8
resulting in: ���������zㅢ��