[
https://issues.apache.org/jira/browse/AVRO-3618?focusedWorklogId=805688&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-805688
]
ASF GitHub Bot logged work on AVRO-3618:
----------------------------------------
Author: ASF GitHub Bot
Created on: 02/Sep/22 07:06
Start Date: 02/Sep/22 07:06
Worklog Time Spent: 10m
Work Description: clesaec commented on code in PR #1842:
URL: https://github.com/apache/avro/pull/1842#discussion_r961354244
##########
lang/java/avro/src/test/java/org/apache/avro/io/TestBinaryDecoder.java:
##########
@@ -317,7 +320,7 @@ private void validateInputStreamSkips(InputStream test,
InputStream check) throw
public void testBadIntEncoding() throws IOException {
byte[] badint = new byte[5];
Arrays.fill(badint, (byte) 0xff);
- Decoder bd = factory.binaryDecoder(badint, null);
+ Decoder bd = this.newDecoder(badint);
Review Comment:
Change, all methods now test DirectBinaryDecoder, then BinaryDecoder. We can
see that the behavior sometimes differs with the type of exceptions that are
thrown.
Issue Time Tracking
-------------------
Worklog Id: (was: 805688)
Remaining Estimate: 0h
Time Spent: 10m
> [Java] TestBinaryDecoder should check consistency with directBinaryDecoder
> --------------------------------------------------------------------------
>
> Key: AVRO-3618
> URL: https://issues.apache.org/jira/browse/AVRO-3618
> Project: Apache Avro
> Issue Type: Bug
> Components: java
> Reporter: Ryan Skraba
> Assignee: Christophe Le Saec
> Priority: Major
> Labels: starter
> Fix For: 1.12.0
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> The unit tests for TestBinaryDecoder were originally parameterized so that
> _every_ test verifies that {{*BinaryDecoder*}} and {{*DirectBinaryDecoder*}}
> show the same behaviour.
> In the meantime, some tests have been added or modified that only test
> BinaryDecoder (twice). Where possible, this should be fixed so that both
> classes are checked and that their behaviour are the same.
> Notably: the {{testNegativeBytesLength}} throws a different exception when
> DirectBinaryEncoder is used.
> Please pay special attention around the tests deserializing invalid binary
> data: this might be an unrecoverable error for Avro that throws a runtime
> exception but shouldn't consume unnecessary resources or cause
> OutOfMemoryErrors.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)