Hi,

The "AdvancedSearch" document type is declared in the module
"nuxeo-platform-webapp-types" (unlike most of other default doc
types).
So adding it to your test dependencies and deploying its bundle
(deployBundle("org.nuxeo.ecm.platform.webapp.types")) should do it.
If not, please give more information about your test setup and
copy/paste the stack trace of the error.

Regards,

-- 
Anahide Tchertchian, Nuxeo
Mail: [email protected] - Tel: +33 (0)1 40 33 79 87
http://www.nuxeo.com - http://www.nuxeo.org

On 13 October 2010 11:06, Gianluca Ferrario <[email protected]> wrote:
> Hello,
> I'm having some troubles writing a JUnit to test my changes to Advanced
> Search in Nuxeo 5.3 with QueryModelService.
> In Nuxeo the search works fine, but in the JUnit test when I initialize the
> DocumentModel of my advanced search to pass to the constructor of
> QueryModel, I receive a ClientException saying that my DocType for the
> advanced search is not a registered core type.
> The code is the following:
>
>         final QueryModelService queryModelService = (QueryModelService)
> Framework.getRuntime().getComponent(QueryModelService.NAME);
>         final QueryModel advanceSearch =
> initializeStatefulQueryModel(queryModelService.getQueryModelDescriptor("ADVANCED_SEARCH"));
>         final QueryModelDescriptor desc = advanceSearch.getDescriptor();
>         final DocumentModel search = advanceSearch.getDocumentModel();
>         search.setProperty("expediente_advanced_search", "eas_denominacion",
> "Prueba");
>         final String query = desc.getQuery(search);
>         final DocumentModelList list = session.query(query);
>         Assert.assertEquals(1, list.size());
>         Assert.assertEquals("test-id-3", list.get(0).getName());
>     }
>
>     protected QueryModel initializeStatefulQueryModel(final
> QueryModelDescriptor descriptor)
>    throws ClientException
> {
> final DocumentModel documentModel =
> session.createDocumentModel(descriptor.getDocType()); // CLIENT EXCEPTION
> HERE
> return new QueryModel(descriptor, documentModel);
> }
>
> I thought something is missing in the deployBundle, but I'm already
> deploying the org.nuxeo.ecm.platform.search.api as well al my project and I
> have no idea abouth anything else to add...
> well, long story short, I have no idea about what's the problem here.
> Thanks in advance,
> Gianluca Ferrario
> _______________________________________________
> ECM mailing list
> [email protected]
> http://lists.nuxeo.com/mailman/listinfo/ecm
> To unsubscribe, go to http://lists.nuxeo.com/mailman/options/ecm
>
>
_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm
To unsubscribe, go to http://lists.nuxeo.com/mailman/options/ecm

Reply via email to