* true if all the binding operations have unique interface
* operations specified, false otherwise.
*/
public void testTestAssertionBindingOperation1051()
{
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 operations defined.
try
{
if(!val.testAssertionBindingOperation1051(new BindingOperation[]{}, reporter))
{
fail("The testAssertionBindingOperation1051 method returned false with no binding operations 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 operation defined.
try
{
DescriptionElement descEl = factory.newDescription();
InterfaceElement interfac = descEl.addInterfaceElement();
interfac.setName(name1);
InterfaceOperationElement interfaceOperation = interfac.addInterfaceOperationElement();
interfaceOperation.setName(name2);
BindingElement binding = descEl.addBindingElement();
binding.setName(name2);
binding.setInterfaceName(name1QN);
BindingOperationElement bindingOperation = binding.addBindingOperationElement();
bindingOperation.setRef(name2QN);
if(!val.testAssertionBindingOperation1051(descEl.toComponent().getBindings()[0].getBindingOperations(), reporter))
{
fail("The testAssertionBindingOperation1051 method returned false with one valid binding operation 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 operations defined with
// unique interface operations.
try
{
DescriptionElement descEl = factory.newDescription();
descEl.setTargetNamespace(namespace1);
InterfaceElement interfac = descEl.addInterfaceElement();
interfac.setName(name1);
InterfaceOperationElement interfaceOperation = interfac.addInterfaceOperationElement();
interfaceOperation.setName(name3);
InterfaceOperationElement interfaceOperation2 = interfac.addInterfaceOperationElement();
interfaceOperation2.setName(name4);
BindingElement binding = descEl.addBindingElement();
binding.setName(name2);
binding.setInterfaceName(name1QN);
BindingOperationElement bindingOperation = binding.addBindingOperationElement();
bindingOperation.setRef(name3QN);
BindingOperationElement bindingOperation2 = binding.addBindingOperationElement();
bindingOperation2.setRef(name4QN);
if(!val.testAssertionBindingOperation1051(descEl.toComponent().getBindings()[0].getBindingOperations(), reporter))
{
fail("The testAssertionBindingOperation1051 method returned false with two valid binding operations 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 operations defined with
// the same interface operation.
try
{
DescriptionElement descEl = factory.newDescription();
descEl.setTargetNamespace(namespace1);
InterfaceElement interfac = descEl.addInterfaceElement();
interfac.setName(name1);
InterfaceOperationElement interfaceOperation = interfac.addInterfaceOperationElement();
interfaceOperation.setName(name3);