tomj 2002/09/17 13:02:13
Modified: java/src/org/apache/axis/wsdl/toJava Utils.java
java/test/wsdl/types VerifyTestCase.java
Log:
The PositiveInteger, NegativeInteger, NonPositiveInteger and NonNegativeInteger
types do not throw a checked exception from their constructors, so don't treat
them as if they do.
Revision Changes Path
1.57 +4 -4 xml-axis/java/src/org/apache/axis/wsdl/toJava/Utils.java
Index: Utils.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/Utils.java,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- Utils.java 15 Sep 2002 19:16:17 -0000 1.56
+++ Utils.java 17 Sep 2002 20:02:12 -0000 1.57
@@ -756,6 +756,10 @@
constructorMap.put("byte[]", "new byte[0]");
constructorMap.put("java.util.Calendar",
"java.util.Calendar.getInstance()");
constructorMap.put("javax.xml.namespace.QName", "new
javax.xml.namespace.QName(\"http://double-double\", \"toil-and-trouble\")");
+ constructorMap.put("org.apache.axis.types.NonNegativeInteger", "new
org.apache.axis.types.NonNegativeInteger(\"0\")");
+ constructorMap.put("org.apache.axis.types.PositiveInteger", "new
org.apache.axis.types.PositiveInteger(\"1\")");
+ constructorMap.put("org.apache.axis.types.NonPositiveInteger", "new
org.apache.axis.types.NonPositiveInteger(\"0\")");
+ constructorMap.put("org.apache.axis.types.NegativeInteger", "new
org.apache.axis.types.NegativeInteger(\"-1\")");
// These constructors throw exception
constructorThrowMap.put("org.apache.axis.types.Time", "new
org.apache.axis.types.Time(\"15:45:45.275Z\")");
@@ -763,10 +767,6 @@
constructorThrowMap.put("org.apache.axis.types.UnsignedInt", "new
org.apache.axis.types.UnsignedInt(0)");
constructorThrowMap.put("org.apache.axis.types.UnsignedShort", "new
org.apache.axis.types.UnsignedShort(0)");
constructorThrowMap.put("org.apache.axis.types.UnsignedByte", "new
org.apache.axis.types.UnsignedByte(0)");
- constructorThrowMap.put("org.apache.axis.types.NonNegativeInteger", "new
org.apache.axis.types.NonNegativeInteger(\"0\")");
- constructorThrowMap.put("org.apache.axis.types.PositiveInteger", "new
org.apache.axis.types.PositiveInteger(\"1\")");
- constructorThrowMap.put("org.apache.axis.types.NonPositiveInteger", "new
org.apache.axis.types.NonPositiveInteger(\"0\")");
- constructorThrowMap.put("org.apache.axis.types.NegativeInteger", "new
org.apache.axis.types.NegativeInteger(\"-1\")");
constructorThrowMap.put("org.apache.axis.types.URI", "new
org.apache.axis.types.URI(\"urn:testing\")");
constructorThrowMap.put("org.apache.axis.types.Year", "new
org.apache.axis.types.Year(2000)");
constructorThrowMap.put("org.apache.axis.types.Month", "new
org.apache.axis.types.Month(1)");
1.34 +6 -26 xml-axis/java/test/wsdl/types/VerifyTestCase.java
Index: VerifyTestCase.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/wsdl/types/VerifyTestCase.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- VerifyTestCase.java 15 Sep 2002 19:16:17 -0000 1.33
+++ VerifyTestCase.java 17 Sep 2002 20:02:12 -0000 1.34
@@ -742,44 +742,28 @@
throw new junit.framework.AssertionFailedError("methodUnsignedByte
Exception caught: " + re );
}
try {
- NonNegativeInteger sendValue = null;
- try {
- sendValue = new NonNegativeInteger("246802468024680");
- } catch (Exception e) {
- }
+ NonNegativeInteger sendValue = new
NonNegativeInteger("246802468024680");
NonNegativeIntegerHolder nnih = new NonNegativeIntegerHolder(sendValue);
NonNegativeInteger actual = binding.methodNonNegativeInteger(sendValue,
nnih);
} catch (java.rmi.RemoteException re) {
throw new
junit.framework.AssertionFailedError("methodNonNegativeInteger Exception caught: " +
re );
}
try {
- PositiveInteger sendValue = null;
- try {
- sendValue = new PositiveInteger("246802468024680");
- } catch (Exception e) {
- }
+ PositiveInteger sendValue = new PositiveInteger("246802468024680");
PositiveIntegerHolder pih = new PositiveIntegerHolder(sendValue);
PositiveInteger actual = binding.methodPositiveInteger(sendValue, pih);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodPositiveInteger
Exception caught: " + re );
}
try {
- NonPositiveInteger sendValue = null;
- try {
- sendValue = new NonPositiveInteger("-246802468024680");
- } catch (Exception e) {
- }
+ NonPositiveInteger sendValue = new
NonPositiveInteger("-246802468024680");
NonPositiveIntegerHolder npih = new NonPositiveIntegerHolder(sendValue);
NonPositiveInteger actual = binding.methodNonPositiveInteger(sendValue,
npih);
} catch (java.rmi.RemoteException re) {
throw new
junit.framework.AssertionFailedError("methodNonPositiveInteger Exception caught: " +
re );
}
try {
- NegativeInteger sendValue = null;
- try {
- sendValue = new NegativeInteger("-246802468024680");
- } catch (Exception e) {
- }
+ NegativeInteger sendValue = new NegativeInteger("-246802468024680");
NegativeIntegerHolder nih = new NegativeIntegerHolder(sendValue);
NegativeInteger actual = binding.methodNegativeInteger(sendValue, nih);
} catch (java.rmi.RemoteException re) {
@@ -789,7 +773,7 @@
URI sendValue = null;
try {
sendValue = new URI("urn:this-is-a-test");
- } catch (Exception e) {
+ } catch (URI.MalformedURIException e) {
}
URIHolder ch = new URIHolder(sendValue);
URI actual = binding.methodAnyURI(sendValue, ch);
@@ -798,11 +782,7 @@
}
try {
- SimpleAnyURIType sendValue = null;
- try {
- sendValue = new SimpleAnyURIType("urn:this-is-a-simple-test");
- } catch (Exception e) {
- }
+ SimpleAnyURIType sendValue = new
SimpleAnyURIType("urn:this-is-a-simple-test");
SimpleAnyURITypeHolder ch = new SimpleAnyURITypeHolder(sendValue);
SimpleAnyURIType actual = binding.methodSimpleAnyURI(sendValue, ch);
} catch (java.rmi.RemoteException re) {