ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adammurd...@apache.org
Subject cvs commit: jakarta-ant-myrmidon/framework/src/conf MANIFEST.MF
Date Thu, 16 May 2002 03:26:46 GMT
adammurdoch    02/05/15 20:26:45

  Modified:    container project.xml
               container/src/test/org/apache/myrmidon/components/library/test
                        DefaultLibraryManagerTestCase.java
  Added:       container/src/testlibs/org/apache/myrmidon/components/library/test/libs/extn
                        ExtnClass.java extn.txt
               container/src/testlibs/org/apache/myrmidon/components/library/test/libs/shared
                        SharedClass.java shared.txt
               container/src/testlibs/org/apache/myrmidon/components/library/test/libs/unshared
                        UnsharedClass.java unshared.txt
  Removed:     api/src/conf MANIFEST.MF
               aut/src/conf MANIFEST.MF
               buildtools/src/conf MANIFEST.MF
               container/src/conf MANIFEST.MF
               container/src/test/org/apache/myrmidon/components/classloader/test/libs
                        cycle-extension-1.mf cycle-extension-2.mf
                        one-dependency.mf simple-extension.mf
               container/src/test/org/apache/myrmidon/components/classloader/test/libs/extn
                        ExtnClass.java extn.txt
               container/src/test/org/apache/myrmidon/components/classloader/test/libs/shared
                        SharedClass.java shared.txt
               container/src/test/org/apache/myrmidon/components/classloader/test/libs/unshared
                        UnsharedClass.java unshared.txt
               framework/src/conf MANIFEST.MF
  Log:
  Fixed the DefaultLibraryManager tests.  All the container tests pass now.
  
  Revision  Changes    Path
  1.10      +81 -37    jakarta-ant-myrmidon/container/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/project.xml,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- project.xml	10 May 2002 06:27:31 -0000	1.9
  +++ project.xml	16 May 2002 03:26:45 -0000	1.10
  @@ -39,6 +39,87 @@
           </jar>
       </build>
   
  +    <!-- Jars used by the unit tests -->
  +    <additional-build>
  +        <lib-dir>${test.working.dir}/org/apache/myrmidon/components/library/test</lib-dir>
  +        <sourceDirectory>src/testlibs</sourceDirectory>
  +
  +        <jar>
  +            <id>test-common</id>
  +            <name>test-common.jar</name>
  +            <patternset>
  +                <include name="**/shared/**"/>
  +            </patternset>
  +        </jar>
  +        <jar>
  +            <id>test-no-dependencies</id>
  +            <name>test-no-dependencies.jar</name>
  +            <patternset>
  +                <include name="**/shared/**"/>
  +                <include name="**/unshared/**"/>
  +            </patternset>
  +        </jar>
  +        <jar>
  +            <id>test-one-dependency</id>
  +            <name>test-one-dependency.jar</name>
  +            <depends>
  +                <extension extension-name="test.simple"
  +                           specification-version="1.0"/>
  +            </depends>
  +            <patternset>
  +                <include name="**/shared/**"/>
  +                <include name="**/unshared/**"/>
  +            </patternset>
  +        </jar>
  +        <jar>
  +            <id>test-one-dependency-2</id>
  +            <name>test-one-dependency-2.jar</name>
  +            <depends>
  +                <extension extension-name="test.simple"
  +                           specification-version="1.0"/>
  +            </depends>
  +            <patternset>
  +                <include name="**/shared/**"/>
  +                <include name="**/unshared/**"/>
  +            </patternset>
  +        </jar>
  +        <jar>
  +            <id>test-simple-extension</id>
  +            <name>test-simple-extension.jar</name>
  +            <extension extension-name="test.simple"
  +                       specification-title="Test Simple Extension"
  +                       specification-version="1.0.0"
  +                       specification-vendor="Jakarta Apache"
  +                       implementation-vendor-id="org.apache.myrmidon"
  +                       implementation-vendor="Apache Myrmidon Project"
  +                       implementation-version="1.0.2"/>
  +            <patternset>
  +                <include name="**/shared/**"/>
  +                <include name="**/extn/**"/>
  +            </patternset>
  +        </jar>
  +        <jar>
  +            <id>test-cycle-extension-1</id>
  +            <name>test-cycle-extension-1.jar</name>
  +            <extension extension-name="test.cycle1"
  +                       specification-version="1.0.0"/>
  +            <depends>
  +                <extension extension-name="test.cycle2" specification-version="1.0"/>
  +            </depends>
  +            <patternset excludes="**"/>
  +        </jar>
  +        <jar>
  +            <id>test-cycle-extension-2</id>
  +            <name>test-cycle-extension-2.jar</name>
  +            <extension extension-name="test.cycle2"
  +                       specification-version="1.0.0"/>
  +            <depends>
  +                <extension extension-name="test.cycle1" specification-version="1.0"/>
  +            </depends>
  +            <patternset excludes="**"/>
  +        </jar>
  +    </additional-build>
  +
       <unitTest>
           <sourceDirectory>src/test</sourceDirectory>
           <includeDescriptors>false</includeDescriptors>
  @@ -68,43 +149,6 @@
               <jar jarfile="${test.type.dir}/types.jar">
                   <fileset dir="${test.classes}" includes="org/apache/myrmidon/interfaces/type/test/MyType1.class"/>
               </jar>
  -
  -            <!-- Prepare the class loader manager tests -->
  -            <property name="test.classloader.pkg" value="org/apache/myrmidon/components/classloader/test/libs"/>
  -            <property name="test.classloader.dir" value="${test.working.dir}/${test.classloader.pkg}/.."/>
  -            <property name="test.classloader.classes" value="${test.working.dir}/${test.classloader.pkg}"/>
  -            <mkdir dir="${test.classloader.dir}/ext"/>
  -            <jar jarfile="${test.classloader.dir}/common.jar">
  -                <fileset dir="${test.classes}">
  -                    <include name="${test.classloader.pkg}/shared/**"/>
  -                </fileset>
  -            </jar>
  -            <jar jarfile="${test.classloader.dir}/no-dependencies.jar">
  -                <fileset dir="${test.classes}">
  -                    <include name="${test.classloader.pkg}/shared/**"/>
  -                    <include name="${test.classloader.pkg}/unshared/**"/>
  -                </fileset>
  -            </jar>
  -            <jar jarfile="${test.classloader.dir}/one-dependency.jar"
  -                 manifest="src/test/${test.classloader.pkg}/one-dependency.mf">
  -                <fileset dir="${test.classes}">
  -                    <include name="${test.classloader.pkg}/shared/**"/>
  -                    <include name="${test.classloader.pkg}/unshared/**"/>
  -                </fileset>
  -            </jar>
  -            <copy file="${test.classloader.dir}/one-dependency.jar"
  -                  tofile="${test.classloader.dir}/one-dependency-2.jar"/>
  -            <jar jarfile="${test.classloader.dir}/ext/simple-extension.jar"
  -                 manifest="src/test/${test.classloader.pkg}/simple-extension.mf" >
  -                <fileset dir="${test.classes}">
  -                    <include name="${test.classloader.pkg}/shared/**"/>
  -                    <include name="${test.classloader.pkg}/extn/**"/>
  -                </fileset>
  -            </jar>
  -            <jar jarfile="${test.classloader.dir}/ext/cycle-extension-1.jar"
  -                 manifest="src/test/${test.classloader.pkg}/cycle-extension-1.mf" />
  -            <jar jarfile="${test.classloader.dir}/ext/cycle-extension-2.jar"
  -                 manifest="src/test/${test.classloader.pkg}/cycle-extension-2.mf" />
           </prepare>
       </unitTest>
   
  
  
  
  1.4       +13 -12    jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/library/test/DefaultLibraryManagerTestCase.java
  
  Index: DefaultLibraryManagerTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/library/test/DefaultLibraryManagerTestCase.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultLibraryManagerTestCase.java	12 May 2002 12:57:54 -0000	1.3
  +++ DefaultLibraryManagerTestCase.java	16 May 2002 03:26:45 -0000	1.4
  @@ -22,7 +22,7 @@
    * Test cases for the DefaultClassLoaderManager.
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.3 $ $Date: 2002/05/12 12:57:54 $
  + * @version $Revision: 1.4 $ $Date: 2002/05/16 03:26:45 $
    */
   public class DefaultLibraryManagerTestCase
       extends AbstractComponentTest
  @@ -58,7 +58,7 @@
       {
           super.setUp();
   
  -        m_commonJar = getTestResource( "common.jar" );
  +        m_commonJar = getTestResource( "test-common.jar" );
           final URL commonJarUrl = m_commonJar.toURL();
           m_commonClassLoader = new URLClassLoader( new URL[]{commonJarUrl} );
   
  @@ -76,7 +76,7 @@
       protected Map getParameters()
       {
           final Map parameters = super.getParameters();
  -        parameters.put( "myrmidon.ext.path", new File[] { getTestDirectory( "ext" ) } );
  +        parameters.put( "myrmidon.ext.path", new File[] { getTestDirectory() } );
           parameters.put( "myrmidon.shared.classloader", m_commonClassLoader );
           return parameters;
       }
  @@ -219,7 +219,7 @@
           assertResourceNotFound( m_commonClassLoader, UNSHARED_RES_NAME );
   
           // Build the classloader
  -        final File jarFile = getTestResource( "no-dependencies.jar" );
  +        final File jarFile = getTestResource( "test-no-dependencies.jar" );
           final Library lib = m_libraryManager.createLibrary( new File[] { jarFile } );
           final ClassLoader classLoader = lib.getClassLoader();
   
  @@ -244,12 +244,12 @@
           assertResourceNotFound( m_commonClassLoader, EXTN_RES_NAME );
   
           // Build the extension classloader
  -        final File extnJarFile = getTestResource( "ext/simple-extension.jar" );
  +        final File extnJarFile = getTestResource( "test-simple-extension.jar" );
           final Library extnLib = m_libraryManager.getLibrary( "test.simple" );
           final ClassLoader extnClassLoader = extnLib.getClassLoader();
   
           // Build the Jar classloader
  -        final File jarFile = getTestResource( "one-dependency.jar" );
  +        final File jarFile = getTestResource( "test-one-dependency.jar" );
           final Library lib = m_libraryManager.createLibrary( new File[] { jarFile } );
           final ClassLoader classLoader = lib.getClassLoader();
   
  @@ -272,15 +272,15 @@
       public void testShareClasses() throws Exception
       {
           // Build the extension classloader
  -        final File extnJarFile = getTestResource( "ext/simple-extension.jar" );
  +        final File extnJarFile = getTestResource( "test-simple-extension.jar" );
           final Library extnLib = m_libraryManager.getLibrary( "test.simple" );
           final ClassLoader extnClassLoader = extnLib.getClassLoader();
   
           // Build the Jar classloaders
  -        final File jarFile1 = getTestResource( "one-dependency.jar" );
  +        final File jarFile1 = getTestResource( "test-one-dependency.jar" );
           final Library lib1 = m_libraryManager.createLibrary( new File[] { jarFile1 } );
           final ClassLoader classLoader1 = lib1.getClassLoader();
  -        final File jarFile2 = getTestResource( "one-dependency-2.jar" );
  +        final File jarFile2 = getTestResource( "test-one-dependency-2.jar" );
           final Library lib2 = m_libraryManager.createLibrary( new File[] { jarFile2 } );
           final ClassLoader classLoader2 = lib2.getClassLoader();
   
  @@ -296,17 +296,18 @@
        */
       public void testCycle() throws Exception
       {
  -        final File jarFile = getTestResource( "ext/cycle-extension-1.jar" );
  +        final String libname = "test.cycle1";
           try
           {
  -            m_libraryManager.createLibrary( new File[] { jarFile } );
  +            m_libraryManager.getLibrary( libname );
               fail();
           }
           catch( final Exception e )
           {
  +            final File jarFile = getTestResource( "test-cycle-extension-1.jar" );
               final Resources rez = getResourcesForTested( DefaultLibraryManager.class );
               final String[] messages = {
  -                rez.getString( "create-classloader-for-file.error", jarFile ),
  +                rez.getString( "load-library.error", libname ),
                   rez.getString( "dependency-cycle.error", jarFile )
               };
               assertSameMessage( messages, e );
  
  
  
  1.1                  jakarta-ant-myrmidon/container/src/testlibs/org/apache/myrmidon/components/library/test/libs/extn/ExtnClass.java
  
  Index: ExtnClass.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.myrmidon.components.library.test.libs.extn;
  
  import org.apache.myrmidon.components.library.test.libs.shared.SharedClass;
  
  /**
   * A test class loaded from an extension.
   *
   * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
   * @version $Revision: 1.1 $ $Date: 2002/05/16 03:26:45 $
   */
  public class ExtnClass
  {
      public SharedClass m_test = new SharedClass();
  }
  
  
  
  1.1                  jakarta-ant-myrmidon/container/src/testlibs/org/apache/myrmidon/components/library/test/libs/extn/extn.txt
  
  Index: extn.txt
  ===================================================================
  A test resource loaded from an extension.
  
  
  1.1                  jakarta-ant-myrmidon/container/src/testlibs/org/apache/myrmidon/components/library/test/libs/shared/SharedClass.java
  
  Index: SharedClass.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.myrmidon.components.library.test.libs.shared;
  
  /**
   * A test class.
   *
   * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
   * @version $Revision: 1.1 $ $Date: 2002/05/16 03:26:45 $
   */
  public class SharedClass
  {
  }
  
  
  
  1.1                  jakarta-ant-myrmidon/container/src/testlibs/org/apache/myrmidon/components/library/test/libs/shared/shared.txt
  
  Index: shared.txt
  ===================================================================
  A shared resource.
  
  
  1.1                  jakarta-ant-myrmidon/container/src/testlibs/org/apache/myrmidon/components/library/test/libs/unshared/UnsharedClass.java
  
  Index: UnsharedClass.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.myrmidon.components.library.test.libs.unshared;
  
  import org.apache.myrmidon.components.library.test.libs.shared.SharedClass;
  
  /**
   * A test class.
   *
   * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
   * @version $Revision: 1.1 $ $Date: 2002/05/16 03:26:45 $
   */
  public class UnsharedClass
  {
      public SharedClass m_test = new SharedClass();
  }
  
  
  
  1.1                  jakarta-ant-myrmidon/container/src/testlibs/org/apache/myrmidon/components/library/test/libs/unshared/unshared.txt
  
  Index: unshared.txt
  ===================================================================
  An unshared resource.
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message