Class ColCtrl
- java.lang.Object
-
- com.adobe.cq.testing.client.components.AbstractComponent
-
- com.adobe.cq.testing.client.components.foundation.AbstractFoundationComponent
-
- com.adobe.cq.testing.client.components.foundation.parsys.ColCtrl
-
public class ColCtrl extends AbstractFoundationComponent
Created with IntelliJ IDEA. User: catalan Date: 5/29/12 Time: 10:13 AM
-
-
Field Summary
Fields Modifier and Type Field Description static StringCOL_BREAK_CONTROL_TYPEstatic StringCOL_END_CONTROL_TYPEstatic StringLAYOUT_2_COLSstatic StringLAYOUT_3_COLSstatic StringPROP_CONTROL_TYPEstatic StringPROP_LAYOUTstatic StringPROP_ORDERstatic StringPROP_RESOURCE_TYPEstatic StringRESOURCE_TYPE-
Fields inherited from class com.adobe.cq.testing.client.components.AbstractComponent
changeProperties, client, componentPath, DEFAULT_LOCATION, jsonNode, location, pagePath
-
-
Constructor Summary
Constructors Constructor Description ColCtrl(ComponentClient client, String pagePath, String location, String nameHint)The constructor stores all the component path information like parentPage, name etc.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends AbstractComponent>
TaddComponent(Class<T> componentClass, int colNum)org.apache.sling.testing.clients.SlingHttpResponsecreate(String order, int... expectedStatus)We override the default create call, so we can capture the reference to the end component.AbstractFoundationComponent[]getColCtrlBreaks()Returns the break nodes of the ColCtrl component.AbstractFoundationComponentgetColCtrlEndComponent()Returns the end ColCtrl component that belongs to this start component.StringgetOrderPropertyForCol(int colNum)StringgetResourceType()The resource type for the component, e.g.voidsetLayout(String layout)-
Methods inherited from class com.adobe.cq.testing.client.components.AbstractComponent
getClient, getComponentNode, getComponentPath, getCreateFormEntity, getFirstChild, getLocation, getName, getNext, getNextNodePath, getPagePath, getParentPath, getPrevious, getPreviousNodePath, getProperty, getPropertyAsString, getPropertyAsStringArray, reorder, save, setProperty, setProperty
-
-
-
-
Field Detail
-
RESOURCE_TYPE
public static final String RESOURCE_TYPE
- See Also:
- Constant Field Values
-
PROP_RESOURCE_TYPE
public static final String PROP_RESOURCE_TYPE
- See Also:
- Constant Field Values
-
PROP_CONTROL_TYPE
public static final String PROP_CONTROL_TYPE
- See Also:
- Constant Field Values
-
PROP_LAYOUT
public static final String PROP_LAYOUT
- See Also:
- Constant Field Values
-
PROP_ORDER
public static final String PROP_ORDER
- See Also:
- Constant Field Values
-
COL_BREAK_CONTROL_TYPE
public static final String COL_BREAK_CONTROL_TYPE
- See Also:
- Constant Field Values
-
COL_END_CONTROL_TYPE
public static final String COL_END_CONTROL_TYPE
- See Also:
- Constant Field Values
-
LAYOUT_2_COLS
public static final String LAYOUT_2_COLS
- See Also:
- Constant Field Values
-
LAYOUT_3_COLS
public static final String LAYOUT_3_COLS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ColCtrl
public ColCtrl(ComponentClient client, String pagePath, String location, String nameHint)
The constructor stores all the component path information like parentPage, name etc.- Parameters:
client- TheFoundationClientthat's creating this instance.pagePath- path to the page that will contain the component.location- relative location to the parent node inside the page that will contain the component node.nameHint- name to be used for the component node. Might get altered by the server if a naming conflict occurs. TheAbstractComponent.getName()method will return the correct name after(String,int...)has been called.
-
-
Method Detail
-
create
public org.apache.sling.testing.clients.SlingHttpResponse create(String order, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException, InterruptedException
We override the default create call, so we can capture the reference to the end component. The end component is created right after the colctrl component.- Overrides:
createin classAbstractComponent- Parameters:
order- Defines where the component should be added in relation to its siblings. Possible values arefirst,last,before [nodeName],after [nodeName].expectedStatus- list of expected HTTP Status to be returned, if not set, 201 is assumed.- Returns:
- the response
- Throws:
org.apache.sling.testing.clients.ClientException- if the request failsInterruptedException- to mark this method as waiting
-
getResourceType
public String getResourceType()
Description copied from class:AbstractComponentThe resource type for the component, e.g. foundation/components/text. this will be set in thesling:resourceTypeproperty of the node.- Specified by:
getResourceTypein classAbstractComponent- Returns:
- the resource type
-
addComponent
public <T extends AbstractComponent> T addComponent(Class<T> componentClass, int colNum) throws Exception
- Throws:
Exception
-
getOrderPropertyForCol
public String getOrderPropertyForCol(int colNum) throws Exception
- Throws:
Exception
-
setLayout
public void setLayout(String layout) throws org.apache.sling.testing.clients.ClientException, InterruptedException
- Throws:
org.apache.sling.testing.clients.ClientExceptionInterruptedException
-
getColCtrlEndComponent
public AbstractFoundationComponent getColCtrlEndComponent() throws org.apache.sling.testing.clients.ClientException
Returns the end ColCtrl component that belongs to this start component.- Returns:
- The end component for this start component
- Throws:
org.apache.sling.testing.clients.ClientException- if something fails during request/response
-
getColCtrlBreaks
public AbstractFoundationComponent[] getColCtrlBreaks()
Returns the break nodes of the ColCtrl component.- Returns:
- The array of colctrl break nodes
-
-