mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merge from SEAMIST3
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10734 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -55,6 +55,7 @@ public class BaseCMISWebScriptTest extends BaseWebScriptTest
|
||||
{
|
||||
private CMISValidator cmisValidator = new CMISValidator();
|
||||
private boolean argsAsHeaders = false;
|
||||
private boolean validateResponse = true;
|
||||
|
||||
/**
|
||||
* Pass URL arguments as headers
|
||||
@@ -65,7 +66,17 @@ public class BaseCMISWebScriptTest extends BaseWebScriptTest
|
||||
{
|
||||
this.argsAsHeaders = argsAsHeaders;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Validate Response
|
||||
*
|
||||
* @param validateResponse
|
||||
*/
|
||||
protected void setValidateResponse(boolean validateResponse)
|
||||
{
|
||||
this.validateResponse = validateResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if URL arguments are passed as headers
|
||||
*
|
||||
@@ -125,14 +136,17 @@ public class BaseCMISWebScriptTest extends BaseWebScriptTest
|
||||
protected void assertValidXML(String xml, Validator validator)
|
||||
throws IOException, ParserConfigurationException
|
||||
{
|
||||
try
|
||||
if (validateResponse)
|
||||
{
|
||||
Document document = cmisValidator.getDocumentBuilder().parse(new InputSource(new StringReader(xml)));
|
||||
validator.validate(new DOMSource(document));
|
||||
}
|
||||
catch (SAXException e)
|
||||
{
|
||||
fail(cmisValidator.toString(e, xml));
|
||||
try
|
||||
{
|
||||
Document document = cmisValidator.getDocumentBuilder().parse(new InputSource(new StringReader(xml)));
|
||||
validator.validate(new DOMSource(document));
|
||||
}
|
||||
catch (SAXException e)
|
||||
{
|
||||
fail(cmisValidator.toString(e, xml));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user