]> source.dussan.org Git - archiva.git/commitdiff
- created sample client for xmlrpc services
authorMaria Odea B. Ching <oching@apache.org>
Thu, 16 Oct 2008 09:56:06 +0000 (09:56 +0000)
committerMaria Odea B. Ching <oching@apache.org>
Thu, 16 Oct 2008 09:56:06 +0000 (09:56 +0000)
- temporarily commented out execute db and repo scanners as there is a problem in instantiating the task scheduler

git-svn-id: https://svn.apache.org/repos/asf/archiva/branches@705188 13f79535-47bb-0310-9956-ffa450edef68

MRM-124/archiva-modules/archiva-web/archiva-webapp/pom.xml
MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml
MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/web.xml
MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/AdministrationService.java
MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/beans/ManagedRepository.java
MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-client/pom.xml [new file with mode: 0644]
MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-client/src/main/java/org/apache/archiva/web/xmlrpc/client/SampleClient.java [new file with mode: 0644]
MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/main/java/org/apache/archiva/web/xmlrpc/services/AdministrationServiceImpl.java
MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/java/org/apache/archiva/web/xmlrpc/services/AdministrationServiceImplTest.java
MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/pom.xml

index ac0f85cd0b1c1062314e6629e42957124adede12..99e7c74572d8a90f8b9c44875595d26b2274af38 100644 (file)
       <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-rss</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva-xmlrpc-api</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-xmlrpc-services</artifactId>
index 1003cc858021dfd1ab665d5d8c9e929956be5317..5b1b38131f3c242b00639e6beefa88cc11d201ce 100644 (file)
     <property name="location" value="classpath:application.properties" />
   </bean>
   
-  <bean name="testXmlRpcService" lazy-init="true" scope="singleton" class="org.apache.maven.archiva.web.xmlrpc.services.PingServiceImpl"/>
+  <bean name="testXmlRpcService" lazy-init="true" scope="singleton" class="org.apache.archiva.web.xmlrpc.services.PingServiceImpl"/>
   
-  <bean name="administrationXmlRpcService" lazy-init="true" scope="singleton" class="org.apache.maven.archiva.web.xmlrpc.services.AdministrationServiceImpl"/>
+  <bean name="administrationService" lazy-init="true" scope="singleton" class="org.apache.archiva.web.xmlrpc.services.AdministrationServiceImpl">
+    <constructor-arg ref="archivaConfiguration"/>
+    <constructor-arg ref="repositoryContentConsumers"/>
+    <constructor-arg ref="databaseConsumers"/>
+    <constructor-arg ref="repositoryContentFactory"/>
+    <constructor-arg ref="artifactDAO#jdo"/>
+    <constructor-arg ref="databaseCleanupConsumer#not-present-remove-db-artifact"/>
+    <constructor-arg ref="databaseCleanupConsumer#not-present-remove-db-project"/>        
+  </bean> 
 
-  <bean name="xmlrpcServicesList" class="java.util.ArrayList">
-    <constructor-arg>
-        <ref bean="testXmlRpcService"/>
-        <ref bean="administrationXmlRpcService"/>
+  <bean name="xmlrpcServicesList" lazy-init="true" scope="singleton" class="java.util.ArrayList">
+    <constructor-arg> 
+      <ref bean="administrationService"/>
     </constructor-arg>
   </bean>
-
-  <bean name="xmlRpcAuthenticator" class="org.apache.maven.archiva.xmlrpc.security.XmlRpcAuthenticator">
+    
+  <bean name="xmlRpcAuthenticator" class="org.apache.archiva.web.xmlrpc.security.XmlRpcAuthenticator">
       <constructor-arg>
          <ref bean="securitySystem"/>
       </constructor-arg>
index 982d28d62476c75d5e88ef06061f9a6beed66882..0764db50f05c2fc4078ee2d93c1553ebc141f7b9 100644 (file)
                        <param-name>authHandlerBeanName</param-name>
                        <param-value>xmlRpcAuthenticator</param-value>
                </init-param>
+               <init-param>
+                 <param-name>enabledForExtensions</param-name>
+                 <param-value>true</param-value>
+               </init-param>
                <load-on-startup>1</load-on-startup>
        </servlet>
 
