// Test that the assertion returns true for an endpoint with no binding defined.
try
{
DescriptionElement descEl = factory.newDescription();
ServiceElement service = descEl.addServiceElement();
EndpointElement endpoint = service.addEndpointElement();
if(!val.testAssertionEndpoint1062(descEl.toComponent().getServices()[0].getEndpoints()[0], reporter))
{
fail("The testAssertionEndpoint1062 method returned false for an endpoint with no binding defined.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
/* (jkaputin) ditto the comment above for the first test case (NPE on getParent)
// Test that the assertion returns true for an endpoint with no parent defined.
try
{
EndpointImpl endpoint = new EndpointImpl();
BindingElement binding = descEl.createBindingElement();
binding.setName(name1);
endpoint.setBindingName(name1);
if(!val.testAssertionEndpoint0066(endpoint, reporter))
{
fail("The testAssertionEndpoint0066 method returned false for an endpoint with no parent defined.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
*/
// Test that the assertion returns true for an endpoint that specifies a binding with no interface specified.
try
{
DescriptionElement descEl = factory.newDescription();
InterfaceElement interfac = descEl.addInterfaceElement();
interfac.setName(name1);
BindingElement binding = descEl.addBindingElement();
binding.setName(name2);
ServiceElement service = descEl.addServiceElement();
service.setInterfaceName(name1QN);
EndpointElement endpoint = service.addEndpointElement();
endpoint.setBindingName(name2QN);
if(!val.testAssertionEndpoint1062(descEl.toComponent().getServices()[0].getEndpoints()[0], reporter))
{
fail("The testAssertionEndpoint1062 method returned false for an endpoint that specifies a binding with no specified interface.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that the assertion returns true for an endpoint that specifies a binding with the same interface
// as the parent service specified.
try
{
DescriptionElement descEl = factory.newDescription();
InterfaceElement interfac = descEl.addInterfaceElement();
interfac.setName(name1);
BindingElement binding = descEl.addBindingElement();
binding.setName(name2);
binding.setInterfaceName(name1QN);
ServiceElement service = descEl.addServiceElement();
service.setInterfaceName(name1QN);
EndpointElement endpoint = service.addEndpointElement();
endpoint.setBindingName(name2QN);
if(!val.testAssertionEndpoint1062(descEl.toComponent().getServices()[0].getEndpoints()[0], reporter))
{
fail("The testAssertionEndpoint1062 method returned false for an endpoint that specifies a binding with the same interface specified as the parent service specifies.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that the assertion returns false for an endpoint that specifies a binding with a different interface
// than the parent service specified.
try
{
DescriptionElement descEl = factory.newDescription();
descEl.setTargetNamespace(namespace1);
InterfaceElement interfac = descEl.addInterfaceElement();
interfac.setName(name1);
InterfaceElement interfac2 = descEl.addInterfaceElement();
interfac2.setName(name2);
BindingElement binding = descEl.addBindingElement();
binding.setName(name3);
binding.setInterfaceName(name2QN);
ServiceElement service = descEl.addServiceElement();
service.setInterfaceName(name1QN);
EndpointElement endpoint = service.addEndpointElement();
endpoint.setBindingName(name3QN);
if(val.testAssertionEndpoint1062(descEl.toComponent().getServices()[0].getEndpoints()[0], reporter))
{
fail("The testAssertionEndpoint1062 method returned true for an endpoint that specifies a binding with a different interface specified than the parent service specifies.");
}
}