Unit testing Share WebScripts?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2013 06:52 AM
To test my WebScripts that live on the Repository side, I've been following the approach on the <a href="http://wiki.alfresco.com/wiki/3.0_Web_Scripts_Testing">WebScript Testing wiki page</a>. This involves having your test class extend from BaseWebScriptTest. Apart for missing a few of the nice bits of JUnit 4 Rules that the pure-service unit test seem to have available to them, it works fine.
Now I find myself wanting to unit test some WebScripts that live on the Share tier. BaseWebScriptTest doesn't seem to be an option, as that automatically brings up the Repository web application, and I need to test my WebScript in Share. I've tried looking at the Alfresco source tree, but I couldn't seem to track down any WebScript unit tests targetting the Share tier.
Is there a recommended way to do this? Is there a different class I can extend from? Do I need to subclass something like BaseWebScriptTest and try to load the Share context files instead? Is there anything in Surf that'll help?
Now I find myself wanting to unit test some WebScripts that live on the Share tier. BaseWebScriptTest doesn't seem to be an option, as that automatically brings up the Repository web application, and I need to test my WebScript in Share. I've tried looking at the Alfresco source tree, but I couldn't seem to track down any WebScript unit tests targetting the Share tier.
Is there a recommended way to do this? Is there a different class I can extend from? Do I need to subclass something like BaseWebScriptTest and try to load the Share context files instead? Is there anything in Surf that'll help?
Labels:
- Labels:
-
Archive
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2013 05:33 AM
Im too looking for this, the way explained in the wiki is not complet and not clair we need a another solution to test webscripts.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2013 10:32 AM
There was a post few days ago about testing, maybe you can find some insight there:
http://forums.alfresco.com/comment/133803
http://forums.alfresco.com/comment/133803

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2013 05:42 AM
i'm using org.alfresco.repo.web.scripts.BaseWebScriptTest to junit my repo (/alfresco/service/…) webscripts. The class disappeard from alfresco-remote-api jar from version 4.2.d; last working version is 4.2.c community; I didn't find any information right now. Any idea?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2013 04:16 PM
There are some basic automated WebScript tests in the FVT test suite for Surf (which is effectively the same environment Share is running in)… it uses TestNG via Maven to launch a test Jetty app and uses makes requests to WebScripts and checks the response is as expected. It's pretty crude but is at least an example of testing WebScripts.
