@Test
public void testEnumBasedConversion() throws Exception {

    ModelNode schema = json("{\"enum\": [1, \"a\", true, 2.0]}");
    ModelNode json = json("1");
    PlexusConfiguration config = SchemaDrivenJSONToXmlConverter.convert(json, schema, "tag", null);
    assertNotNull(config);
    assertEquals("tag", config.getName());
    assertEquals(0, config.getChildCount());
    assertEquals("1", config.getValue());
    json = json("\"a\"");
    config = SchemaDrivenJSONToXmlConverter.convert(json, schema, "tag", null);
    assertNotNull(config);
    assertEquals("tag", config.getName());
    assertEquals(0, config.getChildCount());
    assertEquals("a", config.getValue());
    json = json("true");
    config = SchemaDrivenJSONToXmlConverter.convert(json, schema, "tag", null);
    assertNotNull(config);
    assertEquals("tag", config.getName());
    assertEquals(0, config.getChildCount());
    assertEquals("true", config.getValue());
    json = json("2.0");
    config = SchemaDrivenJSONToXmlConverter.convert(json, schema, "tag", null);
    assertNotNull(config);
    assertEquals("tag", config.getName());
    assertEquals(0, config.getChildCount());
    assertEquals("2.0", config.getValue());
}