bloritsch    2003/07/09 05:48:52

  Modified:    merlin/meta-spi/src/java/org/apache/avalon/meta/model
                        Import.java
               merlin   maven.xml
  Added:       merlin/meta-spi/src/test/org/apache/avalon/meta/model/test
                        ImportTestCase.java
  Log:
  Add tests for the import class
  
  Revision  Changes    Path
  1.2       +5 -5      
avalon-sandbox/merlin/meta-spi/src/java/org/apache/avalon/meta/model/Import.java
  
  Index: Import.java
  ===================================================================
  RCS file: 
/home/cvs/avalon-sandbox/merlin/meta-spi/src/java/org/apache/avalon/meta/model/Import.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Import.java       13 Mar 2003 01:06:26 -0000      1.1
  +++ Import.java       9 Jul 2003 12:48:52 -0000       1.2
  @@ -89,7 +89,7 @@
       /**
        * The container's context entry key.
        */
  -    private final String m_name;
  +    private final String m_importName;
   
       /**
        * Creation of a new entry directive.
  @@ -106,11 +106,11 @@
           m_key = key;
           if( null == name )
           {
  -            m_name = key;
  +            m_importName = key;
           }
           else
           {
  -            m_name = name;
  +            m_importName = name;
           }
       }
   
  @@ -120,7 +120,7 @@
        */
       public String getImportName()
       {
  -        return m_name;
  +        return m_importName;
       }
   
       /**
  
  
  
  1.1                  
avalon-sandbox/merlin/meta-spi/src/test/org/apache/avalon/meta/model/test/ImportTestCase.java
  
  Index: ImportTestCase.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, 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 "Jakarta", "Avalon", "Excalibur" 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
      [EMAIL PROTECTED]
  
   5. Products  derived from this software may not  be called "Apache", 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 (INCLU-
   DING, 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. For more  information on the
   Apache Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.avalon.meta.model.test;
  
  import junit.framework.TestCase;
  import org.apache.avalon.meta.model.Import;
  
  /**
   * ImportTestCase does XYZ
   *
   * @author <a href="bloritsch.at.apache.org">Berin Loritsch</a>
   * @version CVS $ Revision: 1.1 $
   */
  public class ImportTestCase extends TestCase
  {
      public ImportTestCase( String name )
      {
          super( name );
      }
  
      public void testImport()
      {
          String key = "key";
          String name = "name";
  
          try
          {
              new Import(null, name);
              fail("Did not throw the expected NullPointerException");
          }
          catch (NullPointerException npe)
          {
              // Success!!
          }
  
          Import imp = new Import(key, null);
          assertNotNull( imp.getImportName() );
          assertEquals( key, imp.getImportName() );
          assertEquals( key, imp.getKey() );
  
          imp = new Import( key, name );
          assertEquals( name, imp.getImportName() );
          assertEquals( key, imp.getKey() );
      }
  }
  
  
  1.25      +296 -0    avalon-sandbox/merlin/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/maven.xml,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- maven.xml 9 Jul 2003 11:39:26 -0000       1.24
  +++ maven.xml 9 Jul 2003 12:48:52 -0000       1.25
  @@ -1,3 +1,298 @@
  +<<<<<<< maven.xml
  +<project default="jar:jar" xmlns:maven="jelly:maven" xmlns:j="jelly:core" 
xmlns:util="jelly:util">
  +
  +  <property file="${basedir}/../build.properties"/>
  +  <property file="${basedir}/../project.properties"/>
  +  <property file="project.properties"/>
  +  <property name="merlin.build.inst" value="inst"/>
  +  <property name="merlin.build.inst.dir" 
