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


git-svn-id: https://svn.apache.org/repos/asf/xmlbeans/trunk@110214 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/JAXRPCSchemaBinder.java b/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/JAXRPCSchemaBinder.java
index 7101432..6c2e9ad 100644
--- a/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/JAXRPCSchemaBinder.java
+++ b/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/JAXRPCSchemaBinder.java
@@ -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)
     {
diff --git a/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/JavaCodeGenerator.java b/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/JavaCodeGenerator.java
index 0cb6b43..21b0ee6 100644
--- a/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/JavaCodeGenerator.java
+++ b/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/JavaCodeGenerator.java
@@ -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();
     
     /**
diff --git a/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/JavaToSchemaInput.java b/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/JavaToSchemaInput.java
new file mode 100644
index 0000000..2b06088
--- /dev/null
+++ b/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/JavaToSchemaInput.java
@@ -0,0 +1,72 @@
+/*
+* 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();
+    
+}
diff --git a/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/JavaToSchemaResult.java b/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/JavaToSchemaResult.java
new file mode 100644
index 0000000..0e7cac8
--- /dev/null
+++ b/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/JavaToSchemaResult.java
@@ -0,0 +1,63 @@
+/*
+* 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();
+}
diff --git a/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/SchemaGenerator.java b/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/SchemaGenerator.java
new file mode 100644
index 0000000..22b2302
--- /dev/null
+++ b/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/SchemaGenerator.java
@@ -0,0 +1,79 @@
+/*
+* 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?
+}
diff --git a/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/SchemaToJavaInput.java b/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/SchemaToJavaInput.java
new file mode 100644
index 0000000..d82a94c
--- /dev/null
+++ b/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/SchemaToJavaInput.java
@@ -0,0 +1,73 @@
+/*
+* 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();
+}
diff --git a/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/TylarLoader.java b/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/TylarLoader.java
new file mode 100644
index 0000000..ff27626
--- /dev/null
+++ b/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/TylarLoader.java
@@ -0,0 +1,82 @@
+/*
+* 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();
+}
diff --git a/v2/src/configschema/schema/binding-config.xsd b/v2/src/configschema/schema/binding-config.xsd
index 3ef5a72..21f1736 100644
--- a/v2/src/configschema/schema/binding-config.xsd
+++ b/v2/src/configschema/schema/binding-config.xsd
@@ -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>
diff --git a/v2/test/src/drt/drtcases/BindingTests.java b/v2/test/src/drt/drtcases/BindingTests.java
index 8796231..af650b4 100644
--- a/v2/test/src/drt/drtcases/BindingTests.java
+++ b/v2/test/src/drt/drtcases/BindingTests.java
@@ -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);
diff --git a/v2/test/src/drt/drtcases/SmokeTests.java b/v2/test/src/drt/drtcases/SmokeTests.java
index cc5d8fb..003746f 100644
--- a/v2/test/src/drt/drtcases/SmokeTests.java
+++ b/v2/test/src/drt/drtcases/SmokeTests.java
@@ -85,6 +85,7 @@
         suite.addTest(DomTests.suite());
         suite.addTest(GDateTests.suite());
         suite.addTest(SubstGroupTests.suite());
+        suite.addTest(BindingTests.suite());
         return suite;
     }
 }