@Test
public void testMarshal() throws Exception {

    ComponentLibrary library = new ComponentLibrary();
    BehaviorModel behaviorModel = new BehaviorModel(FacesId.parseId("my_behavior"));
    behaviorModel.setTargetClass(ClassName.parseName(Object.class.getName()));
    PropertyBase prop = behaviorModel.getOrCreateAttribute("attr1");
    prop.setType(new ClassName(String.class));
    AttributeModel attributeModel = new AttributeModel();
    attributeModel.setName("attr2");
    attributeModel.setType(new ClassName(String.class));
    behaviorModel.getAttributes().add(attributeModel);
    library.getBehaviors().add(behaviorModel);
    // Jaxb marshaling
    StringWriter facesConfig = generateFacesConfig(library);
    log.debug(facesConfig.toString());
    // Checks
    checkXmlStructure(facesConfig);
    validateXml(facesConfig);
}