Page History
...
With the help of info.magnolia.test.mock.jcr.SessionTestUtil MockNodes can be created from properties files
Code Block | ||
---|---|---|
| ||
page1.@type = mgnl:content
page1/page11.@type = mgnl:content
page1/page12.@type = mgnl:content
page1/page13.@type = mgnl:content
page1/collection.@type = mgnl:contentNode
page1/collection/para11.@type = mgnl:contentNode
page1/collection/para12.@type = mgnl:contentNode
page1/page12/collection/para121.@type = mgnl:contentNode
page1/page12/collection/para122.@type = mgnl:contentNode |
Code Block | ||
---|---|---|
| ||
MockSession session = SessionTestUtil.createSession("test", getClass().getResourceAsStream("sample.properties")); |
...
Code Block | ||
---|---|---|
| ||
MockNode root = new MockNode();
root.addNode(MetaData.DEFAULT_META_NODE);
root.setProperty("stringProperty", "HelloWorld");
|
Setup
In order to use these testing utilities, you must add the following dependency to your project:
Code Block |
---|
<dependency> <groupId>info.magnolia</groupId> <artifactId>magnolia-core</artifactId> <type>test-jar</type> <scope>test</scope> <version>${magnolia.version}</version> </dependency> |
Overview
Content Tools