This repository was archived by the owner on Jan 22, 2019. It is now read-only.
File tree 2 files changed +30
-0
lines changed
src/test/java/com/fasterxml/jackson/dataformat/avro
2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ Project: jackson-dataformat-avro
4
4
= Releases
5
5
------------------------------------------------------------------------
6
6
7
+ 2.6.6 (not yet released)
8
+
9
+ #41: Problems with type `Number`, with schema
10
+
7
11
2.6.5 (19-Jan-2016)
8
12
9
13
No changes since 2.6.4
Original file line number Diff line number Diff line change
1
+ package com .fasterxml .jackson .dataformat .avro ;
2
+
3
+ public class NumberTest extends AvroTestBase
4
+ {
5
+ static class NumberWrapper {
6
+ public Number value ;
7
+
8
+ public NumberWrapper () { }
9
+ public NumberWrapper (Number v ) { value = v ; }
10
+ }
11
+
12
+ // for [dataformat-avro#41]
13
+ public void testNumberType () throws Exception
14
+ {
15
+ AvroMapper mapper = new AvroMapper ();
16
+ AvroSchema schema = mapper .schemaFor (NumberWrapper .class );
17
+
18
+ byte [] bytes = mapper .writer (schema )
19
+ .writeValueAsBytes (new NumberWrapper (Integer .valueOf (17 )));
20
+ NumberWrapper result = mapper .readerFor (NumberWrapper .class )
21
+ .with (schema )
22
+ .readValue (bytes );
23
+ assertNotNull (result );
24
+ assertEquals (Integer .valueOf (17 ), result .value );
25
+ }
26
+ }
You can’t perform that action at this time.
0 commit comments