@Test
public void testEnumBasedConversion() throws Exception {

    XmlToJson<Node> converter = converter("ext", "{\"enum\": [1, \"a\", true, 2.0]}");
    Node xml = xml("<config><ext>1</ext></config>");
    ModelNode config = converter.convert(xml).get(0).get("configuration");
    Assert.assertNotNull(config);
    Assert.assertEquals(ModelType.LONG, config.getType());
    Assert.assertEquals(1L, config.asLong());
    xml = xml("<config><ext>a</ext></config>");
    config = converter.convert(xml).get(0).get("configuration");
    Assert.assertNotNull(config);
    Assert.assertEquals(ModelType.STRING, config.getType());
    Assert.assertEquals("a", config.asString());
    xml = xml("<config><ext>true</ext></config>");
    config = converter.convert(xml).get(0).get("configuration");
    Assert.assertNotNull(config);
    Assert.assertEquals(ModelType.BOOLEAN, config.getType());
    Assert.assertEquals(true, config.asBoolean());
    xml = xml("<config><ext>2.0</ext></config>");
    config = converter.convert(xml).get(0).get("configuration");
    Assert.assertNotNull(config);
    Assert.assertEquals(ModelType.DOUBLE, config.getType());
    Assert.assertEquals(2.0d, config.asDouble(), 0);
}