How to create a namespace mapping from a remote test?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to create a namespace mapping from a remote test?

Christian Schneider
I would like to reproduce a problem with replication when a namespace is
not present on publish.

So I would like to:
- create a new namespace mapping on author
- Create a node with an attribute that uses the new namespace
- publish the node to author and check if it is correct

I can do all the steps but the namespace mapping creation.

Does anyone know how to do this? I have not found any means on the sling
testing client to do it.

Christian

--
--
Christian Schneider
http://www.liquid-reality.de

Computer Scientist
http://www.adobe.com
Reply | Threaded
Open this post in threaded view
|

Re: How to create a namespace mapping from a remote test?

Julian Sedding-3
Hi Christian

I can see two options. However, both require deploying a custom bundle.

1. The JCR Content Loader has support for installing *.cnd files[0].
I.e. a (very slim) bundle could be installed to register a namespace
declared in a cnd file.
2. Deploy a custom bundle with a servlet that allows registering a
namespace. The servlet could even implement the majority of your test
case. I'm not sure how far the Teleporter junit rule would get you,
but it may be worth looking into.

Regards
Julian

[0] https://sling.apache.org/documentation/bundles/content-loading-jcr-contentloader.html#declared-node-type-registration

On Thu, Feb 7, 2019 at 10:53 AM Christian Schneider
<[hidden email]> wrote:

>
> I would like to reproduce a problem with replication when a namespace is
> not present on publish.
>
> So I would like to:
> - create a new namespace mapping on author
> - Create a node with an attribute that uses the new namespace
> - publish the node to author and check if it is correct
>
> I can do all the steps but the namespace mapping creation.
>
> Does anyone know how to do this? I have not found any means on the sling
> testing client to do it.
>
> Christian
>
> --
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Computer Scientist
> http://www.adobe.com
Reply | Threaded
Open this post in threaded view
|

Re: How to create a namespace mapping from a remote test?

Bertrand Delacretaz
Hi,

On Fri, Feb 8, 2019 at 5:14 AM Julian Sedding <[hidden email]> wrote:
> ...2. Deploy a custom bundle with a servlet that allows registering a
> namespace...

Yes and you might use tinybundles to create that bundle, to avoid too
complex a setup.

> ...I'm not sure how far the Teleporter junit rule would get you,
> but it may be worth looking into...

Teleported tests run server-side so they can do whatever - and BTW the
sling-org-apache-sling-junit-teleporter uses the tinybundles technique
mentioned above to inject the tests in a Sling instance.

-Bertrand