Search in sources :

Example 1 with DefaultTestDefinitionParser

use of org.xwiki.security.authorization.testwikis.internal.parser.DefaultTestDefinitionParser in project xwiki-platform by xwiki.

the class AbstractAuthorizationTestCase method initialiseWikiMock.

/**
 * Initialize the test by loading wikis form XML.
 * @param filename the filename without extension
 * @return the test wikis, also available using {@link #testDefinition}
 * @throws Exception on error.
 */
protected TestDefinition initialiseWikiMock(String filename) throws Exception {
    TestDefinitionParser parser = new DefaultTestDefinitionParser();
    EntityReferenceResolver<String> resolver = componentManager.getInstance(EntityReferenceResolver.TYPE_STRING);
    EntityReferenceSerializer<String> serializer = componentManager.getInstance(EntityReferenceSerializer.TYPE_STRING);
    testDefinition = parser.parse("testwikis" + File.separator + filename + ".xml", resolver, serializer);
    return testDefinition;
}
Also used : DefaultTestDefinitionParser(org.xwiki.security.authorization.testwikis.internal.parser.DefaultTestDefinitionParser) TestDefinitionParser(org.xwiki.security.authorization.testwikis.TestDefinitionParser) DefaultTestDefinitionParser(org.xwiki.security.authorization.testwikis.internal.parser.DefaultTestDefinitionParser)

Aggregations

TestDefinitionParser (org.xwiki.security.authorization.testwikis.TestDefinitionParser)1 DefaultTestDefinitionParser (org.xwiki.security.authorization.testwikis.internal.parser.DefaultTestDefinitionParser)1