@Test
public void testMarshal() throws Exception {

    ComponentLibrary library = new ComponentLibrary();
    ValidatorModel validatorModel = new ValidatorModel(FacesId.parseId("my_validator"));
    validatorModel.setTargetClass(ClassName.parseName(Object.class.getName()));
    library.getValidators().add(validatorModel);
    // Jaxb marshaling
    StringWriter facesConfig = generateFacesConfig(library);
    // Checks
    checkXmlStructure(facesConfig);
    validateXml(facesConfig);
}