From 1cafc79927c5597d17dc3704ed3877f231d8ef2d Mon Sep 17 00:00:00 2001 From: Jesse McConnell Date: Fri, 13 Apr 2007 15:44:20 +0000 Subject: [PATCH] commiting latest bits on the scheduler parts git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/branches@528529 13f79535-47bb-0310-9956-ffa450edef68 --- .../archiva-scheduled/pom.xml | 2 +- .../ArchivaScheduledTaskExecutor.java | 1 + .../resources/META-INF/plexus/components.xml | 20 +++++++++++ .../ArchivaScheduledTaskExecutorTest.java | 36 ++++++++++--------- 4 files changed, 42 insertions(+), 17 deletions(-) diff --git a/archiva-jpox-database-refactor/archiva-scheduled/pom.xml b/archiva-jpox-database-refactor/archiva-scheduled/pom.xml index 2cd903cf6..e7dd23a6a 100644 --- a/archiva-jpox-database-refactor/archiva-scheduled/pom.xml +++ b/archiva-jpox-database-refactor/archiva-scheduled/pom.xml @@ -22,7 +22,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> org.apache.maven.archiva - archiva-base + archiva-parent 1.0-SNAPSHOT 4.0.0 diff --git a/archiva-jpox-database-refactor/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaScheduledTaskExecutor.java b/archiva-jpox-database-refactor/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaScheduledTaskExecutor.java index af629fdd1..98b712135 100644 --- a/archiva-jpox-database-refactor/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaScheduledTaskExecutor.java +++ b/archiva-jpox-database-refactor/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaScheduledTaskExecutor.java @@ -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 diff --git a/archiva-jpox-database-refactor/archiva-scheduled/src/main/resources/META-INF/plexus/components.xml b/archiva-jpox-database-refactor/archiva-scheduled/src/main/resources/META-INF/plexus/components.xml index 245d002e9..9c8752e90 100644 --- a/archiva-jpox-database-refactor/archiva-scheduled/src/main/resources/META-INF/plexus/components.xml +++ b/archiva-jpox-database-refactor/archiva-scheduled/src/main/resources/META-INF/plexus/components.xml @@ -1,3 +1,23 @@ + + + org.codehaus.plexus.taskqueue.TaskQueue diff --git a/archiva-jpox-database-refactor/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaScheduledTaskExecutorTest.java b/archiva-jpox-database-refactor/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaScheduledTaskExecutorTest.java index 1bdb02361..19516a448 100644 --- a/archiva-jpox-database-refactor/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaScheduledTaskExecutorTest.java +++ b/archiva-jpox-database-refactor/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaScheduledTaskExecutorTest.java @@ -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 -- 2.39.5