summaryrefslogtreecommitdiffstats
path: root/archiva-core/src/test
diff options
context:
space:
mode:
authorJoakim Erdfelt <joakime@apache.org>2007-02-23 19:05:21 +0000
committerJoakim Erdfelt <joakime@apache.org>2007-02-23 19:05:21 +0000
commitdee0d5a300ee0ba0240efc1277428b52cdcec9e0 (patch)
tree0f4c8d3b8b8b0468deac3c8851380a68bfa1744e /archiva-core/src/test
parent2b50a18d22ef8972d241f54c20a131e05a584ac4 (diff)
downloadarchiva-dee0d5a300ee0ba0240efc1277428b52cdcec9e0.tar.gz
archiva-dee0d5a300ee0ba0240efc1277428b52cdcec9e0.zip
Merge from archiva-MRM-239 branch to trunk. r506385:HEAD
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@511053 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-core/src/test')
-rw-r--r--archiva-core/src/test/java/org/apache/maven/archiva/AllTests.java (renamed from archiva-core/src/test/java/org/apache/maven/archiva/LegacyRepositoryConverterTest.java)34
-rw-r--r--archiva-core/src/test/java/org/apache/maven/archiva/repositories/AllTests.java43
-rw-r--r--archiva-core/src/test/java/org/apache/maven/archiva/repositories/DefaultActiveManagedRepositoriesTest.java8
-rw-r--r--archiva-core/src/test/java/org/apache/maven/archiva/scheduler/executors/AllTests.java43
-rw-r--r--archiva-core/src/test/java/org/apache/maven/archiva/scheduler/executors/DataRefreshExecutorTest.java (renamed from archiva-core/src/test/java/org/apache/maven/archiva/scheduler/executors/IndexerTaskExecutorTest.java)18
-rw-r--r--archiva-core/src/test/resources/org/apache/maven/archiva/scheduler/executors/DataRefreshExecutorTest.xml90
-rw-r--r--archiva-core/src/test/resources/org/apache/maven/archiva/scheduler/executors/IndexerTaskExecutorTest.xml35
7 files changed, 206 insertions, 65 deletions
diff --git a/archiva-core/src/test/java/org/apache/maven/archiva/LegacyRepositoryConverterTest.java b/archiva-core/src/test/java/org/apache/maven/archiva/AllTests.java
index bd13a7deb..e037e09c3 100644
--- a/archiva-core/src/test/java/org/apache/maven/archiva/LegacyRepositoryConverterTest.java
+++ b/archiva-core/src/test/java/org/apache/maven/archiva/AllTests.java
@@ -9,7 +9,7 @@ package org.apache.maven.archiva;
* "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
+ * 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
@@ -19,26 +19,26 @@ package org.apache.maven.archiva;
* under the License.
*/
-import org.apache.maven.archiva.conversion.LegacyRepositoryConverter;
-import org.codehaus.plexus.PlexusTestCase;
-
-import java.io.File;
+import junit.framework.Test;
+import junit.framework.TestSuite;
/**
- * @author Jason van Zyl
+ * AllTests - added to allow IDE users to pull all tests into their tool.
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
*/
-public class LegacyRepositoryConverterTest
- extends PlexusTestCase
+public class AllTests
{
- public void testLegacyRepositoryConversion()
- throws Exception
- {
- File legacyRepositoryDirectory = getTestFile( "src/test/maven-1.x-repository" );
-
- File repositoryDirectory = getTestFile( "target/maven-2.x-repository" );
- LegacyRepositoryConverter rm = (LegacyRepositoryConverter) lookup( LegacyRepositoryConverter.ROLE );
-
- rm.convertLegacyRepository( legacyRepositoryDirectory, repositoryDirectory, null, true );
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite( "Test for org.apache.maven.archiva" );
+ //$JUnit-BEGIN$
+ suite.addTest( org.apache.maven.archiva.repositories.AllTests.suite() );
+ suite.addTest( org.apache.maven.archiva.scheduler.executors.AllTests.suite() );
+ //$JUnit-END$
+ return suite;
}
+
}
diff --git a/archiva-core/src/test/java/org/apache/maven/archiva/repositories/AllTests.java b/archiva-core/src/test/java/org/apache/maven/archiva/repositories/AllTests.java
new file mode 100644
index 000000000..0b82640b9
--- /dev/null
+++ b/archiva-core/src/test/java/org/apache/maven/archiva/repositories/AllTests.java
@@ -0,0 +1,43 @@
+package org.apache.maven.archiva.repositories;
+
+/*
+ * 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.
+ */
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * AllTests
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class AllTests
+{
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite( "Test for org.apache.maven.archiva.repositories" );
+ //$JUnit-BEGIN$
+ suite.addTestSuite( DefaultActiveManagedRepositoriesTest.class );
+ //$JUnit-END$
+ return suite;
+ }
+
+}
diff --git a/archiva-core/src/test/java/org/apache/maven/archiva/repositories/DefaultActiveManagedRepositoriesTest.java b/archiva-core/src/test/java/org/apache/maven/archiva/repositories/DefaultActiveManagedRepositoriesTest.java
index a535307e2..f4e89eadf 100644
--- a/archiva-core/src/test/java/org/apache/maven/archiva/repositories/DefaultActiveManagedRepositoriesTest.java
+++ b/archiva-core/src/test/java/org/apache/maven/archiva/repositories/DefaultActiveManagedRepositoriesTest.java
@@ -19,15 +19,15 @@ package org.apache.maven.archiva.repositories;
* under the License.
*/
-import org.apache.maven.archiva.artifact.ManagedArtifact;
-import org.apache.maven.archiva.artifact.ManagedEjbArtifact;
-import org.apache.maven.archiva.artifact.ManagedJavaArtifact;
+import org.apache.maven.archiva.common.artifact.managed.ManagedArtifact;
+import org.apache.maven.archiva.common.artifact.managed.ManagedEjbArtifact;
+import org.apache.maven.archiva.common.artifact.managed.ManagedJavaArtifact;
import org.codehaus.plexus.PlexusTestCase;
/**
* DefaultActiveManagedRepositoriesTest
*
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @author <a href="mailto:joakime@apache.org">Joakim Erdfelt</a>
* @version $Id$
*/
public class DefaultActiveManagedRepositoriesTest
diff --git a/archiva-core/src/test/java/org/apache/maven/archiva/scheduler/executors/AllTests.java b/archiva-core/src/test/java/org/apache/maven/archiva/scheduler/executors/AllTests.java
new file mode 100644
index 000000000..9fdfcc15b
--- /dev/null
+++ b/archiva-core/src/test/java/org/apache/maven/archiva/scheduler/executors/AllTests.java
@@ -0,0 +1,43 @@
+package org.apache.maven.archiva.scheduler.executors;
+
+/*
+ * 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.
+ */
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * AllTests
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class AllTests
+{
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite( "Test for org.apache.maven.archiva.scheduler.executors" );
+ //$JUnit-BEGIN$
+ suite.addTestSuite( DataRefreshExecutorTest.class );
+ //$JUnit-END$
+ return suite;
+ }
+
+}
diff --git a/archiva-core/src/test/java/org/apache/maven/archiva/scheduler/executors/IndexerTaskExecutorTest.java b/archiva-core/src/test/java/org/apache/maven/archiva/scheduler/executors/DataRefreshExecutorTest.java
index 8729e0ccb..ad9900795 100644
--- a/archiva-core/src/test/java/org/apache/maven/archiva/scheduler/executors/IndexerTaskExecutorTest.java
+++ b/archiva-core/src/test/java/org/apache/maven/archiva/scheduler/executors/DataRefreshExecutorTest.java
@@ -22,7 +22,7 @@ package org.apache.maven.archiva.scheduler.executors;
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.scheduler.task.IndexerTask;
+import org.apache.maven.archiva.scheduler.task.DataRefreshTask;
import org.codehaus.plexus.PlexusTestCase;
import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
import org.codehaus.plexus.taskqueue.execution.TaskExecutor;
@@ -32,10 +32,10 @@ import java.io.File;
/**
* IndexerTaskExecutorTest
*
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @author <a href="mailto:joakime@apache.org">Joakim Erdfelt</a>
* @version $Id$
*/
-public class IndexerTaskExecutorTest
+public class DataRefreshExecutorTest
extends PlexusTestCase
{
private TaskExecutor taskExecutor;
@@ -45,7 +45,7 @@ public class IndexerTaskExecutorTest
{
super.setUp();
- taskExecutor = (TaskExecutor) lookup( "org.codehaus.plexus.taskqueue.execution.TaskExecutor", "indexer" );
+ taskExecutor = (TaskExecutor) lookup( "org.codehaus.plexus.taskqueue.execution.TaskExecutor", "data-refresh" );
ArchivaConfiguration archivaConfiguration =
(ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName() );
@@ -58,18 +58,18 @@ public class IndexerTaskExecutorTest
}
}
- public void testIndexer()
+ public void testExecutor()
throws TaskExecutionException
{
- taskExecutor.executeTask( new TestIndexerTask() );
+ taskExecutor.executeTask( new TestDataRefreshTask() );
}
- class TestIndexerTask
- extends IndexerTask
+ class TestDataRefreshTask
+ extends DataRefreshTask
{
public String getJobName()
{
- return "TestIndexer";
+ return "TestDataRefresh";
}
}
}
diff --git a/archiva-core/src/test/resources/org/apache/maven/archiva/scheduler/executors/DataRefreshExecutorTest.xml b/archiva-core/src/test/resources/org/apache/maven/archiva/scheduler/executors/DataRefreshExecutorTest.xml
new file mode 100644
index 000000000..5a7d8101b
--- /dev/null
+++ b/archiva-core/src/test/resources/org/apache/maven/archiva/scheduler/executors/DataRefreshExecutorTest.xml
@@ -0,0 +1,90 @@
+<?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.
+ -->
+
+<component-set>
+ <components>
+ <component>
+ <role>org.codehaus.plexus.registry.Registry</role>
+ <implementation>org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry</implementation>
+ <role-hint>commons-configuration</role-hint>
+ <configuration>
+ <properties>
+ <xml fileName="${basedir}/src/test/conf/archiva.xml"
+ config-name="org.apache.maven.archiva" config-at="org.apache.maven.archiva"/>
+ </properties>
+ </configuration>
+ </component>
+
+ <component>
+ <role>org.codehaus.plexus.jdo.JdoFactory</role>
+ <role-hint>archiva</role-hint>
+ <implementation>org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory</implementation>
+
+ <configuration>
+ <!-- Database Configuration -->
+ <driverName>org.hsqldb.jdbcDriver</driverName>
+ <url>jdbc:hsqldb:mem:TESTDB</url>
+ <userName>sa</userName>
+ <password></password>
+
+ <!-- JPOX and JDO configuration -->
+ <persistenceManagerFactoryClass>org.jpox.PersistenceManagerFactoryImpl</persistenceManagerFactoryClass>
+ <otherProperties>
+ <property>
+ <name>javax.jdo.PersistenceManagerFactoryClass</name>
+ <value>org.jpox.PersistenceManagerFactoryImpl</value>
+ </property>
+ <property>
+ <name>org.jpox.autoCreateSchema</name>
+ <value>true</value>
+ </property>
+ <property>
+ <name>org.jpox.validateTables</name>
+ <value>false</value>
+ </property>
+ <property>
+ <name>org.jpox.validateConstraints</name>
+ <value>false</value>
+ </property>
+ <property>
+ <name>org.jpox.validateColumns</name>
+ <value>false</value>
+ </property>
+ <property>
+ <name>org.jpox.autoStartMechanism</name>
+ <value>None</value>
+ </property>
+ <property>
+ <name>org.jpox.transactionIsolation</name>
+ <value>READ_UNCOMMITTED</value>
+ </property>
+ <property>
+ <name>org.jpox.poid.transactionIsolation</name>
+ <value>READ_UNCOMMITTED</value>
+ </property>
+ <property>
+ <name>org.jpox.rdbms.dateTimezone</name>
+ <value>JDK_DEFAULT_TIMEZONE</value>
+ </property>
+ </otherProperties>
+ </configuration>
+ </component>
+ </components>
+</component-set>
diff --git a/archiva-core/src/test/resources/org/apache/maven/archiva/scheduler/executors/IndexerTaskExecutorTest.xml b/archiva-core/src/test/resources/org/apache/maven/archiva/scheduler/executors/IndexerTaskExecutorTest.xml
deleted file mode 100644
index 34d15023a..000000000
--- a/archiva-core/src/test/resources/org/apache/maven/archiva/scheduler/executors/IndexerTaskExecutorTest.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?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.
- -->
-
-<component-set>
- <components>
- <component>
- <role>org.codehaus.plexus.registry.Registry</role>
- <implementation>org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry</implementation>
- <role-hint>commons-configuration</role-hint>
- <configuration>
- <properties>
- <xml fileName="${basedir}/src/test/conf/archiva.xml"
- config-name="org.apache.maven.archiva" config-at="org.apache.maven.archiva"/>
- </properties>
- </configuration>
- </component>
- </components>
-</component-set>