}
// [Issue-2], deserialization
public void testReadConfigs() throws Exception
{
JacksonXMLProvider prov = new JacksonXMLProvider();
Method m = getClass().getDeclaredMethod("readConfig");
JacksonFeatures feats = m.getAnnotation(JacksonFeatures.class);
assertNotNull(feats); // just a sanity check
// ok: here let's verify that we can disable exception throwing unrecognized things
@SuppressWarnings("unchecked")
Class<Object> raw = (Class<Object>)(Class<?>)Bean.class;
Object ob = prov.readFrom(raw, raw,
new Annotation[] { feats },
MediaType.APPLICATION_JSON_TYPE, null,
new ByteArrayInputStream("<Bean><foobar>3</foobar></Bean>".getBytes("UTF-8")));
assertNotNull(ob);
// but without setting, get the exception
try {
prov.readFrom(raw, raw,
new Annotation[] { },
MediaType.APPLICATION_JSON_TYPE, null,
new ByteArrayInputStream("<Bean><foobar>3</foobar></Bean>".getBytes("UTF-8")));
fail("Should have caught an exception");
} catch (JsonMappingException e) {