for my client using BRXM 14.x and BRUT 3.0.0, I’m implementing a unit test that has a document with a reference to an image.
The problem is that the resulting bean returns NULL when I call the get-method.
With a lot of debugging deep into the code, I found that the logic in BRUT is treating the reference field as a string, in stead of a reference. In class JcrContentProcessor#applyProperties(...) the method isReferenceTypeProperty(modelProperty) is called, which returns FALSE.
Which is strange, because in my yaml file the field is defined as:
I did a intensive debug session last friday and found that the image is imported in the JCR. In the YAML files the reference is the same as the uuid of the image. Pretty sure the in-memory JCR uuid values where the same as well.
Just reproduced it, although I don’t think this is related to the JcrContentProcessor. I fixed it locally in my test. Here’s what I think was going wrong:
In org.bloomreach.forge.brut.components.AbstractRepoTest#registerBaseNodeTypes BRUT has:
You see, the super type for the imagelink was not registered therefore the objectconverter didn’t know which bean class to use for that type. I can cut another release with this change and let you know here.
If you don’t want to wait (or actually test this out) of course you can override the org.bloomreach.forge.brut.components.AbstractRepoTest#registerBaseNodeTypes with this particular change(while keeping everything else of course).
I tried to implement an “unregister” (via NodeManager) but I got this message:
org.bloomreach.forge.brut.components.exception.SetupTeardownException: The check for the existence of content using the given node type is not yet implemented, so to guarantee repository consistency the request to unregister the type is denied. Contributions to implement this feature would be welcome! To restore the broken behavior of previous Jackrabbit versions where this check was simply skipped, please set the disableCheckForReferencesInContentException system property to true.
Next option is to override the #registerBaseNodeTypes method. Which worked!