Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added content of sample.properties

...

With the help of info.magnolia.test.mock.jcr.SessionTestUtil MockNodes can be created from properties files

Code Block
titlesample.properties
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
titlecreate MockSession from properties file
MockSession session = SessionTestUtil.createSession("test", getClass().getResourceAsStream("sample.properties"));

...