]> source.dussan.org Git - archiva.git/commitdiff
commiting latest bits on the scheduler parts
authorJesse McConnell <jmcconnell@apache.org>
Fri, 13 Apr 2007 15:44:20 +0000 (15:44 +0000)
committerJesse McConnell <jmcconnell@apache.org>
Fri, 13 Apr 2007 15:44:20 +0000 (15:44 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/branches@528529 13f79535-47bb-0310-9956-ffa450edef68

archiva-jpox-database-refactor/archiva-scheduled/pom.xml
archiva-jpox-database-refactor/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaScheduledTaskExecutor.java
archiva-jpox-database-refactor/archiva-scheduled/src/main/resources/META-INF/plexus/components.xml
archiva-jpox-database-refactor/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaScheduledTaskExecutorTest.java

index 2cd903cf64d5b01b5f60443dde3adb1af36bd966..e7dd23a6aba1451118b0b07cb5c47e767521d4b1 100644 (file)
@@ -22,7 +22,7 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <parent>
     <groupId>org.apache.maven.archiva</groupId>
-    <artifactId>archiva-base</artifactId>
+    <artifactId>archiva-parent</artifactId>
     <version>1.0-SNAPSHOT</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
index af629fdd1b8e35905d767f286dcaadb1cc2f57d7..98b7121355042c355f817782e36574c1762a6677 100644 (file)
@@ -180,6 +180,7 @@ public class ArchivaScheduledTaskExecutor extends AbstractLogEnabled implements
             
             if ( availableConsumers.containsKey( availableConsumers.get( consumer ) )  )
             {
+                getLogger().warn( "Using consumer " + consumer );
                 activeConsumers.add( availableConsumers.get( consumer ) );
             }
             else
index 245d002e9a0a8fa30b069a784052f799c9b648f9..9c8752e901635038a6e197ac90578a7dfc59a817 100644 (file)
@@ -1,3 +1,23 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+  
 <components>
     <component>
       <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
index 1bdb02361fc03eae7ca8ef9b226a3d8bff4a4538..19516a4481b526f3f85d2cd15ba5878ebaaf45cb 100644 (file)
@@ -19,21 +19,6 @@ package org.apache.maven.archiva.scheduled.executors;
  * under the License.
  */
 
-import org.apache.commons.io.FileUtils;
-import org.apache.maven.archiva.configuration.ArchivaConfiguration;
-import org.apache.maven.archiva.configuration.Configuration;
-import org.apache.maven.archiva.database.ArchivaDAO;
-import org.apache.maven.archiva.database.ArchivaDatabaseException;
-import org.apache.maven.archiva.database.RepositoryDAO;
-import org.apache.maven.archiva.model.ArchivaRepository;
-import org.apache.maven.archiva.scheduled.tasks.RepositoryTask;
-import org.codehaus.plexus.PlexusTestCase;
-import org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory;
-import org.codehaus.plexus.jdo.JdoFactory;
-import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
-import org.codehaus.plexus.taskqueue.execution.TaskExecutor;
-import org.jpox.SchemaTool;
-
 import java.io.File;
 import java.net.URL;
 import java.util.Iterator;
@@ -44,6 +29,17 @@ import javax.jdo.JDOHelper;
 import javax.jdo.PersistenceManager;
 import javax.jdo.PersistenceManagerFactory;
 
+import org.apache.commons.lang.StringUtils;
+import org.apache.maven.archiva.database.ArchivaDAO;
+import org.apache.maven.archiva.database.RepositoryDAO;
+import org.apache.maven.archiva.model.ArchivaRepository;
+import org.apache.maven.archiva.scheduled.tasks.RepositoryTask;
+import org.codehaus.plexus.PlexusTestCase;
+import org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory;
+import org.codehaus.plexus.jdo.JdoFactory;
+import org.codehaus.plexus.taskqueue.execution.TaskExecutor;
+import org.jpox.SchemaTool;
+
 /**
  * IndexerTaskExecutorTest
  *
@@ -61,6 +57,7 @@ public class ArchivaScheduledTaskExecutorTest
         throws Exception
     {
         super.setUp();
+        
         DefaultConfigurableJdoFactory jdoFactory = (DefaultConfigurableJdoFactory) lookup( JdoFactory.ROLE, "archiva" );
         assertEquals( DefaultConfigurableJdoFactory.class.getName(), jdoFactory.getClass().getName() );
 
@@ -142,9 +139,16 @@ public class ArchivaScheduledTaskExecutorTest
     {
         RepositoryDAO repoDao = dao.getRepositoryDAO();
 
+        File repoDir = new File( getBasedir(), "src/test/repositories/default-repository" );
+
+        assertTrue( "Default Test Repository should exist.", repoDir.exists() && repoDir.isDirectory() );
+
+        String repoUri = "file://" + StringUtils.replace( repoDir.getAbsolutePath(), "\\", "/" );
+
+        
         // Create it
         ArchivaRepository repo =
-            repoDao.createRepository( "testRepo", "Test Repository", "http://localhost:8080/repository/foo" );
+            repoDao.createRepository( "testRepo", "Test Repository", repoUri );
         assertNotNull( repo );
 
         // Set some mandatory values