scheu 02/05/28 10:57:01 Modified: java/test/wsdl/roundtrip BondInvestment.java RoundtripPortType.java RoundtripTestServiceTestCase.java RoundtripTestSoapBindingImpl.java Log: Added overloaded method, getId(...), to the roundtrip testcase to verify overloaded method processing in Java2WSDL and WSDL2Java. Revision Changes Path 1.6 +1 -0 xml-axis/java/test/wsdl/roundtrip/BondInvestment.java Index: BondInvestment.java =================================================================== RCS file: /home/cvs/xml-axis/java/test/wsdl/roundtrip/BondInvestment.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- BondInvestment.java 31 Mar 2002 23:09:34 -0000 1.5 +++ BondInvestment.java 28 May 2002 17:57:01 -0000 1.6 @@ -95,6 +95,7 @@ private CallOptions[] options; public Object options2; public Object options3; + public int id; public BondInvestment() { 1.5 +5 -0 xml-axis/java/test/wsdl/roundtrip/RoundtripPortType.java Index: RoundtripPortType.java =================================================================== RCS file: /home/cvs/xml-axis/java/test/wsdl/roundtrip/RoundtripPortType.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- RoundtripPortType.java 3 Apr 2002 15:28:36 -0000 1.4 +++ RoundtripPortType.java 28 May 2002 17:57:01 -0000 1.5 @@ -164,5 +164,10 @@ public void throwInvalidTradeExchange() throws InvalidCompanyId, InvalidTradeExchange, InvalidTickerSymbol, java.rmi.RemoteException; + + // Overloading test + public int getId(BondInvestment investment) throws java.rmi.RemoteException; + public int getId(Investment investment) throws java.rmi.RemoteException; + } // RoundtripPortType 1.9 +83 -0 xml-axis/java/test/wsdl/roundtrip/RoundtripTestServiceTestCase.java Index: RoundtripTestServiceTestCase.java =================================================================== RCS file: /home/cvs/xml-axis/java/test/wsdl/roundtrip/RoundtripTestServiceTestCase.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- RoundtripTestServiceTestCase.java 24 May 2002 21:34:22 -0000 1.8 +++ RoundtripTestServiceTestCase.java 28 May 2002 17:57:01 -0000 1.9 @@ -517,6 +517,89 @@ } // testBondInvestmentIn /** + * Test the overloaded method getId with a BondInvestment. + */ + public void testBondInvestmentGetId() { + + try { + + CallOptions[] callOptions = new CallOptions[2]; + callOptions[0] = new CallOptions(); + Calendar date = Calendar.getInstance(); + TimeZone gmt = TimeZone.getTimeZone("GMT"); + date.setTimeZone(gmt); + date.setTime(new Date(1013441507388L)); + callOptions[0].setCallDate(date); + callOptions[1] = new CallOptions(); + date = Calendar.getInstance(); + date.setTimeZone(gmt); + date.setTime(new Date(1013441507390L)); + callOptions[1].setCallDate(date); + + short[] shortArray = {(short) 30}; + byte[] byteArray = {(byte) 1}; + Short[] wrapperShortArray = {new Short((short) 23), new Short((short) 56)}; + Byte[] wrapperByteArray = {new Byte((byte) 2), new Byte((byte) 15)}; + + BondInvestment sendValue = new BondInvestment(); + + sendValue.setOptions(callOptions); + sendValue.setOptions2(callOptions); + sendValue.setOptions3(callOptions[0]); + sendValue.setWrapperShortArray(wrapperShortArray); + sendValue.setWrapperByteArray(wrapperByteArray); + sendValue.setWrapperDouble(new Double(2323.232D)); + sendValue.setWrapperFloat(new Float(23.023F)); + sendValue.setWrapperInteger(new Integer(2093)); + sendValue.setWrapperShort(new Short((short) 203)); + sendValue.setWrapperByte(new Byte((byte) 20)); + sendValue.setWrapperBoolean(new Boolean(true)); + sendValue.setShortArray(shortArray); + sendValue.setByteArray(byteArray); + date = Calendar.getInstance(); + date.setTimeZone(gmt); + date.setTime(new Date(1012937861996L)); + sendValue.setCallableDate(date); + sendValue.setBondAmount(new BigDecimal("2675.23")); + sendValue.setPortfolioType(new BigInteger("2093")); + sendValue.setTradeExchange("NYSE"); + sendValue.setFiftyTwoWeekHigh(45.012D); + sendValue.setLastTradePrice(87895.32F); + sendValue.setYield(5475L); + sendValue.setStockBeta(32); + sendValue.setDocType((short) 35); + sendValue.setTaxIndicator((byte) 3); + sendValue.setId(-123); + + int id = binding.getId(sendValue); + assertEquals("The wrong id was sent back", -123, id); + + } catch (RemoteException re) { + fail("Remote Exception caught: " + re); + } + + } // testBondInvestmentGetId + + /** + * Test the overloaded method getId with a StockInvestment. + */ + public void testInvestmentGetId() { + + try { + StockInvestment stock = new StockInvestment(); + stock.setName("International Business Machines"); + stock.setId(1); + stock.setTradeExchange("NYSE"); + stock.setLastTradePrice(200.55F); + int id = binding.getId(stock); + assertEquals("The wrong id was sent back", 1, id); + } catch (RemoteException re) { + fail("Remote Exception caught: " + re); + } + + } // testInvestmentGetId + + /** * Test to insure that a multiple array sent by a remote method can be * received and its values match the expected values. */ 1.8 +9 -0 xml-axis/java/test/wsdl/roundtrip/RoundtripTestSoapBindingImpl.java Index: RoundtripTestSoapBindingImpl.java =================================================================== RCS file: /home/cvs/xml-axis/java/test/wsdl/roundtrip/RoundtripTestSoapBindingImpl.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- RoundtripTestSoapBindingImpl.java 3 Apr 2002 15:28:36 -0000 1.7 +++ RoundtripTestSoapBindingImpl.java 28 May 2002 17:57:01 -0000 1.8 @@ -686,4 +686,13 @@ } // throwInvalidTradeExchange + public int getId(BondInvestment investment) + throws java.rmi.RemoteException { + return investment.getId(); + } + public int getId(Investment investment) + throws java.rmi.RemoteException { + return investment.getId(); + } + } // End class RoundtripTypesTestSoapBindingImpl