// Test that the assertion returns true when no operation or fault is specified
// and an interface is not specified.
try
{
DescriptionElement desc = factory.newDescription();
BindingElement bindingEl = desc.addBindingElement();
bindingEl.setName(name1);
if(!val.testAssertionBinding1044(desc.toComponent().getBindings()[0], reporter))
{
fail("The testAssertionBinding1044 method returned false for a binding with no interface, operation, or faults specified.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that the assertion returns true when no operation or fault is specified
// and an interface is specified.
try
{
DescriptionElement descEl = factory.newDescription();
InterfaceElement interfac = descEl.addInterfaceElement();
interfac.setName(name1);
BindingElement binding = descEl.addBindingElement();
binding.setName(name2);
binding.setInterfaceName(name1QN);
if(!val.testAssertionBinding1044(descEl.toComponent().getBindings()[0], reporter))
{
fail("The testAssertionBinding1044 method returned false for a binding with an interface and no operation or faults specified.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that the assertion returns true when an operation is specified
// and an interface is specified.
try
{
DescriptionElement descEl = factory.newDescription();
descEl.setTargetNamespace(namespace1);
InterfaceElement interfac = descEl.addInterfaceElement();
interfac.setName(name1);
BindingElement binding = descEl.addBindingElement();
binding.setName(name2);
binding.setInterfaceName(name1QN);
BindingOperationElement bindingOperation = binding.addBindingOperationElement();
if(!val.testAssertionBinding1044(descEl.toComponent().getBindings()[0], reporter))
{
fail("The testAssertionBinding1044 method returned false for a binding with an interface and an operation specified.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that the assertion returns true when a fault is specified
// and an interface is specified.
try
{
DescriptionElement descEl = factory.newDescription();
descEl.setTargetNamespace(namespace1);
InterfaceElement interfac = descEl.addInterfaceElement();
interfac.setName(name1);
BindingElement binding = descEl.addBindingElement();
binding.setName(name2);
binding.setInterfaceName(name1QN);
BindingFaultElement bindingFault = binding.addBindingFaultElement();
if(!val.testAssertionBinding1044(descEl.toComponent().getBindings()[0], reporter))
{
fail("The testAssertionBinding1044 method returned false for a binding with an interface and a fault specified.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that the assertion returns true when an operation and a fault are specified
// and an interface is specified.
try
{
DescriptionElement descEl = factory.newDescription();
descEl.setTargetNamespace(namespace1);
InterfaceElement interfac = descEl.addInterfaceElement();
interfac.setName(name1);
BindingElement binding = descEl.addBindingElement();
binding.setName(name2);
binding.setInterfaceName(name1QN);
BindingFaultElement bindingFault = binding.addBindingFaultElement();
BindingOperationElement bindingOperation = binding.addBindingOperationElement();
if(!val.testAssertionBinding1044(descEl.toComponent().getBindings()[0], reporter))
{
fail("The testAssertionBinding1044 method returned false for a binding with an interface and an operation and a fault specified.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that the assertion returns false when an operation is specified
// and no interface is specified.
try
{
DescriptionElement descEl = factory.newDescription();
descEl.setTargetNamespace(namespace1);
BindingElement binding = descEl.addBindingElement();
binding.setName(name1);
BindingOperationElement bindingOperation = binding.addBindingOperationElement();
if(val.testAssertionBinding1044(descEl.toComponent().getBindings()[0], reporter))
{
fail("The testAssertionBinding1044 method returned true for a binding with an operation and no interface.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that the assertion returns false when a fault is specified
// and no interface is specified.
try
{
DescriptionElement descEl = factory.newDescription();
descEl.setTargetNamespace(namespace1);
BindingElement binding = descEl.addBindingElement();
binding.setName(name1);
BindingFaultElement bindingFault = binding.addBindingFaultElement();
if(val.testAssertionBinding1044(descEl.toComponent().getBindings()[0], reporter))
{
fail("The testAssertionBinding1044 method returned true for a binding with a fault and no interface.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that the assertion returns false when an operation and a fault are specified
// and no interface is specified.
try
{
DescriptionElement descEl = factory.newDescription();
BindingElement binding = descEl.addBindingElement();
binding.setName(name1);
BindingFaultElement bindingFault = binding.addBindingFaultElement();
BindingOperationElement bindingOperation = binding.addBindingOperationElement();
if(val.testAssertionBinding1044(descEl.toComponent().getBindings()[0], reporter))
{
fail("The testAssertionBinding1044 method returned true for a binding with an operation and a fault and no interface.");
}
}