-
Notifications
You must be signed in to change notification settings - Fork 8
Developing on the service registry
Check out the easysoa-model-demo project, do a mvn eclipse:eclipse
at the root of the maven projects (in plugins/
), import them in Eclipse and you're ready to go !
In order to build and deploy the plugins, you can either:
- Use [Buildr](Development Environment) (recommended). Check out the easysoa-demo-dist to the same folder as the other repository, configure your Nuxeo location in
build.yaml
, then build and deploy by typingbuildr nx_mvn nx_dist
from the easysoa-demo-dist folder. - Build them using the
buildPlugins.sh
(or.bat
) script, them move thetarget/plugins
contents to your Nuxeo plugins folder (./nxserver/plugins
).
The easiest way is basically to send HTTP requests to Nuxeo, as in [NotificationTestCase] (https://github.com/easysoa/easysoa-model-demo/blob/master/plugins/easysoa-model-demo-rest/src/test/java/org/easysoa/test/rest/tools/NotificationTestCase.java)
- either by using the EasySOA REST API (alpha) to create Service, API or AppliImpl objects. We provide [a helper : RestNotificationFactory] (https://github.com/easysoa/easysoa-model-demo/blob/master/plugins/easysoa-model-demo-rest/src/test/java/org/easysoa/test/rest/tools/notification/RestNotificationFactory.java)
- or outside this perimeter (ex. queries), the Nuxeo Content Automation API. Nuxeo provides a comprehensive Java client, we provide [a helper : AutomationHelper] (https://github.com/easysoa/easysoa-model-demo/blob/master/plugins/easysoa-model-demo-rest/src/test/java/org/easysoa/test/rest/tools/automation/AutomationHelper.java)
To test (with JUnit) Nuxeo developments, there must be a runnning Nuxeo server, or at least part of it. There are several ways :
Use a custom JUnit Feature, and annotations to configure an embedded Nuxeo deployment. Available features :
- EasySOAFeature : adds EasySOA bundle & document types to CoreFeature. Example : [SCAImportTest] (https://github.com/easysoa/easysoa-model-demo/blob/master/plugins/easysoa-model-demo-core/src/test/java/org/easysoa/sca/SCAImportTest.java)
- EasySOAServerFeature : adds a Jetty HTTP server. Example (still in the works, also adds custom vocabulary) : [VocabulariesTest] (https://github.com/easysoa/easysoa-model-demo/blob/master/plugins/easysoa-model-demo-core/src/test/java/org/easysoa/tests/VocabulariesTest.java)
- original Nuxeo Features : RuntimeFeature (bare runtime), CoreFeature (adds base document API). More at http://doc.nuxeo.com/display/CORG/Unit+Testing
Extend org.nuxeo.runtime.test.NXRuntimeTestCase, and use the deployBundle, deployContrib methods & others to configure an embedded Nuxeo deployment. Example : see org.nuxeo.ecm.core.storage.sql.SQLRepositoryTestCase
Write tests that interact remotely with a manually deployed Nuxeo by extending [NotificationTestCase] (https://github.com/easysoa/easysoa-model-demo/blob/master/plugins/easysoa-model-demo-rest/src/test/java/org/easysoa/test/rest/tools/NotificationTestCase.java), or using other remote interaction alternatives as described above.