From: Joakim Erdfelt Date: Fri, 26 Oct 2007 16:10:59 +0000 (+0000) Subject: Updating test cases for ManagedRepositories to not set RoleManager via plexus (to... X-Git-Tag: archiva-1.0-beta-3~10 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a7bf8292c3a3b1951bd07fa9337fbb3394426f5e;p=archiva.git Updating test cases for ManagedRepositories to not set RoleManager via plexus (to aide in upgrade of redback) /me runs to the edge of the ring and tags Jesse. git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@588696 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoryArchivaDAOStub.java b/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoryArchivaDAOStub.java new file mode 100644 index 000000000..81c1b76bd --- /dev/null +++ b/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoryArchivaDAOStub.java @@ -0,0 +1,85 @@ +package org.apache.maven.archiva.web.action.admin.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 java.io.Serializable; +import java.util.List; + +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.database.ProjectModelDAO; +import org.apache.maven.archiva.database.RepositoryContentStatisticsDAO; +import org.apache.maven.archiva.database.RepositoryProblemDAO; +import org.apache.maven.archiva.database.SimpleConstraint; + +/** + * AbstractManagedRepositoryArchivaDAOStub + * + * @author Maria Odea Ching + * @version + */ +public class AbstractManagedRepositoryArchivaDAOStub + implements ArchivaDAO +{ + /** + * @plexus.requirement role-hint="jdo" + */ + private ProjectModelDAO projectModelDAO; + + /** + * @plexus.requirement role-hint="jdo" + */ + private ArtifactDAO artifactDAO; + + /** + * @plexus.requirement role-hint="jdo" + */ + private RepositoryContentStatisticsDAO repoContentStatisticsDAO; + + public List query( SimpleConstraint constraint ) + { + return null; + } + + public Object save( Serializable obj ) + { + throw new UnsupportedOperationException( "query not implemented for stub" ); + } + + public ArtifactDAO getArtifactDAO() + { + return artifactDAO; + } + + public ProjectModelDAO getProjectModelDAO() + { + return projectModelDAO; + } + + public RepositoryProblemDAO getRepositoryProblemDAO() + { + throw new UnsupportedOperationException( "query not implemented for stub" ); + } + + public RepositoryContentStatisticsDAO getRepositoryContentStatisticsDAO() + { + return repoContentStatisticsDAO; + } +} diff --git a/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryActionTest.java b/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryActionTest.java index 779ad630e..8a870cc5c 100644 --- a/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryActionTest.java +++ b/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryActionTest.java @@ -57,7 +57,13 @@ public class AddManagedRepositoryActionTest private static final String REPO_ID = "repo-ident"; private File location; - + + @Override + protected String getCustomConfigurationName() + { + return AbstractManagedRepositoriesAction.class.getName().replace( '.', '/' ) + "Test.xml"; + } + protected void setUp() throws Exception { diff --git a/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.java b/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.java index 95f25df2b..c0582812c 100644 --- a/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.java +++ b/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.java @@ -66,6 +66,12 @@ public class DeleteManagedRepositoryActionTest private File location; + @Override + protected String getCustomConfigurationName() + { + return AbstractManagedRepositoriesAction.class.getName().replace( '.', '/' ) + "Test.xml"; + } + protected void setUp() throws Exception { diff --git a/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryArchivaDAOStub.java b/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryArchivaDAOStub.java deleted file mode 100644 index d48ccc455..000000000 --- a/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryArchivaDAOStub.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.apache.maven.archiva.web.action.admin.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 java.io.Serializable; -import java.util.List; - -import org.apache.maven.archiva.database.ArchivaDAO; -import org.apache.maven.archiva.database.ArtifactDAO; -import org.apache.maven.archiva.database.ProjectModelDAO; -import org.apache.maven.archiva.database.RepositoryContentStatisticsDAO; -import org.apache.maven.archiva.database.RepositoryProblemDAO; -import org.apache.maven.archiva.database.SimpleConstraint; - -/** - * DeleteManagedRepositoryArchivaDAOStub - * - * @author Maria Odea Ching - * @version - */ -public class DeleteManagedRepositoryArchivaDAOStub - implements ArchivaDAO -{ - /** - * @plexus.requirement role-hint="jdo" - */ - private ProjectModelDAO projectModelDAO; - - /** - * @plexus.requirement role-hint="jdo" - */ - private ArtifactDAO artifactDAO; - - /** - * @plexus.requirement role-hint="jdo" - */ - private RepositoryContentStatisticsDAO repoContentStatisticsDAO; - - public List query( SimpleConstraint constraint ) - { - return null; - } - - public Object save( Serializable obj ) - { - throw new UnsupportedOperationException( "query not implemented for stub" ); - } - - public ArtifactDAO getArtifactDAO() - { - return artifactDAO; - } - - public ProjectModelDAO getProjectModelDAO() - { - return projectModelDAO; - } - - public RepositoryProblemDAO getRepositoryProblemDAO() - { - throw new UnsupportedOperationException( "query not implemented for stub" ); - } - - public RepositoryContentStatisticsDAO getRepositoryContentStatisticsDAO() - { - return repoContentStatisticsDAO; - } -} diff --git a/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryActionTest.java b/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryActionTest.java index f596f42b7..407ffd710 100644 --- a/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryActionTest.java +++ b/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryActionTest.java @@ -57,6 +57,12 @@ public class EditManagedRepositoryActionTest private File location; + @Override + protected String getCustomConfigurationName() + { + return AbstractManagedRepositoriesAction.class.getName().replace( '.', '/' ) + "Test.xml"; + } + protected void setUp() throws Exception { diff --git a/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoriesActionTest.xml b/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoriesActionTest.xml new file mode 100644 index 000000000..7273543eb --- /dev/null +++ b/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoriesActionTest.xml @@ -0,0 +1,98 @@ + + + + + + org.codehaus.plexus.logging.LoggerManager + org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager + basic + + + + com.opensymphony.xwork.Action + addManagedRepositoryAction + org.apache.maven.archiva.web.action.admin.repositories.AddManagedRepositoryAction + per-lookup + + + + + com.opensymphony.xwork.Action + deleteManagedRepositoryAction + org.apache.maven.archiva.web.action.admin.repositories.DeleteManagedRepositoryAction + per-lookup + + + org.apache.maven.archiva.database.ArchivaDAO + jdo + archivaDAO + + + + + + com.opensymphony.xwork.Action + editManagedRepositoryAction + org.apache.maven.archiva.web.action.admin.repositories.EditManagedRepositoryAction + per-lookup + + + + + + org.apache.maven.archiva.database.ArchivaDAO + jdo + org.apache.maven.archiva.web.action.admin.repositories.AbstractManagedRepositoryArchivaDAOStub + + + org.apache.maven.archiva.database.ArtifactDAO + jdo + artifactDAO + + + org.apache.maven.archiva.database.ProjectModelDAO + jdo + projectModelDAO + + + org.apache.maven.archiva.database.RepositoryContentStatisticsDAO + jdo + repoContentStatisticsDAO + + + + + org.apache.maven.archiva.database.ArtifactDAO + jdo + org.apache.maven.archiva.web.action.admin.repositories.ArtifactDAOStub + + + org.apache.maven.archiva.database.ProjectModelDAO + jdo + org.apache.maven.archiva.web.action.admin.repositories.ProjectModelDAOStub + + + org.apache.maven.archiva.database.RepositoryContentStatisticsDAO + jdo + org.apache.maven.archiva.web.action.admin.repositories.RepositoryContentStatisticsDAOStub + + + + diff --git a/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.xml b/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.xml index c6e35788e..a5891aacc 100644 --- a/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.xml +++ b/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.xml @@ -24,6 +24,11 @@ org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager basic + + org.codehaus.plexus.redback.role.RoleManager + default + org.apache.maven.archiva.web.action.admin.repositories.RoleManagerStub + com.opensymphony.xwork.Action deleteManagedRepositoryAction