value="${maven.build.dir}/${merlin.build.inst}"/>
  +  <property name="maven.jar.manifest.extensions.add" value="true"/>
  +
  +  <property name="maven.checkstyle.format" value="avalon"/>
  +  <property name="pom.organization.identifier" value="ASF"/>
  +  <property name="pom.specificationVersion" value="1.0"/>
  +
  +  <goal name="merlin-dist" 
  +    description="Build the Merlin distribution." >
  +
  +    <mkdir dir="${merlin.build.inst.dir}"/>
  +    <mkdir dir="${merlin.build.inst.dir}/ext"/>
  +    <mkdir dir="${merlin.build.inst.dir}/lib/system"/>
  +    <mkdir dir="${merlin.build.inst.dir}/lib/shared"/>
  +    <copy toDir="${merlin.build.inst.dir}/lib">
  +      <fileset dir="${basedir}/merlin-platform/lib"/>
  +    </copy>
  +
  +    <!--
  +    Install the sub-project jars (meta, assembly, merlin, etc.)
  +    into the user's local repository and put a copy in the 
  +    build target install directory.
  +    -->
  +
  +    <maven:reactor
  +      basedir="${basedir}"
  +      
includes="*/project.xml,merlin-extensions/merlin-jmx/project.xml,merlin-extensions/merlin-jndi/project.xml,merlin-extensions/merlin-servlet/project.xml"
  +      excludes="merlin-platform/*,merlin-plugin/*,activation*/*"
  +      goals="merlin-propergate"
  +      banner="Installing:"
  +      ignoreFailures="false" />
  +
  +    <!--
  +    Import the dependent jar files referenced by the SMP 
  +    subproject into the install directory.
  +    -->
  +
  +    <maven:reactor
  +      basedir="${basedir}"
  +      includes="merlin-platform/project.xml"
  +      goals="merlin-import-external-jars"
  +      banner="Resolving dependencies:"
  +      ignoreFailures="false"/>
  +
  +    <!--
  +    Move spi and framework jar files into the shared library.
  +    -->
  +
  +    <move toDir="${merlin.build.inst.dir}/lib/shared">
  +      <fileset dir="${merlin.build.inst.dir}/lib/system">
  +        <include name="*-api-*.jar"/>
  +        <include name="*-spi-*.jar"/>
  +      </fileset>
  +    </move>
  +
  +    <!--
  +    Add the supporting resources.
  +    -->
  +
  +    <copy toDir="${merlin.build.inst.dir}">
  +      <fileset dir="${basedir}/merlin-platform/src">
  +        <include name="bin/**/*"/>
  +        <include name="config/**/*"/>
  +        <include name="repository/**/*"/>
  +      </fileset>
  +      <fileset dir="${basedir}">
  +        <include name="LICENSE.txt"/>
  +        <include name="README.TXT"/>
  +      </fileset>
  +    </copy>
  +
  +    <chmod file="${merlin.build.inst.dir}/bin/merlin.sh" perm="ugo+rx"/>
  +
  +  </goal>
  +
  +  <goal name="testing">
  +    <copy toDir="${merlin.build.inst.dir}" flatten="true">
  +      <fileset dir="${basedir}/merlin-platform/src/etc">
  +        <include name="LICENSE.txt"/>
  +      </fileset>
  +    </copy>
  +  </goal>
  +
  +  <!--
  +  The following project is called against a subproject.  It results in 
  +  the build of the subproject, install of the jar in the user's local 
  +  repository, and copies the jar file into the merlin installation 
  +  directory.
  +  -->
  +  <goal name="merlin-propergate" prereqs="jar:install">
  +    <copy todir="${basedir}/../target/${merlin.build.inst}/lib/system">
  +      <fileset dir="${maven.build.dir}">
  +        <include name="${maven.final.name}.jar"/>
  +      </fileset>
  +    </copy>
  +  </goal>
  +
  +  <!--
  +  Import the jar files declared as dependecies of the smp project.  This
  +  includes all of the external jar files needed to run merlin.  Dependent 
  +  jar files are copied from the user's local repository to the merlin 
  +  install system library.
  +  -->
  +  <goal name="merlin-import-external-jars">
  +    <j:forEach var="dep" items="${pom.dependencies}">
  +      <copy 
  +        todir="${basedir}/../target/${merlin.build.inst}/lib/system"
  +        file="${maven.repo.local}/${dep.artifactDirectory}/jars/${dep.artifact}"/>
  +    </j:forEach>
  +  </goal>
  +
  +  <!--
  +  The site goal is called by the merlin-install goal and handles the generation
  +  of the documetation for the entire Merlin project including the related sub-
  +  projects.
  +  -->
  +  <goal name="merlin-site"
  +    description="Build the Merlin site.">
  +    <maven:reactor
  +      basedir="${basedir}"
  +      includes="merlin-platform/project.xml"
  +      goals="xjavadoc,site"
  +      banner="Building site."
  +      ignoreFailures="false"/>
  +  </goal>
  +
  +  <!-- convinience docs generation within runing javadoc -->
  +  <goal name="merlin-site-xdocs"
  +    description="Build the Merlin site.">
  +    <maven:reactor
  +      basedir="${basedir}"
  +      includes="merlin-platform/project.xml"
  +      goals="site"
  +      banner="Building site."
  +      ignoreFailures="false"/>
  +  </goal>
  +
  +  <!-- convinience javadoc generation within runing xdocs -->
  +  <goal name="merlin-site-javadoc"
  +    description="Build the Merlin site.">
  +    <maven:reactor
  +      basedir="${basedir}"
  +      includes="merlin-platform/project.xml"
  +      goals="xjavadoc"
  +      banner="Building site."
  +      ignoreFailures="false"/>
  +  </goal>
  +
  +
  +  <!--
  +  The site goal is called by the merlin-install goal and handles the generation
  +  of the documetation for the entire Merlin project including the related sub-
  +  projects.
  +  -->
  +  <goal name="merlin-site-deploy"
  +    description="Deploy the Merlin site.">
  +
  +    <maven:reactor
  +      basedir="${basedir}"
  +      includes="merlin-platform/project.xml"
  +      goals="site:fsdeploy"
  +      banner="Deploying site."
  +      ignoreFailures="false"/>
  +
  +  </goal>
  +
  +  <!--
  +  The update goal generates the merlin site and deploys it to local site repository.
  +  -->
  +  <goal name="merlin-update">
  +    <attainGoal name="merlin-site"/>
  +    <attainGoal name="merlin-site-deploy"/>
  +  </goal>
  +
  +  <!--
  +  Copy the distribution into the local merlin installation.  This target
  +  is very preliminary and presumes that you have a MERLIN_HOME environment 
  +  variable already defined.  No checking or validation is currently in 
  +  place.  It is useful if you want to update an existing installation.
  +  -->
  +  <goal name="merlin-install" prereqs="merlin-install-plugin,merlin-dist">
  +    <property environment="env"/>
  +    <mkdir dir="${env.MERLIN_HOME}"/>
  +    <echo>Installing Merlin into home directory: ${env.MERLIN_HOME}</echo>
  +    <copy toDir="${env.MERLIN_HOME}">
  +      <fileset dir="${merlin.build.inst.dir}">
  +        <include name="**/*"/>
  +      </fileset>
  +    </copy>
  +  </goal>
  +
  +  <!--
  +  Utility goal to update the lib directories in the Merlin installation
  +  without disrupting current executing NT services.  I.e. just update
  +  the jar files in the lib subdirectories.
  +  -->
  +  <goal name="merlin-libs" prereqs="merlin-install-plugin,merlin-dist">
  +    <property environment="env"/>
  +    <mkdir dir="${env.MERLIN_HOME}/lib/shared"/>
  +    <echo>Updating Merlin libraries: ${env.MERLIN_HOME}</echo>
  +    <copy toDir="${env.MERLIN_HOME}/lib/shared">
  +      <fileset dir="${merlin.build.inst.dir}/lib/shared">
  +        <include name="**/*"/>
  +      </fileset>
  +    </copy>
  +    <mkdir dir="${env.MERLIN_HOME}/lib/system"/>
  +    <copy toDir="${env.MERLIN_HOME}/lib/system">
  +      <fileset dir="${merlin.build.inst.dir}/lib/system">
  +        <include name="**/*"/>
  +      </fileset>
  +    </copy>
  +  </goal>
  +
  +  <goal name="xjavadoc">
  +    <mkdir dir="${basedir}/target/docs/api" />
  +    <property name="copyright"
  +      value="Copyright &amp;copy; ${year} ${pom.organization.name}. All Rights 
