|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.myfaces.test.utils.HtmlCheckAttributesUtil
public class HtmlCheckAttributesUtil
This is a utility class used in unit test cases to check if a component's attributes are rendered properly.
Constructor Summary | |
---|---|
HtmlCheckAttributesUtil()
|
Method Summary | |
---|---|
static void |
addBaseAttributes(javax.faces.component.UIComponent component,
HtmlRenderedAttr[] attrs)
This method adds all elements of attrs to the attributes map of component. |
static void |
checkAttributeOccurrences(HtmlRenderedAttr attr,
String actual)
Checks if the occurrence of the rendered attribute in the html generated by the renderer is equal to the number of times expected. |
static void |
checkRenderedAttributes(HtmlRenderedAttr[] attrs,
String output)
Iterates through all elements of attrs to check if they are only rendered once in output. |
static void |
checkRenderedAttributes(javax.faces.component.UIComponent component,
javax.faces.context.FacesContext context,
org.apache.myfaces.test.mock.MockResponseWriter writer,
HtmlRenderedAttr[] attrs)
This method adds all attributes from attrs into the component. |
static String |
constructErrorMessage(HtmlRenderedAttr[] attrs,
String actual)
Constructs an error message string detailing which attributes were not rendered and which attributes were rendered more than once. |
static HtmlRenderedAttr[] |
generateAttrsNotRenderedForReadOnly()
|
static HtmlRenderedAttr[] |
generateBasicAttrs()
|
static HtmlRenderedAttr[] |
generateBasicReadOnlyAttrs()
|
static boolean |
hasFailedAttrRender(HtmlRenderedAttr[] attrs)
Checks the attrs array if it has elements which were rendered incorrectly. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HtmlCheckAttributesUtil()
Method Detail |
---|
public static void addBaseAttributes(javax.faces.component.UIComponent component, HtmlRenderedAttr[] attrs)
component
- The component to add the attributes to.attrs
- The attributes to be added to the component.public static void checkRenderedAttributes(HtmlRenderedAttr[] attrs, String output) throws Exception
attrs
- The attributes to be checked.output
- The html output of the component's renderer.
Exception
public static void checkRenderedAttributes(javax.faces.component.UIComponent component, javax.faces.context.FacesContext context, org.apache.myfaces.test.mock.MockResponseWriter writer, HtmlRenderedAttr[] attrs) throws Exception
component
- The component whose attributes will be tested.context
- writer
- The ResponseWriter used by the renderer to output the html generated.attrs
- An array of attributes which will be tested.
Exception
public static boolean hasFailedAttrRender(HtmlRenderedAttr[] attrs)
attrs
- The attributes to be checked.
public static String constructErrorMessage(HtmlRenderedAttr[] attrs, String actual)
attrs
- The attributes to be tested.actual
- The html generated by the renderer.
public static void checkAttributeOccurrences(HtmlRenderedAttr attr, String actual)
attr
- The attribute to be tested.actual
- The html generated by the renderer.public static HtmlRenderedAttr[] generateBasicAttrs()
public static HtmlRenderedAttr[] generateAttrsNotRenderedForReadOnly()
public static HtmlRenderedAttr[] generateBasicReadOnlyAttrs()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |