avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AVRO-1427) Minor issues with Resolving Decoder Tests
Date Thu, 09 Jan 2014 20:41:51 GMT

    [ https://issues.apache.org/jira/browse/AVRO-1427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13867028#comment-13867028
] 

Hudson commented on AVRO-1427:
------------------------------

SUCCESS: Integrated in AvroJava #421 (See [https://builds.apache.org/job/AvroJava/421/])
AVRO-1427. Java: Improve ResolvingDecoder tests. Contributed by Rob Turner. (cutting: rev
1556934)
* /avro/trunk/CHANGES.txt
* /avro/trunk/lang/java/avro/src/test/java/org/apache/avro/io/TestResolvingIO.java
* /avro/trunk/lang/java/avro/src/test/java/org/apache/avro/io/TestResolvingIOResolving.java
* /avro/trunk/lang/java/avro/src/test/java/org/apache/avro/io/TestValidatingIO.java


> Minor issues with Resolving Decoder Tests 
> ------------------------------------------
>
>                 Key: AVRO-1427
>                 URL: https://issues.apache.org/jira/browse/AVRO-1427
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.7.5
>            Reporter: Rob Turner
>            Assignee: Rob Turner
>            Priority: Minor
>              Labels: test
>             Fix For: 1.7.6
>
>         Attachments: AVRO-1427.patch
>
>
> Hard coded TestValidatingIO.Encoding.BINARY is used rather than "this.eEnc" passed in
via the @Parameterized test, preventing the other Encodings being tested.
> {code:title=TestResolvingIOResolving.java|borderStyle=solid}
>   @Test
>   public void testResolving()
>     throws IOException {
>     Schema writerSchema = new Schema.Parser().parse(sJsWrtSchm);
>     byte[] bytes = TestValidatingIO.make(writerSchema, sWrtCls,
>         oaWrtVals, TestValidatingIO.Encoding.BINARY);
> // Needs changing to
>   @Test
>   public void testResolving()
>     throws IOException {
>     Schema writerSchema = new Schema.Parser().parse(sJsWrtSchm);
>     byte[] bytes = TestValidatingIO.make(writerSchema, sWrtCls,
>         oaWrtVals, eEnc);
> {code}
> Number types are not checked for exact matches in TestResolvingIO.check() so that an
expected type of Integer 100 matches Long 100 at line 178 as follows:
> {code:title=TestResolvingIOResolving.java|borderStyle=solid}
>         { "[ \"int\", \"string\"]", "U0I", new Object[] { 100 },
>             "\"long\"", "L", new Object[] { 100 } },
> // Needs changing to
>         { "[ \"int\", \"string\"]", "U0I", new Object[] { 100 },
>             "\"long\"", "L", new Object[] { 100L } },
> {code}
> The above fix to TestResolvingIO.check() makes TestResolvingIO fail, so the expected
values need to be generated with the correct type and not just reuse the random input values.
This can be done by making the random generation deterministic so that correctly typed expected
values may be generated.
> {code:title=TestValidatingIO.java|borderStyle=solid}
>   public static Object[] randomValues(String calls) {
>     Random r = new Random();
> // Needs changing to
>   public static Object[] randomValues(String calls) {
>     Random r = new Random(0L);
> {code}
> Patch to follow.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message