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

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Active Member II

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

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
Highlighted
Established Member II

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

Highlighted
Active Member II

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

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?

Highlighted
Active Member II

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

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

Highlighted
Established Member II

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

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.

Highlighted
Established Member II

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

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"
}'

Highlighted
Active Member II

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

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