|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.sling.testing.resourceresolver.MockHelper
public class MockHelper
Helper class to create resources: MockHelper.create(resolver).resource("/libs").p("prop", "value") .resource("sub").p("sub", "hello") .resource(".sameLevel") .resource("/apps").p("foo", "baa").commit()
| Method Summary | |
|---|---|
void |
add()
Finish building and add all resources to the resource tree. |
void |
commit()
Finish building, add all resources to the resource tree and commit changes. |
static MockHelper |
create(org.apache.sling.api.resource.ResourceResolver resolver)
Create a new helper |
MockHelper |
p(String name,
Object value)
Add a property to the current resource |
MockHelper |
resource(String path)
Add a new resource If the path is relative, this resource is added as a child to the previous resource. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static MockHelper create(org.apache.sling.api.resource.ResourceResolver resolver)
public MockHelper resource(String path)
public MockHelper p(String name,
Object value)
public void add()
throws org.apache.sling.api.resource.PersistenceException
org.apache.sling.api.resource.PersistenceException
public void commit()
throws org.apache.sling.api.resource.PersistenceException
org.apache.sling.api.resource.PersistenceException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||