Assert.assertNotNull(panelGroup1);
UINamingContainer compositeComponent1 = (UINamingContainer) panelGroup1.getChildren().get(0);
Assert.assertNotNull(compositeComponent1);
UIComponent facet1 = compositeComponent1.getFacet(UIComponent.COMPOSITE_FACET_NAME);
Assert.assertNotNull(facet1);
HtmlOutputText text1 = (HtmlOutputText) facet1.findComponent("text");
Assert.assertNotNull(text1);
compositeComponent1.pushComponentToEL(facesContext, compositeComponent1);
facet1.pushComponentToEL(facesContext, facet1);
text1.pushComponentToEL(facesContext, text1);
//set on tag
Assert.assertEquals("class1", text1.getStyleClass());
//set as default
Assert.assertEquals("background:red", text1.getStyle());
//Check coercion of attribute using type value
Assert.assertEquals(5, compositeComponent1.getAttributes().get("index"));
//Check default coercion
ValueExpression ve = facesContext.getApplication().getExpressionFactory().createValueExpression(
facesContext.getELContext(), "#{cc.attrs.cols}", Object.class);
Assert.assertEquals(1, ve.getValue(facesContext.getELContext()));
text1.popComponentFromEL(facesContext);
facet1.popComponentFromEL(facesContext);
compositeComponent1.popComponentFromEL(facesContext);
UIComponent panelGroup2 = root.findComponent("testGroup2");
Assert.assertNotNull(panelGroup2);
UINamingContainer compositeComponent2 = (UINamingContainer) panelGroup2.getChildren().get(0);
Assert.assertNotNull(compositeComponent2);
UIComponent facet2 = compositeComponent2.getFacet(UIComponent.COMPOSITE_FACET_NAME);
Assert.assertNotNull(facet2);
HtmlOutputText text2 = (HtmlOutputText) facet2.findComponent("text");
Assert.assertNotNull(text2);
compositeComponent2.pushComponentToEL(facesContext, compositeComponent2);
facet2.pushComponentToEL(facesContext, facet2);
text2.pushComponentToEL(facesContext, text2);
//set on tag
Assert.assertEquals("background:green", text2.getStyle());
// not set, should return null, but since there is a ValueExpression indirection,
// coercing rules apply here, so null is converted as ""
Assert.assertEquals("", text2.getStyleClass());
text2.popComponentFromEL(facesContext);
facet2.popComponentFromEL(facesContext);
compositeComponent2.popComponentFromEL(facesContext);
StringWriter sw = new StringWriter();
MockResponseWriter mrw = new MockResponseWriter(sw);