Merge from SEAMIST3

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10740 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2008-09-04 11:29:25 +00:00
parent 865ea6668f
commit 22bc716fcc
2 changed files with 15 additions and 3 deletions

View File

@@ -443,6 +443,18 @@ public abstract class BaseWebScriptTest extends TestCase
return getHeader("Content-Type"); return getHeader("Content-Type");
} }
public int getContentLength()
{
try
{
return method.getResponseBody().length;
}
catch (IOException e)
{
return 0;
}
}
public String getHeader(String name) public String getHeader(String name)
{ {
Header header = method.getResponseHeader(name); Header header = method.getResponseHeader(name);
@@ -453,7 +465,7 @@ public abstract class BaseWebScriptTest extends TestCase
{ {
return method.getStatusCode(); return method.getStatusCode();
} }
} }
} }

View File

@@ -110,7 +110,7 @@ public class PreferenceServiceTest extends BaseWebScriptTest
jsonObject.put("comp1", getPreferenceObj()); jsonObject.put("comp1", getPreferenceObj());
resp = sendRequest(new PostRequest(URL, jsonObject.toString(), "application/json"), 200); resp = sendRequest(new PostRequest(URL, jsonObject.toString(), "application/json"), 200);
assertEquals(0, resp.getContentAsByteArray().length); assertEquals(0, resp.getContentLength());
// Get the preferences // Get the preferences
@@ -128,7 +128,7 @@ public class PreferenceServiceTest extends BaseWebScriptTest
jsonObject.put("comp2", getPreferenceObj()); jsonObject.put("comp2", getPreferenceObj());
resp = sendRequest(new PostRequest(URL, jsonObject.toString(), "application/json"), 200); resp = sendRequest(new PostRequest(URL, jsonObject.toString(), "application/json"), 200);
assertEquals(0, resp.getContentAsByteArray().length); assertEquals(0, resp.getContentLength());
// Get the preferences // Get the preferences