cancel
Showing results for 
Search instead for 
Did you mean: 

Dependencies for WebScript test

mmonshausen
Champ in-the-making
Champ in-the-making
Hi folks,
after reading the wiki article about testing WebScripts (http://wiki.alfresco.com/wiki/3.0_Web_Scripts_Testing) I wanted to use mentioned practices in my own project. But I have a problem with required dependencies…

I want to write a junit testcase by extending org.alfresco.repo.web.scripts.BaseWebScriptTest, this class has a dependency to org.springframework.extensions.webscripts.TestWebScriptServer. I'm not able to resolve the dependency.
I found spring-webscripts-1.0.0.CI-SNAPSHOT.jar in WEB-INF/libs folder of my Alfresco webapp. This jar includes the package org.springframework.extensions.webscripts but not the class TestWebScriptServer. I'm using Alfresco 3.3.

Has anyone tried to use JUnit testing of WebScripts and could please provide me help finding the needed jar?

Thanks alot of help and kind regards,

Martin
2 REPLIES 2

alex_lu
Champ in-the-making
Champ in-the-making
Hello,

I also struggled with this today. This is what I did

Checked out spring-surf source code and run maven build. in spring-webscripts/target directory, maven build created a jar file called spring-webscripts-1.0.0.CI-SNAPSHOT-tests.jar. TestWebScriptServer is in this jar.

This solved my problem, hopefully the same to you.

iguannago
Champ on-the-rise
Champ on-the-rise
Also you can add to your pom this to resolve your dependency:

<dependency>
<groupId>org.springframework.extensions.surf</groupId>
<artifactId>spring-webscripts</artifactId>
<version>${dependency.surf.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>commons-collections</artifactId>
<groupId>commons-collections</groupId>
</exclusion>
</exclusions>
</dependency>

source:

https://maven.alfresco.com/nexus/content/repositories/releases/org/alfresco/alfresco-remote-api/4.2....