use of com.thoughtworks.xstream.security.ForbiddenClassException in project camel by apache.
the class XStreamDataFormatPermissionsTest method testAllowAnyAndDeny.
@Test
public void testAllowAnyAndDeny() {
XStreamDataFormat xStreamDataFormat = new XStreamDataFormat();
xStreamDataFormat.setPermissions("*,-org.apache.camel.dataformat.xstream.PurchaseOrder");
XStream xStream = xStreamDataFormat.createXStream(context.getClassResolver(), context.getApplicationContextClassLoader());
try {
xStream.fromXML(XML_PURCHASE_ORDER);
fail("should fail to unmarshall");
} catch (ForbiddenClassException e) {
// OK
}
}
Aggregations