Skip to content

Commit 0b4141b

Browse files
committed
Add a (failing) test for #25
1 parent d065b1d commit 0b4141b

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
}

jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/ReadWithCtorsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ static class FromLong2 {
1818
protected long value;
1919
public FromLong2(Long v) { value = v.longValue(); }
2020
}
21-
21+
2222
/*
2323
/**********************************************************************
2424
/* Test methdods

0 commit comments

Comments
 (0)