You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlbeans-cvs@xml.apache.org by da...@apache.org on 2003/10/29 21:32:03 UTC

cvs commit: xml-xmlbeans/v2/test/src/drt/drtcases BindingTests.java SmokeTests.java

davidbau    2003/10/29 12:32:03

  Modified:    v2/src/binding/org/apache/xmlbeans/impl/binding/compile
                        JAXRPCSchemaBinder.java JavaCodeGenerator.java
               v2/src/configschema/schema binding-config.xsd
               v2/test/src/drt/drtcases BindingTests.java SmokeTests.java
  Added:       v2/src/binding/org/apache/xmlbeans/impl/binding/compile
                        JavaToSchemaInput.java JavaToSchemaResult.java
                        SchemaGenerator.java SchemaToJavaInput.java
                        TylarLoader.java
  Log:
  Added "[JavaToSchema/SchemaToJava][Input/Result]" interfaces, as well as
  a TylarLoader interface.  No implementations or usages yet.
  
  Also fixed up some comments and incorporated by simple binding tests
  into the "ant drt" target.
  
  Code reviewed by: pcal
  Regression tests: passed
  
  Revision  Changes    Path
  1.3       +24 -24    xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/JAXRPCSchemaBinder.java
  
  Index: JAXRPCSchemaBinder.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/JAXRPCSchemaBinder.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JAXRPCSchemaBinder.java	28 Oct 2003 17:51:27 -0000	1.2
  +++ JAXRPCSchemaBinder.java	29 Oct 2003 20:32:03 -0000	1.3
  @@ -130,31 +130,30 @@
           return binder;
       }
       
  -    // build up four lists:
  -    // 1. types <-> java classes
  -    // 2. elements -> java classes
  -    // 3. attributes -> java classes
  -    // 4. java classes -> elements (may not be unique)
  -    
  -    // each complex type turns into a by-name-strucutre
  -    // each simple type turns into a simple-type-mapping
  -    // each element turns into a delegated-element-binding
  -    // each attribute turns into a delegated-attribute-binding
  -    
  -    // javaclass -> element entered only if unique, otherwise warning
  -    
  -    // each entry is:
  -    // 1. created
  -    // 2. resolved (properties figured out etc)
  -    // creation can happen at any time
  -    // resolution must occur after the base type is resolved
  -    
  +    /**
  +     * Computes the binding.
  +     */ 
       private void bind()
       {
  -        // create a scratch area for every type AND SOAP Array
  +        // Every type or global element or global attribute is dropped into
  +        // one of a number of categories.  (See Scratch constants.)
  +        //
  +        // Based on the category, a java class is either defined or found
  +        // that maches with the schema type.
  +        //
  +        // The phases work as follows:
  +        //
  +        // 1. categorize and allocate Scratches
  +        // 2. write or find java names for each xml type
  +        // 3. allocate binding types for each scratch (done in the same pass as 2)
  +        // 4. fill in the java getter/setter structure of any complex types
  +        
  +        
  +        // 1. categorize and allocate Scratches
           createScratchArea();
           
  -        // resolve or generate all names of java classes
  +        // 2. write or find java names for each xml type
  +        // 3. allocate binding types for each scratch (done in the same pass as 2)
           for (Iterator i = scratchIterator(); i.hasNext(); )
           {
               Scratch scratch = (Scratch)i.next(); 
  @@ -162,7 +161,7 @@
               createBindingType(scratch);
           }
           
  -        // resolve or generate all java structure
  +        // 4. fill in the java getter/setter structure of any complex types
           for (Iterator i = scratchIterator(); i.hasNext(); )
           {
               resolveJavaStructure((Scratch)i.next());
  @@ -362,8 +361,9 @@
   
       /**
        * Now we resolve the structural aspects (property names) for each
  -     * scratch.  Notice that we only process
  -     * @param scratch
  +     * scratch.
  +     * 
  +     * todo: understand how we want inheritance to work
        */ 
       private void resolveJavaStructure(Scratch scratch)
       {
  
  
  
  1.2       +3 -1      xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/JavaCodeGenerator.java
  
  Index: JavaCodeGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/JavaCodeGenerator.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JavaCodeGenerator.java	27 Oct 2003 19:17:21 -0000	1.1
  +++ JavaCodeGenerator.java	29 Oct 2003 20:32:03 -0000	1.2
  @@ -62,7 +62,9 @@
   
   public interface JavaCodeGenerator
   {
  -    // returns a collection of fully-qualified Java class name strings
  +    /**
  +     * Returns a collection of fully-qualified Java class name strings
  +     */
       Collection getToplevelClasses();
       
       /**
  
  
  
  1.1                  xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/JavaToSchemaInput.java
  
  Index: JavaToSchemaInput.java
  ===================================================================
  /*
  * The Apache Software License, Version 1.1
  *
  *
  * Copyright (c) 2003 The Apache Software Foundation.  All rights
  * reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  *
  * 1. Redistributions of source code must retain the above copyright
  *    notice, this list of conditions and the following disclaimer.
  *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
  *
  * 3. The end-user documentation included with the redistribution,
  *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
  *
  * 4. The names "Apache" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
  *    software without prior written permission. For written
  *    permission, please contact apache@apache.org.
  *
  * 5. Products derived from this software may not be called "Apache
  *    XMLBeans", nor may "Apache" appear in their name, without prior
  *    written permission of the Apache Software Foundation.
  *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
  *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation and was
  * originally based on software copyright (c) 2003 BEA Systems
  * Inc., <http://www.bea.com/>. For more information on the Apache Software
  * Foundation, please see <http://www.apache.org/>.
  */
  
  package org.apache.xmlbeans.impl.binding.compile;
  
  public interface JavaToSchemaInput
  {
      /**
       * Returns a something that represents a set of JClasses that
       * are to be processed for binding. (??)
       */ 
      // JClassSet getJClassSet();
      
      /**
       * Returns the path used for resolving already-known bindings
       */
      TylarLoader getTylarLoader();
      
  }
  
  
  
  1.1                  xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/JavaToSchemaResult.java
  
  Index: JavaToSchemaResult.java
  ===================================================================
  /*
  * The Apache Software License, Version 1.1
  *
  *
  * Copyright (c) 2003 The Apache Software Foundation.  All rights
  * reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  *
  * 1. Redistributions of source code must retain the above copyright
  *    notice, this list of conditions and the following disclaimer.
  *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
  *
  * 3. The end-user documentation included with the redistribution,
  *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
  *
  * 4. The names "Apache" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
  *    software without prior written permission. For written
  *    permission, please contact apache@apache.org.
  *
  * 5. Products derived from this software may not be called "Apache
  *    XMLBeans", nor may "Apache" appear in their name, without prior
  *    written permission of the Apache Software Foundation.
  *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
  *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation and was
  * originally based on software copyright (c) 2003 BEA Systems
  * Inc., <http://www.bea.com/>. For more information on the Apache Software
  * Foundation, please see <http://www.apache.org/>.
  */
  
  package org.apache.xmlbeans.impl.binding.compile;
  
  public interface JavaToSchemaResult
  {
      BindingFileGenerator getBindingFileGenerator();
      SchemaGenerator getSchemaGenerator();
  }
  
  
  
  1.1                  xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/SchemaGenerator.java
  
  Index: SchemaGenerator.java
  ===================================================================
  /*
  * The Apache Software License, Version 1.1
  *
  *
  * Copyright (c) 2003 The Apache Software Foundation.  All rights
  * reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  *
  * 1. Redistributions of source code must retain the above copyright
  *    notice, this list of conditions and the following disclaimer.
  *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
  *
  * 3. The end-user documentation included with the redistribution,
  *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
  *
  * 4. The names "Apache" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
  *    software without prior written permission. For written
  *    permission, please contact apache@apache.org.
  *
  * 5. Products derived from this software may not be called "Apache
  *    XMLBeans", nor may "Apache" appear in their name, without prior
  *    written permission of the Apache Software Foundation.
  *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
  *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation and was
  * originally based on software copyright (c) 2003 BEA Systems
  * Inc., <http://www.bea.com/>. For more information on the Apache Software
  * Foundation, please see <http://www.apache.org/>.
  */
  
  package org.apache.xmlbeans.impl.binding.compile;
  
  import java.util.Collection;
  import java.io.OutputStream;
  import java.io.IOException;
  
  public interface SchemaGenerator
  {
      /**
       * Returns a collection of targetNamespace URIs as Strings.
       */
      Collection getTargetNamespaces();
      
      /**
       * Prints the .xsd source code for the given target namespace.
       * 
       * Note for internationalization: utf-8 is always used for the
       * given OutputStream.
       */ 
      void printSchema(String targetNamespace, OutputStream output) throws IOException;
      
      // consider: maybe returning generated schemas in some other form?
  }
  
  
  
  1.1                  xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/SchemaToJavaInput.java
  
  Index: SchemaToJavaInput.java
  ===================================================================
  /*
  * The Apache Software License, Version 1.1
  *
  *
  * Copyright (c) 2003 The Apache Software Foundation.  All rights
  * reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  *
  * 1. Redistributions of source code must retain the above copyright
  *    notice, this list of conditions and the following disclaimer.
  *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
  *
  * 3. The end-user documentation included with the redistribution,
  *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
  *
  * 4. The names "Apache" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
  *    software without prior written permission. For written
  *    permission, please contact apache@apache.org.
  *
  * 5. Products derived from this software may not be called "Apache
  *    XMLBeans", nor may "Apache" appear in their name, without prior
  *    written permission of the Apache Software Foundation.
  *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
  *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation and was
  * originally based on software copyright (c) 2003 BEA Systems
  * Inc., <http://www.bea.com/>. For more information on the Apache Software
  * Foundation, please see <http://www.apache.org/>.
  */
  
  package org.apache.xmlbeans.impl.binding.compile;
  
  import org.apache.xmlbeans.SchemaTypeSystem;
  
  public interface SchemaToJavaInput
  {
      /**
       * Returns a typesystem that contains all the schema types to be
       * converted to or bound to Java.
       */ 
      SchemaTypeSystem getSchemaTypeSystem();
      
      /**
       * Returns the path used for resolving already-known bindings
       */
      TylarLoader getTylarLoader();
  }
  
  
  
  1.1                  xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/TylarLoader.java
  
  Index: TylarLoader.java
  ===================================================================
  /*
  * The Apache Software License, Version 1.1
  *
  *
  * Copyright (c) 2003 The Apache Software Foundation.  All rights
  * reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  *
  * 1. Redistributions of source code must retain the above copyright
  *    notice, this list of conditions and the following disclaimer.
  *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
  *
  * 3. The end-user documentation included with the redistribution,
  *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
  *
  * 4. The names "Apache" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
  *    software without prior written permission. For written
  *    permission, please contact apache@apache.org.
  *
  * 5. Products derived from this software may not be called "Apache
  *    XMLBeans", nor may "Apache" appear in their name, without prior
  *    written permission of the Apache Software Foundation.
  *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
  *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation and was
  * originally based on software copyright (c) 2003 BEA Systems
  * Inc., <http://www.bea.com/>. For more information on the Apache Software
  * Foundation, please see <http://www.apache.org/>.
  */
  
  package org.apache.xmlbeans.impl.binding.compile;
  
  import org.apache.xmlbeans.impl.jam.JClassLoader;
  import org.apache.xmlbeans.impl.binding.bts.BindingLoader;
  import org.apache.xmlbeans.SchemaTypeLoader;
  
  /**
   * Represents a path on which:
   * <pre>
   * (1) Binding metadata can be loaded
   * (2) Metadata about the bound java classes can be loaded
   * (3) Metadata about the bound schema components can be loaded
   * </pre>
   * 
   * This tylarLoader concept is used at both compiletime and runtime.
   * At compiletime, it is used to provide java/schema/binding type
   * information to link against.  At runtime, it is used to provide
   * the complete java/schema/binding type information to marshal
   * with.
   */ 
  public interface TylarLoader
  {
      BindingLoader getBindingLoader();
      JClassLoader getJClassLoader();
      SchemaTypeLoader getSchemaTypeLoader();
  }
  
  
  
  1.5       +0 -1      xml-xmlbeans/v2/src/configschema/schema/binding-config.xsd
  
  Index: binding-config.xsd
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/configschema/schema/binding-config.xsd,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- binding-config.xsd	28 Oct 2003 17:51:27 -0000	1.4
  +++ binding-config.xsd	29 Oct 2003 20:32:03 -0000	1.5
  @@ -40,7 +40,6 @@
       <xs:sequence>
         <xs:element name="xmlcomponent" type="tns:xml-signature"/>
         <xs:element name="javatype" type="tns:java-class-name"/>
  -      <xs:element name="xmlobj" type="xs:boolean"/>
         <!-- todo: maybe more java info, e.g., instanceType, is-interface, is-xmlobj etc? -->
       </xs:sequence>
     </xs:complexType>
  
  
  
  1.7       +14 -7     xml-xmlbeans/v2/test/src/drt/drtcases/BindingTests.java
  
  Index: BindingTests.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/test/src/drt/drtcases/BindingTests.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- BindingTests.java	28 Oct 2003 17:51:27 -0000	1.6
  +++ BindingTests.java	29 Oct 2003 20:32:03 -0000	1.7
  @@ -38,22 +38,28 @@
       public BindingTests(String name) { super(name); }
       public static Test suite() { return new TestSuite(BindingTests.class); }
       
  +    public static boolean verbose = false;
  +    
       public void testJAXRPCBinding() throws Exception
       {
           File typesonlyfile = TestEnv.xbeanCase("schema/typesonly/typesonly.xsd");
           SchemaTypeSystem sts = XmlBeans.compileXsd(new XmlObject[] { SchemaDocument.Factory.parse(typesonlyfile) }, XmlBeans.getBuiltinTypeSystem(), null);
           SchemaToJavaResult result = JAXRPCSchemaBinder.bind(sts, BuiltinBindingLoader.getInstance());
  -        result.getBindingFileGenerator().printBindingFile(System.out);
  +        if (verbose)
  +            result.getBindingFileGenerator().printBindingFile(System.out);
           JavaCodeGenerator javacode = result.getJavaCodeGenerator();
           for (Iterator i = javacode.getToplevelClasses().iterator(); i.hasNext(); )
           {
               String javaclass = (String)i.next();
  -            System.out.println("=======================");
  -            System.out.println(javaclass);
  -            System.out.println("=======================");
  -            javacode.printSourceCode(javaclass, System.out);
  +            if (verbose)
  +            {
  +                System.out.println("=======================");
  +                System.out.println(javaclass);
  +                System.out.println("=======================");
  +                javacode.printSourceCode(javaclass, System.out);
  +                System.out.flush();
  +            }
           }
  -        System.out.flush();
       }
   
       public void testBindingFile() throws Exception
  @@ -116,7 +122,8 @@
   
           // now serialize
           BindingConfigDocument doc = bf.write();
  -        System.out.println(doc.toString());
  +        if (verbose)
  +            System.out.println(doc.toString());
   
           // now load
           BindingFile bfc = BindingFile.forDoc(doc);
  
  
  
  1.2       +1 -0      xml-xmlbeans/v2/test/src/drt/drtcases/SmokeTests.java
  
  Index: SmokeTests.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/test/src/drt/drtcases/SmokeTests.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SmokeTests.java	26 Sep 2003 21:23:40 -0000	1.1
  +++ SmokeTests.java	29 Oct 2003 20:32:03 -0000	1.2
  @@ -85,6 +85,7 @@
           suite.addTest(DomTests.suite());
           suite.addTest(GDateTests.suite());
           suite.addTest(SubstGroupTests.suite());
  +        suite.addTest(BindingTests.suite());
           return suite;
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xmlbeans-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-cvs-help@xml.apache.org