avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon-phoenix/src/test/org/apache/avalon/phoenix/test AbstractContainerTestCase.java
Date Tue, 01 Oct 2002 06:16:59 GMT
donaldp     2002/09/30 23:16:59

  Added:       src/test/org/apache/avalon/phoenix/test
                        AbstractContainerTestCase.java
  Log:
  Add in an abstract test case that will be used to test the innerts of Phoenix
  
  Revision  Changes    Path
  1.1                  jakarta-avalon-phoenix/src/test/org/apache/avalon/phoenix/test/AbstractContainerTestCase.java
  
  Index: AbstractContainerTestCase.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.avalon.phoenix.test;
  
  import junit.framework.TestCase;
  import org.apache.avalon.phoenix.metadata.SarMetaData;
  import org.apache.avalon.phoenix.tools.assembler.Assembler;
  import org.apache.avalon.phoenix.tools.configuration.ConfigurationBuilder;
  import org.apache.avalon.framework.logger.ConsoleLogger;
  import org.apache.avalon.framework.configuration.Configuration;
  import java.io.File;
  import java.net.URL;
  
  /**
   * Abstract class which TestCases can extend.
   *
   * @author <a href="mailto:peter at apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/10/01 06:16:59 $
   */
  public class AbstractContainerTestCase
      extends TestCase
  {
      public AbstractContainerTestCase( String name )
      {
          super( name );
      }
  
      protected SarMetaData assembleSar( final String config )
          throws Exception
      {
          final Assembler assembler = new Assembler();
          assembler.enableLogging( new ConsoleLogger() );
          final ClassLoader classLoader = getClass().getClassLoader();
          final Configuration assembly = loadConfig( config );
          return assembler.assembleSar( "test", assembly,
                                        new File( "." ), classLoader );
      }
  
      protected Configuration loadConfig( final String config )
          throws Exception
      {
          final URL resource = getClass().getResource( config );
          return ConfigurationBuilder.build( resource.toExternalForm() );
      }
  }
  
  
  

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


Mime
View raw message