Site Service CRUD API's (Java, JavaScript and REST), unit test methods added to JS API to help unit test JS API's

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8986 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2008-05-01 16:48:30 +00:00
parent 060c5eb8a1
commit 7d32941e9c
15 changed files with 270 additions and 102 deletions

View File

@@ -71,11 +71,27 @@ public abstract class BaseWebScriptTest extends TestCase
return sendRequest(METHOD_GET, url, expectedStatus, null, null);
}
/**
* "DELETE" the url and check for the expected status code
*
* @param url
* @param expectedStatus
* @return
* @throws IOException
*/
protected MockHttpServletResponse deleteRequest(String url, int expectedStatus)
throws IOException
{
return sendRequest(METHOD_DELETE, url, expectedStatus, null, null);
}
/**
* "POST" the url and check for the expected status code
*
* @param url
* @param expectedStatus
* @param body
* @param contentType
* @return
* @throws IOException
*/
@@ -85,6 +101,22 @@ public abstract class BaseWebScriptTest extends TestCase
return sendRequest(METHOD_POST, url, expectedStatus, body, contentType);
}
/**
* "PUT" the url and check for the expected status code
*
* @param url
* @param expectedStatus
* @param body
* @param contentType
* @return
* @throws IOException
*/
protected MockHttpServletResponse putRequest(String url, int expectedStatus, String body, String contentType)
throws IOException
{
return sendRequest(METHOD_PUT, url, expectedStatus, body, contentType);
}
/**
*
* @param method