avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: avalon-sandbox/merlin/merlin-core/src/test/org/apache/avalon/merlin RepositoryTestCase.java
Date Thu, 17 Apr 2003 03:27:27 GMT
mcconnell    2003/04/16 20:27:26

  Added:       merlin/merlin-core/src/test/org/apache/avalon/merlin
                        RepositoryTestCase.java
  Log:
  Addition of the repository test case.
  
  Revision  Changes    Path
  1.1                  avalon-sandbox/merlin/merlin-core/src/test/org/apache/avalon/merlin/RepositoryTestCase.java
  
  Index: RepositoryTestCase.java
  ===================================================================
  
  
  package org.apache.avalon.merlin;
  
  import java.io.File;
  import java.io.IOException;
  import java.io.FileInputStream;
  import java.io.InputStream;
  import java.io.IOException;
  import java.io.FileNotFoundException;
  import java.util.StringTokenizer;
  import java.util.Enumeration;
  import java.util.List;
  import java.util.Iterator;
  import java.util.jar.JarFile;
  import java.util.ArrayList;
  import java.util.Map;
  import java.util.jar.Attributes;
  import java.util.jar.Manifest;
  import java.net.URLClassLoader;
  import java.net.URL;
  import java.util.zip.ZipEntry;
  import java.net.MalformedURLException;
  import java.net.JarURLConnection;
  
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.configuration.ConfigurationException;
  import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
  import org.apache.avalon.framework.context.Context;
  import org.apache.avalon.framework.context.DefaultContext;
  import org.apache.avalon.framework.context.Contextualizable;
  import org.apache.avalon.framework.context.ContextException;
  import org.apache.avalon.meta.info.ReferenceDescriptor;
  import org.apache.avalon.merlin.block.Block;
  import org.apache.avalon.merlin.kernel.KernelException;
  import org.apache.avalon.assembly.util.ExceptionHelper;
  import org.apache.avalon.assembly.locator.DefaultLocator;
  import org.apache.avalon.assembly.appliance.Appliance;
  import org.apache.avalon.assembly.util.ExceptionHelper;
  import junit.framework.TestCase;
  
  public class RepositoryTestCase extends AbstractTestCase
  {
      public RepositoryTestCase( )
      {
          this( "repository" );
      }
  
      public RepositoryTestCase( String name )
      {
          super( name );
      }
  
      public void testBlock() throws Exception
      {
          System.out.println( "-------------------------------------" );
          Block block = super.getRootBlock();
          printBlock( "  ", block );
          System.out.println( "-------------------------------------" );
      }
  
      private void printBlock( String lead, Block block )
      {
          System.out.println( lead + "block: " + block + ", " + System.identityHashCode( block
) );
          System.out.println( lead + "context: " + block.getContextProvider() );
          Appliance[] appliances = block.getAppliances();
          System.out.println( lead + "appliances: " + appliances.length );
          for( int i=0; i<appliances.length; i++ )
          {
              Appliance appliance = appliances[i];
              if( appliance instanceof Block )
              {
                  printBlock( lead + " ", (Block) appliance );
              }
              else
              {
                  System.out.println( lead + "--> appliance: " + appliance );
              }
          }
      }
  }
  
  
  

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


Mime
View raw message