@Test
public void testOneOf() throws Exception {

    XmlToJson<Node> converter = converter("ext", "{\"oneOf\": [{\"type\": \"integer\"}, {\"type\": \"number\"}, {\"type\": \"boolean\"}]}");
    Node xml1 = xml("<config><ext>1</ext></config>");
    Node xml2 = xml("<config><ext>true</ext></config>");
    Node xml3 = xml("<config><ext>asdf</ext></config>");
    try {
        converter.convert(xml1).get(0).get("configuration");
        Assert.fail("Invalid config should not have been converted.");
    } catch (IllegalArgumentException __) {
        //good
    }
    ModelNode c2 = converter.convert(xml2).get(0).get("configuration");
    try {
        converter.convert(xml3).get(0).get("configuration");
        Assert.fail("Invalid configuration should not have been converted.");
    } catch (IllegalArgumentException __) {
        //good
    }
    Assert.assertNotNull(c2);
    Assert.assertEquals(ModelType.BOOLEAN, c2.getType());
    Assert.assertTrue(c2.asBoolean());
}