* true if all the interface operations have bindings defined,
* false otherwise.
*/
public void testTestAssertionBinding1045()
{
WSDLFactory factory = null;
try {
factory = WSDLFactory.newInstance();
} catch (WSDLException e) {
fail("Can't instanciate the WSDLFactory object.");
}
// Test that the assertion returns true when the binding does not specify an interface.
try
{
DescriptionElement descEl = factory.newDescription();
descEl.setTargetNamespace(namespace1);
BindingElement binding = descEl.addBindingElement();
binding.setName(name1);
if(!val.testAssertionBinding1045(descEl.toComponent().getBindings()[0], reporter))
{
fail("The testAssertionBinding1045 method returned false for a binding with no defined interface.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that the assertion returns true when an interface is specified with no operations and
// the binding has no operations defined.
try
{
DescriptionElement descEl = factory.newDescription();
InterfaceElement interfac = descEl.addInterfaceElement();
interfac.setName(name1);
BindingElement binding = descEl.addBindingElement();
binding.setName(name2);
binding.setInterfaceName(name1QN);
if(!val.testAssertionBinding1045(descEl.toComponent().getBindings()[0], reporter))
{
fail("The testAssertionBinding1045 method returned false for a binding with an interface with no operations.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that the assertion returns true when an interface is specified with no operations and
// the binding has an operation defined.
try
{
DescriptionElement descEl = factory.newDescription();
InterfaceElement interfac = descEl.addInterfaceElement();
interfac.setName(name1);
BindingElement binding = descEl.addBindingElement();
binding.setName(name2);
binding.setInterfaceName(name1QN);
BindingOperationElement bindingOperation = binding.addBindingOperationElement();
if(!val.testAssertionBinding1045(descEl.toComponent().getBindings()[0], reporter))
{
fail("The testAssertionBinding1045 method returned false for a binding with an interface with no operations and one binding operation defined.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that the assertion returns true when an interface is specified with one operation and
// the binding defines a binding operation for the interface operation.
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.testAssertionBinding1045(descEl.toComponent().getBindings()[0], reporter))
{
fail("The testAssertionBinding1045 method returned false for a binding with an interface with one operation and one binding operation 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 one operation and
// the binding defines no operations.
try
{
DescriptionElement descEl = factory.newDescription();
descEl.setTargetNamespace(namespace1);
InterfaceElement interfac = descEl.addInterfaceElement();
interfac.setName(name1);
InterfaceOperationElement interfaceOperation = interfac.addInterfaceOperationElement();
interfaceOperation.setName(name2);
BindingElement binding = descEl.addBindingElement();
binding.setName(name2);
binding.setInterfaceName(name1QN);
if(val.testAssertionBinding1045(descEl.toComponent().getBindings()[0], reporter))
{
fail("The testAssertionBinding1045 method returned true for a binding with an interface with one operation and no binding operation defined.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that the assertion returns true when an interface is specified with one operation through
// an extended interface and the binding defines a binding operation for the operation.
try
{
DescriptionElement descEl = factory.newDescription();
InterfaceElement interfac = descEl.addInterfaceElement();
interfac.setName(name1);
interfac.addExtendedInterfaceName(name2QN);
InterfaceElement interfac2 = descEl.addInterfaceElement();
interfac2.setName(name2);
InterfaceOperationElement interfaceOperation = interfac2.addInterfaceOperationElement();
interfaceOperation.setName(name3);
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 false for a binding with an interface with one extended operation and one binding operation 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 one operation through
// an extended interface and the binding defines no operations.
try
{
DescriptionElement descEl = factory.newDescription();
descEl.setTargetNamespace(namespace1);
InterfaceElement interfac = descEl.addInterfaceElement();
interfac.setName(name1);
interfac.addExtendedInterfaceName(name2QN);
InterfaceElement interfac2 = descEl.addInterfaceElement();
interfac2.setName(name2);
InterfaceOperationElement interfaceOperation = interfac2.addInterfaceOperationElement();
interfaceOperation.setName(name3);
BindingElement binding = descEl.addBindingElement();
binding.setName(name2);
binding.setInterfaceName(name1QN);
if(val.testAssertionBinding1045(descEl.toComponent().getBindings()[0], reporter))
{
fail("The testAssertionBinding1045 method returned true for a binding with an interface with one extended operation and no binding operation defined.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that the assertion returns true when an interface is specified with two operations, one
// explicit and one inherited, and the binding defines operations for both.
try
{
DescriptionElement descEl = factory.newDescription();
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();