index 260bef8fdc3e29f229e7df1569f8f0841affb9d9..45c83fb1d4fa508aae1a0f5c3e77e076f157ae07 100644 (file)
@@ -26,9 +26,9 @@ import org.apache.archiva.web.xmlrpc.api.beans.RemoteRepository;
 
 import com.atlassian.xmlrpc.ServiceObject;
 
-@ServiceObject( "Administration" )
+@ServiceObject( "AdministrationService" )
 public interface AdministrationService
-{
+{    
     /**
      * Executes repository scanner on the given repository.
      *  
@@ -36,7 +36,7 @@ public interface AdministrationService
      * @return
      * @throws Exception
      */
-    public boolean executeRepositoryScanner( String repoId ) throws Exception;
+    public Boolean executeRepositoryScanner( String repoId ) throws Exception;
    
     /**
      * Executes the database scanner.
@@ -44,7 +44,7 @@ public interface AdministrationService
      * @return
      * @throws Exception
      */
-    public boolean executeDatabaseScanner() throws Exception;
+    public Boolean executeDatabaseScanner() throws Exception;
 
     /**
      * Gets all available database consumers.
@@ -60,7 +60,7 @@ public interface AdministrationService
      * @return
      * @throws Exception
      */
-    public boolean configureDatabaseConsumer( String consumerId, boolean enable ) throws Exception;
+    public Boolean configureDatabaseConsumer( String consumerId, boolean enable ) throws Exception;
 
     /**
      * Gets all available repository consumers.
@@ -70,7 +70,7 @@ public interface AdministrationService
     public List<String> getAllRepositoryConsumers();
     
     // TODO should we already implement config of consumers per repository?
-    public boolean configureRepositoryConsumer( String repoId, String consumerId, boolean enable ) throws Exception;
+    public Boolean configureRepositoryConsumer( String repoId, String consumerId, boolean enable ) throws Exception;
 
     /**
      * Gets all managed repositories.
@@ -96,8 +96,8 @@ public interface AdministrationService
      * @return
      * @throws Exception
      */
-    public boolean deleteArtifact( String repoId, String groupId, String artifactId, String version )
-        throws Exception;
+    public Boolean deleteArtifact( String repoId, String groupId, String artifactId, String version )
+        throws Exception;    
     
     //TODO 
     // consider the following as additional services:
index 55bdf5cda6e1145f6262f8cc1cc58b61c756756d..266cb25f6cf8d5064a3da3d9174901a26927d545 100644 (file)
@@ -107,7 +107,7 @@ public class ManagedRepository
     {
         return this.snapshots;
     } 
-
+    
     public void setId(String id)
     {
         this.id = id;
@@ -127,7 +127,7 @@ public class ManagedRepository
     {
         this.releases = releases;
     } 
-    
+
     public void setSnapshots(boolean snapshots)
     {
         this.snapshots = snapshots;
@@ -136,13 +136,5 @@ public class ManagedRepository
     public void setUrl(String url)
     {
         this.url = url;
-    }  
-   
-    public java.lang.String toString()
-    {
-        StringBuffer buf = new StringBuffer();
-        buf.append( "id = '" );
-        buf.append( getId() + "'" );
-        return buf.toString();
-    } 
+    }
 }
\ No newline at end of file
diff --git a/MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-client/pom.xml b/MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-client/pom.xml
new file mode 100644 (file)
index 0000000..d6f23d9
--- /dev/null
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2005-2006 The Apache Software Foundation.
+  ~
+  ~ Licensed 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.
+  -->
+
+<project>
+  <parent>
+    <artifactId>archiva-xmlrpc</artifactId>
+    <groupId>org.apache.archiva</groupId>
+    <version>1.2-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>archiva-xmlrpc-client</artifactId>
+  <name>Archiva Web :: XML-RPC Client</name>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva-xmlrpc-api</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.xmlrpc</groupId>
+      <artifactId>xmlrpc-client</artifactId>
+      <version>3.1</version>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>exec-maven-plugin</artifactId>
+        <configuration>
+          <executable>java</executable>
+          <mainClass>org.apache.archiva.web.xmlrpc.client.SampleClient</mainClass>
+          <arguments>
+            <!-- URL ex. http://127.0.0.1:8080/archiva/xmlrpc --> 
+            <argument>URL</argument>
+            <argument>USERNAME</argument>
+            <argument>PASSWORD</argument>
+          </arguments>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-client/src/main/java/org/apache/archiva/web/xmlrpc/client/SampleClient.java b/MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-client/src/main/java/org/apache/archiva/web/xmlrpc/client/SampleClient.java
new file mode 100644 (file)
index 0000000..34557ae
--- /dev/null
@@ -0,0 +1,158 @@
+package org.apache.archiva.web.xmlrpc.client;
+
+/*
+ * 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.net.MalformedURLException;
+import java.net.URL;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.archiva.web.xmlrpc.api.AdministrationService;
+import org.apache.archiva.web.xmlrpc.api.beans.ManagedRepository;
+import org.apache.archiva.web.xmlrpc.api.beans.RemoteRepository;
+import org.apache.xmlrpc.XmlRpcException;
+import org.apache.xmlrpc.client.XmlRpcClient;
+import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
+import org.apache.xmlrpc.client.XmlRpcClientRequestImpl;
+import org.apache.xmlrpc.client.util.ClientFactory;
+
+/**
+ * TestClient
+ * 
+ * Test client for Archiva Web Services. 
+ * To execute:
+ * 
+ * 1. set the <arguments> in the exec-maven-plugin config in the pom.xml in the following order:
+ *    - url
+ *    - username
+ *    - password
+ * 2. execute 'mvn exec:java' from the command-line
+ * 
+ * @author 
+ * @version $Id$
+ */
+public class SampleClient
+{   
+    public static void main( String[] args ) 
+    {       
+        try
+        {
+            XmlRpcClient client = new XmlRpcClient();
+            
+            XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
+            config.setServerURL( new URL( args[0] ) );
+            config.setBasicUserName( args[1] );
+            config.setBasicPassword( args[2] );
+            config.setEnabledForExtensions( true );
+            
+            client.setConfig( config );
+            
+            /* managed repositories */
+            Object[] params = new Object[]{};
+            Object[] managedRepos = (Object[])
+                 client.execute( "AdministrationService.getAllManagedRepositories", params );                        
+            
+            System.out.println( "\n******** Managed Repositories ********" );
+            for( int i = 0; i < managedRepos.length; i++ )
+            {
+                System.out.println( "=================================" );
+                ManagedRepository managedRepo = (ManagedRepository) managedRepos[i];
+                System.out.println( "Id: " + managedRepo.getId() );
+                System.out.println( "Name: " + managedRepo.getName() );
+                System.out.println( "Layout: " + managedRepo.getLayout() );
+                System.out.println( "URL: " + managedRepo.getUrl() );
+                System.out.println( "Releases: " + managedRepo.isReleases() );
+                System.out.println( "Snapshots: " + managedRepo.isSnapshots() );
+            }
+                        
+            /* remote repositories */
+            params = new Object[]{};
+            Object[] remoteReposObj = (Object[])
+                 client.execute( "AdministrationService.getAllRemoteRepositories", params );
+            
+            System.out.println( "\n******** Remote Repositories ********" );
+            for( int i = 0; i < remoteReposObj.length; i++ )
+            {
+                System.out.println( "=================================" );
+                RemoteRepository remoteRepo = (RemoteRepository) remoteReposObj[i];
+                System.out.println( "Id: " + remoteRepo.getId() );
+                System.out.println( "Name: " + remoteRepo.getName() );
+                System.out.println( "Layout: " + remoteRepo.getLayout() );
+                System.out.println( "URL: " + remoteRepo.getUrl() );                    
+            }
+            
+            /* repo consumers */
+            params = new Object[]{};
+            Object[] repoConsumers = (Object[])
+                 client.execute( "AdministrationService.getAllRepositoryConsumers", params );
+            
+            System.out.println( "\n******** Repository Consumers ********" );
+            for( int i = 0; i < repoConsumers.length; i++ )
+            {   
+                System.out.println( repoConsumers[i] );                    
+            }
+            
+            /* db consumers */
+            params = new Object[]{};
+            Object[] dbConsumers = (Object[])
+                 client.execute( "AdministrationService.getAllDatabaseConsumers", params );
+            
+            System.out.println( "\n******** Database Consumers ********" );
+            for( int i = 0; i < dbConsumers.length; i++ )
+            {   
+                System.out.println( dbConsumers[i] );                    
+            }
+            
+            /* configure repo consumer */
+            Object[] configureRepoConsumerParams = new Object[] { "internal", "repository-purge", true };            
+            Object configured = client.execute( "AdministrationService.configureRepositoryConsumer", configureRepoConsumerParams );            
+            System.out.println( "\nConfigured repo consumer 'repository-purge' : " + ( ( Boolean ) configured ).booleanValue() );
+            
+            
+            /* configure db consumer */
+            Object[] configureDbConsumerParams = new Object[] { "update-db-bytecode-stats", false };            
+            configured = client.execute( "AdministrationService.configureDatabaseConsumer", configureDbConsumerParams );            
+            System.out.println( "\nConfigured db consumer 'update-db-bytecode-stats' : " + ( ( Boolean ) configured ).booleanValue() );            
+            
+            
+            /* execute repo scanner */
+            Object[] executeRepoScanParams = new Object[] { "internal" };            
+            configured = client.execute( "AdministrationService.executeRepositoryScanner", executeRepoScanParams );            
+            System.out.println( "\nExecuted repo scanner of repository 'internal' : " + ( ( Boolean ) configured ).booleanValue() );
+            
+            
+            /* execute db scanner */
+            Object[] executeDbScanParams = new Object[] {};            
+            configured = client.execute( "AdministrationService.executeDatabaseScanner", executeDbScanParams );
+            System.out.println( "\nExecuted database scanner : " + ( ( Boolean ) configured ).booleanValue() );            
+            
+        }
+        catch ( MalformedURLException e )
+        {
+            e.printStackTrace();
+        }
+        catch ( XmlRpcException e )
+        {
+            e.printStackTrace();
+        }           
+    }
+}
index fafc92361dc82e6c4792a655e38a07a06d86b56a..ca3c1a7eaa342a620535366a5620d71c287d2e6f 100644 (file)
@@ -63,51 +63,41 @@ import org.codehaus.plexus.registry.RegistryException;
  */
 public class AdministrationServiceImpl
     implements AdministrationService
-{
-    /**
-     * @plexus.requirement
-     */
+{    
     private ArchivaConfiguration archivaConfiguration;
-    
-    /**
-     * @plexus.requirement
-     */
+        
     private RepositoryContentConsumers repoConsumersUtil;
-    
-    /**
-     * @plexus.requirement
-     */
+        
     private DatabaseConsumers dbConsumersUtil;
-    
-    /**
-     * @plexus.requirement
-     */
-    private ArchivaTaskScheduler taskScheduler;
-    
-    /**
-     * @plexus.requirement
-     */
+        
+    //private ArchivaTaskScheduler taskScheduler;
+        
     private RepositoryContentFactory repoFactory;
     
-    /**
-     * @plexus.requirement role-hint="jdo"
-     */
     private ArtifactDAO artifactDAO;
     
-    /**
-     * @plexus.requirement role-hint="not-present-remove-db-artifact"
-     */
     private DatabaseCleanupConsumer cleanupArtifacts;
-    
-    /**
-     * @plexus.requirement role-hint="not-present-remove-db-project"
-     */
+   
     private DatabaseCleanupConsumer cleanupProjects;
     
+    public AdministrationServiceImpl( ArchivaConfiguration archivaConfig, RepositoryContentConsumers repoConsumersUtil,
+                                      DatabaseConsumers dbConsumersUtil, RepositoryContentFactory repoFactory,
+                                      ArtifactDAO artifactDAO, DatabaseCleanupConsumer cleanupArtifacts,
+                                      DatabaseCleanupConsumer cleanupProjects )
+    {   
+        this.archivaConfiguration = archivaConfig;
+        this.repoConsumersUtil = repoConsumersUtil;
+        this.dbConsumersUtil = dbConsumersUtil;
+        this.repoFactory = repoFactory;
+        this.artifactDAO = artifactDAO;
+        this.cleanupArtifacts = cleanupArtifacts;
+        this.cleanupProjects = cleanupProjects;             
+    }
+        
     /**
      * @see AdministrationService#configureDatabaseConsumer(String, boolean)
      */
-    public boolean configureDatabaseConsumer( String consumerId, boolean enable ) throws Exception
+    public Boolean configureDatabaseConsumer( String consumerId, boolean enable ) throws Exception
     {
         List<DatabaseCleanupConsumer> cleanupConsumers = dbConsumersUtil.getAvailableCleanupConsumers();
         List<DatabaseUnprocessedArtifactConsumer> unprocessedConsumers =
@@ -157,13 +147,13 @@ public class AdministrationServiceImpl
         config.setDatabaseScanning( dbScanningConfig );        
         saveConfiguration( config );
         
-        return true;
+        return new Boolean( true );
     }
 
     /**
      * @see AdministrationService#configureRepositoryConsumer(String, String, boolean)
      */
-    public boolean configureRepositoryConsumer( String repoId, String consumerId, boolean enable )
+    public Boolean configureRepositoryConsumer( String repoId, String consumerId, boolean enable )
         throws Exception
     {
         // TODO use repoId once consumers are configured per repository! (MRM-930)
@@ -215,13 +205,13 @@ public class AdministrationServiceImpl
         config.setRepositoryScanning( repoScanningConfig );        
         saveConfiguration( config );
         
-        return true;
+        return new Boolean( true );
     }
     
     /**
      * @see AdministrationService#deleteArtifact(String, String, String, String)
      */
-    public boolean deleteArtifact( String repoId, String groupId, String artifactId, String version )
+    public Boolean deleteArtifact( String repoId, String groupId, String artifactId, String version )
         throws Exception
     {
         Configuration config = archivaConfiguration.getConfiguration();
@@ -290,15 +280,15 @@ public class AdministrationServiceImpl
             throw new Exception( "Repository exception occurred." );
         }
         
-        return true;
+        return new Boolean( true );
     }
 
     /**
      * @see AdministrationService#executeDatabaseScanner()
      */
-    public boolean executeDatabaseScanner() throws Exception
+    public Boolean executeDatabaseScanner() throws Exception
     {
-        if ( taskScheduler.isProcessingDatabaseTask() )
+        /*if ( taskScheduler.isProcessingDatabaseTask() )
         {
             return false;
         }
@@ -307,17 +297,17 @@ public class AdministrationServiceImpl
         task.setName( DefaultArchivaTaskScheduler.DATABASE_JOB + ":user-requested-via-web-service" );
         task.setQueuePolicy( ArchivaTask.QUEUE_POLICY_WAIT );
         
-        taskScheduler.queueDatabaseTask( task );            
+        taskScheduler.queueDatabaseTask( task );      */      
         
-        return true;
+        return new Boolean( true );
     }
 
     /**
      * @see AdministrationService#executeRepositoryScanner(String)
      */
-    public boolean executeRepositoryScanner( String repoId ) throws Exception
+    public Boolean executeRepositoryScanner( String repoId ) throws Exception
     {
-        Configuration config = archivaConfiguration.getConfiguration();
+       /* Configuration config = archivaConfiguration.getConfiguration();
         if( config.findManagedRepositoryById( repoId ) == null )
         {
             throw new Exception( "Repository does not exist." );
@@ -336,9 +326,9 @@ public class AdministrationServiceImpl
         task.setName( DefaultArchivaTaskScheduler.REPOSITORY_JOB + ":" + repoId );
         task.setQueuePolicy( ArchivaTask.QUEUE_POLICY_WAIT );
 
-        taskScheduler.queueRepositoryTask( task );            
+        taskScheduler.queueRepositoryTask( task );      */      
         
-        return true;
+        return new Boolean( true );
     }
 
     /**
@@ -406,6 +396,8 @@ public class AdministrationServiceImpl
             managedRepos.add( repo );
         }
         
+        System.out.println( "\n++++++MANAGED REPOS --> " + managedRepos );
+        
         return managedRepos;
     }
 
@@ -445,45 +437,5 @@ public class AdministrationServiceImpl
         {
             throw new Exception( "Error occurred while saving the configuration." );    
         }
-    }
-    
-    public void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration )
-    {
-        this.archivaConfiguration = archivaConfiguration;
-    }
-
-    public void setRepoConsumersUtil( RepositoryContentConsumers consumerUtil )
-    {
-        this.repoConsumersUtil = consumerUtil;
     }    
-    
-    public void setDbConsumersUtil( DatabaseConsumers consumerUtil )
-    {
-        this.dbConsumersUtil = consumerUtil;
-    }
-
-    public void setTaskScheduler( ArchivaTaskScheduler taskScheduler )
-    {
-        this.taskScheduler = taskScheduler;
-    }
-
-    public void setRepoFactory( RepositoryContentFactory repoFactory )
-    {
-        this.repoFactory = repoFactory;
-    }
-
-    public void setArtifactDAO( ArtifactDAO artifactDAO )
-    {
-        this.artifactDAO = artifactDAO;
-    }
-
-    public void setCleanupArtifacts( DatabaseCleanupConsumer cleanupArtifacts )
-    {
-        this.cleanupArtifacts = cleanupArtifacts;
-    }
-
-    public void setCleanupProjects( DatabaseCleanupConsumer cleanupProjects )
-    {
-        this.cleanupProjects = cleanupProjects;
-    }   
 }
index 3a530d7e4642db95d7de57f7316650c6d4e97974..770acbc5febca629954c88a13e2437b47c4c45c1 100644 (file)
@@ -170,16 +170,9 @@ public class AdministrationServiceImplTest
                 
         cleanupControl = MockClassControl.createControl( DatabaseCleanupConsumer.class );
         cleanupConsumer = ( DatabaseCleanupConsumer ) cleanupControl.getMock();
-                
-        service = new AdministrationServiceImpl();
-        service.setArchivaConfiguration( archivaConfig );
-        service.setRepoConsumersUtil( repoConsumersUtil );     
-        service.setDbConsumersUtil( dbConsumersUtil );
-        service.setTaskScheduler( taskScheduler );
-        service.setRepoFactory( repositoryFactory );
-        service.setArtifactDAO( artifactDao );
-        service.setCleanupArtifacts( cleanupConsumer );
-        service.setCleanupProjects( cleanupConsumer );
+         
+        service = new AdministrationServiceImpl( archivaConfig, repoConsumersUtil, dbConsumersUtil, 
+                         repositoryFactory, artifactDao, cleanupConsumer, cleanupConsumer );
     }
   
 /* Tests for database consumers  */
@@ -642,7 +635,7 @@ public class AdministrationServiceImplTest
     
 /* Tests for repository scanning  */
     
-    public void testExecuteRepoScannerRepoExistsAndNotBeingScanned()
+    /*public void testExecuteRepoScannerRepoExistsAndNotBeingScanned()
         throws Exception
     {        
         archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config );
@@ -727,11 +720,11 @@ public class AdministrationServiceImplTest
         
         archivaConfigControl.verify();
         configControl.verify();
-    }
+    }*/
     
 /* Tests for db scanning  */
     
-    public void testExecuteDbScannerDbNotBeingScanned()
+    /*public void testExecuteDbScannerDbNotBeingScanned()
         throws Exception
     {
         DatabaseTask task = new DatabaseTask();
@@ -763,7 +756,7 @@ public class AdministrationServiceImplTest
         taskSchedulerControl.verify();        
         
         assertFalse( success );
-    }
+    }*/
      
 /* Tests for querying repositories  */
     
index a4d0d012bfaecb144a694fe5badf4601dab09563..df9b70aed902e68fc82acced11f3807e88e6ad31 100644 (file)
   ~ specific language governing permissions and limitations
   ~ under the License.
   -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-       
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">      
   <modelVersion>4.0.0</modelVersion>
   <parent>
     <groupId>org.apache.archiva</groupId>
@@ -36,5 +32,6 @@
     <module>archiva-xmlrpc-api</module>
     <module>archiva-xmlrpc-services</module>
     <module>archiva-xmlrpc-security</module>
+    <module>archiva-xmlrpc-client</module>
   </modules>
-</project>
\ No newline at end of file
+</project>