summaryrefslogtreecommitdiffstats
path: root/archiva-scheduled
diff options
context:
space:
mode:
authorJesse McConnell <jmcconnell@apache.org>2007-04-13 15:44:20 +0000
committerJesse McConnell <jmcconnell@apache.org>2007-04-13 15:44:20 +0000
commit45abcbe8029c6f86e27d3386bd4e642eb34dcfc2 (patch)
tree5d663ea0775fbc602780dbba4a405da01d59f7cf /archiva-scheduled
parentc1cbf37fc64f4ac587ea38de02abf1487c484c2b (diff)
downloadarchiva-45abcbe8029c6f86e27d3386bd4e642eb34dcfc2.tar.gz
archiva-45abcbe8029c6f86e27d3386bd4e642eb34dcfc2.zip
commiting latest bits on the scheduler parts
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/branches/archiva-jpox-database-refactor@528529 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-scheduled')
-rw-r--r--archiva-scheduled/pom.xml2
-rw-r--r--archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaScheduledTaskExecutor.java1
-rw-r--r--archiva-scheduled/src/main/resources/META-INF/plexus/components.xml20
-rw-r--r--archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaScheduledTaskExecutorTest.java36
4 files changed, 42 insertions, 17 deletions
diff --git a/archiva-scheduled/pom.xml b/archiva-scheduled/pom.xml
index 2cd903cf6..e7dd23a6a 100644
--- a/archiva-scheduled/pom.xml
+++ b/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">
<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>
diff --git a/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaScheduledTaskExecutor.java b/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaScheduledTaskExecutor.java
index af629fdd1..98b712135 100644
--- a/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaScheduledTaskExecutor.java
+++ b/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-scheduled/src/main/resources/META-INF/plexus/components.xml b/archiva-scheduled/src/main/resources/META-INF/plexus/components.xml
index 245d002e9..9c8752e90 100644
--- a/archiva-scheduled/src/main/resources/META-INF/plexus/components.xml
+++ b/archiva-scheduled/src/main/resources/META-INF/plexus/components.xml
@@ -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>
diff --git a/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaScheduledTaskExecutorTest.java b/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaScheduledTaskExecutorTest.java
index 1bdb02361..19516a448 100644
--- a/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaScheduledTaskExecutorTest.java
+++ b/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