RepositoryUtil.registerNodeType(adminSession,
getClass().getResourceAsStream("/CQ-INF/nodetypes/dam.cnd"));
-Amit
-----Original Message-----
From: Lukas Eder [mailto:[email protected]]
Sent: 23 May 2013 18:28
To: [email protected]
Subject: Registering Node Types in a Bundle used by unit tests of that same
bundle
Hello,
I'm registering a mixin node type as documented here by this useful post by
Bertrand [1]. This post indicates that the Apache Felix configuration should be
enhanced with something along these lines:
<Sling-Nodetypes>
SLING-INF/nodetypes/mytype.cnd
</Sling-Nodetypes>
<Sling-Namespaces>
mytype=http://www.example.com/mytype
</Sling-Namespaces>
This works well, when deployed to Sling.
However, I would like to use that same node type in unit tests that are run by
Maven from within that same bundle. This doesn't seem to work in the same way.
The workaround is simple, of course. Just add the node type manually through
the JackRabbit API from the unit test.
But is there a way to leverage the same mechanism for both bundle deployment
and unit testing?
Cheers
Lukas
[1]: http://stackoverflow.com/a/14375040/521799