use of jakarta.faces.component.html.HtmlMessage in project myfaces by apache.
the class HtmlMessageRendererTest method setUp.
public void setUp() throws Exception {
super.setUp();
writer = new MockResponseWriter(new StringWriter(), null, null);
message = new HtmlMessage();
form = new HtmlForm();
inputText = new HtmlInputText();
facesContext.setResponseWriter(writer);
facesContext.getViewRoot().setRenderKitId(MockRenderKitFactory.HTML_BASIC_RENDER_KIT);
facesContext.getRenderKit().addRenderer(message.getFamily(), message.getRendererType(), new HtmlMessageRenderer());
facesContext.getRenderKit().addRenderer(inputText.getFamily(), inputText.getRendererType(), new HtmlTextRenderer());
facesContext.getRenderKit().addRenderer(form.getFamily(), form.getRendererType(), new HtmlFormRenderer());
// inputText.setParent(form);
inputText.setId("myInputId");
// message.setParent(form);
form.getChildren().add(inputText);
form.getChildren().add(message);
facesContext.getAttributes().put("org.apache.myfaces.RENDERED_FACES_JS", Boolean.TRUE);
}
Aggregations