File tree 2 files changed +35
-1
lines changed
jr-objects/src/test/java/com/fasterxml/jackson/jr
2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change
1
+ package com .fasterxml .jackson .jr .failing ;
2
+
3
+ import com .fasterxml .jackson .jr .ob .JSON ;
4
+ import com .fasterxml .jackson .jr .ob .TestBase ;
5
+
6
+ public class ReadWithCtors25Test extends TestBase
7
+ {
8
+ static class FromInt1 {
9
+ protected int value ;
10
+ public FromInt1 (int v ) { value = v ; }
11
+ }
12
+
13
+ static class FromInt2 {
14
+ protected int value ;
15
+ public FromInt2 (Integer v ) { value = v .intValue (); }
16
+ }
17
+
18
+ /*
19
+ /**********************************************************************
20
+ /* Test methdods
21
+ /**********************************************************************
22
+ */
23
+
24
+ public void testIntCtor () throws Exception
25
+ {
26
+ FromInt1 output = JSON .std .beanFrom (FromInt1 .class , "123" );
27
+ assertNotNull (output );
28
+ assertEquals (123L , output .value );
29
+
30
+ FromInt2 output2 = JSON .std .beanFrom (FromInt2 .class , "456" );
31
+ assertNotNull (output2 );
32
+ assertEquals (456L , output2 .value );
33
+ }
34
+ }
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ static class FromLong2 {
18
18
protected long value ;
19
19
public FromLong2 (Long v ) { value = v .longValue (); }
20
20
}
21
-
21
+
22
22
/*
23
23
/**********************************************************************
24
24
/* Test methdods
You can’t perform that action at this time.
0 commit comments