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/test/src/jamtest/tests/org/apache/xmlbeans/test/jam ClassesJamTest.java ImplComparisonTest.java JamTestBase.java ParserJamTest.java SourcesJamTest.java
Date Tue, 02 Mar 2004 06:32:14 GMT
pcal        2004/03/01 22:32:14

  Modified:    v2/src/jam/org/apache/xmlbeans/impl/jam JFactory.java
                        JFileSet.java
               v2/src/jam/org/apache/xmlbeans/impl/jam/internal/parser
                        ParserClassBuilder.java
               v2/src/jam/org/apache/xmlbeans/impl/jam/provider
                        DefaultJResultFactory.java JStoreParams.java
               v2/src/jeti/org/apache/xmlbeans/impl/jeti ToolContext.java
               v2/test/src/jamtest build.xml
               v2/test/src/jamtest/tests/org/apache/xmlbeans/test/jam
                        ClassesJamTest.java ImplComparisonTest.java
                        JamTestBase.java ParserJamTest.java
                        SourcesJamTest.java
  Added:       v2/src/jam/org/apache/xmlbeans/impl/jam JService.java
                        JServiceFactory.java JServiceParams.java
               v2/src/jam/org/apache/xmlbeans/impl/jam/editable
                        EService.java EServiceFactory.java
                        EServiceParams.java
               v2/src/jam/org/apache/xmlbeans/impl/jam/editable/impl
                        EServiceImpl.java EServiceParamsImpl.java
               v2/src/jam/org/apache/xmlbeans/impl/jam/provider
                        JServiceImpl.java JServiceParamsImpl.java
                        NewJServiceFactory.java
  Removed:     v2/src/jam/org/apache/xmlbeans/impl/jam JResult.java
                        JResultFactory.java JResultParams.java
               v2/src/jam/org/apache/xmlbeans/impl/jam/editable
                        EResult.java EResultFactory.java EResultParams.java
               v2/src/jam/org/apache/xmlbeans/impl/jam/editable/impl
                        EResultImpl.java EResultParamsImpl.java
               v2/src/jam/org/apache/xmlbeans/impl/jam/provider
                        JResultImpl.java JResultParamsImpl.java
                        NewJResultFactory.java
  Log:
  jam: un-rename JService, comment out bad test
  
  Revision  Changes    Path
  1.11      +1 -1      xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/JFactory.java
  
  Index: JFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/JFactory.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- JFactory.java	2 Mar 2004 04:26:18 -0000	1.10
  +++ JFactory.java	2 Mar 2004 06:32:13 -0000	1.11
  @@ -44,7 +44,7 @@
    * }
    * </pre>
    *
  - * @deprecated Please us JResultFactory instead.
  + * @deprecated Please us JServiceFactory instead.
    *
    * @author Patrick Calahan <pcal@bea.com>
    */
  
  
  
  1.7       +1 -1      xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/JFileSet.java
  
  Index: JFileSet.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/JFileSet.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- JFileSet.java	1 Mar 2004 21:20:05 -0000	1.6
  +++ JFileSet.java	2 Mar 2004 06:32:13 -0000	1.7
  @@ -22,7 +22,7 @@
    * <p>Describes a set of input source files which describe the java types to
    * be represented.  Instances of JFileSet are created by JFactory.</p>
    *
  - * @deprecated Please us JResultFactory instead.
  + * @deprecated Please us JServiceFactory instead.
    *
    * @author Patrick Calahan <pcal@bea.com>
    */
  
  
  
  1.7       +4 -4      xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/JService.java
  
  
  
  
  1.4       +13 -15    xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/JServiceFactory.java
  
  
  
  
  1.5       +0 -0      xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/JServiceParams.java
  
  
  
  
  1.4       +0 -0      xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/editable/EService.java
  
  
  
  
  1.6       +0 -0      xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/editable/EServiceFactory.java
  
  
  
  
  1.4       +0 -0      xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/editable/EServiceParams.java
  
  
  
  
  1.5       +12 -1     xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/editable/impl/EServiceImpl.java
  
  
  
  
  1.4       +0 -0      xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/editable/impl/EServiceParamsImpl.java
  
  
  
  
  1.2       +3 -3      xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/internal/parser/ParserClassBuilder.java
  
  Index: ParserClassBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/internal/parser/ParserClassBuilder.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ParserClassBuilder.java	2 Mar 2004 04:26:18 -0000	1.1
  +++ ParserClassBuilder.java	2 Mar 2004 06:32:13 -0000	1.2
  @@ -17,9 +17,9 @@
   import org.apache.xmlbeans.impl.jam.JClass;
   import org.apache.xmlbeans.impl.jam.JClassLoader;
   import org.apache.xmlbeans.impl.jam.editable.EClass;
  -import org.apache.xmlbeans.impl.jam.editable.EResult;
  -import org.apache.xmlbeans.impl.jam.editable.EResultFactory;
  -import org.apache.xmlbeans.impl.jam.editable.EResultParams;
  +import org.apache.xmlbeans.impl.jam.editable.EService;
  +import org.apache.xmlbeans.impl.jam.editable.EServiceFactory;
  +import org.apache.xmlbeans.impl.jam.editable.EServiceParams;
   import org.apache.xmlbeans.impl.jam.provider.JStoreParams;
   import org.apache.xmlbeans.impl.jam.provider.JPath;
   import org.apache.xmlbeans.impl.jam.provider.EClassBuilder;
  
  
  
  1.3       +18 -18    xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/provider/DefaultJResultFactory.java
  
  Index: DefaultJResultFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/provider/DefaultJResultFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultJResultFactory.java	2 Mar 2004 04:26:18 -0000	1.2
  +++ DefaultJResultFactory.java	2 Mar 2004 06:32:13 -0000	1.3
  @@ -14,9 +14,9 @@
    */
   package org.apache.xmlbeans.impl.jam.provider;
   
  -import org.apache.xmlbeans.impl.jam.JResultFactory;
  -import org.apache.xmlbeans.impl.jam.JResultParams;
  -import org.apache.xmlbeans.impl.jam.JResult;
  +import org.apache.xmlbeans.impl.jam.JServiceFactory;
  +import org.apache.xmlbeans.impl.jam.JServiceParams;
  +import org.apache.xmlbeans.impl.jam.JService;
   import org.apache.xmlbeans.impl.jam.JClassLoader;
   import org.apache.xmlbeans.impl.jam.internal.RootJClassLoader;
   import org.apache.xmlbeans.impl.jam.internal.javadoc.JDClassLoaderFactory;
  @@ -27,7 +27,7 @@
   import java.net.URLClassLoader;
   
   /**
  - * <p>Default implementation of JResultFactory.  It currently uses javadoc
  + * <p>Default implementation of JServiceFactory.  It currently uses javadoc
    * for inspecting sources and reflection for inspecting classes.</p>
    *
    * <p>Note that this class can be used as a base class for custom factories.
  @@ -35,7 +35,7 @@
    *
    * @author Patrick Calahan <pcal@bea.com>
    */
  -public class DefaultJResultFactory extends JResultFactory {
  +public class DefaultJResultFactory extends JServiceFactory {
   
     // ========================================================================
     // Constructors
  @@ -43,33 +43,33 @@
     public DefaultJResultFactory() {}
   
     // ========================================================================
  -  // JResultFactory implementation
  +  // JServiceFactory implementation
   
  -  public JResultParams createResultParams() {
  -    return new JResultParamsImpl();
  +  public JServiceParams createResultParams() {
  +    return new JServiceParamsImpl();
     }
   
  -  public JResult createResult(JResultParams jsps) throws IOException {
  -    //assert that they aren't implementing JResultParams themselves or
  +  public JService createResult(JServiceParams jsps) throws IOException {
  +    //assert that they aren't implementing JServiceParams themselves or
       //getting them from somewhere else
  -    if (!(jsps instanceof JResultParamsImpl)) {
  +    if (!(jsps instanceof JServiceParamsImpl)) {
         throw new IllegalArgumentException
  -              ("JResultParams must be instantiated by this JResultFactory.");
  +              ("JServiceParams must be instantiated by this JServiceFactory.");
       }
       //create and return the service
  -    return new JResultImpl(createClassLoader((JResultParamsImpl)jsps),
  -                           getSpecifiedClasses((JResultParamsImpl)jsps));
  +    return new JServiceImpl(createClassLoader((JServiceParamsImpl)jsps),
  +                           getSpecifiedClasses((JServiceParamsImpl)jsps));
     }
   
     // ========================================================================
     // Protected methods - override at your own risk
   
     /**
  -   * <p>Returns the set of classes to be included in a JResult to be
  +   * <p>Returns the set of classes to be included in a JService to be
      * created by the given params.  You should not override this
      * unless you really know what you're doing.</p>
      */
  -  protected String[] getSpecifiedClasses(JResultParamsImpl params)
  +  protected String[] getSpecifiedClasses(JServiceParamsImpl params)
             throws IOException
     {
       return params.getAllClassnames();
  @@ -81,7 +81,7 @@
      * classfile classloader.  Subclasses may override to change the behavior.
      * </p>
      */
  -  protected JClassLoader createClassLoader(JResultParamsImpl params)
  +  protected JClassLoader createClassLoader(JServiceParamsImpl params)
             throws IOException
     {
       // Build up the clasloader chain.  Note that each loader we create is
  @@ -111,7 +111,7 @@
      * Returns null if no source files are specified in the params.  Subclasses
      * may override to change the way in which java sources are loaded.</p>
      */
  -  protected JClassLoader createSourceLoader(JResultParamsImpl params,
  +  protected JClassLoader createSourceLoader(JServiceParamsImpl params,
                                               JClassLoader parent)
             throws IOException
     {
  
  
  
  1.3       +1 -1      xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/provider/JStoreParams.java
  
  Index: JStoreParams.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/provider/JStoreParams.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JStoreParams.java	1 Mar 2004 21:20:05 -0000	1.2
  +++ JStoreParams.java	2 Mar 2004 06:32:13 -0000	1.3
  @@ -64,7 +64,7 @@
   /**
    * <p>Structure containing information given to a BaseJProvider subclass in
    * order to instantiate a new JStore.  This interface really just provides
  - * an 'inside look' at JResultParams - it's usually going to be implemented
  + * an 'inside look' at JServiceParams - it's usually going to be implemented
    * by the same object.</p>
    *
    * @author Patrick Calahan <pcal@bea.com>
  
  
  
  1.1                  xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/provider/JServiceImpl.java
  
  Index: JServiceImpl.java
  ===================================================================
  /*   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.
   */
  
  package org.apache.xmlbeans.impl.jam.provider;
  
  import org.apache.xmlbeans.impl.jam.JService;
  import org.apache.xmlbeans.impl.jam.JClassLoader;
  import org.apache.xmlbeans.impl.jam.JClassIterator;
  import org.apache.xmlbeans.impl.jam.JClass;
  
  /**
   *
   * @author Patrick Calahan <pcal@bea.com>
   */
  public class JServiceImpl implements JService {
  
    // ========================================================================
    // Variables
  
    private JClassLoader mClassLoader;
    private String[] mClassNames;
  
    // ========================================================================
    // Constructors
  
    public JServiceImpl(JClassLoader jcl, String[] classes) {
      if (jcl == null) throw new IllegalArgumentException("null jcl");
      if (classes == null) throw new IllegalArgumentException("null classes");
      mClassLoader = jcl;
      mClassNames = classes;
    }
  
    // ========================================================================
    // JService implementation
  
    public JClassLoader getClassLoader() {
      return mClassLoader;
    }
  
    public String[] getClassNames() {
      return mClassNames;
    }
  
    public JClassIterator getClasses() {
      return new JClassIterator(getClassLoader(),getClassNames());
    }
  
    public JClass[] getAllClasses() {
      JClass[] out = new JClass[mClassNames.length];
      for(int i=0; i<out.length; i++) {
        out[i] = getClassLoader().loadClass(mClassNames[i]);
      }
      return out;
    }
  
  }
  
  
  
  1.1                  xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/provider/JServiceParamsImpl.java
  
  Index: JServiceParamsImpl.java
  ===================================================================
  /*   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.
   */
  
  package org.apache.xmlbeans.impl.jam.provider;
  
  import org.apache.xmlbeans.impl.jam.JAnnotationLoader;
  import org.apache.xmlbeans.impl.jam.JClassLoader;
  import org.apache.xmlbeans.impl.jam.JServiceParams;
  import org.apache.xmlbeans.impl.jam.internal.DirectoryScanner;
  import org.apache.xmlbeans.impl.jam.provider.JStoreParams;
  import org.apache.xmlbeans.impl.jam.provider.JPath;
  
  import java.util.*;
  import java.io.PrintWriter;
  import java.io.File;
  import java.io.IOException;
  
  /**
   *
   * @author Patrick Calahan <pcal@bea.com>
   */
  public class JServiceParamsImpl implements JServiceParams, JStoreParams
  {
    // ========================================================================
    // Variables
  
    private Properties mProperties = null;
    private Map mSourceRoot2Scanner = null;
    private Map mClassRoot2Scanner = null;
    private List mClasspath = null;
    private List mSourcepath = null;
    private List mToolClasspath = null;
  
    private List mIncludeClasses = null;
    private List mExcludeClasses = null;
  
    private PrintWriter mOut = null;
    private JAnnotationLoader mAnnotationLoader = null;
    private boolean mUseSystemClasspath = true;
    private boolean mVerbose = false;
    private JClassLoader mParentClassloader = null;
  
    // ========================================================================
    // Constructors
  
    public JServiceParamsImpl() {}
  
    // ========================================================================
    // Public methods - used by BaseJProvider
  
    public JAnnotationLoader getAnnotationLoader() {
      return mAnnotationLoader;
    }
  
    public boolean isUseSystemClasspath() { return mUseSystemClasspath; }
  
    public boolean isVerbose() { return mVerbose; }
  
    /**
     * Returns an array containing the qualified names of the classes which
     * are in the Service class set.
     */
    public String[] getAllClassnames() throws IOException {
      Set all = new HashSet();
      if (mIncludeClasses != null) all.addAll(mIncludeClasses);
      for(Iterator i = getAllDirectoryScanners(); i.hasNext(); ) {
        DirectoryScanner ds = (DirectoryScanner)i.next();
        String[] files = ds.getIncludedFiles();
        for(int j=0; j<files.length; j++) {
          all.add(filename2classname(files[j]));
        }
      }
      if (mExcludeClasses != null) all.removeAll(mExcludeClasses);
      String[] out = new String[all.size()];
      all.toArray(out);
      return out;
    }
  
    /*
    public String[] getSourceClassnames() throws IOException {
      if (mSourceRoot2Scanner == null) return new String[0];
      Set set = new HashSet();
      for(Iterator i = mSourceRoot2Scanner.values().iterator(); i.hasNext(); ) {
        DirectoryScanner ds = (DirectoryScanner)i.next();
        String[] files = ds.getIncludedFiles();
        for(int j=0; j<files.length; j++) {
          set.add(filename2classname(files[j]));
        }
      }
      String[] out = new String[set.size()];
      set.toArray(out);
      return out;
    }*/
  
    public File[] getSourceFiles() throws IOException {
      if (mSourceRoot2Scanner == null) return new File[0];
      Set set = new HashSet();
      for(Iterator i = mSourceRoot2Scanner.values().iterator(); i.hasNext(); ) {
        DirectoryScanner ds = (DirectoryScanner)i.next();
        String[] files = ds.getIncludedFiles();
        for(int j=0; j<files.length; j++) {
          set.add(new File(ds.getRoot(),files[j]));
        }
      }
      File[] out = new File[set.size()];
      set.toArray(out);
      return out;
    }
  
    // ========================================================================
    // JServiceFactory implementation
  
    public void includeSourceFiles(File srcRoot, String pattern) {
      addSourcepath(srcRoot);
      getSourceScanner(srcRoot).include(pattern);
    }
  
    public void includeClassFiles(File srcRoot, String pattern) {
      addClasspath(srcRoot);
      getClassScanner(srcRoot).include(pattern);
    }
  
    public void excludeSourceFiles(File srcRoot, String pattern) {
      addSourcepath(srcRoot);
      getSourceScanner(srcRoot).exclude(pattern);
    }
  
    public void excludeClassFiles(File srcRoot, String pattern) {
      addClasspath(srcRoot);
      getClassScanner(srcRoot).exclude(pattern);
    }
  
    public void includeSourceFile(File root, File sourceFile) {
      includeSourceFiles(root,source2pattern(root,sourceFile));
    }
  
    public void excludeSourceFile(File root, File sourceFile) {
      excludeSourceFiles(root,source2pattern(root,sourceFile));
    }
  
    public void includeClassFile(File root, File classFile) {
      includeClassFiles(root,source2pattern(root,classFile));
    }
  
    public void excludeClassFile(File root, File classFile) {
      excludeClassFiles(root,source2pattern(root,classFile));
    }
  
    public void includeClass(String qualifiedClassname) {
      if (mIncludeClasses == null) mIncludeClasses = new ArrayList();
      mIncludeClasses.add(qualifiedClassname);
    }
  
    public void excludeClass(String qualifiedClassname) {
      if (mExcludeClasses == null) mExcludeClasses = new ArrayList();
      mExcludeClasses.add(qualifiedClassname);
    }
  
    public void addClasspath(File classpathElement) {
      if (mClasspath == null) mClasspath = new ArrayList();
      mClasspath.add(classpathElement);
    }
  
    public void addSourcepath(File sourcepathElement) {
      if (mSourcepath == null) mSourcepath = new ArrayList();
      mSourcepath.add(sourcepathElement);
    }
  
    public void addToolClasspath(File classpathElement) {
      if (mToolClasspath == null) mToolClasspath = new ArrayList();
      mToolClasspath.add(classpathElement);
    }
  
    public void setProperty(String name, String value) {
      if (mProperties == null) mProperties = new Properties();
      mProperties.setProperty(name,value);
    }
  
    public void setLogger(PrintWriter out) { mOut = out; }
  
    public void setVerbose(boolean v) {
      mVerbose = v;
    }
  
    public void setAnnotationLoader(JAnnotationLoader ann) {
      mAnnotationLoader = ann;
    }
  
    public void setParentClassLoader(JClassLoader loader) {
      mParentClassloader = loader;
    }
  
    public void setUseSystemClasspath(boolean use) {
      mUseSystemClasspath = use;
    }
  
    // ========================================================================
    // JStoreParams implementation
  
    public JPath getInputClasspath() {
      return createJPath(mClasspath);
    }
  
    public JPath getInputSourcepath() {
      return createJPath(mSourcepath);
    }
  
    public JPath getToolClasspath() {
      return createJPath(mToolClasspath);
    }
  
    public PrintWriter getOut() {
      return new PrintWriter(System.out,true);
    }
  
    public Properties getProperties() {
      return null;
    }
  
    public JClassLoader getParentClassLoader() {
      return null;
    }
  
    public File getRootForFile(File[] sourceRoots, File sourceFile) {
      if (sourceRoots == null) throw new IllegalArgumentException("null roots");
      if (sourceFile == null) throw new IllegalArgumentException("null file");
      String f = sourceFile.getAbsolutePath();
      for(int i=0; i<sourceRoots.length; i++) {
        if (f.startsWith(sourceRoots[i].getAbsolutePath())) {//cheesy?
          return sourceRoots[i];
        }
      }
      return null;
    }
  
  
    // ========================================================================
    // Private methods
  
    /**
     * Converts the sourceFile to a pattern expression relative to the
     * given root.
     */
    private String source2pattern(File root, File sourceFile) {
      //REVIEW this is a bit cheesy
      String r = root.getAbsolutePath();
      String s = sourceFile.getAbsolutePath();
      return s.substring(r.length());
    }
  
    /**
     * Converts the given java source or class filename into a qualified
     * classname.  The filename is assumed to be relative to the source or
     * class root.
     */
    private static String filename2classname(String filename) {
      int extDot = filename.lastIndexOf('.');
      if (extDot != -1) filename = filename.substring(0,extDot);
      filename = filename.replace('/','.');
      filename = filename.replace('\\','.');
      return filename;
    }
  
    /**
     * Returns all of the directory scanners for all class and source
     * roots created in this params object.
     */
    private Iterator getAllDirectoryScanners() {
      Collection out = new ArrayList();
      if (mSourceRoot2Scanner != null) {
        out.addAll(mSourceRoot2Scanner.values());
      }
      if (mClassRoot2Scanner != null) {
        out.addAll(mClassRoot2Scanner.values());
      }
      return out.iterator();
    }
  
    /**
     * Creates a JPath for the given collection of Files, or returns null
     * if the collections is null or empty.
     */
    private static JPath createJPath(Collection filelist) {
      if (filelist == null || filelist.size() == 0) return null;
      File[] files = new File[filelist.size()];
      filelist.toArray(files);
      return JPath.forFiles(files);
    }
  
    /**
     * Returns the DirectoryScanner which we have mapped to the given source
     * root, creating a new one if necessary.
     */
    private DirectoryScanner getSourceScanner(File srcRoot) {
      if (mSourceRoot2Scanner == null) mSourceRoot2Scanner = new HashMap();
      DirectoryScanner out = (DirectoryScanner)mSourceRoot2Scanner.get(srcRoot);
      if (out == null) {
        mSourceRoot2Scanner.put(srcRoot,out = new DirectoryScanner(srcRoot));
      }
      return out;
    }
  
    /**
     * Returns the DirectoryScanner which we have mapped to the given class
     * root, creating a new one if necessary.
     */
    private DirectoryScanner getClassScanner(File clsRoot) {
      if (mClassRoot2Scanner == null) mClassRoot2Scanner = new HashMap();
      DirectoryScanner out = (DirectoryScanner)mClassRoot2Scanner.get(clsRoot);
      if (out == null) {
        mClassRoot2Scanner.put(clsRoot,out = new DirectoryScanner(clsRoot));
      }
      return out;
    }
  }
  
  
  1.1                  xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/provider/NewJServiceFactory.java
  
  Index: NewJServiceFactory.java
  ===================================================================
  /*   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.
   */
  package org.apache.xmlbeans.impl.jam.provider;
  
  import org.apache.xmlbeans.impl.jam.JClassLoader;
  import org.apache.xmlbeans.impl.jam.internal.parser.ParserClassBuilder;
  import org.apache.xmlbeans.impl.jam.internal.JClassLoaderImpl;
  
  import java.io.IOException;
  
  /**
   *
   * @author Patrick Calahan <pcal@bea.com>
   */
  public class NewJServiceFactory extends DefaultJResultFactory {
  
    /**
     * <p>Creates the sourcefile classloader to be used given the input params.
     * Returns null if no source files are specified in the params.  Subclasses
     * may override to change the way in which java sources are loaded.</p>
     */
    protected JClassLoader createSourceLoader(JServiceParamsImpl params,
                                              JClassLoader parent)
            throws IOException
    {
      ParserClassBuilder pcb = new ParserClassBuilder(params);
      return new JClassLoaderImpl(pcb,null);
    }
  
  }
  
  
  
  1.3       +2 -2      xml-xmlbeans/v2/src/jeti/org/apache/xmlbeans/impl/jeti/ToolContext.java
  
  Index: ToolContext.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/jeti/org/apache/xmlbeans/impl/jeti/ToolContext.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ToolContext.java	1 Mar 2004 21:20:06 -0000	1.2
  +++ ToolContext.java	2 Mar 2004 06:32:13 -0000	1.3
  @@ -14,7 +14,7 @@
    */
   package org.apache.xmlbeans.impl.jeti;
   
  -import org.apache.xmlbeans.impl.jam.JResultFactory;
  +import org.apache.xmlbeans.impl.jam.JServiceFactory;
   import org.apache.xmlbeans.impl.jeti.parameter.ParameterService;
   import org.apache.xmlbeans.impl.jeti.output.OutputService;
   import org.apache.xmlbeans.impl.jeti.logging.LoggingService;
  @@ -49,7 +49,7 @@
      * <p>Returns an entry point into the JAM service, which provides a model
      * of java type information.</p>
      */
  -  public JResultFactory getJavaTypeService();
  +  public JServiceFactory getJavaTypeService();
   
     /**
      * <p>Returns a service which exposes user-specified parameters for
  
  
  
  1.6       +2 -0      xml-xmlbeans/v2/test/src/jamtest/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/test/src/jamtest/build.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- build.xml	2 Mar 2004 04:26:18 -0000	1.5
  +++ build.xml	2 Mar 2004 06:32:13 -0000	1.6
  @@ -58,7 +58,9 @@
           <pathelement path='${classpath-value}'/> <!--ref no workie-->
         </classpath>
         <formatter type='plain' usefile='false'/>
  +<!--
         <test name='org.apache.xmlbeans.test.jam.ParserJamTest'/>
  +-->
         <test name='org.apache.xmlbeans.test.jam.SourcesJamTest'/>
         <test name='org.apache.xmlbeans.test.jam.ClassesJamTest'/>
   
  
  
  
  1.3       +6 -6      xml-xmlbeans/v2/test/src/jamtest/tests/org/apache/xmlbeans/test/jam/ClassesJamTest.java
  
  Index: ClassesJamTest.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/test/src/jamtest/tests/org/apache/xmlbeans/test/jam/ClassesJamTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ClassesJamTest.java	1 Mar 2004 21:20:06 -0000	1.2
  +++ ClassesJamTest.java	2 Mar 2004 06:32:13 -0000	1.3
  @@ -55,9 +55,9 @@
   */
   package org.apache.xmlbeans.test.jam;
   
  -import org.apache.xmlbeans.impl.jam.JResultFactory;
  -import org.apache.xmlbeans.impl.jam.JResultParams;
  -import org.apache.xmlbeans.impl.jam.JResult;
  +import org.apache.xmlbeans.impl.jam.JServiceFactory;
  +import org.apache.xmlbeans.impl.jam.JServiceParams;
  +import org.apache.xmlbeans.impl.jam.JService;
   
   import java.io.IOException;
   
  @@ -78,9 +78,9 @@
     // ========================================================================
     // JamTestBase implementation
   
  -  protected JResult getResultToTest() throws IOException {
  -    JResultFactory jsf = JResultFactory.getInstance();
  -    JResultParams params = jsf.createResultParams();
  +  protected JService getResultToTest() throws IOException {
  +    JServiceFactory jsf = JServiceFactory.getInstance();
  +    JServiceParams params = jsf.createResultParams();
       params.includeClassFiles(getDummyclassesClassDir(),"**/*.class");
       return jsf.createResult(params);
     }
  
  
  
  1.4       +4 -4      xml-xmlbeans/v2/test/src/jamtest/tests/org/apache/xmlbeans/test/jam/ImplComparisonTest.java
  
  Index: ImplComparisonTest.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/test/src/jamtest/tests/org/apache/xmlbeans/test/jam/ImplComparisonTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ImplComparisonTest.java	1 Mar 2004 21:20:06 -0000	1.3
  +++ ImplComparisonTest.java	2 Mar 2004 06:32:13 -0000	1.4
  @@ -28,8 +28,8 @@
     // ========================================================================
     // Variables
   
  -  private JResult mService1;
  -  private JResult mService2;
  +  private JService mService1;
  +  private JService mService2;
     private boolean mCompareAnnotations = false;
     private boolean mCompareComments = false;
     private PrintWriter mOut = new PrintWriter(System.out);
  @@ -39,7 +39,7 @@
     // ========================================================================
     // Public methods
   
  -  public void compare(JResult service1, JResult service2) {
  +  public void compare(JService service1, JService service2) {
       List list1 = getSortedClassList(service1);
       //FIXME should also compare that the same classes are in each service
       //  List list2 = getSortedClassList(service2);
  @@ -118,7 +118,7 @@
       return out;
     }
   
  -  private List getSortedClassList(JResult service) {
  +  private List getSortedClassList(JService service) {
       JClass[] classes = service.getAllClasses();
       Arrays.sort(classes,JElementComparator.getInstance());
       return Arrays.asList(classes);
  
  
  
  1.5       +4 -4      xml-xmlbeans/v2/test/src/jamtest/tests/org/apache/xmlbeans/test/jam/JamTestBase.java
  
  Index: JamTestBase.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/test/src/jamtest/tests/org/apache/xmlbeans/test/jam/JamTestBase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JamTestBase.java	2 Mar 2004 04:26:19 -0000	1.4
  +++ JamTestBase.java	2 Mar 2004 06:32:13 -0000	1.5
  @@ -64,7 +64,7 @@
   
   /**
    * <p>Abstract base class for basic jam test cases.  These test cases work
  - * against an abstract JResult - they don't care how the java types
  + * against an abstract JService - they don't care how the java types
    * were loaded.  Extending classes are responsible for implementing the
    * getService() method which should create the service from sources, or
    * classes, or whatever is appropriate.</p>
  @@ -108,7 +108,7 @@
     // ========================================================================
     // Variables
   
  -  private JResult mResult = null;
  +  private JService mResult = null;
     private JClassLoader mLoader = null;
   
     // ========================================================================
  @@ -126,9 +126,9 @@
     // Abstract methods
   
     /**
  -   * Called during setup() to get the JResult object to test against.
  +   * Called during setup() to get the JService object to test against.
      */
  -  protected abstract JResult getResultToTest() throws Exception;
  +  protected abstract JService getResultToTest() throws Exception;
   
     //kind of a quick hack for now, should remove this and make sure that
     //even the classes case make the annotations available using a special
  
  
  
  1.2       +7 -7      xml-xmlbeans/v2/test/src/jamtest/tests/org/apache/xmlbeans/test/jam/ParserJamTest.java
  
  Index: ParserJamTest.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/test/src/jamtest/tests/org/apache/xmlbeans/test/jam/ParserJamTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ParserJamTest.java	2 Mar 2004 04:26:19 -0000	1.1
  +++ ParserJamTest.java	2 Mar 2004 06:32:13 -0000	1.2
  @@ -14,10 +14,10 @@
    */
   package org.apache.xmlbeans.test.jam;
   
  -import org.apache.xmlbeans.impl.jam.JResult;
  -import org.apache.xmlbeans.impl.jam.JResultFactory;
  -import org.apache.xmlbeans.impl.jam.JResultParams;
  -import org.apache.xmlbeans.impl.jam.provider.NewJResultFactory;
  +import org.apache.xmlbeans.impl.jam.JService;
  +import org.apache.xmlbeans.impl.jam.JServiceFactory;
  +import org.apache.xmlbeans.impl.jam.JServiceParams;
  +import org.apache.xmlbeans.impl.jam.provider.NewJServiceFactory;
   
   import java.io.IOException;
   
  @@ -37,9 +37,9 @@
     // ========================================================================
     // JamTestBase implementation
   
  -  protected JResult getResultToTest() throws IOException {
  -    JResultFactory jsf = new NewJResultFactory();
  -    JResultParams params = jsf.createResultParams();
  +  protected JService getResultToTest() throws IOException {
  +    JServiceFactory jsf = new NewJServiceFactory();
  +    JServiceParams params = jsf.createResultParams();
       params.includeSourceFiles(getDummyclassesSourceRoot(),"**/*.java");
       return jsf.createResult(params);
     }
  
  
  
  1.3       +6 -6      xml-xmlbeans/v2/test/src/jamtest/tests/org/apache/xmlbeans/test/jam/SourcesJamTest.java
  
  Index: SourcesJamTest.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/test/src/jamtest/tests/org/apache/xmlbeans/test/jam/SourcesJamTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SourcesJamTest.java	1 Mar 2004 21:20:06 -0000	1.2
  +++ SourcesJamTest.java	2 Mar 2004 06:32:13 -0000	1.3
  @@ -55,9 +55,9 @@
   */
   package org.apache.xmlbeans.test.jam;
   
  -import org.apache.xmlbeans.impl.jam.JResultFactory;
  -import org.apache.xmlbeans.impl.jam.JResultParams;
  -import org.apache.xmlbeans.impl.jam.JResult;
  +import org.apache.xmlbeans.impl.jam.JServiceFactory;
  +import org.apache.xmlbeans.impl.jam.JServiceParams;
  +import org.apache.xmlbeans.impl.jam.JService;
   
   import java.io.IOException;
   
  @@ -78,9 +78,9 @@
     // ========================================================================
     // JamTestBase implementation
   
  -  protected JResult getResultToTest() throws IOException {
  -    JResultFactory jsf = JResultFactory.getInstance();
  -    JResultParams params = jsf.createResultParams();
  +  protected JService getResultToTest() throws IOException {
  +    JServiceFactory jsf = JServiceFactory.getInstance();
  +    JServiceParams params = jsf.createResultParams();
       params.includeSourceFiles(getDummyclassesSourceRoot(),"**/*.java");
       return jsf.createResult(params);
     }
  
  
  

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