Reserved." />
  +    <property name="title" value="${pom.name} ${pom.currentVersion} API"/>
  +    <javadoc destdir="${basedir}/target/docs/api" 
  +     doctitle="&lt;h1&gt;Merlin Service Management API&lt;/h1&gt;" 
  +      noindex="false" author="true" use="true"
  +     windowtitle="${title}" 
  +      bottom="${copyright}"
  +      additionalparam="-breakiterator -J-Xmx128m -tag todo:a:ToDo: "
  +      packagenames="*,org.*">
  +        <j:forEach var="packageGroup" items="${pom.packageGroups}">
  +               <group title="${packageGroup.title}" 
packages="${packageGroup.packages}"/>
  +        </j:forEach>
  +        <sourcepath path="${basedir}/../meta-spi/src/java"/>
  +        <sourcepath path="${basedir}/../meta/src/java"/>
  +        <sourcepath path="${basedir}/../extension-spi/src/java"/>
  +        <sourcepath path="${basedir}/../extension/src/java"/>
  +        <sourcepath path="${basedir}/../composition-spi/src/java"/>
  +        <sourcepath path="${basedir}/../composition/src/java"/>
  +        <sourcepath path="${basedir}/../assembly-spi/src/java"/>
  +        <sourcepath path="${basedir}/../assembly/src/java"/>
  +        <sourcepath path="${basedir}/../merlin-spi/src/java"/>
  +        <sourcepath path="${basedir}/../merlin-core/src/java"/>
  +        <classpath>
  +          <path refid="maven.dependency.classpath"/>
  +       </classpath>
  +       <link href="${sun.j2se.link}" />
  +       <link href="${avalon.framework.link}" />
  +       <link href="${avalon.logkit.link}" />
  +       <link href="${avalon.lifecycle.link}" />
  +       <link href="${excalibur.configuration.link}" />
  +       <link href="${excalibur.pool.link}" />
  +       <link href="${excalibur.thread.link}" />
  +       <link href="${excalibur.event.link}" />
  +    </javadoc>
  +  </goal>
  +
  +  <!--
  +  Install the merlin plugin into the Maven plugin suite.
  +  -->
  +  <goal name="merlin-install-plugin" prereqs="merlin-dist" 
  +      description="Install Merlin Maven plugin.">
  +    <attainGoal name="merlinx-install-plugin"/>
  +  </goal>
  +
  +  <goal name="merlinx-install-plugin">
  +    <maven:reactor
  +      basedir="${basedir}"
  +      includes="merlin-plugin/project.xml"
  +      goals="plugin:install"
  +      banner="Installing plugin:"
  +      ignoreFailures="false"/>
  +  </goal>
  +
  +
  +  <!--
  +  ==============================================================================
  +  utilities
  +  ==============================================================================
  +  -->
  +
  +  <goal name="merlin-clean" prereqs="clean">
  +    <maven:reactor
  +      basedir="${basedir}"
  +      includes="*/project.xml,merlin-extensions/*/project.xml"
  +      excludes="activation*/*"
  +      goals="clean"
  +      banner="Cleaning subproject:"
  +      ignoreFailures="false"/>
  +  </goal>
  +
  +</project>
  +=======
   <project default="jar:jar" xmlns:maven="jelly:maven" xmlns:j="jelly:core" 
xmlns:util="jelly:util">
   
     <property file="${basedir}/../build.properties"/>
  @@ -293,3 +588,4 @@
     </goal>
   
   </project>
  +>>>>>>> 1.24
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to