cancel
Showing results for 
Search instead for 
Did you mean: 

How to unit test my client library that uses CMIS 1.1 (with apache chemistry)?

kartech11
Confirmed Champ
Confirmed Champ

Hi, 

I am currently creating a CMIS 1.1 based client library (using apache chemistry) to query Alfresco to add, delete, update folders and documents.  Please can you let me know how to write JUnit tests to test my API calls. 

Is there a way to spin up a in memory alfresco instance to test out my client library that I am writing using CMIS 1.1.

Thanks

6 REPLIES 6

ranjeetsi
Star Contributor
Star Contributor

You can refer if the below url helps:

GitHub - gsdenys/junit-server-cmis: JUnit Runner for CMIS Server 

Alfresco Content Services Certified Engineer (ACSCE)

Thanks a lot for the link Ranjeet. Is there a way to setup aspects using the runner? Do you have any examples to share as to how I can create aspects via the runner?

Thanks Ranjeet for the link. I am getting an error when I execute my runner, it is not able to start up jetty automatically. Did you have to do any further setup other than the steps outlined in the github page? Appreciate if you can let me know what could be the issue.

I raised the below query to help on the above

 

Thanks

Hi,

I had tested this quite long ago and just provided the github url for the same.

Will check it once i have time, meanwhile can you please provide the error you are getting.

Alfresco Content Services Certified Engineer (ACSCE)

I setup the runner as outlined in the github page. I have the dependency to the runner in my pom.xml .  When I started my runner I got the below error.

Aug 27, 2018 4:06:43 AM org.eclipse.jetty.webapp.WebInfConfiguration getCanonicalNameForWebAppTmpDir
WARNING: Can't generate resourceBase as part of webapp tmp dir name: java.lang.IllegalStateException: No resourceBase or war set for context
Aug 27, 2018 4:06:43 AM org.eclipse.jetty.webapp.WebAppContext doStart
WARNING: Failed startup of context o.e.j.w.WebAppContext@2e4b8173{/cmis,null,null}
java.lang.IllegalStateException: No resourceBase or war set for context

For creation of site , you can use - REST call also: 

curl command:

curl -X POST \
'http://localhost:8084/alfresco/api/-default-/public/alfresco/versions/1/sites?skipConfiguration=fals...' \
-H 'Authorization: Basic YWRtaW46YWRtaW4=' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-H 'Postman-Token: 5c8f33b2-bac9-498f-b1d3-c542eaf87e0f' \
-d '{
"id": "test8084site",
"title": "test8084site",
"description": "test8084site",
"visibility": "PUBLIC"
}'

Alfresco Content Services Certified Engineer (ACSCE)