xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From z...@apache.org
Subject cvs commit: xml-xmlbeans/v2/test/src/drt/drtcases BindingTests.java
Date Thu, 22 Apr 2004 17:27:07 GMT
zieg        2004/04/22 10:27:07

  Modified:    v2/src/binding/org/apache/xmlbeans/impl/binding/compile
                        Java2Schema.java
               v2/test/src/drt/drtcases BindingTests.java
  Log:
  fix bug in java2schema that was preventing the isSet annotation from
  being honored
  
  Revision  Changes    Path
  1.52      +5 -4      xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/Java2Schema.java
  
  Index: Java2Schema.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/Java2Schema.java,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- Java2Schema.java	20 Apr 2004 07:01:14 -0000	1.51
  +++ Java2Schema.java	22 Apr 2004 17:27:06 -0000	1.52
  @@ -325,15 +325,16 @@
         }
         String propName;
         { // determine the property name to use and set it
  -        propName = getAnnotation(props[i],TAG_AT_NAME,null);
  +        propName = getAnnotation(props[i], TAG_AT_NAME, null);
           if (propName != null) {
             facade.newAttributeProperty(props[i]);
  -          facade.setSchemaName(propName);
           } else {
             facade.newElementProperty(props[i]);
  -          facade.setSchemaName(getAnnotation
  -                         (props[i],TAG_EL_NAME,props[i].getSimpleName()));
  +          propName = getAnnotation(props[i], TAG_EL_NAME,
  +                                   props[i].getSimpleName());
           }
  +        assert propName != null;
  +        facade.setSchemaName(propName);
         }
         { // determine the property type to use and set it
           JClass propType = null;
  
  
  
  1.22      +54 -5     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.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- BindingTests.java	8 Apr 2004 20:01:01 -0000	1.21
  +++ BindingTests.java	22 Apr 2004 17:27:06 -0000	1.22
  @@ -19,19 +19,33 @@
   import junit.framework.Test;
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
  -import org.apache.xmlbeans.impl.binding.bts.*;
  +import org.apache.xml.xmlbeans.bindingConfig.BindingConfigDocument;
   import org.apache.xmlbeans.SchemaTypeSystem;
  -import org.apache.xmlbeans.impl.binding.compile.Schema2Java;
  +import org.apache.xmlbeans.impl.binding.bts.BindingFile;
  +import org.apache.xmlbeans.impl.binding.bts.BindingLoader;
  +import org.apache.xmlbeans.impl.binding.bts.BindingType;
  +import org.apache.xmlbeans.impl.binding.bts.BindingTypeName;
  +import org.apache.xmlbeans.impl.binding.bts.BuiltinBindingLoader;
  +import org.apache.xmlbeans.impl.binding.bts.ByNameBean;
  +import org.apache.xmlbeans.impl.binding.bts.CompositeBindingLoader;
  +import org.apache.xmlbeans.impl.binding.bts.JavaTypeName;
  +import org.apache.xmlbeans.impl.binding.bts.MethodName;
  +import org.apache.xmlbeans.impl.binding.bts.QNameProperty;
  +import org.apache.xmlbeans.impl.binding.bts.SimpleBindingType;
  +import org.apache.xmlbeans.impl.binding.bts.XmlTypeName;
   import org.apache.xmlbeans.impl.binding.compile.BindingCompilerTask;
  +import org.apache.xmlbeans.impl.binding.compile.Schema2Java;
  +import org.apache.xmlbeans.impl.binding.joust.JavaOutputStream;
   import org.apache.xmlbeans.impl.binding.joust.SourceJavaOutputStream;
   import org.apache.xmlbeans.impl.binding.joust.WriterFactory;
  -import org.apache.xmlbeans.impl.binding.joust.JavaOutputStream;
   import org.apache.xmlbeans.impl.binding.tylar.TylarWriter;
  -import org.apache.xml.xmlbeans.bindingConfig.BindingConfigDocument;
   import org.w3.x2001.xmlSchema.SchemaDocument;
   
   import javax.xml.namespace.QName;
  -import java.io.*;
  +import java.io.File;
  +import java.io.IOException;
  +import java.io.PrintWriter;
  +import java.io.Writer;
   
   public class BindingTests extends TestCase
   {
  @@ -71,6 +85,41 @@
           // to test later
           //SimpleSchemaToJavaResultCompiler.compile(result, params);
       }
  +//
  +//    public void testIsSetAnnotation()
  +//        throws Exception
  +//    {
  +//        final File sourcefile =
  +//            TestEnv.xbeanCase("marshal/com/mytest/MySubClass.java");
  +//        Assert.assertTrue(sourcefile.exists());
  +//
  +//        File sourcepath =
  +//            TestEnv.xbeanCase("marshal");
  +//        Assert.assertTrue(sourcepath.exists());
  +//        Assert.assertTrue(sourcepath.isDirectory());
  +//
  +//        JamServiceFactory jf = JamServiceFactory.getInstance();
  +//        JamServiceParams params = jf.createServiceParams();
  +//
  +//        params.includeSourceFile(new File[]{sourcepath}, sourcefile);
  +//
  +//        JamService service = jf.createService(params);
  +//
  +//        final Java2Schema j2s = new Java2Schema(service.getAllClasses());
  +//
  +////        j2s.setVerbose(true);
  +//
  +//
  +//        final File tmpfile = File.createTempFile("bindingTests", "-tylar");
  +//        if (!tmpfile.delete()) {
  +//            throw new AssertionError("delete failed on " + tmpfile);
  +//        }
  +//        final boolean ok = tmpfile.mkdirs();
  +//        Assert.assertTrue("mkdir" + tmpfile + " failed", ok);
  +//
  +//        j2s.bindAsExplodedTylar(tmpfile);
  +//
  +//    }
   
     //creates a JavaOutputStream that either spits out to System.out
     //or swallows the source output entirely.  This is temporary.  -pcal
  
  
  

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


Mime
View raw message