avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/sourceresolve/src/test/org/apache/excalibur/source SourceResolverImplTestCase.java
Date Wed, 29 Jan 2003 16:00:10 GMT
mcconnell    2003/01/29 08:00:09

  Added:       sourceresolve/src/test/org/apache/excalibur/source
                        SourceResolverImplTestCase.java
  Log:
  Updated but now working yet.
  
  Revision  Changes    Path
  1.1                  jakarta-avalon-excalibur/sourceresolve/src/test/org/apache/excalibur/source/SourceResolverImplTestCase.java
  
  Index: SourceResolverImplTestCase.java
  ===================================================================
  
  
  package org.apache.excalibur.source;
  
  import java.io.File;
  import junit.framework.TestCase;
  import org.apache.avalon.framework.logger.ConsoleLogger;
  import org.apache.avalon.framework.logger.Logger;
  import org.apache.avalon.framework.context.DefaultContext;
  import org.apache.avalon.framework.parameters.Parameters;
  import org.apache.avalon.framework.service.DefaultServiceManager;
  import org.apache.avalon.framework.service.DefaultServiceSelector;
  import org.apache.excalibur.source.impl.SourceResolverImpl;
  import org.apache.excalibur.source.impl.ResourceSourceFactory;
  
  public class SourceResolverImplTestCase extends TestCase
  {
  
      public SourceResolverImplTestCase( )
      {
          this( "source" );
      }
  
      public SourceResolverImplTestCase( String name )
      {
          super( name );
      }
  
      public void testResolver() throws Exception
      {
          Logger logger = new ConsoleLogger( ConsoleLogger.LEVEL_DEBUG );
  
          //
          // create the component to handle source resolution
          //
  
          final SourceResolverImpl resolver = new SourceResolverImpl();
          resolver.enableLogging( logger );
  
          //
          // create the context argument and set the root directory and 
          // contextualize the resolver
          //
          // NOTE: javadoc needed on contextualize method
          //
  
          final DefaultContext context = new DefaultContext();
          context.put( "context-root", new File( System.getProperty( "user.work" ) ) );
          resolver.contextualize( context );
  
          //
          // create a service selector to be included in a service manager 
          // to be supplied to the resolver
          //
  
          final ResourceSourceFactory factory = new ResourceSourceFactory();
          factory.enableLogging( logger.getChildLogger( "factory" ) );
  
          // create a selector and add the factory to the selector,
          // add the selector to the manager, and service the resolver
          // NOTE: javadoc missing on the serviceable method
          //
  
          final DefaultServiceSelector selector = new DefaultServiceSelector();
          selector.put( "resource", factory );
  
          final DefaultServiceManager manager = new DefaultServiceManager();
          manager.put( SourceFactory.ROLE + "Selector", selector );
  
          //
          // parameterize the resolver - Why?
          // NOTE: Missing javadoc
          //
  
          resolver.parameterize( new Parameters() );
  
          //
          // setup a protocol handler - TO BE DONE
          //
  
          logger.debug( "help me - need to setup a handler" );
  
          //
          // test source URL creation - TO BE DONE
          //
  
          logger.debug( "help me - need to test source creation" );
  
          //
          // test source resolution - TO BE DONE
          //
  
          logger.debug( "help me - need to test source resolution" );
  
          assertTrue( true );
      }
  
  }
  
  
  

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


Mime
View raw message