Methods Summary |
---|
public org.w3c.dom.Element | createElement(java.lang.String tag, java.lang.String child)
Document doc = null;
try {
doc = XMLUtils.newDocument();
} catch (ParserConfigurationException e) {
throw new RuntimeException("xml trouble");
}
Element element = doc.createElement(tag);
Text text = doc.createTextNode(child);
element.appendChild(text);
return element;
|
private void | dumpFault(org.apache.axis.AxisFault af)helper method to stick in when diagnosing stuff
String s=af.dumpToString();
System.out.println(s);
|
public static junit.framework.Test | suite()
return new TestSuite(TestAxisFault.class);
|
public void | testArrayAddWorks()
AxisFault af = new AxisFault();
af.addFaultDetailString("alles geht gut");
Element array[]=new Element[2];
array[0] = createElement("ein","un");
array[1] = createElement("zwei", "deux");
af.setFaultDetail(array);
Element match = af.lookupFaultDetail(new QName(null, "zwei"));
assertNotNull(match);
Element old = af.lookupFaultDetail(new QName(null, "string"));
assertNull(old);
|
public void | testAxisFaultFillIn()test that making an axis fault from an axis fault retains it
AxisFault af1=new AxisFault("fault1");
AxisFault af2=AxisFault.makeFault(af1);
assertSame(af1,af2);
|
public void | testDetailRemoval()test we can remove some detail
Exception e = new Exception("foo");
AxisFault af = AxisFault.makeFault(e);
assertTrue(af.removeFaultDetail(Constants.QNAME_FAULTDETAIL_STACKTRACE));
Element stackTrace;
stackTrace = af.lookupFaultDetail(Constants.QNAME_FAULTDETAIL_STACKTRACE);
assertNull(stackTrace);
String text=af.getFaultString();
assertNotNull(text);
text=af.toString();
assertNotNull(text);
|
public void | testEmptyArrayAddWorks()
AxisFault af = new AxisFault();
af.addFaultDetailString("alles geht gut");
Element array[] = new Element[0];
af.setFaultDetail(array);
Element old = af.lookupFaultDetail(new QName(null, "string"));
assertNull(old);
|
public void | testEmptyNamespaceLookup()verify we can properly lookup empty namespace stuff
AxisFault af=new AxisFault();
af.addFaultDetailString("alles geht gut");
Element match=af.lookupFaultDetail(new QName(null,"string"));
assertNotNull(match);
|
public void | testExceptionFillIn()test that exceptions are filled in
Exception e=new Exception("foo");
AxisFault af=AxisFault.makeFault(e);
Element stackTrace;
stackTrace = af.lookupFaultDetail(Constants.QNAME_FAULTDETAIL_STACKTRACE);
assertNotNull(stackTrace);
Element exceptionName;
exceptionName = af.lookupFaultDetail(Constants.QNAME_FAULTDETAIL_EXCEPTIONNAME);
assertNull(exceptionName);
QName faultCode=af.getFaultCode();
assertEquals(faultCode.getLocalPart(), Constants.FAULT_SERVER_USER);
|
public void | testSubclassProcessing()test what happens with subclasses. We expect the classname to be preserved
in the details
AxisFault af=new NoEndPointException();
Element exceptionName;
exceptionName = af.lookupFaultDetail(Constants.QNAME_FAULTDETAIL_EXCEPTIONNAME);
assertNotNull(exceptionName);
String exceptionClassname= XMLUtils.getInnerXMLString(exceptionName);
assertTrue(exceptionClassname.indexOf("NoEndPointException")>=0);
|