ext1.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICY));
List<WSDLExtensibilityElement> pol2 = new ArrayList<WSDLExtensibilityElement>(
ext2.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICY));
//check whether lists are the same size
if (pol1.size() != pol2.size())
throw new JBossWSToolsException("Policy WSDLExtensibilityElement mismatch!");
//check equality
for (WSDLExtensibilityElement el1 : pol1)
{
boolean done = false;
Iterator it = pol2.iterator();
WSDLExtensibilityElement el2 = null;
while (it.hasNext() && !done)
{
el2 = (WSDLExtensibilityElement)it.next();
done = (el1.isRequired() == el2.isRequired()) &&
checkElementEquality(el1.getElement(), el2.getElement());
}
if (!done)
{
log.error("Failing policy validation on policy on: "+ext1+" and "+ext2);
return false;
}
pol2.remove(el2);
}
//policy references
List<WSDLExtensibilityElement> polRef1 = new ArrayList<WSDLExtensibilityElement>(
ext1.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICYREFERENCE));
List<WSDLExtensibilityElement> polRef2 = new ArrayList<WSDLExtensibilityElement>(
ext2.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICYREFERENCE));
//check whether lists are the same size
if (polRef1.size() != polRef2.size())
throw new JBossWSToolsException("Policy ref WSDLExtensibilityElement mismatch!");
//check equality
for (WSDLExtensibilityElement el1 : polRef1)
{
boolean done = false;
Iterator it = polRef2.iterator();
WSDLExtensibilityElement el2 = null;
while (it.hasNext() && !done)
{
el2 = (WSDLExtensibilityElement)it.next();
done = (el1.isRequired() == el2.isRequired()) &&
checkElementEquality(el1.getElement(), el2.getElement());
}
if (!done)
{
log.error("Failing policy validation on policy ref on: "+ext1+" and "+ext2);
return false;
}
polRef2.remove(el2);
}
//check properties
WSDLProperty prop1 = ext1.getProperty(Constants.WSDL_PROPERTY_POLICYURIS);
WSDLProperty prop2 = ext2.getProperty(Constants.WSDL_PROPERTY_POLICYURIS);
if (prop1 != null || prop2 != null)
{
if (prop1 == null || prop2 == null || prop1.isRequired() != prop2.isRequired())
throw new JBossWSToolsException("Policy prop WSDLExtensibilityElement mismatch!");
String value1 = prop1.getValue();
String value2 = prop2.getValue();
if (value1 != null || value2 != null)
{
if (value1 == null || value2 == null || !value1.equalsIgnoreCase(value2))