* true if all the binding fault references have unique interface
* fault references specified, false otherwise.
*/
public void testTestAssertionBindingFaultReference1055()
{
WSDLFactory factory = null;
try {
factory = WSDLFactory.newInstance();
} catch (WSDLException e) {
fail("Can't instanciate the WSDLFactory object.");
}
// Test that the assertion returns true when there are no binding fault references defined.
try
{
if(!val.testAssertionBindingFaultReference1055(new BindingFaultReference[]{}, reporter))
{
fail("The testAssertionBindingFaultReference1055 method returned false with no binding fault references defined.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that the assertion returns true when there is one binding fault reference defined.
try
{
DescriptionElement descEl = factory.newDescription();
descEl.setTargetNamespace(namespace1);
InterfaceElement interfac = descEl.addInterfaceElement();
interfac.setName(name1);
InterfaceFaultElement interfaceFault = interfac.addInterfaceFaultElement();
interfaceFault.setName(name3);
InterfaceOperationElement interfaceOperation = interfac.addInterfaceOperationElement();
interfaceOperation.setName(name4);
InterfaceFaultReferenceElement interfaceFaultReference = interfaceOperation.addInterfaceFaultReferenceElement();
interfaceFaultReference.setMessageLabel(MessageLabel.IN);
interfaceFaultReference.setRef(name3QN);
BindingElement binding = descEl.addBindingElement();
binding.setName(name2);
binding.setInterfaceName(name1QN);
BindingOperationElement bindingOperation = binding.addBindingOperationElement();
bindingOperation.setRef(name4QN);
BindingFaultReferenceElement bindingFaultReference = bindingOperation.addBindingFaultReferenceElement();
bindingFaultReference.setMessageLabel(MessageLabel.IN);
bindingFaultReference.setRef(name3QN);
if(!val.testAssertionBindingFaultReference1055(descEl.toComponent().getBindings()[0].getBindingOperations()[0].getBindingFaultReferences(), reporter))
{
fail("The testAssertionBindingFaultReference1055 method returned false with one valid binding fault reference defined.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that the assertion returns true when there are two binding fault references defined with
// unique interface fault references.
try
{
DescriptionElement descEl = factory.newDescription();
descEl.setTargetNamespace(namespace1);
InterfaceElement interfac = descEl.addInterfaceElement();
interfac.setName(name1);
InterfaceFaultElement interfaceFault = interfac.addInterfaceFaultElement();
interfaceFault.setName(name3);
InterfaceOperationElement interfaceOperation = interfac.addInterfaceOperationElement();
interfaceOperation.setName(name4);
InterfaceFaultReferenceElement interfaceFaultReference = interfaceOperation.addInterfaceFaultReferenceElement();
interfaceFaultReference.setMessageLabel(MessageLabel.IN);
interfaceFaultReference.setRef(name3QN);
InterfaceFaultReferenceElement interfaceFaultReference2 = interfaceOperation.addInterfaceFaultReferenceElement();
interfaceFaultReference2.setMessageLabel(MessageLabel.OUT);
interfaceFaultReference2.setRef(name3QN);
BindingElement binding = descEl.addBindingElement();
binding.setName(name2);
binding.setInterfaceName(name1QN);
BindingOperationElement bindingOperation = binding.addBindingOperationElement();
bindingOperation.setRef(name4QN);
BindingFaultReferenceElement bindingFaultReference = bindingOperation.addBindingFaultReferenceElement();
bindingFaultReference.setMessageLabel(MessageLabel.IN);
bindingFaultReference.setRef(name3QN);
BindingFaultReferenceElement bindingFaultReference2 = bindingOperation.addBindingFaultReferenceElement();
bindingFaultReference2.setMessageLabel(MessageLabel.OUT);
bindingFaultReference2.setRef(name3QN);
if(!val.testAssertionBindingFaultReference1055(descEl.toComponent().getBindings()[0].getBindingOperations()[0].getBindingFaultReferences(), reporter))
{
fail("The testAssertionBindingFaultReference1055 method returned false with two valid binding fault references defined.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that the assertion returns false when there are two binding fault references define with
// the same interface fault reference.
try
{
DescriptionElement descEl = factory.newDescription();
descEl.setTargetNamespace(namespace1);
InterfaceElement interfac = descEl.addInterfaceElement();
interfac.setName(name1);
InterfaceFaultElement interfaceFault = interfac.addInterfaceFaultElement();
interfaceFault.setName(name3);