catch(URISyntaxException e)
{
fail("There was a problem creating the test URIs: " + e);
}
WSDLFactory factory = null;
try {
factory = WSDLFactory.newInstance();
} catch (WSDLException e) {
fail("Can't instantiate the WSDLFactory object.");
}
// Test that a schema without any style defaults is valid.
handler.reset();
try
{
DescriptionElement desc = factory.newDescription();
InterfaceElement interfaceElem = desc.addInterfaceElement();
if(!val.testAssertionInterface1012(interfaceElem, reporter))
{
fail("The testAssertionInterface1012 method returned false for an interface that specifies no style defaults.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that a schema with an absolute style default is valid.
handler.reset();
try
{
DescriptionElement desc = factory.newDescription();
InterfaceElement interfaceElem = desc.addInterfaceElement();
interfaceElem.addStyleDefaultURI(absoluteURI);
if(!val.testAssertionInterface1012(interfaceElem, reporter))
{
fail("The testAssertionInterface1012 method returned false for an interface that specifies one absolute style default.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that a schema with a relative style default is not valid.
handler.reset();
try
{
DescriptionElement desc = factory.newDescription();
InterfaceElement interfaceElem = desc.addInterfaceElement();
interfaceElem.addStyleDefaultURI(relativeURI);
if(val.testAssertionInterface1012(interfaceElem, reporter))
{
fail("The testAssertionInterface1012 method returned true for an interface that specifies one relative style default.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that a schema with an absolute style default and a relative sytle default is not valid.
handler.reset();
try
{
DescriptionElement desc = factory.newDescription();
InterfaceElement interfaceElem = desc.addInterfaceElement();
interfaceElem.addStyleDefaultURI(absoluteURI);
interfaceElem.addStyleDefaultURI(relativeURI);
if(val.testAssertionInterface1012(interfaceElem, reporter))
{
fail("The testAssertionInterface1012 method returned true for an interface that specifies an absolute style default and a relative style default.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that a schema with two relative style defaults returns two error messages
handler.reset();
try
{
DescriptionElement desc = factory.newDescription();
InterfaceElement interfaceElem = desc.addInterfaceElement();
interfaceElem.addStyleDefaultURI(relativeURI);
interfaceElem.addStyleDefaultURI(relativeURI2);
val.testAssertionInterface1012(interfaceElem, reporter);
if(handler.numErrors != 2)