You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by mc...@apache.org on 2003/10/07 23:33:37 UTC

cvs commit: avalon/merlin/kernel/unit/src/java/org/apache/avalon/merlin/unit AbstractMerlinTestCase.java

mcconnell    2003/10/07 14:33:37

  Modified:    merlin/kernel/unit project.xml
               merlin/kernel/unit/src/java/org/apache/avalon/merlin/unit
                        AbstractMerlinTestCase.java
  Log:
  Exception message enhancements and build housekeeping.
  
  Revision  Changes    Path
  1.2       +5 -13     avalon/merlin/kernel/unit/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/kernel/unit/project.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- project.xml	7 Oct 2003 18:03:11 -0000	1.1
  +++ project.xml	7 Oct 2003 21:33:37 -0000	1.2
  @@ -169,11 +169,12 @@
     
     <build>
   
  -    <sourceDirectory>src/java</sourceDirectory>
  -    <unitTestSourceDirectory>src/test</unitTestSourceDirectory>
  +    <sourceDirectory>${basedir}/src/java/</sourceDirectory>
  +    <unitTestSourceDirectory>${basedir}/src/test/</unitTestSourceDirectory>
   
       <unitTest>
         <includes>
  +        <include>**/*Test.*</include>
           <include>**/*TestCase.*</include>
         </includes>
         <excludes>
  @@ -181,8 +182,8 @@
         </excludes>
         <resources>
           <resource>
  -          <directory>${basedir}/src/test</directory>
  -          <includes> 
  +          <directory>${basedir}/src/java</directory>
  +          <includes>
               <include>**/*.dtd</include>
               <include>**/*.properties</include>
               <include>**/*.x*</include>
  @@ -198,18 +199,9 @@
         </resources>
       </unitTest>
   
  -    <testResources></testResources>
       <integrationUnitTestPatterns></integrationUnitTestPatterns>
   
       <resources>
  -      <resource>
  -        <directory>${basedir}/src/java</directory>
  -        <includes>
  -          <include>**/*.dtd</include>
  -          <include>**/*.properties</include>
  -          <include>**/*.x*</include>
  -        </includes>
  -      </resource>
         <resource>
           <directory>${basedir}</directory>
           <includes> 
  
  
  
  1.2       +19 -8     avalon/merlin/kernel/unit/src/java/org/apache/avalon/merlin/unit/AbstractMerlinTestCase.java
  
  Index: AbstractMerlinTestCase.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/kernel/unit/src/java/org/apache/avalon/merlin/unit/AbstractMerlinTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractMerlinTestCase.java	7 Oct 2003 18:03:11 -0000	1.1
  +++ AbstractMerlinTestCase.java	7 Oct 2003 21:33:37 -0000	1.2
  @@ -184,12 +184,14 @@
                   repository, repo, library, base, kernel, new URL[0], 
                   config, true, info, debug );
               m_kernel = new DefaultKernel( m_context );
  -            m_logger = m_context.getLoggerForCategory( "testcase" ).getChildLogger( name );
  +            m_logger = 
  +              m_context.getLoggerForCategory( "testcase" ).getChildLogger( name );
           }
           catch( Throwable e )
           {
  -            final String error =
  +            final String message =
                 "Internal error while attempting to establish the kernel.";
  +            final String error = ExceptionHelper.packException( message, e, true );
               throw new UnitRuntimeException( error, e );
           }
   
  @@ -207,9 +209,11 @@
           }
           catch( Throwable e )
           {
  -            final String error =
  +            final String message = 
                 "Internal error while attempting to establish the test container.";
  -            throw new UnitRuntimeException( error, e );
  +            final String error = ExceptionHelper.packException( message, e, true );
  +            getLogger().error( error );
  +            throw new UnitRuntimeException( error );
           }
       }
   
  @@ -231,10 +235,11 @@
           catch( Throwable e )
           {
               final String message = 
  -              "Internal error while attempting to establish the test container: " 
  +              "Internal error while attempting to resolve test block: " 
                 + m_test;
  -            final String error = ExceptionHelper.packException( message, e, false );
  -            throw new UnitException( error, e );
  +            final String error = ExceptionHelper.packException( message, e, true );
  +            getLogger().error( error );
  +            throw new UnitException( error );
           }
       }
   
  @@ -276,6 +281,12 @@
           try
           {
               Appliance appliance = m_block.resolveAppliance( path );
  +            if( appliance == null )
  +            {
  +                final String problem = 
  +                  "Unknown appliance: " + path;
  +                throw new IllegalArgumentException( problem );
  +            }
               return appliance.resolve( this );
           }
           catch( Throwable e )
  
  
  

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