InterfaceElement interfac = descEl.addInterfaceElement();
interfac.setName(name1);
interfac.addExtendedInterfaceName(name2QN);
InterfaceOperationElement interfaceOperation = interfac.addInterfaceOperationElement();
interfaceOperation.setName(name3);
InterfaceImpl interfac2 = new InterfaceImpl();
interfac2.setName(name2);
InterfaceOperationElement interfaceOperation2 = interfac2.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.testAssertionBinding1045(descEl.toComponent().getBindings()[0], reporter))
{
fail("The testAssertionBinding1045 method returned false for a binding with an interface with one defined operation and one extended operation and two binding operations defined.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that the assertion returns false when an interface is specified with two operations, one
// explicit and one inherited, and the binding defines an operation only for the explicit operation.
try
{
DescriptionElement descEl = factory.newDescription();
descEl.setTargetNamespace(namespace1);
InterfaceElement interfac = descEl.addInterfaceElement();
interfac.setName(name1);
interfac.addExtendedInterfaceName(name2QN);
InterfaceOperationElement interfaceOperation = interfac.addInterfaceOperationElement();
interfaceOperation.setName(name3);
InterfaceElement interfac2 = descEl.addInterfaceElement();
interfac2.setName(name2);
InterfaceOperationElement interfaceOperation2 = interfac2.addInterfaceOperationElement();
interfaceOperation2.setName(name4);
BindingElement binding = descEl.addBindingElement();
binding.setName(name2);
binding.setInterfaceName(name1QN);
BindingOperationElement bindingOperation = binding.addBindingOperationElement();
bindingOperation.setRef(name3QN);
if(val.testAssertionBinding1045(descEl.toComponent().getBindings()[0], reporter))
{
fail("The testAssertionBinding1045 method returned true for a binding with an interface with one defined operation and one extended operation and one binding operation defined for the defined operation.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that the assertion returns false when an interface is specified with two operations, one
// explicit and one inherited, and the binding defines an operation only for the inherited operation.
try
{
DescriptionElement descEl = factory.newDescription();
descEl.setTargetNamespace(namespace1);
InterfaceElement interfac = descEl.addInterfaceElement();
interfac.setName(name1);
interfac.addExtendedInterfaceName(name2QN);
InterfaceOperationElement interfaceOperation = interfac.addInterfaceOperationElement();
interfaceOperation.setName(name3);
InterfaceImpl interfac2 = new InterfaceImpl();
interfac2.setName(name2);
InterfaceOperationElement interfaceOperation2 = interfac2.addInterfaceOperationElement();
interfaceOperation2.setName(name4);
BindingElement binding = descEl.addBindingElement();
binding.setName(name2);
binding.setInterfaceName(name1QN);
BindingOperationElement bindingOperation = binding.addBindingOperationElement();
bindingOperation.setRef(name4QN);
if(val.testAssertionBinding1045(descEl.toComponent().getBindings()[0], reporter))
{
fail("The testAssertionBinding1045 method returned true for a binding with an interface with one defined operation and one inherited operation and one binding operation defined for the inherited operation.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
handler.reset();
// Test that two messages are returned when an interface with two operations, one explicit and one
// inherited, is specified and the binding defines no operations.
try
{
DescriptionElement descEl = factory.newDescription();
descEl.setTargetNamespace(namespace1);
InterfaceElement interfac = descEl.addInterfaceElement();
interfac.setName(name1);
interfac.addExtendedInterfaceName(name2QN);
InterfaceOperationElement interfaceOperation = interfac.addInterfaceOperationElement();
interfaceOperation.setName(name3);
InterfaceElement interfac2 = descEl.addInterfaceElement();
interfac2.setName(name2);
InterfaceOperationElement interfaceOperation2 = interfac2.addInterfaceOperationElement();
interfaceOperation2.setName(name4);
BindingElement binding = descEl.addBindingElement();
binding.setName(name2);
binding.setInterfaceName(name1QN);