mirror of https://github.com/apache/archiva.git
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
This commit is contained in:
parent
c1cbf37fc6
commit
45abcbe802
|
@ -22,7 +22,7 @@
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.apache.maven.archiva</groupId>
|
<groupId>org.apache.maven.archiva</groupId>
|
||||||
<artifactId>archiva-base</artifactId>
|
<artifactId>archiva-parent</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
|
@ -180,6 +180,7 @@ public class ArchivaScheduledTaskExecutor extends AbstractLogEnabled implements
|
||||||
|
|
||||||
if ( availableConsumers.containsKey( availableConsumers.get( consumer ) ) )
|
if ( availableConsumers.containsKey( availableConsumers.get( consumer ) ) )
|
||||||
{
|
{
|
||||||
|
getLogger().warn( "Using consumer " + consumer );
|
||||||
activeConsumers.add( availableConsumers.get( consumer ) );
|
activeConsumers.add( availableConsumers.get( consumer ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -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>
|
<components>
|
||||||
<component>
|
<component>
|
||||||
<role>org.codehaus.plexus.taskqueue.TaskQueue</role>
|
<role>org.codehaus.plexus.taskqueue.TaskQueue</role>
|
||||||
|
|
|
@ -19,21 +19,6 @@ package org.apache.maven.archiva.scheduled.executors;
|
||||||
* under the License.
|
* 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.io.File;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
@ -44,6 +29,17 @@ import javax.jdo.JDOHelper;
|
||||||
import javax.jdo.PersistenceManager;
|
import javax.jdo.PersistenceManager;
|
||||||
import javax.jdo.PersistenceManagerFactory;
|
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
|
* IndexerTaskExecutorTest
|
||||||
*
|
*
|
||||||
|
@ -61,6 +57,7 @@ public class ArchivaScheduledTaskExecutorTest
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
super.setUp();
|
super.setUp();
|
||||||
|
|
||||||
DefaultConfigurableJdoFactory jdoFactory = (DefaultConfigurableJdoFactory) lookup( JdoFactory.ROLE, "archiva" );
|
DefaultConfigurableJdoFactory jdoFactory = (DefaultConfigurableJdoFactory) lookup( JdoFactory.ROLE, "archiva" );
|
||||||
assertEquals( DefaultConfigurableJdoFactory.class.getName(), jdoFactory.getClass().getName() );
|
assertEquals( DefaultConfigurableJdoFactory.class.getName(), jdoFactory.getClass().getName() );
|
||||||
|
|
||||||
|
@ -142,9 +139,16 @@ public class ArchivaScheduledTaskExecutorTest
|
||||||
{
|
{
|
||||||
RepositoryDAO repoDao = dao.getRepositoryDAO();
|
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
|
// Create it
|
||||||
ArchivaRepository repo =
|
ArchivaRepository repo =
|
||||||
repoDao.createRepository( "testRepo", "Test Repository", "http://localhost:8080/repository/foo" );
|
repoDao.createRepository( "testRepo", "Test Repository", repoUri );
|
||||||
assertNotNull( repo );
|
assertNotNull( repo );
|
||||||
|
|
||||||
// Set some mandatory values
|
// Set some mandatory values
|
||||||
|
|
Loading…
Reference in New Issue