dims 2003/01/16 05:17:12
Modified: java/test/wsdl/dataset DataServiceTestCase.java
Log:
Add try/catch for server problems.
Revision Changes Path
1.3 +24 -5 xml-axis/java/test/wsdl/dataset/DataServiceTestCase.java
Index: DataServiceTestCase.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/wsdl/dataset/DataServiceTestCase.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DataServiceTestCase.java 10 Jan 2003 04:02:13 -0000 1.2
+++ DataServiceTestCase.java 16 Jan 2003 13:17:11 -0000 1.3
@@ -7,6 +7,10 @@
package test.wsdl.dataset;
+import org.apache.axis.AxisFault;
+
+import java.net.ConnectException;
+
public class DataServiceTestCase extends junit.framework.TestCase {
public DataServiceTestCase(java.lang.String name) {
super(name);
@@ -25,10 +29,25 @@
assertTrue("binding is null", binding != null);
binding.setTimeout(60000);
- // Test operation
- test.wsdl.dataset.GetTitleAuthorsResult value = null;
- value = binding.getTitleAuthors();
- assertTrue(value != null);
- // TBD - validate results
+
+ try {
+ // Test operation
+ test.wsdl.dataset.GetTitleAuthorsResult value = null;
+ value = binding.getTitleAuthors();
+ assertTrue(value != null);
+ // TBD - validate results
+ } catch (java.rmi.RemoteException re) {
+ if (re instanceof AxisFault) {
+ AxisFault fault = (AxisFault) re;
+ if (fault.detail instanceof ConnectException ||
+ fault.getFaultCode().getLocalPart().equals("HTTP")) {
+ System.err.println("DataService HTTP error: " + fault);
+ return;
+ }
+ }
+ throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re);
+ } catch (java.io.IOException ioe){
+ System.err.println("DataService IO error: " + ioe);
+ }
}
}