maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ogusa...@apache.org
Subject svn commit: r769199 [19/19] - in /maven/mercury/trunk: mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/ mercury-ant-tasks/src/test/java/org/apache/maven/mercury/ant/tasks/ mercury-core/src/main/java/org/apache/maven/mercury/artifact/...
Date Mon, 27 Apr 2009 23:12:32 GMT
Modified: maven/mercury/trunk/mercury-it/src/test/java/org/apache/maven/mercury/repository/tests/RemoteRepositoryWriterM2Test.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-it/src/test/java/org/apache/maven/mercury/repository/tests/RemoteRepositoryWriterM2Test.java?rev=769199&r1=769198&r2=769199&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-it/src/test/java/org/apache/maven/mercury/repository/tests/RemoteRepositoryWriterM2Test.java
(original)
+++ maven/mercury/trunk/mercury-it/src/test/java/org/apache/maven/mercury/repository/tests/RemoteRepositoryWriterM2Test.java
Mon Apr 27 23:12:25 2009
@@ -35,14 +35,11 @@
 import org.apache.maven.mercury.util.FileUtil;
 
 /**
- *
- *
  * @author Oleg Gusakov
  * @version $Id$
- *
  */
 public class RemoteRepositoryWriterM2Test
-extends AbstractRepositoryWriterM2Test
+    extends AbstractRepositoryWriterM2Test
 {
     static final String _davContext = "/webdav";
 
@@ -54,107 +51,111 @@
 
     RemoteRepositoryM2 _davRepo;
 
-  String _basePath = "./target/webdav";
+    String _basePath = "./target/webdav";
 
-  //------------------------------------------------------------------------------
-  @Override
-  void setReleases()
-  throws Exception
-  {
-  }
-  //------------------------------------------------------------------------------
-  @Override
-  void setSnapshots()
-  throws Exception
-  {
-  }
-  //---------------------------------------------------------------------------------------------
-  protected void startDavServer( String basePath, String baseHint )
-  throws Exception
-  {
-      targetDirectory = new File( basePath );
-
-      FileUtil.delete( targetDirectory );
-
-      targetDirectory.mkdirs();
-      
-      _dav = new WebDavServer( 0, targetDirectory, _davContext, getContainer(), 9, baseHint,
null );
-      
-      _dav.start();
-      
-      Credentials user = new Credentials(_user,_pass);
-      
-      server = new Server("dav", new URL("http://localhost:"+_dav.getPort()+_davContext),
false, false, user );
-      
-System.out.println("Server: "+server.getURL() + " ==> " + basePath );
-      
-      mdProcessor = new MetadataProcessorMock();
-      
-      repo = new RemoteRepositoryM2( server, mdProcessor );
-      
-      // verifiers
-      factories = new HashSet<StreamVerifierFactory>();       
-      factories.add( 
-          new PgpStreamVerifierFactory(
-                  new StreamVerifierAttributes( PgpStreamVerifierFactory.DEFAULT_EXTENSION,
false, false )
-                  , getClass().getResourceAsStream( secretKeyFile )
-                  , keyId
-                  , secretKeyPass
-                                      )
-                    );
-      factories.add( new SHA1VerifierFactory(false,false) );
-      server.setWriterStreamVerifierFactories(factories);
-        
-      reader = repo.getReader();
-      writer = repo.getWriter();
-      
-  }
-  //---------------------------------------------------------------------------------------------
-  protected void stopDavServer()
-  throws Exception
-  {
-      if( _dav != null )
-      {
-          _dav.stop();
-          _dav.destroy();
-          _dav = null;
-      }  
-  }
-  //------------------------------------------------------------------------------
-  @Override
-  protected void setUp()
-  throws Exception
-  {
-    super.setUp();
-
-    query = new ArrayList<ArtifactMetadata>();
-
-    startDavServer( _basePath, "mercury-test"  );
-  }
-  //-------------------------------------------------------------------------
-  @Override
-  protected void tearDown()
-  throws Exception
-  {
-    super.tearDown();
-    
-    stopDavServer();
-  }
-  //-------------------------------------------------------------------------
-  @Override
-  public void testWriteContentionMultipleArtifacts()
-      throws Exception
-  {
-    System.out.println("Mutliple Artifacts contention does not apply to remote repo client");
-  }
-  
-  @Override
-  public void testWriteContentionSingleArtifact()
-      throws Exception
-  {
-    System.out.println("Single Artifacts contention does not apply to remote repo client");
-  }
-  
-  //-------------------------------------------------------------------------
-  //-------------------------------------------------------------------------
+    // ------------------------------------------------------------------------------
+    @Override
+    void setReleases()
+        throws Exception
+    {
+    }
+
+    // ------------------------------------------------------------------------------
+    @Override
+    void setSnapshots()
+        throws Exception
+    {
+    }
+
+    // ---------------------------------------------------------------------------------------------
+    protected void startDavServer( String basePath, String baseHint )
+        throws Exception
+    {
+        targetDirectory = new File( basePath );
+
+        FileUtil.delete( targetDirectory );
+
+        targetDirectory.mkdirs();
+
+        _dav = new WebDavServer( 0, targetDirectory, _davContext, getContainer(), 9, baseHint,
null );
+
+        _dav.start();
+
+        Credentials user = new Credentials( _user, _pass );
+
+        server = new Server( "dav", new URL( "http://localhost:" + _dav.getPort() + _davContext
), false, false, user );
+
+        System.out.println( "Server: " + server.getURL() + " ==> " + basePath );
+
+        mdProcessor = new MetadataProcessorMock();
+
+        repo = new RemoteRepositoryM2( server, mdProcessor );
+
+        // verifiers
+        factories = new HashSet<StreamVerifierFactory>();
+        factories.add( new PgpStreamVerifierFactory(
+                                                     new StreamVerifierAttributes(
+                                                                                   PgpStreamVerifierFactory.DEFAULT_EXTENSION,
+                                                                                   false,
false ),
+                                                     getClass().getResourceAsStream( secretKeyFile
), keyId,
+                                                     secretKeyPass ) );
+        factories.add( new SHA1VerifierFactory( false, false ) );
+        server.setWriterStreamVerifierFactories( factories );
+
+        reader = repo.getReader();
+        writer = repo.getWriter();
+
+    }
+
+    // ---------------------------------------------------------------------------------------------
+    protected void stopDavServer()
+        throws Exception
+    {
+        if ( _dav != null )
+        {
+            _dav.stop();
+            _dav.destroy();
+            _dav = null;
+        }
+    }
+
+    // ------------------------------------------------------------------------------
+    @Override
+    protected void setUp()
+        throws Exception
+    {
+        super.setUp();
+
+        query = new ArrayList<ArtifactMetadata>();
+
+        startDavServer( _basePath, "mercury-test" );
+    }
+
+    // -------------------------------------------------------------------------
+    @Override
+    protected void tearDown()
+        throws Exception
+    {
+        super.tearDown();
+
+        stopDavServer();
+    }
+
+    // -------------------------------------------------------------------------
+    @Override
+    public void testWriteContentionMultipleArtifacts()
+        throws Exception
+    {
+        System.out.println( "Mutliple Artifacts contention does not apply to remote repo
client" );
+    }
+
+    @Override
+    public void testWriteContentionSingleArtifact()
+        throws Exception
+    {
+        System.out.println( "Single Artifacts contention does not apply to remote repo client"
);
+    }
+
+    // -------------------------------------------------------------------------
+    // -------------------------------------------------------------------------
 }

Modified: maven/mercury/trunk/mercury-it/src/test/java/org/apache/maven/mercury/repository/tests/THelper.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-it/src/test/java/org/apache/maven/mercury/repository/tests/THelper.java?rev=769199&r1=769198&r2=769199&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-it/src/test/java/org/apache/maven/mercury/repository/tests/THelper.java
(original)
+++ maven/mercury/trunk/mercury-it/src/test/java/org/apache/maven/mercury/repository/tests/THelper.java
Mon Apr 27 23:12:25 2009
@@ -24,16 +24,13 @@
 import org.apache.maven.mercury.artifact.ArtifactMetadata;
 
 /**
- *
- *
  * @author Oleg Gusakov
  * @version $Id$
- *
  */
 public class THelper
 {
-  public static List<ArtifactMetadata> toList( ArtifactMetadata... bmds)
-  {
-    return Arrays.asList( bmds );
-  }
+    public static List<ArtifactMetadata> toList( ArtifactMetadata... bmds )
+    {
+        return Arrays.asList( bmds );
+    }
 }

Modified: maven/mercury/trunk/mercury-it/src/test/java/org/apache/maven/mercury/repository/tests/VirtualRepositoryReaderIntegratedTest.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-it/src/test/java/org/apache/maven/mercury/repository/tests/VirtualRepositoryReaderIntegratedTest.java?rev=769199&r1=769198&r2=769199&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-it/src/test/java/org/apache/maven/mercury/repository/tests/VirtualRepositoryReaderIntegratedTest.java
(original)
+++ maven/mercury/trunk/mercury-it/src/test/java/org/apache/maven/mercury/repository/tests/VirtualRepositoryReaderIntegratedTest.java
Mon Apr 27 23:12:25 2009
@@ -29,8 +29,8 @@
 import org.apache.maven.mercury.MavenDependencyProcessor;
 import org.apache.maven.mercury.artifact.ArtifactMetadata;
 import org.apache.maven.mercury.builder.api.DependencyProcessor;
-import org.apache.maven.mercury.repository.api.MetadataResults;
 import org.apache.maven.mercury.repository.api.ArtifactResults;
+import org.apache.maven.mercury.repository.api.MetadataResults;
 import org.apache.maven.mercury.repository.api.Repository;
 import org.apache.maven.mercury.repository.api.RepositoryMetadataCache;
 import org.apache.maven.mercury.repository.api.RepositoryUpdateIntervalPolicy;
@@ -48,205 +48,213 @@
 import org.apache.maven.mercury.util.Util;
 
 public class VirtualRepositoryReaderIntegratedTest
-extends TestCase
+    extends TestCase
 {
-  File _testBase;
-  File _localRepoBase;
-  
-  public String _port;
-  HttpTestServer _server;
-  
-  List<ArtifactMetadata> _query;
-  
-  RemoteRepositoryM2 _remoteRepo;
-  LocalRepositoryM2  _localRepo;
-  
-  
-  VirtualRepositoryReader _vr;
-
-  //-------------------------------------------------------------------------
-  @Override
-  protected void setUp()
-  throws Exception
-  {
-    _testBase = new File("./target/test-classes/repoVr");
-    _localRepoBase = new File("./target/localRepo");
-    
-    FileUtil.delete( _localRepoBase );
-    _localRepoBase.mkdirs();
-    
-    _server = new HttpTestServer( _testBase, "/repo" );
-    _server.start();
-    _port = String.valueOf( _server.getPort() );
-
-    _query = new ArrayList<ArtifactMetadata>();
-
-    DependencyProcessor mdProcessor = new MetadataProcessorMock();
-
-    Server server = new Server( "testRemoteRepo", new URL("http://localhost:"+_port+"/repo")
);
-    _remoteRepo = new RemoteRepositoryM2( server, new MavenDependencyProcessor() );
-    _remoteRepo.setUpdatePolicy( new RepositoryUpdateIntervalPolicy("interval2").setInterval(
2000L ) );
-    _remoteRepo.setDependencyProcessor( mdProcessor );
-    
-    _localRepo = new LocalRepositoryM2( "testLocalRepo", _localRepoBase, new MavenDependencyProcessor()
);
-    _localRepo.setDependencyProcessor( mdProcessor );
-    
-    List<Repository> reps = new ArrayList<Repository>();
-    reps.add( _remoteRepo );
-    reps.add( _localRepo );
-
-    _vr = new VirtualRepositoryReader( reps );
-  }
-  //-------------------------------------------------------------------------
-  @Override
-  protected void tearDown()
-  throws Exception
-  {
-    super.tearDown();
-    _server.stop();
-    _server.destroy();
-  }
-  //-------------------------------------------------------------------------
-  public void testReadArtifact()
-  throws Exception
-  {
-    try
-    {
-    ArtifactMetadata bmd = new ArtifactMetadata("a:a:[1,)");
-    List<ArtifactMetadata> q = THelper.toList( bmd );
-    
-    MetadataResults vres = _vr.readVersions( q );
-     
-    assertNotNull( vres );
-     
-    assertFalse( vres.hasExceptions() );
-    
-    assertTrue( vres.hasResults() );
-    
-    assertTrue( vres.hasResults(bmd) );
-    
-    List<ArtifactMetadata> versions = vres.getResult( bmd );
-    
-    assertNotNull( versions );
-    
-    assertEquals( 5, versions.size() );
-    
-    // add version 6 to GA metadata
-    File mdf = new File( _testBase, "a/a/maven-metadata.xml");
-    Metadata md = MetadataBuilder.getMetadata( FileUtil.readRawData( mdf ) );
-    
-    byte [] newBytes = MetadataBuilder.changeMetadata( md, new AddVersionOperation(new StringOperand("6"))
);
-    
-    FileUtil.writeRawData( mdf, newBytes );
-    
-    // version MD is in memory, there should be still be 5 versions
-    vres = _vr.readVersions( q );
-    
-    assertNotNull( vres );
-     
-    assertFalse( vres.hasExceptions() );
-    
-    assertTrue( vres.hasResults() );
-    
-    assertTrue( vres.hasResults(bmd) );
-    
-    versions = vres.getResult( bmd );
-    
-    assertNotNull( versions );
-    
-    assertEquals( 5, versions.size() );
-    
-    // clean in-memory cache, so that on-disk expiration rules apply
-    RepositoryMetadataCache cache = _vr.getCache();
-    
-    cache.clearSession();
-    
-    Thread.sleep( 4000L );
-    
-    // We are past the expiration point of 5 sec - should now have 6 versions.  
-    vres = _vr.readVersions( q );
-    
-    assertNotNull( vres );
-     
-    assertFalse( vres.hasExceptions() );
-    
-    assertTrue( vres.hasResults() );
-    
-    assertTrue( vres.hasResults(bmd) );
-    
-    versions = vres.getResult( bmd );
-    
-    assertNotNull( versions );
-    
-    assertEquals( 6, versions.size() );
-    
-    }
-    finally
-    {
-      // restore back 5 versions
-      File mdf = new File( _testBase, "a/a/maven-metadata.xml");
-      InputStream in = VirtualRepositoryReaderIntegratedTest.class.getResourceAsStream( "/repoVr/a.a-maven-metadata.xml"
);
-      FileUtil.writeRawData( in, mdf );
-    }
-  }
-  //-------------------------------------------------------------------------
-  public void testReadBadVersions()
-  {
-    ArtifactMetadata bmd = new ArtifactMetadata("does.not:exist:1.0");
-    List<ArtifactMetadata> q = THelper.toList( bmd );
-    
-    MetadataResults vres = null;
-    try
-    {
-        vres = _vr.readVersions( q );
-    }
-    catch ( Exception e )
-    {
-        fail("reading non-existing artifact throws an exception");
-    }
-     
-    assertNull( vres );
-    
-  }
-  //-------------------------------------------------------------------------
-  public void testReadBadDependencies()
-  {
-    ArtifactMetadata bmd = new ArtifactMetadata("does.not:exist:1.0");
-    
-    ArtifactMetadata vres = null;
-    try
-    {
-        vres = _vr.readDependencies( bmd );
-    }
-    catch ( Exception e )
-    {
-        fail("reading non-existing artifact throws an exception");
-    }
-     
-    assertTrue( Util.isEmpty( vres.getDependencies() ) );
-    
-  }
-  //-------------------------------------------------------------------------
-  public void testReadBadArtifact()
-  {
-      ArtifactMetadata bmd = new ArtifactMetadata("does.not:exist:1.0");
-      List<ArtifactMetadata> q = THelper.toList( bmd );
-      
-    ArtifactResults vres = null;
-    try
-    {
-        vres = _vr.readArtifacts(  q );
-    }
-    catch ( Exception e )
-    {
-        fail("reading non-existing artifact throws an exception");
-    }
-    
-    assertNotNull( vres );
-    
-    assertFalse( vres.hasResults() );
-    
-  }
-  //-------------------------------------------------------------------------
-  //-------------------------------------------------------------------------
+    File _testBase;
+
+    File _localRepoBase;
+
+    public String _port;
+
+    HttpTestServer _server;
+
+    List<ArtifactMetadata> _query;
+
+    RemoteRepositoryM2 _remoteRepo;
+
+    LocalRepositoryM2 _localRepo;
+
+    VirtualRepositoryReader _vr;
+
+    // -------------------------------------------------------------------------
+    @Override
+    protected void setUp()
+        throws Exception
+    {
+        _testBase = new File( "./target/test-classes/repoVr" );
+        _localRepoBase = new File( "./target/localRepo" );
+
+        FileUtil.delete( _localRepoBase );
+        _localRepoBase.mkdirs();
+
+        _server = new HttpTestServer( _testBase, "/repo" );
+        _server.start();
+        _port = String.valueOf( _server.getPort() );
+
+        _query = new ArrayList<ArtifactMetadata>();
+
+        DependencyProcessor mdProcessor = new MetadataProcessorMock();
+
+        Server server = new Server( "testRemoteRepo", new URL( "http://localhost:" + _port
+ "/repo" ) );
+        _remoteRepo = new RemoteRepositoryM2( server, new MavenDependencyProcessor() );
+        _remoteRepo.setUpdatePolicy( new RepositoryUpdateIntervalPolicy( "interval2" ).setInterval(
2000L ) );
+        _remoteRepo.setDependencyProcessor( mdProcessor );
+
+        _localRepo = new LocalRepositoryM2( "testLocalRepo", _localRepoBase, new MavenDependencyProcessor()
);
+        _localRepo.setDependencyProcessor( mdProcessor );
+
+        List<Repository> reps = new ArrayList<Repository>();
+        reps.add( _remoteRepo );
+        reps.add( _localRepo );
+
+        _vr = new VirtualRepositoryReader( reps );
+    }
+
+    // -------------------------------------------------------------------------
+    @Override
+    protected void tearDown()
+        throws Exception
+    {
+        super.tearDown();
+        _server.stop();
+        _server.destroy();
+    }
+
+    // -------------------------------------------------------------------------
+    public void testReadArtifact()
+        throws Exception
+    {
+        try
+        {
+            ArtifactMetadata bmd = new ArtifactMetadata( "a:a:[1,)" );
+            List<ArtifactMetadata> q = THelper.toList( bmd );
+
+            MetadataResults vres = _vr.readVersions( q );
+
+            assertNotNull( vres );
+
+            assertFalse( vres.hasExceptions() );
+
+            assertTrue( vres.hasResults() );
+
+            assertTrue( vres.hasResults( bmd ) );
+
+            List<ArtifactMetadata> versions = vres.getResult( bmd );
+
+            assertNotNull( versions );
+
+            assertEquals( 5, versions.size() );
+
+            // add version 6 to GA metadata
+            File mdf = new File( _testBase, "a/a/maven-metadata.xml" );
+            Metadata md = MetadataBuilder.getMetadata( FileUtil.readRawData( mdf ) );
+
+            byte[] newBytes = MetadataBuilder.changeMetadata( md, new AddVersionOperation(
new StringOperand( "6" ) ) );
+
+            FileUtil.writeRawData( mdf, newBytes );
+
+            // version MD is in memory, there should be still be 5 versions
+            vres = _vr.readVersions( q );
+
+            assertNotNull( vres );
+
+            assertFalse( vres.hasExceptions() );
+
+            assertTrue( vres.hasResults() );
+
+            assertTrue( vres.hasResults( bmd ) );
+
+            versions = vres.getResult( bmd );
+
+            assertNotNull( versions );
+
+            assertEquals( 5, versions.size() );
+
+            // clean in-memory cache, so that on-disk expiration rules apply
+            RepositoryMetadataCache cache = _vr.getCache();
+
+            cache.clearSession();
+
+            Thread.sleep( 4000L );
+
+            // We are past the expiration point of 5 sec - should now have 6 versions.
+            vres = _vr.readVersions( q );
+
+            assertNotNull( vres );
+
+            assertFalse( vres.hasExceptions() );
+
+            assertTrue( vres.hasResults() );
+
+            assertTrue( vres.hasResults( bmd ) );
+
+            versions = vres.getResult( bmd );
+
+            assertNotNull( versions );
+
+            assertEquals( 6, versions.size() );
+
+        }
+        finally
+        {
+            // restore back 5 versions
+            File mdf = new File( _testBase, "a/a/maven-metadata.xml" );
+            InputStream in =
+                VirtualRepositoryReaderIntegratedTest.class.getResourceAsStream( "/repoVr/a.a-maven-metadata.xml"
);
+            FileUtil.writeRawData( in, mdf );
+        }
+    }
+
+    // -------------------------------------------------------------------------
+    public void testReadBadVersions()
+    {
+        ArtifactMetadata bmd = new ArtifactMetadata( "does.not:exist:1.0" );
+        List<ArtifactMetadata> q = THelper.toList( bmd );
+
+        MetadataResults vres = null;
+        try
+        {
+            vres = _vr.readVersions( q );
+        }
+        catch ( Exception e )
+        {
+            fail( "reading non-existing artifact throws an exception" );
+        }
+
+        assertNull( vres );
+
+    }
+
+    // -------------------------------------------------------------------------
+    public void testReadBadDependencies()
+    {
+        ArtifactMetadata bmd = new ArtifactMetadata( "does.not:exist:1.0" );
+
+        ArtifactMetadata vres = null;
+        try
+        {
+            vres = _vr.readDependencies( bmd );
+        }
+        catch ( Exception e )
+        {
+            fail( "reading non-existing artifact throws an exception" );
+        }
+
+        assertTrue( Util.isEmpty( vres.getDependencies() ) );
+
+    }
+
+    // -------------------------------------------------------------------------
+    public void testReadBadArtifact()
+    {
+        ArtifactMetadata bmd = new ArtifactMetadata( "does.not:exist:1.0" );
+        List<ArtifactMetadata> q = THelper.toList( bmd );
+
+        ArtifactResults vres = null;
+        try
+        {
+            vres = _vr.readArtifacts( q );
+        }
+        catch ( Exception e )
+        {
+            fail( "reading non-existing artifact throws an exception" );
+        }
+
+        assertNotNull( vres );
+
+        assertFalse( vres.hasResults() );
+
+    }
+    // -------------------------------------------------------------------------
+    // -------------------------------------------------------------------------
 }

Modified: maven/mercury/trunk/mercury-it/src/test/java/org/apache/maven/mercury/repository/tests/WebDavServer.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-it/src/test/java/org/apache/maven/mercury/repository/tests/WebDavServer.java?rev=769199&r1=769198&r2=769199&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-it/src/test/java/org/apache/maven/mercury/repository/tests/WebDavServer.java
(original)
+++ maven/mercury/trunk/mercury-it/src/test/java/org/apache/maven/mercury/repository/tests/WebDavServer.java
Mon Apr 27 23:12:25 2009
@@ -15,7 +15,7 @@
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
-*/
+ */
 
 package org.apache.maven.mercury.repository.tests;
 
@@ -30,24 +30,15 @@
 import org.sonatype.webdav.WebdavServlet;
 
 /**
- *
- *
  * @author Oleg Gusakov
  * @version $Id$
- *
  */
 public class WebDavServer
-extends Server
+    extends Server
 {
-    public WebDavServer( int port
-                         , File base
-                         , String remotePathFragment
-                         , PlexusContainer container
-                         , int debugLevel
-                         , String fileCollectionHint
-                         , String fileCollectionBase
-                         )
-    throws Exception
+    public WebDavServer( int port, File base, String remotePathFragment, PlexusContainer
container, int debugLevel,
+                         String fileCollectionHint, String fileCollectionBase )
+        throws Exception
     {
         super( port );
 
@@ -56,46 +47,45 @@
             base.mkdirs();
         }
 
-        if( ! base.isDirectory() )
+        if ( !base.isDirectory() )
         {
             throw new IllegalArgumentException( "Specified base is not a directory: " + base.getCanonicalPath()
);
         }
-        
-//        HandlerCollection handlers = new HandlerCollection();
-//        setHandler( handlers );
-//
-//        Context context = new Context( handlers, remotePathFragment );
-//        handlers.addHandler( new DefaultHandler() );
-        
-        
+
+        // HandlerCollection handlers = new HandlerCollection();
+        // setHandler( handlers );
+        //
+        // Context context = new Context( handlers, remotePathFragment );
+        // handlers.addHandler( new DefaultHandler() );
+
         ContextHandlerCollection contexts = new ContextHandlerCollection();
-        setHandler(contexts);
-        
+        setHandler( contexts );
+
         Context context = new Context( contexts, remotePathFragment, Context.SESSIONS );
-        context.addServlet(new ServletHolder( new WebdavServlet() ), "/*");
+        context.addServlet( new ServletHolder( new WebdavServlet() ), "/*" );
         context.setAttribute( PlexusConstants.PLEXUS_KEY, container );
         context.setResourceBase( base.getCanonicalPath() );
-        
-        if( fileCollectionBase != null )
+
+        if ( fileCollectionBase != null )
         {
             context.setAttribute( "resourceCollectionBase", fileCollectionBase );
-            System.out.println("webDav resource base: "+fileCollectionBase);
+            System.out.println( "webDav resource base: " + fileCollectionBase );
         }
         else
         {
             context.setAttribute( "resourceCollectionHint", fileCollectionHint );
-            System.out.println("webDav resource hint: "+fileCollectionHint);
+            System.out.println( "webDav resource hint: " + fileCollectionHint );
         }
 
-        context.setAttribute( "debug", debugLevel+"" );
+        context.setAttribute( "debug", debugLevel + "" );
+
+        // Map<String,String> initParams = new HashMap<String, String>(8);
+        //        
+        // initParams.put( "resourceCollectionHint", fileCollectionHint );
+        // initParams.put( "debug", debugLevel+"" );
+        //        
+        // context.setInitParams( initParams );
 
-//        Map<String,String> initParams = new HashMap<String, String>(8);
-//        
-//        initParams.put( "resourceCollectionHint", fileCollectionHint );
-//        initParams.put( "debug", debugLevel+"" );
-//        
-//        context.setInitParams( initParams  );
-        
     }
 
     public int getPort()

Modified: maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/DefaultPlexusMercury.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/DefaultPlexusMercury.java?rev=769199&r1=769198&r2=769199&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/DefaultPlexusMercury.java
(original)
+++ maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/DefaultPlexusMercury.java
Mon Apr 27 23:12:25 2009
@@ -47,8 +47,8 @@
 import org.apache.maven.mercury.metadata.DependencyBuilder;
 import org.apache.maven.mercury.metadata.DependencyBuilderFactory;
 import org.apache.maven.mercury.metadata.MetadataTreeException;
-import org.apache.maven.mercury.repository.api.MetadataResults;
 import org.apache.maven.mercury.repository.api.ArtifactResults;
+import org.apache.maven.mercury.repository.api.MetadataResults;
 import org.apache.maven.mercury.repository.api.Repository;
 import org.apache.maven.mercury.repository.api.RepositoryException;
 import org.apache.maven.mercury.repository.api.RepositoryWriter;
@@ -110,16 +110,19 @@
     {
         return findDependencyProcessor( _defaultDpHint );
     }
+
     // ---------------------------------------------------------------
     public void setDefaultDependencyProcessorHint( String hint )
     {
         _defaultDpHint = hint;
     }
+
     // ---------------------------------------------------------------
     public void setAllowCircularDependencies( boolean allow )
     {
         _allowCircularDependencies = allow;
     }
+
     // ---------------------------------------------------------------
     public RemoteRepositoryM2 constructRemoteRepositoryM2( String id, URL serverUrl, String
serverUser,
                                                            String serverPass, URL proxyUrl,
String proxyUser,
@@ -268,12 +271,9 @@
     }
 
     // ---------------------------------------------------------------
-    public List<ArtifactMetadata> resolve( List<Repository> repos
-                                           , ArtifactScopeEnum scope
-                                           , ArtifactQueryList artifacts
-                                           , ArtifactInclusionList inclusions
-                                           , ArtifactExclusionList exclusions
-                                           )
+    public List<ArtifactMetadata> resolve( List<Repository> repos, ArtifactScopeEnum
scope,
+                                           ArtifactQueryList artifacts, ArtifactInclusionList
inclusions,
+                                           ArtifactExclusionList exclusions )
         throws RepositoryException
     {
         return resolve( repos, scope, artifacts, inclusions, exclusions, null );
@@ -290,16 +290,19 @@
         try
         {
             DependencyBuilder depBuilder =
-                DependencyBuilderFactory.create( DependencyBuilderFactory.JAVA_DEPENDENCY_MODEL,
repos, null, null, null
-                             , Util.mapOf( new Object [][] { 
-                                 {DependencyBuilder.SYSTEM_PROPERTY_ALLOW_CIRCULAR_DEPENDENCIES,
""+_allowCircularDependencies}
-                               , {DependencyBuilder.CONFIGURATION_PROPERTY_VERSION_MAP, config}
-                                                          } 
-                                       ) 
-                                                );
+                DependencyBuilderFactory.create(
+                                                 DependencyBuilderFactory.JAVA_DEPENDENCY_MODEL,
+                                                 repos,
+                                                 null,
+                                                 null,
+                                                 null,
+                                                 Util.mapOf( new Object[][] {
+                                                     { DependencyBuilder.SYSTEM_PROPERTY_ALLOW_CIRCULAR_DEPENDENCIES,
+                                                         "" + _allowCircularDependencies
},
+                                                     { DependencyBuilder.CONFIGURATION_PROPERTY_VERSION_MAP,
config } } ) );
 
             List<ArtifactMetadata> res = depBuilder.resolveConflicts( scope, artifacts,
inclusions, exclusions );
-            
+
             depBuilder.close();
 
             return res;
@@ -321,16 +324,19 @@
         try
         {
             DependencyBuilder depBuilder =
-                DependencyBuilderFactory.create( DependencyBuilderFactory.JAVA_DEPENDENCY_MODEL,
repos, null, null, null
-                       , Util.mapOf( new Object [][] { 
-                             {DependencyBuilder.SYSTEM_PROPERTY_ALLOW_CIRCULAR_DEPENDENCIES,
""+_allowCircularDependencies}
-                           , {DependencyBuilder.CONFIGURATION_PROPERTY_VERSION_MAP, config}
-                                                      } 
-                                   ) 
-                );
+                DependencyBuilderFactory.create(
+                                                 DependencyBuilderFactory.JAVA_DEPENDENCY_MODEL,
+                                                 repos,
+                                                 null,
+                                                 null,
+                                                 null,
+                                                 Util.mapOf( new Object[][] {
+                                                     { DependencyBuilder.SYSTEM_PROPERTY_ALLOW_CIRCULAR_DEPENDENCIES,
+                                                         "" + _allowCircularDependencies
},
+                                                     { DependencyBuilder.CONFIGURATION_PROPERTY_VERSION_MAP,
config } } ) );
 
             MetadataTreeNode res = depBuilder.resolveConflictsAsTree( scope, artifacts, inclusions,
exclusions );
-            
+
             depBuilder.close();
 
             return res;
@@ -342,15 +348,12 @@
     }
 
     // ---------------------------------------------------------------
-    public MetadataTreeNode resolveAsTree( List<Repository> repos
-                                           , ArtifactScopeEnum scope
-                                           , ArtifactQueryList artifacts
-                                           , ArtifactInclusionList inclusions
-                                           , ArtifactExclusionList exclusions
-                                           )
+    public MetadataTreeNode resolveAsTree( List<Repository> repos, ArtifactScopeEnum
scope,
+                                           ArtifactQueryList artifacts, ArtifactInclusionList
inclusions,
+                                           ArtifactExclusionList exclusions )
         throws RepositoryException
     {
-            return resolveAsTree( repos, scope, artifacts, inclusions, exclusions, null );
+        return resolveAsTree( repos, scope, artifacts, inclusions, exclusions, null );
     }
 
     // ---------------------------------------------------------------

Modified: maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/MercuryPlexusLogger.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/MercuryPlexusLogger.java?rev=769199&r1=769198&r2=769199&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/MercuryPlexusLogger.java
(original)
+++ maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/MercuryPlexusLogger.java
Mon Apr 27 23:12:25 2009
@@ -23,93 +23,92 @@
 
 /**
  * Mercury adaptor for plexus logger
- *
+ * 
  * @author Oleg Gusakov
  * @version $Id$
- *
  */
 public class MercuryPlexusLogger
-implements IMercuryLogger
+    implements IMercuryLogger
 {
-  Logger _logger;
-  
-  public MercuryPlexusLogger( Logger logger )
-  {
-    this._logger = logger;
-  }
-
-  public void debug( String message )
-  {
-    _logger.debug( message );
-  }
-
-  public void debug( String message, Throwable throwable )
-  {
-    _logger.debug( message, throwable );
-  }
-
-  public void error( String message )
-  {
-    _logger.error( message );
-  }
-
-  public void error( String message, Throwable throwable )
-  {
-    _logger.error( message, throwable );
-  }
-
-  public void fatal( String message )
-  {
-    _logger.fatalError( message );
-  }
-
-  public void fatal( String message, Throwable throwable )
-  {
-    _logger.fatalError( message, throwable );
-  }
-
-  public void info( String message )
-  {
-    _logger.info( message );
-  }
-
-  public void info( String message, Throwable throwable )
-  {
-    _logger.info( message, throwable );
-  }
-
-  public void warn( String message )
-  {
-    _logger.warn( message );
-  }
-
-  public void warn( String message, Throwable throwable )
-  {
-    _logger.warn( message, throwable );
-  }
-
-  public boolean isDebugEnabled()
-  {
-    return _logger.isDebugEnabled();
-  }
-
-  public boolean isErrorEnabled()
-  {
-    return _logger.isErrorEnabled();
-  }
-
-  public boolean isFatalEnabled()
-  {
-    return _logger.isFatalErrorEnabled();
-  }
-
-  public boolean isInfoEnabled()
-  {
-    return _logger.isInfoEnabled();
-  }
-
-  public boolean isWarnEnabled()
-  {
-    return _logger.isWarnEnabled();
-  }
+    Logger _logger;
+
+    public MercuryPlexusLogger( Logger logger )
+    {
+        this._logger = logger;
+    }
+
+    public void debug( String message )
+    {
+        _logger.debug( message );
+    }
+
+    public void debug( String message, Throwable throwable )
+    {
+        _logger.debug( message, throwable );
+    }
+
+    public void error( String message )
+    {
+        _logger.error( message );
+    }
+
+    public void error( String message, Throwable throwable )
+    {
+        _logger.error( message, throwable );
+    }
+
+    public void fatal( String message )
+    {
+        _logger.fatalError( message );
+    }
+
+    public void fatal( String message, Throwable throwable )
+    {
+        _logger.fatalError( message, throwable );
+    }
+
+    public void info( String message )
+    {
+        _logger.info( message );
+    }
+
+    public void info( String message, Throwable throwable )
+    {
+        _logger.info( message, throwable );
+    }
+
+    public void warn( String message )
+    {
+        _logger.warn( message );
+    }
+
+    public void warn( String message, Throwable throwable )
+    {
+        _logger.warn( message, throwable );
+    }
+
+    public boolean isDebugEnabled()
+    {
+        return _logger.isDebugEnabled();
+    }
+
+    public boolean isErrorEnabled()
+    {
+        return _logger.isErrorEnabled();
+    }
+
+    public boolean isFatalEnabled()
+    {
+        return _logger.isFatalErrorEnabled();
+    }
+
+    public boolean isInfoEnabled()
+    {
+        return _logger.isInfoEnabled();
+    }
+
+    public boolean isWarnEnabled()
+    {
+        return _logger.isWarnEnabled();
+    }
 }

Modified: maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/MercuryPlexusLoggerFactory.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/MercuryPlexusLoggerFactory.java?rev=769199&r1=769198&r2=769199&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/MercuryPlexusLoggerFactory.java
(original)
+++ maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/MercuryPlexusLoggerFactory.java
Mon Apr 27 23:12:25 2009
@@ -25,35 +25,34 @@
 
 /**
  * mercury adaptor for plesux logger factory (manager)
- *
+ * 
  * @author Oleg Gusakov
  * @version $Id$
- *
  */
 public class MercuryPlexusLoggerFactory
-implements IMercuryLoggerFactory
+    implements IMercuryLoggerFactory
 {
-  LoggerManager _loggerManager;
-  
-  public MercuryPlexusLoggerFactory( LoggerManager loggerManager )
-  {
-    setLoggerFactory( loggerManager );
-  }
-
-  public IMercuryLogger getLogger( Class clazz )
-  {
-    return new MercuryPlexusLogger( _loggerManager.getLoggerForComponent( clazz.getName()
) );
-  }
-
-  public void setLoggerFactory( LoggerManager loggerManager )
-  {
-    this._loggerManager = loggerManager;
-  }
-
-  public void setThreshold( MercuryLoggingLevelEnum threshold )
-  {
-    // TODO Auto-generated method stub
-    
-  }
+    LoggerManager _loggerManager;
+
+    public MercuryPlexusLoggerFactory( LoggerManager loggerManager )
+    {
+        setLoggerFactory( loggerManager );
+    }
+
+    public IMercuryLogger getLogger( Class clazz )
+    {
+        return new MercuryPlexusLogger( _loggerManager.getLoggerForComponent( clazz.getName()
) );
+    }
+
+    public void setLoggerFactory( LoggerManager loggerManager )
+    {
+        this._loggerManager = loggerManager;
+    }
+
+    public void setThreshold( MercuryLoggingLevelEnum threshold )
+    {
+        // TODO Auto-generated method stub
+
+    }
 
 }

Modified: maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/PlexusMercury.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/PlexusMercury.java?rev=769199&r1=769198&r2=769199&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/PlexusMercury.java
(original)
+++ maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/PlexusMercury.java
Mon Apr 27 23:12:25 2009
@@ -150,7 +150,6 @@
     public List<Repository> constructRepositories( String localDir, String... urls
)
         throws RepositoryException;
 
-
     /**
      * write (deploy) given Artifact(s) to the repository
      * 
@@ -197,9 +196,7 @@
 
     public List<ArtifactMetadata> resolve( List<Repository> repos, ArtifactScopeEnum
scope,
                                            ArtifactQueryList artifacts, ArtifactInclusionList
inclusions,
-                                           ArtifactExclusionList exclusions
-                                           , Map<String, ?> config
-                                           )
+                                           ArtifactExclusionList exclusions, Map<String,
?> config )
         throws RepositoryException;
 
     public MetadataTreeNode resolveAsTree( List<Repository> repos, ArtifactScopeEnum
scope,
@@ -209,9 +206,7 @@
 
     public MetadataTreeNode resolveAsTree( List<Repository> repos, ArtifactScopeEnum
scope,
                                            ArtifactQueryList artifacts, ArtifactInclusionList
inclusions,
-                                           ArtifactExclusionList exclusions
-                                           , Map<String, ?> config
-                                           )
+                                           ArtifactExclusionList exclusions, Map<String,
?> config )
         throws RepositoryException;
 
     public List<ArtifactMetadata> resolve( List<Repository> repos, ArtifactScopeEnum
scope, ArtifactMetadata metadata )

Modified: maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/PlexusMercuryException.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/PlexusMercuryException.java?rev=769199&r1=769198&r2=769199&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/PlexusMercuryException.java
(original)
+++ maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/PlexusMercuryException.java
Mon Apr 27 23:12:25 2009
@@ -19,30 +19,26 @@
 package org.apache.maven.mercury.plexus;
 
 public class PlexusMercuryException
-extends Exception
+    extends Exception
 {
 
-  public PlexusMercuryException()
-  {
-  }
-
-  public PlexusMercuryException(
-      String message )
-  {
-    super( message );
-  }
-
-  public PlexusMercuryException(
-      Throwable cause )
-  {
-    super( cause );
-  }
-
-  public PlexusMercuryException(
-      String message,
-      Throwable cause )
-  {
-    super( message, cause );
-  }
+    public PlexusMercuryException()
+    {
+    }
+
+    public PlexusMercuryException( String message )
+    {
+        super( message );
+    }
+
+    public PlexusMercuryException( Throwable cause )
+    {
+        super( cause );
+    }
+
+    public PlexusMercuryException( String message, Throwable cause )
+    {
+        super( message, cause );
+    }
 
 }



Mime
View raw message