1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.springframework.oxm.jibx;
18
19 import junit.framework.TestCase;
20 import org.jibx.runtime.JiBXException;
21 import org.jibx.runtime.ValidationException;
22
23 public class JibxUtilsTest extends TestCase {
24
25 public void testConvertMarshallingException() throws Exception {
26 assertTrue("Invalid exception conversion",
27 JibxUtils.convertJibxException(new JiBXException(""), true) instanceof JibxMarshallingFailureException);
28 }
29
30 public void testConvertUnmarshallingException() throws Exception {
31 assertTrue("Invalid exception conversion", JibxUtils
32 .convertJibxException(new JiBXException(""), false) instanceof JibxUnmarshallingFailureException);
33 }
34
35 public void testConvertValidationException() throws Exception {
36 assertTrue("Invalid exception conversion", JibxUtils
37 .convertJibxException(new ValidationException(""), true) instanceof JibxValidationFailureException);
38 }
39 }