-
Bug
-
Resolution: Won't Do
-
Neutral
-
None
-
None
-
None
MVHTestCase features a method to register extra node types info.magnolia.module.ModuleVersionHandlerTestCase.getExtraNodeTypes() however the actual registration happens only when running info.magnolia.module.ModuleVersionHandlerTestCase.executeUpdatesAsIfTheCurrentlyInstalledVersionWas(Version) that is when the repo structure with nodes of a certain type typically has already been set. This may cause a javax.jcr.nodetype.NoSuchNodeTypeException. Consider the following case
@Test public void something() throws Exception { // GIVEN websiteSession.getRootNode().addNode("foo", "mgnl:page"); websiteSession.getRootNode().addNode("foo/bar", "mgnl:variants"); // WHEN executeUpdatesAsIfTheCurrentlyInstalledVersionWas(null); //rest omitted }
mgnl:variants is a personalization node type which is provided to the test via
@Override protected String getExtraNodeTypes() { return "/mgnl-nodetypes/magnolia-personalization-nodetypes.xml"; }
The above test will fail with
javax.jcr.nodetype.NoSuchNodeTypeException: {http://www.magnolia.info/jcr/mgnl}variants
at org.apache.jackrabbit.core.nodetype.NodeTypeRegistry.getEffectiveNodeType(NodeTypeRegistry.java:1037)
at org.apache.jackrabbit.core.nodetype.NodeTypeRegistry.getEffectiveNodeType(NodeTypeRegistry.java:472)
at org.apache.jackrabbit.core.nodetype.NodeTypeManagerImpl.getNodeType(NodeTypeManagerImpl.java:186)
at org.apache.jackrabbit.core.NodeImpl.addNode(NodeImpl.java:1255)
...
Acceptance criteria
- is related to
-
MGNLDEMO-99 Some pages of the MTE demo are not published
- Closed