}
// Test that the assertion returns true for an interface fault reference list with one entry.
try
{
DescriptionElement descEl = factory.newDescription();
InterfaceElement interfac = descEl.addInterfaceElement();
InterfaceFaultElement fault = interfac.addInterfaceFaultElement();
fault.setName(name1);
InterfaceOperationElement oper = interfac.addInterfaceOperationElement();
InterfaceFaultReferenceElement faultReference = oper.addInterfaceFaultReferenceElement();
faultReference.setRef(name1QN);
faultReference.setMessageLabel(MessageLabel.IN);
descEl.toComponent().getInterfaces(); //init Interface's ref to its Description
if(!val.testAssertionInterfaceFaultReference1039(new InterfaceFaultReference[]{(InterfaceFaultReferenceImpl)faultReference}, reporter))
{
fail("The testAssertionInterfaceFaultReference1039 method returned false for an interface fault reference that is the only interface fault reference defined.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that the assertion returns true for two interface fault references that have both different
// faults and different message labels.
try
{
DescriptionElement descEl = factory.newDescription();
InterfaceElement interfac = descEl.addInterfaceElement();
InterfaceFaultElement fault = interfac.addInterfaceFaultElement();
fault.setName(name1);
InterfaceFaultElement fault2 = interfac.addInterfaceFaultElement();
fault2.setName(name2);
InterfaceOperationElement oper = interfac.addInterfaceOperationElement();
InterfaceFaultReferenceElement faultReference = oper.addInterfaceFaultReferenceElement();
faultReference.setRef(name1QN);
faultReference.setMessageLabel(MessageLabel.IN);
InterfaceFaultReferenceElement faultReference2 = oper.addInterfaceFaultReferenceElement();
faultReference2.setRef(name2QN);
faultReference2.setMessageLabel(MessageLabel.OUT);
descEl.toComponent().getInterfaces(); //init Interface's ref to its Description
if(!val.testAssertionInterfaceFaultReference1039(new InterfaceFaultReference[]{(InterfaceFaultReferenceImpl)faultReference, (InterfaceFaultReferenceImpl)faultReference2}, reporter))
{
fail("The testAssertionInterfaceFaultReference1039 method returned false for two interface fault references that have different faults and message labels.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that the assertion returns true for two interface fault references that have the same fault
// but different message labels
try
{
DescriptionElement descEl = factory.newDescription();
InterfaceElement interfac = descEl.addInterfaceElement();
InterfaceFaultElement fault = interfac.addInterfaceFaultElement();
fault.setName(name1);
InterfaceOperationElement oper = interfac.addInterfaceOperationElement();
InterfaceFaultReferenceElement faultReference = oper.addInterfaceFaultReferenceElement();
faultReference.setRef(name1QN);
faultReference.setMessageLabel(MessageLabel.IN);
InterfaceFaultReferenceElement faultReference2 = oper.addInterfaceFaultReferenceElement();
faultReference2.setRef(name1QN);
faultReference2.setMessageLabel(MessageLabel.OUT);
descEl.toComponent().getInterfaces(); //init Interface's ref to its Description
if(!val.testAssertionInterfaceFaultReference1039(new InterfaceFaultReference[]{(InterfaceFaultReferenceImpl)faultReference, (InterfaceFaultReferenceImpl)faultReference2}, reporter))
{
fail("The testAssertionInterfaceFaultReference1039 method returned false for two interface fault references that have the same fault but different message labels.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that the assertion returns true for two interface fault references that have the same
// message label but different faults.
try
{
DescriptionElement descEl = factory.newDescription();
InterfaceElement interfac = descEl.addInterfaceElement();
InterfaceFaultElement fault = interfac.addInterfaceFaultElement();
fault.setName(name1);
InterfaceFaultElement fault2 = interfac.addInterfaceFaultElement();
fault2.setName(name2);
InterfaceOperationElement oper = interfac.addInterfaceOperationElement();
InterfaceFaultReferenceElement faultReference = oper.addInterfaceFaultReferenceElement();
faultReference.setRef(name1QN);
faultReference.setMessageLabel(MessageLabel.IN);
InterfaceFaultReferenceElement faultReference2 = oper.addInterfaceFaultReferenceElement();
faultReference2.setRef(name2QN);
faultReference2.setMessageLabel(MessageLabel.IN);
descEl.toComponent().getInterfaces(); //init Interface's ref to its Description
if(!val.testAssertionInterfaceFaultReference1039(new InterfaceFaultReference[]{(InterfaceFaultReferenceImpl)faultReference, (InterfaceFaultReferenceImpl)faultReference2}, reporter))
{
fail("The testAssertionInterfaceFaultReference1039 method returned false for two interface fault references that have different faults but the same message labels.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that the assertion returns false for two interface fault references that have the same
// fault and message label.
try
{
DescriptionElement descEl = factory.newDescription();
descEl.setTargetNamespace(namespace1);
InterfaceElement interfac = descEl.addInterfaceElement();
interfac.setName(name1);
InterfaceFaultElement fault = interfac.addInterfaceFaultElement();
fault.setName(name1);
InterfaceOperationElement oper = interfac.addInterfaceOperationElement();
InterfaceFaultReferenceElement faultReference = oper.addInterfaceFaultReferenceElement();
faultReference.setRef(name1QN);
faultReference.setMessageLabel(MessageLabel.IN);
InterfaceFaultReferenceElement faultReference2 = oper.addInterfaceFaultReferenceElement();
faultReference2.setRef(name1QN);
faultReference2.setMessageLabel(MessageLabel.IN);
descEl.toComponent().getInterfaces(); //init Interface's ref to its Description
if(val.testAssertionInterfaceFaultReference1039(new InterfaceFaultReference[]{(InterfaceFaultReferenceImpl)faultReference, (InterfaceFaultReferenceImpl)faultReference2}, reporter))
{
fail("The testAssertionInterfaceFaultReference1039 method returned true for two interface fault references that have the same fault and message label.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that the method returns true for an interface fault reference with a null message label.
try
{
DescriptionElement descEl = factory.newDescription();
descEl.setTargetNamespace(namespace1);
InterfaceElement interfac = descEl.addInterfaceElement();
InterfaceFaultElement fault = interfac.addInterfaceFaultElement();
fault.setName(name1);
InterfaceOperationElement oper = interfac.addInterfaceOperationElement();
InterfaceFaultReferenceElement faultReference = oper.addInterfaceFaultReferenceElement();
faultReference.setRef(name1QN);
descEl.toComponent().getInterfaces(); //init Interface's ref to its Description
if(!val.testAssertionInterfaceFaultReference1039(new InterfaceFaultReference[]{(InterfaceFaultReferenceImpl)faultReference}, reporter))
{
fail("The testAssertionInterfaceFaultReference1039 method returned false for an interface fault references with a null message labels.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that the method returns true for an interface fault reference with a null fault.
try
{
DescriptionElement descEl = factory.newDescription();
descEl.setTargetNamespace(namespace1);
InterfaceElement interfac = descEl.addInterfaceElement();
InterfaceOperationElement oper = interfac.addInterfaceOperationElement();
InterfaceFaultReferenceElement faultReference = oper.addInterfaceFaultReferenceElement();
faultReference.setMessageLabel(MessageLabel.IN);
descEl.toComponent().getInterfaces(); //init Interface's ref to its Description
if(!val.testAssertionInterfaceFaultReference1039(new InterfaceFaultReference[]{(InterfaceFaultReferenceImpl)faultReference}, reporter))
{
fail("The testAssertionInterfaceFaultReference1039 method returned false for ano interface fault reference that has a null fault.");
}
}
catch(WSDLException e)
{
fail("There was a problem running the test assertion method " + e);
}
// Test that the method returns false for two interface fault references that have the same
// fault/message label and a third interface fault reference that has a null fault and is
// defined second.
try
{
DescriptionElement descEl = factory.newDescription();
descEl.setTargetNamespace(namespace1);
InterfaceElement interfac = descEl.addInterfaceElement();
interfac.setName(name1);
InterfaceFaultElement fault = interfac.addInterfaceFaultElement();
fault.setName(name1);
InterfaceOperationElement oper = interfac.addInterfaceOperationElement();
InterfaceFaultReferenceElement faultReference = oper.addInterfaceFaultReferenceElement();
faultReference.setRef(name1QN);
faultReference.setMessageLabel(MessageLabel.IN);
InterfaceFaultReferenceElement faultReference2 = oper.addInterfaceFaultReferenceElement();
faultReference2.setRef(name1QN);
faultReference2.setMessageLabel(MessageLabel.IN);
InterfaceFaultReferenceElement faultReference3 = oper.addInterfaceFaultReferenceElement();
faultReference3.setMessageLabel(MessageLabel.OUT);
descEl.toComponent().getInterfaces(); //init Interface's ref to its Description
if(val.testAssertionInterfaceFaultReference1039(new InterfaceFaultReference[]{(InterfaceFaultReferenceImpl)faultReference, (InterfaceFaultReferenceImpl)faultReference3, (InterfaceFaultReferenceImpl)faultReference2}, reporter))
{
fail("The testAssertionInterfaceFaultReference1039 method returned true for two interface fault references that have the same fault and message label and a third interface fault reference that has a null fault and is defined second.");
}