]> source.dussan.org Git - archiva.git/commitdiff
Updating test cases for ManagedRepositories to not set RoleManager via plexus (to...
authorJoakim Erdfelt <joakime@apache.org>
Fri, 26 Oct 2007 16:10:59 +0000 (16:10 +0000)
committerJoakim Erdfelt <joakime@apache.org>
Fri, 26 Oct 2007 16:10:59 +0000 (16:10 +0000)
/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

archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoryArchivaDAOStub.java [new file with mode: 0644]
archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryActionTest.java
archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.java
archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryArchivaDAOStub.java [deleted file]
archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryActionTest.java
archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoriesActionTest.xml [new file with mode: 0644]
archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.xml

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 (file)
index 0000000..81c1b76
--- /dev/null
@@ -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 <a href="mailto:oching@apache.org">Maria Odea Ching</a>
+ * @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;
+    }
+}
index 779ad630e793a29b9c3890d895304739cf487866..8a870cc5c517bb0f1cc1f7e8bffbee3d4996c633 100644 (file)
@@ -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
     {
index 95f25df2b9e26ec736b2b18ec671b20113bd8ca9..c0582812c9d7a2347de2512ee7ad4a1c42cc9783 100644 (file)
@@ -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 (file)
index d48ccc4..0000000
+++ /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 <a href="mailto:oching@apache.org">Maria Odea Ching</a>
- * @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;
-    }
-}
index f596f42b72b74eb9b4f9f3ea6f278f7018226ef1..407ffd7106c92c4fc11654f13d470f321163a05d 100644 (file)
@@ -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 (file)
index 0000000..7273543
--- /dev/null
@@ -0,0 +1,98 @@
+<!--
+  ~ 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.
+  -->
+
+<plexus>
+  <components>
+    <component>
+      <role>org.codehaus.plexus.logging.LoggerManager</role>
+      <implementation>org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager</implementation>
+      <lifecycle-handler>basic</lifecycle-handler>
+    </component>
+    
+    <component>
+      <role>com.opensymphony.xwork.Action</role>
+      <role-hint>addManagedRepositoryAction</role-hint>
+      <implementation>org.apache.maven.archiva.web.action.admin.repositories.AddManagedRepositoryAction</implementation>
+      <instantiation-strategy>per-lookup</instantiation-strategy>
+      <!--  no requirements set  -->
+    </component>
+    
+    <component>
+      <role>com.opensymphony.xwork.Action</role>
+      <role-hint>deleteManagedRepositoryAction</role-hint>
+      <implementation>org.apache.maven.archiva.web.action.admin.repositories.DeleteManagedRepositoryAction</implementation>
+      <instantiation-strategy>per-lookup</instantiation-strategy>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.archiva.database.ArchivaDAO</role>
+          <role-hint>jdo</role-hint>
+          <field-name>archivaDAO</field-name>
+        </requirement>
+      </requirements>
+    </component>
+    
+    <component>
+      <role>com.opensymphony.xwork.Action</role>
+      <role-hint>editManagedRepositoryAction</role-hint>
+      <implementation>org.apache.maven.archiva.web.action.admin.repositories.EditManagedRepositoryAction</implementation>
+      <instantiation-strategy>per-lookup</instantiation-strategy>
+      <!--  no requirements set  -->
+    </component>
+    
+    <!-- DAO : Stubs -->
+    <component>
+      <role>org.apache.maven.archiva.database.ArchivaDAO</role>
+      <role-hint>jdo</role-hint>
+      <implementation>org.apache.maven.archiva.web.action.admin.repositories.AbstractManagedRepositoryArchivaDAOStub</implementation>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.archiva.database.ArtifactDAO</role>
+          <role-hint>jdo</role-hint>
+          <field-name>artifactDAO</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.database.ProjectModelDAO</role>
+          <role-hint>jdo</role-hint>
+          <field-name>projectModelDAO</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.database.RepositoryContentStatisticsDAO</role>
+          <role-hint>jdo</role-hint>
+          <field-name>repoContentStatisticsDAO</field-name>
+        </requirement>         
+      </requirements>            
+    </component>
+    <component>
+      <role>org.apache.maven.archiva.database.ArtifactDAO</role>
+      <role-hint>jdo</role-hint>
+      <implementation>org.apache.maven.archiva.web.action.admin.repositories.ArtifactDAOStub</implementation>
+    </component>        
+    <component>
+      <role>org.apache.maven.archiva.database.ProjectModelDAO</role>
+      <role-hint>jdo</role-hint>
+      <implementation>org.apache.maven.archiva.web.action.admin.repositories.ProjectModelDAOStub</implementation>
+    </component>   
+    <component>
+      <role>org.apache.maven.archiva.database.RepositoryContentStatisticsDAO</role>
+      <role-hint>jdo</role-hint>
+      <implementation>org.apache.maven.archiva.web.action.admin.repositories.RepositoryContentStatisticsDAOStub</implementation>
+    </component>        
+    
+  </components>
+</plexus>
index c6e35788eeff470f042aff3cb4feaf33a918ad32..a5891aacc699a38050c1db6423ab481162fa8c77 100644 (file)
       <implementation>org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager</implementation>
       <lifecycle-handler>basic</lifecycle-handler>
     </component>
+    <component>
+      <role>org.codehaus.plexus.redback.role.RoleManager</role>
+      <role-hint>default</role-hint>
+      <implementation>org.apache.maven.archiva.web.action.admin.repositories.RoleManagerStub</implementation>
+    </component>
     <component>
       <role>com.opensymphony.xwork.Action</role>
       <role-hint>deleteManagedRepositoryAction</role-hint>