scheu       02/02/22 16:48:28

  Modified:    java/samples/addr Main.java
               java/src/org/apache/axis/wsdl/toJava
                        JavaComplexTypeWriter.java
               java/test/wsdl/arrays PersonalInfoBookServiceTestCase.java
               java/test/wsdl/inout DetailedInoutTestCase.java
                        InoutSOAPBindingImpl.java
               java/test/wsdl/multithread MultithreadTestCase.java
               java/test/wsdl/roundtrip RoundtripTestServiceTestCase.java
                        RoundtripTestSoapBindingImpl.java
               java/test/wsdl/types VerifyTestCase.java
  Log:
  The following changes are made:
  
    * Changed WSDL2Java so that it no longer generates a full constructor
      for bean classes.
  
    * Changed testcases that relied on this non-supported api.
  
  Revision  Changes    Path
  1.17      +18 -4     xml-axis/java/samples/addr/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/addr/Main.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Main.java 5 Feb 2002 16:22:39 -0000       1.16
  +++ Main.java 23 Feb 2002 00:48:27 -0000      1.17
  @@ -71,11 +71,25 @@
    * @author Sanjiva Weerawarana <[EMAIL PROTECTED]>
    */
   public class Main {
  -    static String name1 = "Purdue Boilermaker";
  -    static Address addr1 = new Address (1, "University Drive",
  -                                        "West Lafayette", StateType.IN, 47907,
  -                                        new Phone (765, "494", "4900"));
  +    static String name1;
  +    static Address addr1;
  +    static Phone phone1;
       
  +    static {
  +        name1 = "Purdue Boilermaker";
  +        addr1 = new Address();
  +        phone1 = new Phone();
  +        addr1.setStreetNum(1);
  +        addr1.setStreetName("University Drive");
  +        addr1.setCity("West Lafayette");
  +        addr1.setState(StateType.IN);
  +        addr1.setZip(47907);
  +        phone1.setAreaCode(765);
  +        phone1.setExchange("494");
  +        phone1.setNumber("4900");
  +        addr1.setPhoneNumber(phone1);
  +        
  +    }
       private static void printAddress (Address ad) {
           if (ad == null) {
               System.err.println ("\t[ADDRESS NOT FOUND!]");
  
  
  
  1.10      +20 -13    
xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaComplexTypeWriter.java
  
  Index: JavaComplexTypeWriter.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaComplexTypeWriter.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- JavaComplexTypeWriter.java        22 Feb 2002 23:11:34 -0000      1.9
  +++ JavaComplexTypeWriter.java        23 Feb 2002 00:48:27 -0000      1.10
  @@ -139,21 +139,28 @@
           pw.println();
           pw.println("    public " + className + "() {");
           pw.println("    }");
  -        pw.println();
  -        if (names.size() > 0) {
  -            pw.print("    public " + className + "(");
  -            for (int i = 0; i < names.size(); i += 2) {
  -                if (i != 0) pw.print(", ");
  -                String variable = (String) names.get(i + 1);
  -                pw.print((String) names.get(i) + " " + variable);
  +
  +        // The code used to generate a constructor that set
  +        // all of the properties.  
  +        boolean fullConstructorGen = false;
  +        if (fullConstructorGen) {
  +            pw.println();
  +            if (names.size() > 0) {
  +                pw.print("    public " + className + "(");
  +                for (int i = 0; i < names.size(); i += 2) {
  +                    if (i != 0) pw.print(", ");
  +                    String variable = (String) names.get(i + 1);
  +                    pw.print((String) names.get(i) + " " + variable);
  +                }
  +                pw.println(") {");
  +                for (int i = 1; i < names.size(); i += 2) {
  +                    String variable = (String) names.get(i);
  +                    pw.println("        this." + variable + " = " + variable + ";");
  +                }
  +                pw.println("    }");
               }
  -            pw.println(") {");
  -            for (int i = 1; i < names.size(); i += 2) {
  -                String variable = (String) names.get(i);
  -                pw.println("        this." + variable + " = " + variable + ";");
  -            }
  -            pw.println("    }");
           }
  +
           pw.println();
           for (int i = 0; i < names.size(); i += 2) {
               String typeName = (String) names.get(i);
  
  
  
  1.4       +9 -3      
xml-axis/java/test/wsdl/arrays/PersonalInfoBookServiceTestCase.java
  
  Index: PersonalInfoBookServiceTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/test/wsdl/arrays/PersonalInfoBookServiceTestCase.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PersonalInfoBookServiceTestCase.java      5 Feb 2002 16:22:40 -0000       1.3
  +++ PersonalInfoBookServiceTestCase.java      23 Feb 2002 00:48:28 -0000      1.4
  @@ -26,9 +26,15 @@
           String[] foods  = new String[] { "Cheeze Whiz", "Jolt Cola" };
           Byte[]   nickName = new Byte[] { new Byte((byte)'g'), new Byte((byte)'e'),
                                            new Byte((byte)'e'), new Byte((byte)'k') };
  -        PersonalInfo pi = new PersonalInfo(name,movies,hobbies,pets, id, id2,
  -                                                  foods,
  -                                                  nickName);
  +        PersonalInfo pi = new PersonalInfo();
  +        pi.setName(name);
  +        pi.setFavoriteMovies(movies);
  +        pi.setHobbies(hobbies);
  +        pi.setPets(pets);
  +        pi.setId(id);
  +        pi.setId2(id2);
  +        pi.setFoods(foods);
  +        pi.setNickName(nickName);
   
           // Get the stub and set Session
           test.wsdl.arrays.PersonalInfoBook binding;
  
  
  
  1.5       +27 -4     xml-axis/java/test/wsdl/inout/DetailedInoutTestCase.java
  
  Index: DetailedInoutTestCase.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/wsdl/inout/DetailedInoutTestCase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DetailedInoutTestCase.java        19 Feb 2002 17:38:23 -0000      1.4
  +++ DetailedInoutTestCase.java        23 Feb 2002 00:48:28 -0000      1.5
  @@ -24,6 +24,29 @@
       
       public DetailedInoutTestCase(String name) {
           super(name);
  +        expectedAddress = new Address();
  +        expectedPhone = new Phone();
  +        expectedAddress.setStreetNum(1);
  +        expectedAddress.setStreetName("University Drive");
  +        expectedAddress.setCity("West Lafayette");
  +        expectedAddress.setState("IN");
  +        expectedAddress.setZip(47907);
  +        expectedPhone.setAreaCode(765);
  +        expectedPhone.setExchange("494");
  +        expectedPhone.setNumber("4900");
  +        expectedAddress.setPhoneNumber(expectedPhone);
  +
  +        returnAddress = new Address();
  +        returnPhone = new Phone();
  +        returnAddress.setStreetNum(555);
  +        returnAddress.setStreetName("Monroe Street");
  +        returnAddress.setCity("Madison");
  +        returnAddress.setState("WI");
  +        returnAddress.setZip(54444);
  +        returnPhone.setAreaCode(999);
  +        returnPhone.setExchange("one");
  +        returnPhone.setNumber("two");
  +        returnAddress.setPhoneNumber(returnPhone);
           try {
               io = new InoutServiceLocator().getInoutService();
           }
  @@ -75,12 +98,12 @@
           }
       }
   
  -    private Phone expectedPhone = new Phone (765, "494", "4900");
  -    private Address expectedAddress = new Address (1, "University Drive", "West 
Lafayette", "IN", 47907, expectedPhone);
  +    private Phone expectedPhone;
  +    private Address expectedAddress;
       private int expectedNumber = 99;
   
  -    private Phone returnPhone = new Phone (999, "one", "two");
  -    private Address returnAddress = new Address (555, "Monroe Street", "Madison", 
"WI", 54444, returnPhone);
  +    private Phone returnPhone;
  +    private Address returnAddress;
       private int returnNumber = 66;
   
       public void testOut0Inout0In0 ()
  
  
  
  1.2       +30 -4     xml-axis/java/test/wsdl/inout/InoutSOAPBindingImpl.java
  
  Index: InoutSOAPBindingImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/wsdl/inout/InoutSOAPBindingImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InoutSOAPBindingImpl.java 16 Jan 2002 14:07:59 -0000      1.1
  +++ InoutSOAPBindingImpl.java 23 Feb 2002 00:48:28 -0000      1.2
  @@ -5,6 +5,32 @@
   
   public class InoutSOAPBindingImpl implements Inout
   {
  +    public InoutSOAPBindingImpl() {
  +        expectedAddress = new Address();
  +        expectedPhone = new Phone();
  +        expectedAddress.setStreetNum(1);
  +        expectedAddress.setStreetName("University Drive");
  +        expectedAddress.setCity("West Lafayette");
  +        expectedAddress.setState("IN");
  +        expectedAddress.setZip(47907);
  +        expectedPhone.setAreaCode(765);
  +        expectedPhone.setExchange("494");
  +        expectedPhone.setNumber("4900");
  +        expectedAddress.setPhoneNumber(expectedPhone);
  +
  +        returnAddress = new Address();
  +        returnPhone = new Phone();
  +        returnAddress.setStreetNum(555);
  +        returnAddress.setStreetName("Monroe Street");
  +        returnAddress.setCity("Madison");
  +        returnAddress.setState("WI");
  +        returnAddress.setZip(54444);
  +        returnPhone.setAreaCode(999);
  +        returnPhone.setExchange("one");
  +        returnPhone.setNumber("two");
  +        returnAddress.setPhoneNumber(returnPhone);
  +    }
  +
       private String printAddress (Address ad) {
           String out;
           if (ad == null)
  @@ -50,12 +76,12 @@
           }
       }
   
  -    private Phone expectedPhone = new Phone (765, "494", "4900");
  -    private Address expectedAddress = new Address (1, "University Drive", "West 
Lafayette", "IN", 47907, expectedPhone);
  +    private Phone expectedPhone;
  +    private Address expectedAddress;
       private int expectedNumber = 99;
   
  -    private Phone returnPhone = new Phone (999, "one", "two");
  -    private Address returnAddress = new Address (555, "Monroe Street", "Madison", 
"WI", 54444, returnPhone);
  +    private Phone returnPhone;
  +    private Address returnAddress;
       private int returnNumber = 66;
   
       public void out0Inout0In0 () throws org.apache.axis.AxisFault, TestFailed
  
  
  
  1.6       +14 -5     xml-axis/java/test/wsdl/multithread/MultithreadTestCase.java
  
  Index: MultithreadTestCase.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/wsdl/multithread/MultithreadTestCase.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- MultithreadTestCase.java  20 Feb 2002 15:07:28 -0000      1.5
  +++ MultithreadTestCase.java  23 Feb 2002 00:48:28 -0000      1.6
  @@ -72,11 +72,20 @@
           public void run() {
               try {
                   for (int i = 0; i < 4; ++i) {
  -                    binding.addEntry(
  -                            "hi",
  -                            new Address(var++, "2", "3", StateType.TX, var++,
  -                            new Phone(11, "22", "33")));
  -                    Address address = binding.getAddressFromName("hi");
  +                    Address address = new Address();
  +                    Phone phone = new Phone();
  +                    address.setStreetNum(var++);
  +                    address.setStreetName("2");
  +                    address.setCity("3");
  +                    address.setState(StateType.TX);
  +                    address.setZip(var++);
  +                    phone.setAreaCode(11);
  +                    phone.setExchange("22");
  +                    phone.setNumber("33");
  +                    address.setPhoneNumber(phone);
  +                    
  +                    binding.addEntry("hi", address); 
  +                    Address addressRet = binding.getAddressFromName("hi");
                   }
               } catch (Throwable t) {
                   // There are bound to be connection refused exceptions when the
  
  
  
  1.4       +13 -5     
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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RoundtripTestServiceTestCase.java 20 Feb 2002 20:41:14 -0000      1.3
  +++ RoundtripTestServiceTestCase.java 23 Feb 2002 00:48:28 -0000      1.4
  @@ -202,8 +202,11 @@
           try {
   
               CallOptions[] callOptions = new CallOptions[2];
  -            callOptions[0] = new CallOptions(new Date(1013441507388L));
  -            callOptions[1] = new CallOptions(new Date(1013441507390L));
  +            callOptions[0] = new CallOptions();
  +            callOptions[0].setCallDate(new Date(1013441507388L));
  +            callOptions[1] = new CallOptions();
  +            callOptions[1].setCallDate(new Date(1013441507390L));
  +
               short[] shortArray = {(short) 30};
               byte[] byteArray = {(byte) 1};
               Short[] wrapperShortArray = {new Short((short) 23), new Short((short) 
56)};
  @@ -417,8 +420,11 @@
           try {
   
               CallOptions[] callOptions = new CallOptions[2];
  -            callOptions[0] = new CallOptions(new Date(1013441507388L));
  -            callOptions[1] = new CallOptions(new Date(1013441507390L));
  +            callOptions[0] = new CallOptions();
  +            callOptions[0].setCallDate(new Date(1013441507388L));
  +            callOptions[1] = new CallOptions();
  +            callOptions[1].setCallDate(new Date(1013441507390L));
  +
               short[] shortArray = {(short) 30};
               byte[] byteArray = {(byte) 1};
               Short[] wrapperShortArray = {new Short((short) 23), new Short((short) 
56)};
  @@ -882,7 +888,9 @@
   
           try {
               CallOptions[] callOptions = new CallOptions[1];
  -            callOptions[0] = new CallOptions(new Date(1013459984577L));
  +            callOptions[0] = new CallOptions();
  +            callOptions[0].setCallDate(new Date(1013459984577L));
  +
               CallOptions[] actual = binding.methodCallOptions(callOptions);
               assertEquals("The expected and actual values did not match.",
                            new Date(1013459984507L),
  
  
  
  1.4       +11 -5     
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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RoundtripTestSoapBindingImpl.java 22 Feb 2002 23:11:35 -0000      1.3
  +++ RoundtripTestSoapBindingImpl.java 23 Feb 2002 00:48:28 -0000      1.4
  @@ -119,8 +119,11 @@
           short[] shortArray = {(short) 36};
           byte[] byteArray = {(byte) 7};
           CallOptions[] callOptions = new CallOptions[2];
  -        callOptions[0] = new CallOptions(new Date(1013441507308L));
  -        callOptions[1] = new CallOptions(new Date(1013441507328L));
  +        callOptions[0] = new CallOptions();
  +        callOptions[0].setCallDate(new Date(1013441507308L));
  +        callOptions[1] = new CallOptions();
  +        callOptions[1].setCallDate(new Date(1013441507328L));
  +
           Short[] wrapperShortArray = {new Short((short) 33), new Short((short) 86)};
           Byte[] wrapperByteArray = {new Byte((byte) 4), new Byte((byte) 18)};
   
  @@ -191,8 +194,10 @@
           short[] shortArray = {(short) 36};
           byte[] byteArray = {(byte) 7};
           CallOptions[] callOptions = new CallOptions[2];
  -        callOptions[0] = new CallOptions(new Date(1013441507308L));
  -        callOptions[1] = new CallOptions(new Date(1013441507328L));
  +        callOptions[0] = new CallOptions();
  +        callOptions[0].setCallDate(new Date(1013441507308L));
  +        callOptions[1] = new CallOptions();
  +        callOptions[1].setCallDate(new Date(1013441507328L));
           Short[] wrapperShortArray = {new Short((short) 33), new Short((short) 86)};
           Byte[] wrapperByteArray = {new Byte((byte) 4), new Byte((byte) 18)};
   
  @@ -511,7 +516,8 @@
       public CallOptions[] methodCallOptions(CallOptions[] in0) throws 
RemoteException {
   
           if (in0[0].getCallDate().equals(new Date(1013459984577L))) {
  -            in0[0] = new CallOptions(new Date(1013459984507L));
  +            in0[0] = new CallOptions();
  +            in0[0].setCallDate(new Date(1013459984507L));
               return in0;
           } else {
               throw new RemoteException("Actual value did not match expected value.");
  
  
  
  1.10      +29 -16    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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- VerifyTestCase.java       22 Feb 2002 23:11:35 -0000      1.9
  +++ VerifyTestCase.java       23 Feb 2002 00:48:28 -0000      1.10
  @@ -181,7 +181,10 @@
           } catch (java.rmi.RemoteException re) {
               throw new junit.framework.AssertionFailedError("Remote Exception 
caught: " + re);
           }
  -        ComplexAll complexAll = new ComplexAll(512, "838", "4544");
  +        ComplexAll complexAll = new ComplexAll();
  +        complexAll.setAreaCode(512);
  +        complexAll.setExchange("838");
  +        complexAll.setNumber("4544");
           try {
               binding.complexAllIn(complexAll);
           } catch (java.rmi.RemoteException re) {
  @@ -198,7 +201,11 @@
           } catch (java.rmi.RemoteException re) {
               throw new junit.framework.AssertionFailedError("Remote Exception 
caught: " + re );
           }
  -        ComplexSequence complexSequence = new ComplexSequence(512, "838", "4544");
  +        ComplexSequence complexSequence = new ComplexSequence();
  +        complexSequence.setAreaCode(512);
  +        complexSequence.setExchange("838");
  +        complexSequence.setNumber("4544");
  +
           try {
               binding.complexSequenceIn(complexSequence);
           } catch (java.rmi.RemoteException re) {
  @@ -217,19 +224,24 @@
           }
           String[] strValue = new String[] {"abc", "def"};
           String[][] optArray = new String[][] {strValue};
  -        ElemWComplex elemWComplex = new ElemWComplex(
  -                "one",
  -                new QName[] {new QName("two")},
  -                new Enum[] {Enum.three},
  -                EnumString.value1,
  -                EnumInt.value1,
  -                EnumLong.value2,
  -                EnumFloat.value3,
  -                EnumDouble.value3,
  -                EnumShort.value2,
  -                EnumByte.value1,
  -                new B(new A(3)),
  -                optArray );
  +        B b = new B();
  +        A a = new A();
  +        a.setC(3);
  +        b.setD(a);
  +        ElemWComplex elemWComplex = new ElemWComplex();
  +
  +        elemWComplex.setOne( "one");
  +        elemWComplex.setTwo( new QName[] {new QName("two")});
  +        elemWComplex.setThree( new Enum[] {Enum.three});
  +        elemWComplex.setEnum1( EnumString.value1);
  +        elemWComplex.setEnum2( EnumInt.value1);
  +        elemWComplex.setEnum3( EnumLong.value2);
  +        elemWComplex.setEnum4( EnumFloat.value3);
  +        elemWComplex.setEnum5( EnumDouble.value3);
  +        elemWComplex.setEnum6( EnumShort.value2);
  +        elemWComplex.setEnum7( EnumByte.value1);
  +        elemWComplex.setNested( b);
  +        elemWComplex.setOptArray( optArray );
           try {
               binding.elemWComplexIn(elemWComplex);
           } catch (java.rmi.RemoteException re) {
  @@ -288,7 +300,8 @@
           } catch (java.rmi.RemoteException re) {
               throw new junit.framework.AssertionFailedError("Remote Exception 
caught: " + re );
           }
  -        Cat cat = new Cat("meow");
  +        Cat cat = new Cat();
  +        cat.setPurr("meow");
           try {
               binding.animalIn(cat);
           } catch (java.rmi.RemoteException re) {
  
  
  


Reply via email to