File tree 3 files changed +38
-1
lines changed
java/com/fasterxml/jackson/dataformat/ion 3 files changed +38
-1
lines changed Original file line number Diff line number Diff line change
1
+ package com .fasterxml .jackson .dataformat .ion .failing ;
2
+
3
+ import java .net .URL ;
4
+
5
+ import org .junit .Test ;
6
+
7
+ import com .fasterxml .jackson .core .JsonProcessingException ;
8
+ import com .fasterxml .jackson .dataformat .ion .IonObjectMapper ;
9
+
10
+ import static org .junit .Assert .*;
11
+
12
+ public class UncaughtException303Test
13
+ {
14
+ private final IonObjectMapper MAPPER = IonObjectMapper .builder ().build ();
15
+
16
+ // [dataformats-binary#303]
17
+ @ Test
18
+ public void testUncaughtException303 () throws Exception
19
+ {
20
+ URL poc = getClass ().getResource ("/data/issue-303.ion" );
21
+ try {
22
+ MAPPER .readTree (poc );
23
+ fail ("Should not pass with invalid content" );
24
+ } catch (JsonProcessingException e ) {
25
+ // !!! TODO: change to match what we actually expect
26
+ verifyException (e , "MATCH MESSAGE" );
27
+ }
28
+ }
29
+
30
+ void verifyException (Throwable e , String match )
31
+ {
32
+ String msg = e .getMessage ();
33
+ String lmsg = (msg == null ) ? "" : msg .toLowerCase ();
34
+ if (lmsg .indexOf (match .toLowerCase ()) < 0 ) {
35
+ fail ("Expected an exception with a substrings (" +match +"): got one with message \" " +msg +"\" " );
36
+ }
37
+ }
38
+ }
Original file line number Diff line number Diff line change 1
1
package com .fasterxml .jackson .dataformat .ion .misc ;
2
2
3
3
import java .net .URL ;
4
- import java .util .Arrays ;
5
4
6
5
import org .junit .Test ;
7
6
You can’t perform that action at this time.
0 commit comments