axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/wsdl/test Wsdl2javaTestSuite.java Wsdl2javaTestSuite.list
Date Mon, 22 Oct 2001 13:35:21 GMT
dims        01/10/22 06:35:21

  Modified:    java/src/org/apache/axis/wsdl Emitter.java
               java/src/org/apache/axis/wsdl/test Wsdl2javaTestSuite.java
                        Wsdl2javaTestSuite.list
  Log:
  Added the first Interop test from Whitemesa: http://www.whitemesa.com/interop/InteropTest.wsdl
  
  Revision  Changes    Path
  1.72      +35 -26    xml-axis/java/src/org/apache/axis/wsdl/Emitter.java
  
  Index: Emitter.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/Emitter.java,v
  retrieving revision 1.71
  retrieving revision 1.72
  diff -u -r1.71 -r1.72
  --- Emitter.java	2001/10/20 09:05:30	1.71
  +++ Emitter.java	2001/10/22 13:35:20	1.72
  @@ -508,7 +508,7 @@
   
           this.fileList.add(packageDirName + fileName);
   
  -        if (packageName == null) {
  +        if (packageName == null||packageName.trim().length()==0) {
               this.classList.add(nameValue);
           } else {
               this.classList.add(packageName + "." + nameValue);
  @@ -546,7 +546,7 @@
   
           this.fileList.add(packageDirName + fileName);
   
  -        if (packageName == null) {
  +        if (packageName == null||packageName.trim().length()==0) {
               this.classList.add(nameValue);
           } else {
               this.classList.add(packageName + "." + nameValue);
  @@ -929,7 +929,7 @@
           String fileName = exceptionName + ".java";
   
           // check to make sure we haven't already emitted this fault
  -        if (packageName == null) {
  +        if (packageName == null||packageName.trim().length()==0) {
               if ( this.classList.contains(exceptionName) ) {
                   return exceptionName;
               }
  @@ -941,7 +941,7 @@
   
           this.fileList.add(packageDirName + fileName);
   
  -        if (packageName == null) {
  +        if (packageName == null||packageName.trim().length()==0) {
               this.classList.add(exceptionName);
           } else {
               this.classList.add(packageName + "." + exceptionName);
  @@ -1026,7 +1026,7 @@
   
           this.fileList.add(packageDirName + stubFileName);
   
  -        if (packageName == null) {
  +        if (packageName == null||packageName.trim().length()==0) {
               this.classList.add(stubName);
           } else {
               this.classList.add(packageName + "." + stubName);
  @@ -1113,7 +1113,7 @@
   
               this.fileList.add(packageDirName + skelFileName);
   
  -            if (packageName == null) {
  +            if (packageName == null||packageName.trim().length()==0) {
                   this.classList.add(skelName);
               } else {
                   this.classList.add(packageName + "." + skelName);
  @@ -1146,7 +1146,7 @@
   
               this.fileList.add(packageDirName + implFileName);
   
  -            if (packageName == null) {
  +            if (packageName == null||packageName.trim().length()==0) {
                   this.classList.add(implName);
               } else {
                   this.classList.add(packageName + "." + implName);
  @@ -1516,7 +1516,7 @@
   
           this.fileList.add(packageDirName + fileName);
   
  -        if (packageName == null) {
  +        if (packageName == null||packageName.trim().length()==0) {
               this.classList.add(serviceName);
           } else {
               this.classList.add(packageName + "." + serviceName);
  @@ -1535,7 +1535,7 @@
   
               this.fileList.add(packageDirName + testCaseFileName);
   
  -            if (packageName == null) {
  +            if (packageName == null||packageName.trim().length()==0) {
                   this.classList.add(testCase);
               } else {
                   this.classList.add(packageName + "." + testCase);
  @@ -1669,14 +1669,20 @@
       private void writeDeploymentXML() {
           try {
               PrintWriter deployPW = printWriter("deploy.xml");
  -            this.fileList.add(packageDirName + "deploy.xml");
  +            if(packageDirName == null || packageDirName.trim().length()==0)
  +                this.fileList.add("deploy.xml");
  +            else
  +                this.fileList.add(packageDirName + "deploy.xml");
   
               if (bVerbose) {
                   System.out.println("Generating deployment document: deploy.xml");
               }
               initializeDeploymentDoc(deployPW, "deploy");
               PrintWriter undeployPW = printWriter("undeploy.xml");
  -            this.fileList.add(packageDirName + "undeploy.xml");
  +            if(packageDirName == null || packageDirName.trim().length()==0)
  +                this.fileList.add("undeploy.xml");
  +            else
  +                this.fileList.add(packageDirName + "undeploy.xml");
   
               if (bVerbose) {
                   System.out.println("Generating deployment document: undeploy.xml");
  @@ -1811,7 +1817,7 @@
        * Write out deployment instructions for given WSDL binding
        */
       private void writeDeployBinding(PrintWriter deployPW, Binding binding) throws IOException
{
  -        if (packageName == null) {
  +        if (packageName == null||packageName.trim().length()==0) {
               deployPW.println("      <option name=\"className\" value=\""
                                + binding.getQName().getLocalPart() + "Skeleton" + "\"/>");
           }
  @@ -1896,15 +1902,15 @@
           }
   
           String javaName = type.getJavaLocalName();
  -
           String fileName = javaName + ".java";
  -
  -        this.fileList.add(packageDirName + fileName);
   
  -       if (packageName == null) {
  +       if (type.getJavaPackageName() == null||type.getJavaPackageName().trim().length()==0)
{
              this.classList.add(javaName);
  +           this.fileList.add(fileName);
          } else {
  -           this.classList.add(type.getJavaPackageName() + "." + javaName);
  +           String complexJavaName = type.getJavaPackageName() + "." + javaName; 
  +           this.classList.add(complexJavaName);
  +           this.fileList.add(complexJavaName.replace('.','/')+".java");
          }
           PrintWriter typePW = printWriter(fileName, type.getJavaPackageName());
   
  @@ -1983,12 +1989,14 @@
           String javaName = eType.getJavaLocalName();
   
           String fileName = javaName + ".java";
  -        this.fileList.add(packageDirName + fileName);
   
  -       if (packageName == null) {
  +       if (eType.getJavaPackageName() == null||eType.getJavaPackageName().trim().length()==0)
{
              this.classList.add(javaName);
  +           this.fileList.add(fileName);
          } else {
  -           this.classList.add(eType.getJavaPackageName() + "." + javaName);
  +           String enumJavaName = eType.getJavaPackageName() + "." + javaName;
  +           this.classList.add(enumJavaName);
  +           this.fileList.add(enumJavaName.replace('.','/')+".java");
          }
   
           PrintWriter typePW = printWriter(fileName, eType.getJavaPackageName());
  @@ -2014,13 +2022,14 @@
           String javaName = type.getJavaLocalName();
   
           String fileName = javaName + "Holder.java";
  -
  -        this.fileList.add(packageDirName + fileName);
   
  -        if (packageName == null) {
  -            this.classList.add(javaName);
  +        if (type.getJavaPackageName() == null||type.getJavaPackageName().trim().length()==0)
{
  +            this.classList.add(javaName + "Holder");
  +            this.fileList.add(javaName + "Holder.java");
           } else {
  -            this.classList.add(type.getJavaPackageName() + "." + javaName + "Holder");
  +            String holderJavaName = type.getJavaPackageName() + "." + javaName + "Holder";

  +            this.classList.add(holderJavaName);
  +            this.fileList.add(holderJavaName.replace('.','/')+".java");
           }
   
           PrintWriter pw = printWriter(fileName, type.getJavaPackageName());
  @@ -2251,7 +2260,7 @@
   
           // print package declaration
           if (pkgName == null) {
  -          if (packageName != null) {
  +          if (packageName != null && packageName.trim().length()>0) {
                 pw.println("package " + packageName + ";");
                 pw.println();
             }
  
  
  
  1.20      +23 -11    xml-axis/java/src/org/apache/axis/wsdl/test/Wsdl2javaTestSuite.java
  
  Index: Wsdl2javaTestSuite.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/test/Wsdl2javaTestSuite.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- Wsdl2javaTestSuite.java	2001/10/18 14:36:59	1.19
  +++ Wsdl2javaTestSuite.java	2001/10/22 13:35:21	1.20
  @@ -62,6 +62,7 @@
   import org.apache.axis.utils.AxisClassLoader;
   import org.apache.axis.utils.Options;
   import org.apache.axis.wsdl.Emitter;
  +import org.apache.axis.wsdl.Utils;
   import org.apache.tools.ant.Location;
   import org.apache.tools.ant.Project;
   import org.apache.tools.ant.Target;
  @@ -192,7 +193,8 @@
                   int testNum = 0;
                   while (curLine != null) {
                       curLine = curLine.trim();
  -                    if ( "".equals(curLine) ) {
  +                    // Skip empty lines or ones that start with #
  +                    if ( "".equals(curLine) || curLine.charAt(0)=='#') {
                           curLine = reader.readLine();
                           continue;
                       }
  @@ -239,10 +241,15 @@
        * testNum appended to it.  We also enablt skeleton generation and testcase generation.
 We also turn on verbosity.
        */
       protected void prepareTest(String fileName, int testNum) throws Exception {
  -        String packageName = fileName.replace('/', '.');
           Emitter wsdl2java = new Emitter();
  -        packageName = packageName.substring(0, fileName.lastIndexOf('/'));
  -        wsdl2java.setPackageName(packageName);
  +        String packageName = "";
  +        packageName = fileName;
  +        if(packageName.indexOf(":/")!=-1){
  +            packageName = packageName.substring(packageName.indexOf(":/")+2);
  +        }
  +        packageName = packageName.substring(0, packageName.lastIndexOf('/'));
  +        packageName = packageName.replace('/', '.');
  +        wsdl2java.setPackageName(Utils.makePackageName(packageName));
           wsdl2java.generatePackageName(true);
           wsdl2java.setOutputDir(Wsdl2javaTestSuite.WORK_DIR);
           wsdl2java.generateSkeleton(true);
  @@ -311,12 +318,12 @@
        */
       public void run(TestResult result) {
           // Get the SimpleAxisServer running--using the default port.
  -        System.out.println("Starting test http server.");
           SimpleAxisServer server = new SimpleAxisServer();
   
           try {
               Options opts = new Options(new String[]{});
               int port = opts.getPort();
  +            System.out.println("Starting test http server at port " + port);
               ServerSocket ss = new ServerSocket(port);
               server.setServerSocket(ss);
               Thread serverThread = new Thread(server);
  @@ -335,10 +342,13 @@
                       if (fileName.endsWith(File.separator + "deploy.xml")) {
                           deploy = fileName;
                       }
  +                }
  +                
  +                if(deploy != null){
  +                    // Perform actual deployment
  +                    String[] args = new String[] { Wsdl2javaTestSuite.WORK_DIR + deploy
};
  +                    AdminClient.main(args);
                   }
  -                // Perform actual deployment
  -                String[] args = new String[] { Wsdl2javaTestSuite.WORK_DIR + deploy };
  -                AdminClient.main(args);
               }
   
               //AdminClient.main(new String[] {"list"});
  @@ -357,10 +367,12 @@
                       if (fileName.endsWith(File.separator + "undeploy.xml")) {
                           undeploy = fileName;
                       }
  +                }
  +                if(undeploy != null) {
  +                    // Perform actual undeployment
  +                    String[] args = new String[] { Wsdl2javaTestSuite.WORK_DIR + undeploy
};
  +                    AdminClient.main(args);
                   }
  -                // Perform actual undeployment
  -                String[] args = new String[] { Wsdl2javaTestSuite.WORK_DIR + undeploy };
  -                AdminClient.main(args);
               }
   
               //AdminClient.main(new String[] {"list"});
  
  
  
  1.4       +5 -1      xml-axis/java/src/org/apache/axis/wsdl/test/Wsdl2javaTestSuite.list
  
  Index: Wsdl2javaTestSuite.list
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/test/Wsdl2javaTestSuite.list,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Wsdl2javaTestSuite.list	2001/10/17 17:57:48	1.3
  +++ Wsdl2javaTestSuite.list	2001/10/22 13:35:21	1.4
  @@ -1,2 +1,6 @@
   samples/addr/AddressBook.wsdl
  -test/inout/inout.wsdl
  \ No newline at end of file
  +test/inout/inout.wsdl
  +http://www.whitemesa.com/interop/InteropTest.wsdl
  +#http://www.whitemesa.com/interop/InteropTestB.wsdl
  +#http://www.whitemesa.com/interop/InteropTestC.wsdl
  +#http://www.whitemesa.net/wsdl/std/echoheadersvc.wsdl
  \ No newline at end of file
  
  
  

Mime
View raw message