Re-instated listWebProject test.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@11644 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2008-11-03 11:44:43 +00:00
parent b99a26c188
commit 74f53da78a

View File

@@ -186,69 +186,69 @@ public class WebProjectTest extends BaseWebScriptTest
Response deleteResponse = sendRequest(new DeleteRequest(URL_WEB_PROJECT + "/" + webProjectRef), Status.STATUS_OK); Response deleteResponse = sendRequest(new DeleteRequest(URL_WEB_PROJECT + "/" + webProjectRef), Status.STATUS_OK);
} // END testBasicCRUDWebProject } // END testBasicCRUDWebProject
// public void testListWebSites() throws Exception public void testListWebSites() throws Exception
// { {
// int LOOP_COUNT = 5; int LOOP_COUNT = 5;
//
// this.authenticationComponent.setCurrentUser("admin"); this.authenticationComponent.setCurrentUser("admin");
//
// for(int i = 0; i < LOOP_COUNT; i++) for(int i = 0; i < LOOP_COUNT; i++)
// { {
// /** /**
// * Create a web site * Create a web site
// */ */
// JSONObject webProj = new JSONObject(); JSONObject webProj = new JSONObject();
// webProj.put("name", BASIC_NAME + i); webProj.put("name", BASIC_NAME + i);
// webProj.put("description", BASIC_DESCRIPTION + i); webProj.put("description", BASIC_DESCRIPTION + i);
// webProj.put("title", BASIC_TITLE + i); webProj.put("title", BASIC_TITLE + i);
// webProj.put("dnsName", BASIC_DNSNAME + i); webProj.put("dnsName", BASIC_DNSNAME + i);
// Response response = sendRequest(new PostRequest(URL_WEB_PROJECT, webProj.toString(), "application/json"), Status.STATUS_OK); Response response = sendRequest(new PostRequest(URL_WEB_PROJECT, webProj.toString(), "application/json"), Status.STATUS_OK);
//
// JSONObject result = new JSONObject(response.getContentAsString()); JSONObject result = new JSONObject(response.getContentAsString());
// String webProjectRef = result.getString("webprojectref"); String webProjectRef = result.getString("webprojectref");
// this.createdWebProjects.add(webProjectRef); this.createdWebProjects.add(webProjectRef);
// } }
//
// /** /**
// * List the web sites * List the web sites
// */ */
// { {
// Response list = sendRequest(new GetRequest(URL_WEB_PROJECTS), Status.STATUS_OK); Response list = sendRequest(new GetRequest(URL_WEB_PROJECTS), Status.STATUS_OK);
//
// JSONArray lookupResult = new JSONArray(list.getContentAsString()); JSONArray lookupResult = new JSONArray(list.getContentAsString());
// assertTrue(lookupResult.length() > LOOP_COUNT); assertTrue(lookupResult.length() >= LOOP_COUNT);
//
// /** /**
// * Now check that the list contains the sites created above * Now check that the list contains the sites created above
// */ */
// int foundCount = 0; int foundCount = 0;
//
// for(int i = 0; i < lookupResult.length(); i++) for(int i = 0; i < lookupResult.length(); i++)
// { {
// JSONObject obj = lookupResult.getJSONObject(i); JSONObject obj = lookupResult.getJSONObject(i);
// String name = obj.getString("name"); String name = obj.getString("name");
// if(name.contains(BASIC_NAME)) if(name.contains(BASIC_NAME))
// { {
// foundCount++; foundCount++;
// } }
// } }
// assertTrue (foundCount >= LOOP_COUNT); assertTrue (foundCount >= LOOP_COUNT);
// } }
//
// /** /**
// * List the web sites with a user name (should find 0) * List the web sites with a user name (should find 0)
// */ */
// { {
// String stepURL = "/api/wcm/webprojects?userName=Freddy"; String stepURL = "/api/wcm/webprojects?userName=Freddy";
// Response list = sendRequest(new GetRequest(stepURL), Status.STATUS_OK); Response list = sendRequest(new GetRequest(stepURL), Status.STATUS_OK);
// JSONArray lookupResult = new JSONArray(list.getContentAsString()); JSONArray lookupResult = new JSONArray(list.getContentAsString());
// assertTrue(lookupResult.length() == 0); assertTrue(lookupResult.length() == 0);
// } }
//
//
//
//
// } // testListWebSites } // testListWebSites
public void testUpdateWebProject() throws Exception public void testUpdateWebProject() throws Exception
{ {