xml-xmlbeans-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject cvs commit: xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile Java2Schema_new.java
Date Mon, 22 Mar 2004 01:45:49 GMT
pcal        2004/03/21 17:45:49

  Modified:    v2/jam/src/org/apache/xmlbeans/impl/jam/annotation
                        AnnotationProxy.java
               v2/jam/test/tests/org/apache/xmlbeans/test/jam
                        JamTestBase.java
               v2/src/binding/org/apache/xmlbeans/impl/binding/compile
                        Java2Schema_new.java
  Added:       v2/jam/test/dummyclasses/org TopLevelPackageClass.java
  Log:
  java2schema updates, jam updates & new tests
  
  Revision  Changes    Path
  1.7       +8 -5      xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/annotation/AnnotationProxy.java
  
  Index: AnnotationProxy.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/annotation/AnnotationProxy.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- AnnotationProxy.java	20 Mar 2004 21:51:34 -0000	1.6
  +++ AnnotationProxy.java	22 Mar 2004 01:45:49 -0000	1.7
  @@ -184,13 +184,16 @@
   
     public void initFromJavadocTag(String tagline) {
       if (tagline == null) throw new IllegalArgumentException("null tagline");
  -    setValue(SINGLE_MEMBER_NAME,tagline);
       Properties props = new Properties();
       parseAssignments(props,tagline);
  -    Enumeration names = props.propertyNames();
  -    while(names.hasMoreElements()) {
  -      String name = (String)names.nextElement();
  -      setValue(name,props.getProperty(name));
  +    if (props.size() == 0) {
  +      setValue(SINGLE_MEMBER_NAME,tagline);
  +    } else {
  +      Enumeration names = props.propertyNames();
  +      while(names.hasMoreElements()) {
  +        String name = (String)names.nextElement();
  +        setValue(name,props.getProperty(name));
  +      }
       }
     }
   
  
  
  
  1.1                  xml-xmlbeans/v2/jam/test/dummyclasses/org/TopLevelPackageClass.java
  
  Index: TopLevelPackageClass.java
  ===================================================================
  package org;
  
  /*   Copyright 2004 The Apache Software Foundation
   *
   *   Licensed under the Apache License, Version 2.0 (the "License");
   *   you may not use this file except in compliance with the License.
   *   You may obtain a copy of the License at
   *
   *       http://www.apache.org/licenses/LICENSE-2.0
   *
   *   Unless required by applicable law or agreed to in writing, software
   *   distributed under the License is distributed on an "AS IS" BASIS,
   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   *   See the License for the specific language governing permissions and
   *  limitations under the License.
   */
  /**
   * This is a class in a top-level pacakge.  It might be a little bit weird
   * for JAM just because the package name doesn't have any dots in it -
   * worth testing.
   *
   * @author Patrick Calahan <email: pcal-at-bea-dot-com>
   */
  public interface TopLevelPackageClass {
  
    public int getId();
  }
  
  
  
  1.12      +23 -0     xml-xmlbeans/v2/jam/test/tests/org/apache/xmlbeans/test/jam/JamTestBase.java
  
  Index: JamTestBase.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/test/tests/org/apache/xmlbeans/test/jam/JamTestBase.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- JamTestBase.java	20 Mar 2004 20:10:45 -0000	1.11
  +++ JamTestBase.java	22 Mar 2004 01:45:49 -0000	1.12
  @@ -99,10 +99,13 @@
     protected static final String
             DUMMY = "org.apache.xmlbeans.test.jam.dummyclasses";
   
  +  protected static final String DUMMY_EJB = DUMMY+".ejb";
  +
     //this array must contain the names of all of the test classes under
     //dummyclasses
     private static final String[] ALL_CLASSES = {
       "DefaultPackageClass",
  +    "org.TopLevelPackageClass",
       DUMMY+".ejb.IEnv",
       DUMMY+".ejb.MyEjbException",
       DUMMY+".ejb.TraderEJB",
  @@ -247,6 +250,24 @@
                  expected.containsAll(classNames));
     }
   
  +  public void testPackageNames()
  +  {
  +    JClass clazz = resolved(mLoader.loadClass(DUMMY_EJB+".TraderEJB"));
  +    JPackage pkg = clazz.getContainingPackage();
  +    assertTrue("Expected '"+DUMMY_EJB+"', got '"+pkg.getQualifiedName()+"'",
  +               pkg.getQualifiedName().equals(DUMMY_EJB));
  +    //
  +    clazz = resolved(mLoader.loadClass("DefaultPackageClass"));
  +    pkg = clazz.getContainingPackage();
  +    assertTrue("Expected '', got '"+pkg.getQualifiedName()+"'",
  +               pkg.getQualifiedName().equals(""));
  +    //
  +    clazz = resolved(mLoader.loadClass("org.TopLevelPackageClass"));
  +    pkg = clazz.getContainingPackage();
  +    assertTrue("Expected 'org', got '"+pkg.getQualifiedName()+"'",
  +               pkg.getQualifiedName().equals("org"));
  +  }
  +
   
     public void test175Annotations() throws IOException, XMLStreamException {
       JClass clazz = resolved(mLoader.loadClass(DUMMY+".jsr175.AnnotatedClass"));
  @@ -360,6 +381,8 @@
         verifyAnnotationAbsent(ejbBuy,CLASS_ANN);
       }
     }
  +
  +
   
   
     public void testMultilineTags() {
  
  
  
  1.2       +1 -1      xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/Java2Schema_new.java
  
  Index: Java2Schema_new.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/Java2Schema_new.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Java2Schema_new.java	20 Mar 2004 21:51:34 -0000	1.1
  +++ Java2Schema_new.java	22 Mar 2004 01:45:49 -0000	1.2
  @@ -396,7 +396,7 @@
         JPackage pkg = clazz.getContainingPackage();
         pkg_name = (pkg == null) ? "" : pkg.getQualifiedName();
         if (pkg_name.startsWith(JAVA_PACKAGE_PREFIX)) {
  -        pkg_name = JAVA_NAMESPACE_URI+"."+
  +        pkg_name = JAVA_NAMESPACE_URI+'.'+
                   pkg_name.substring(JAVA_PACKAGE_PREFIX.length());
         }
       }
  
  
  

---------------------------------------------------------------------
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