|
|
|
|
The following issue has been closed. |
|
Sample remote test in placefulservice:
public void testDBAnnotation() throws Exception {
DocumentModel root = _getRootDocument();
DocumentModel file = new DocumentModelImpl(root.getPathAsString(),
"file", "File");
file = _createChildDocument(file);
DBAnnotatableDocument adoc = file.getAdapter(DBAnnotatableDocument.class);
SubscriptionConfig config = new SubscriptionConfig();
config.setId("xxx");
config.setEvent("publish");
adoc.setAnnotation("SubscriptionConfig", "val1");
}
leads to:
java.lang.NullPointerException
at org.nuxeo.ecm.core.api.impl.DocumentModelImpl.findAdapter(DocumentModelImpl.java:454)
at org.nuxeo.ecm.core.api.impl.DocumentModelImpl.getAdapter(DocumentModelImpl.java:429)
...
which happens in:
private <T> T findAdapter(Class<T> itf) {
DocumentAdapterService svc = (DocumentAdapterService) NXRuntime
.getRuntime().getComponent(DocumentAdapterService.NAME);
of DocumentModelImpl.java in org.nuxeo.ecm.core.api.impl
server.log:
2007-02-27 14:51:19,443 INFO [org.nuxeo.ecm.core.api.adapter.DocumentAdapterService] Registered document adapter factorynull: interface org.nuxeo.ecm.platform.ec.placeful.DBAnnotatableDocument
The same NPE happens in standard remote tests in TestAPI.java in
// TODO: fix and reenable.
public void testDocumentAdapter() throws Exception {
DocumentModel root = _getRootDocument();
DocumentModel file = new DocumentModelImpl(root.getPathAsString(),
"file", "File");
file = _createChildDocument(file);
AnnotatedDocument adoc = file.getAdapter(AnnotatedDocument.class);
assertNotNull(adoc);
adoc.putAnnotation("key1", "val1");
adoc.putAnnotation("key2", "val2");
assertEquals("val1", adoc.getAnnotation("key1"));
assertEquals("val2", adoc.getAnnotation("key2"));
adoc = file.getAdapter(AnnotatedDocument.class);
assertEquals("val1", adoc.getAnnotation("key1"));
assertEquals("val2", adoc.getAnnotation("key2"));
}
which is btw disabled at the moment.
|
|
|
|
![]() |
|
_______________________________________________
ECM-tickets mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm-tickets