]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1332] remove database scanning configuration and handle upgrade.
authorOlivier Lamy <olamy@apache.org>
Tue, 4 Oct 2011 21:15:25 +0000 (21:15 +0000)
committerOlivier Lamy <olamy@apache.org>
Tue, 4 Oct 2011 21:15:25 +0000 (21:15 +0000)
make create-archiva-metadata and duplicate-artifacts as default knowContentConsumers

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

archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/DefaultArchivaConfiguration.java
archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo
archiva-modules/archiva-base/archiva-configuration/src/main/resources/org/apache/archiva/configuration/default-archiva.xml
archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/ArchivaConfigurationTest.java
archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java
archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/InvalidScanConsumer.java
archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/KnownScanConsumer.java
archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryContentConsumersTest.java

index afa12c4fd9fae359b618966e4c04464ef21d55e8..fd3f5446a4030cfec72b738c36e4086df3897792 100644 (file)
@@ -29,6 +29,7 @@ import org.apache.archiva.policies.Policy;
 import org.apache.archiva.policies.PostDownloadPolicy;
 import org.apache.archiva.policies.PreDownloadPolicy;
 import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections.ListUtils;
 import org.apache.commons.collections.MapUtils;
 import org.apache.commons.configuration.BaseConfiguration;
 import org.apache.commons.io.FileUtils;
@@ -528,7 +529,6 @@ public class DefaultArchivaConfiguration
         throws RegistryException
     {
         // TODO: may not be needed under commons-configuration 1.4 - check
-        // UPDATE: Upgrading to commons-configuration 1.4 breaks half the unit tests. 2007-10-11 (joakime)
 
         String contents = "<configuration />";
 
@@ -700,39 +700,46 @@ public class DefaultArchivaConfiguration
         throws RegistryException, IndeterminateConfigurationException
     {
 
-        // remove database consumers
         List<String> dbConsumers = Arrays.asList( "update-db-artifact", "update-db-repository-metadata" );
-        List<String> knowContentConsumers = new ArrayList<String>( );
-        for ( String knowContentConsumer : configuration.getRepositoryScanning( ).getKnownContentConsumers( ) )
+
+        // remove database consumers  if here
+        List<String> intersec =
+            ListUtils.intersection( dbConsumers, configuration.getRepositoryScanning( ).getKnownContentConsumers( ) );
+
+        if ( !intersec.isEmpty( ) )
         {
-            if ( !dbConsumers.contains( knowContentConsumer ) )
+
+            List<String> knowContentConsumers = new ArrayList<String>( );
+            for ( String knowContentConsumer : configuration.getRepositoryScanning( ).getKnownContentConsumers( ) )
             {
-                knowContentConsumers.add( knowContentConsumer );
+                if ( !dbConsumers.contains( knowContentConsumer ) )
+                {
+                    knowContentConsumers.add( knowContentConsumer );
+                }
             }
-        }
 
-        configuration.getRepositoryScanning( ).setKnownContentConsumers( knowContentConsumers );
-        save( configuration );
+            configuration.getRepositoryScanning( ).setKnownContentConsumers( knowContentConsumers );
+        }
 
         // ensure create-archiva-metadata is here
         if ( !configuration.getRepositoryScanning( ).getKnownContentConsumers( ).contains( "create-archiva-metadata" ) )
         {
-            knowContentConsumers =
+            List<String> knowContentConsumers =
                 new ArrayList<String>( configuration.getRepositoryScanning( ).getKnownContentConsumers( ) );
             knowContentConsumers.add( "create-archiva-metadata" );
             configuration.getRepositoryScanning( ).setKnownContentConsumers( knowContentConsumers );
-            save( configuration );
         }
 
         // ensure duplicate-artifacts is here
         if ( !configuration.getRepositoryScanning( ).getKnownContentConsumers( ).contains( "duplicate-artifacts" ) )
         {
-            knowContentConsumers =
+            List<String> knowContentConsumers =
                 new ArrayList<String>( configuration.getRepositoryScanning( ).getKnownContentConsumers( ) );
             knowContentConsumers.add( "duplicate-artifacts" );
             configuration.getRepositoryScanning( ).setKnownContentConsumers( knowContentConsumers );
-            save( configuration );
         }
+        // save ??
+        //save( configuration );
     }
 
     public void reload( )
index 0946573508502eadbdf469edb9fbcb6893b35950..9473f9b6ebcbb5fef2b1d7606fc77eae8cf8c0e0 100644 (file)
         </field>
       </fields>
     </class>
-
   </classes>
 </model>
 
index 5705f846064e9ab15798688ce62ae5740463af06..12adacaa361df0cff1a4468c690caac5d3f1d4c3 100644 (file)
       </fileType>
     </fileTypes>
     <knownContentConsumers>
-      <knownContentConsumer>update-db-artifact</knownContentConsumer>
       <knownContentConsumer>create-missing-checksums</knownContentConsumer>
-      <knownContentConsumer>update-db-repository-metadata</knownContentConsumer>
       <knownContentConsumer>validate-checksum</knownContentConsumer>
       <knownContentConsumer>validate-signature</knownContentConsumer>
       <knownContentConsumer>index-content</knownContentConsumer>
       <knownContentConsumer>auto-remove</knownContentConsumer>
       <knownContentConsumer>auto-rename</knownContentConsumer>
       <knownContentConsumer>metadata-updater</knownContentConsumer>
+      <knownContentConsumer>create-archiva-metadata</knownContentConsumer>
+      <knownContentConsumer>duplicate-artifacts</knownContentConsumer>
       <!--knownContentConsumer>repository-purge</knownContentConsumer-->
     </knownContentConsumers>
     <invalidContentConsumers>
     </invalidContentConsumers>
   </repositoryScanning>
 
-  <databaseScanning>
-    <cronExpression>0 0 * * * ?</cronExpression>
-    <unprocessedConsumers>
-      <unprocessedConsumer>index-artifact</unprocessedConsumer>
-      <unprocessedConsumer>update-db-project</unprocessedConsumer>
-      <unprocessedConsumer>validate-repository-metadata</unprocessedConsumer>
-      <unprocessedConsumer>index-archive-toc</unprocessedConsumer>
-      <unprocessedConsumer>update-db-bytecode-stats</unprocessedConsumer>
-      <unprocessedConsumer>index-public-methods</unprocessedConsumer>
-    </unprocessedConsumers>
-    <cleanupConsumers>
-      <cleanupConsumer>not-present-remove-db-artifact</cleanupConsumer>
-      <cleanupConsumer>not-present-remove-db-project</cleanupConsumer>
-      <cleanupConsumer>not-present-remove-indexed</cleanupConsumer>
-    </cleanupConsumers>
-  </databaseScanning>
-
   <webapp>
     <ui>
       <showFindArtifacts>true</showFindArtifacts>
index a46a1a5b62b2de991b498ca75dba854b65fe71da..2ecdc0dc668f3b5a841bdfdca72634ed8dcfdb62 100644 (file)
@@ -629,6 +629,9 @@ public class ArchivaConfigurationTest
 
         assertTrue(
             configuration.getRepositoryScanning( ).getKnownContentConsumers( ).contains( "create-archiva-metadata" ) );
+
+        assertTrue(
+            configuration.getRepositoryScanning( ).getKnownContentConsumers( ).contains( "duplicate-artifacts" ) );
     }
 
     @Test
@@ -794,8 +797,7 @@ public class ArchivaConfigurationTest
         userFile.getParentFile( ).mkdirs( );
         FileUtils.writeStringToFile( userFile, "<configuration/>", null );
 
-        ArchivaConfiguration archivaConfiguration =
-            (ArchivaConfiguration) lookup( ArchivaConfiguration.class, "test-remove-central" );
+        ArchivaConfiguration archivaConfiguration = lookup( ArchivaConfiguration.class, "test-remove-central" );
 
         archivaConfiguration.reload( );
 
@@ -818,8 +820,7 @@ public class ArchivaConfigurationTest
         configuration.removeManagedRepository( managedRepository );
         assertTrue( configuration.getManagedRepositories( ).isEmpty( ) );
 
-        ProxyConnectorConfiguration proxyConnector =
-            (ProxyConnectorConfiguration) configuration.getProxyConnectors( ).get( 0 );
+        ProxyConnectorConfiguration proxyConnector = configuration.getProxyConnectors( ).get( 0 );
         assertNotNull( proxyConnector );
         configuration.removeProxyConnector( proxyConnector );
         assertTrue( configuration.getProxyConnectors( ).isEmpty( ) );
@@ -829,24 +830,25 @@ public class ArchivaConfigurationTest
         configuration.removeNetworkProxy( networkProxy );
         assertTrue( configuration.getNetworkProxies( ).isEmpty( ) );
 
-        LegacyArtifactPath path = (LegacyArtifactPath) configuration.getLegacyArtifactPaths( ).get( 0 );
+        LegacyArtifactPath path = configuration.getLegacyArtifactPaths( ).get( 0 );
         assertNotNull( path );
         configuration.removeLegacyArtifactPath( path );
         assertTrue( configuration.getLegacyArtifactPaths( ).isEmpty( ) );
 
         RepositoryScanningConfiguration scanning = configuration.getRepositoryScanning( );
-        String consumer = (String) scanning.getKnownContentConsumers( ).get( 0 );
+        String consumer = scanning.getKnownContentConsumers( ).get( 0 );
         assertNotNull( consumer );
         scanning.removeKnownContentConsumer( consumer );
-        assertTrue( scanning.getKnownContentConsumers( ).isEmpty( ) );
-        consumer = (String) scanning.getInvalidContentConsumers( ).get( 0 );
+        // default values
+        assertFalse( scanning.getKnownContentConsumers( ).isEmpty( ) );
+        consumer = scanning.getInvalidContentConsumers( ).get( 0 );
         assertNotNull( consumer );
         scanning.removeInvalidContentConsumer( consumer );
         assertTrue( scanning.getInvalidContentConsumers( ).isEmpty( ) );
 
         archivaConfiguration.save( configuration );
 
-        archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.class, "test-read-saved" );
+        archivaConfiguration = lookup( ArchivaConfiguration.class, "test-read-saved" );
         configuration = archivaConfiguration.getConfiguration( );
         assertNull( configuration.getRemoteRepositoriesAsMap( ).get( "central" ) );
         assertTrue( configuration.getRepositoryGroups( ).isEmpty( ) );
@@ -855,7 +857,7 @@ public class ArchivaConfigurationTest
         assertNull( configuration.getNetworkProxiesAsMap( ).get( "proxy" ) );
         assertTrue( configuration.getLegacyArtifactPaths( ).isEmpty( ) );
         scanning = configuration.getRepositoryScanning( );
-        assertTrue( scanning.getKnownContentConsumers( ).isEmpty( ) );
+        assertFalse( scanning.getKnownContentConsumers( ).isEmpty( ) );
         assertTrue( scanning.getInvalidContentConsumers( ).isEmpty( ) );
     }
 
index fa3a07a6fe1e4accc569c64e5b096f243500c977..7badf11e15f31ccaaaa8a2ccda4e18619e60b2ea 100644 (file)
@@ -40,6 +40,8 @@ import org.codehaus.plexus.registry.RegistryListener;
 import org.codehaus.plexus.taskqueue.TaskQueueException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
 
 import javax.annotation.PostConstruct;
 import java.io.File;
@@ -52,6 +54,8 @@ import java.util.List;
 /**
  * Consumer for indexing the repository to provide search and IDE integration features.
  */
+@Service("knownRepositoryContentConsumer#index-content")
+@Scope("prototype")
 public class NexusIndexerConsumer
     extends AbstractMonitoredConsumer
     implements KnownRepositoryContentConsumer, RegistryListener
index 901925ac60d420afa4263eebe8a996c0656274ff..a294c1aa7a23c9d6b98c3eda5dae077131c798a8 100644 (file)
@@ -23,6 +23,8 @@ import org.apache.archiva.admin.model.beans.ManagedRepository;
 import org.apache.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.archiva.consumers.ConsumerException;
 import org.apache.archiva.consumers.InvalidRepositoryContentConsumer;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
 
 import java.util.Date;
 import java.util.List;
index caacfd5e5e39c60ac887728dd5cf007b3d869e53..364e11c4672c8acad4e6bbc15988e8acb48b086c 100644 (file)
@@ -23,6 +23,8 @@ import org.apache.archiva.admin.model.beans.ManagedRepository;
 import org.apache.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.archiva.consumers.ConsumerException;
 import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
 import java.util.Arrays;
index bdee90d75e4302f134c05096f0d83a62f7b18190..ac49db28acd4862e9972f8e24f74ffb2e2fcab4c 100644 (file)
@@ -22,10 +22,10 @@ package org.apache.archiva.repository.scanner;
 import junit.framework.TestCase;
 import org.apache.archiva.admin.model.beans.ManagedRepository;
 import org.apache.archiva.admin.model.beans.RemoteRepository;
-import org.apache.commons.lang.SystemUtils;
 import org.apache.archiva.configuration.ArchivaConfiguration;
 import org.apache.archiva.consumers.InvalidRepositoryContentConsumer;
 import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
+import org.apache.commons.lang.SystemUtils;
 import org.easymock.MockControl;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -69,27 +69,26 @@ public class RepositoryContentConsumersTest
 
     protected ManagedRepository createRepository( String id, String name, File location )
     {
-        ManagedRepository repo = new ManagedRepository();
+        ManagedRepository repo = new ManagedRepository( );
         repo.setId( id );
         repo.setName( name );
-        repo.setLocation( location.getAbsolutePath() );
+        repo.setLocation( location.getAbsolutePath( ) );
         return repo;
     }
 
     protected RemoteRepository createRemoteRepository( String id, String name, String url )
     {
-        RemoteRepository repo = new RemoteRepository();
+        RemoteRepository repo = new RemoteRepository( );
         repo.setId( id );
         repo.setName( name );
         repo.setUrl( url );
         return repo;
     }
 
-    private RepositoryContentConsumers lookupRepositoryConsumers()
+    private RepositoryContentConsumers lookupRepositoryConsumers( )
         throws Exception
     {
 
-
         ArchivaConfiguration configuration =
             applicationContext.getBean( "archivaConfiguration#test-conf", ArchivaConfiguration.class );
 
@@ -98,14 +97,13 @@ public class RepositoryContentConsumersTest
         RepositoryContentConsumers consumerUtilStub = new RepositoryContentConsumersStub( administrationStub );
 
         RepositoryContentConsumers consumerUtil =
-            (RepositoryContentConsumers) applicationContext.getBean( "repositoryContentConsumers#test",
-                                                                     RepositoryContentConsumers.class );
-        ApplicationContext context = new MockApplicationContext( consumerUtil.getAvailableKnownConsumers(),
-                                                                 consumerUtil.getAvailableInvalidConsumers() );
+            applicationContext.getBean( "repositoryContentConsumers#test", RepositoryContentConsumers.class );
+        ApplicationContext context = new MockApplicationContext( consumerUtil.getAvailableKnownConsumers( ),
+                                                                 consumerUtil.getAvailableInvalidConsumers( ) );
 
         consumerUtilStub.setApplicationContext( context );
-        consumerUtilStub.setSelectedInvalidConsumers( consumerUtil.getSelectedInvalidConsumers() );
-        consumerUtilStub.setSelectedKnownConsumers( consumerUtil.getSelectedKnownConsumers() );
+        consumerUtilStub.setSelectedInvalidConsumers( consumerUtil.getSelectedInvalidConsumers( ) );
+        consumerUtilStub.setSelectedKnownConsumers( consumerUtil.getSelectedKnownConsumers( ) );
         consumerUtilStub.setArchivaAdministration( administrationStub );
 
         assertNotNull( "RepositoryContentConsumers should not be null.", consumerUtilStub );
@@ -114,20 +112,20 @@ public class RepositoryContentConsumersTest
     }
 
     @Test
-    public void testGetSelectedKnownIds()
+    public void testGetSelectedKnownIds( )
         throws Exception
     {
-        RepositoryContentConsumers consumerutil = lookupRepositoryConsumers();
+        RepositoryContentConsumers consumerutil = lookupRepositoryConsumers( );
 
         String expectedKnownIds[] =
-            new String[]{ "update-db-artifact", "create-missing-checksums", "update-db-repository-metadata",
-                "validate-checksum", "validate-signature", "index-content", "auto-remove", "auto-rename" };
+            new String[]{ "create-missing-checksums", "validate-checksum", "validate-signature", "index-content",
+                "auto-remove", "auto-rename", "create-archiva-metadata", "duplicate-artifacts" };
 //update-db-artifact, create-missing-checksums, update-db-repository-metadata,
 //validate-checksum, validate-signature, index-content, auto-remove, auto-rename,
 //metadata-updater
-        List<String> knownConsumers = consumerutil.getSelectedKnownConsumerIds();
+        List<String> knownConsumers = consumerutil.getSelectedKnownConsumerIds( );
         assertNotNull( "Known Consumer IDs should not be null", knownConsumers );
-        assertEquals( "Known Consumer IDs.size " + knownConsumers, expectedKnownIds.length, knownConsumers.size() );
+        assertEquals( "Known Consumer IDs.size " + knownConsumers, expectedKnownIds.length, knownConsumers.size( ) );
 
         for ( String expectedId : expectedKnownIds )
         {
@@ -136,16 +134,16 @@ public class RepositoryContentConsumersTest
     }
 
     @Test
-    public void testGetSelectedInvalidIds()
+    public void testGetSelectedInvalidIds( )
         throws Exception
     {
-        RepositoryContentConsumers consumerutil = lookupRepositoryConsumers();
+        RepositoryContentConsumers consumerutil = lookupRepositoryConsumers( );
 
         String expectedInvalidIds[] = new String[]{ "update-db-bad-content" };
 
-        List<String> invalidConsumers = consumerutil.getSelectedInvalidConsumerIds();
+        List<String> invalidConsumers = consumerutil.getSelectedInvalidConsumerIds( );
         assertNotNull( "Invalid Consumer IDs should not be null", invalidConsumers );
-        assertEquals( "Invalid Consumer IDs.size", expectedInvalidIds.length, invalidConsumers.size() );
+        assertEquals( "Invalid Consumer IDs.size", expectedInvalidIds.length, invalidConsumers.size( ) );
 
         for ( String expectedId : expectedInvalidIds )
         {
@@ -154,101 +152,102 @@ public class RepositoryContentConsumersTest
     }
 
     @Test
-    public void testGetSelectedKnownConsumerMap()
+    public void testGetSelectedKnownConsumerMap( )
         throws Exception
     {
-        RepositoryContentConsumers consumerutil = lookupRepositoryConsumers();
+        RepositoryContentConsumers consumerutil = lookupRepositoryConsumers( );
 
         String expectedSelectedKnownIds[] =
-            new String[]{ "update-db-artifact", "create-missing-checksums", "update-db-repository-metadata",
-                "validate-checksum", "index-content", "auto-remove", "auto-rename" };
+            new String[]{ "create-missing-checksums", "validate-checksum", "index-content", "auto-remove",
+                "auto-rename" };
 
-        Map<String, KnownRepositoryContentConsumer> knownConsumerMap = consumerutil.getSelectedKnownConsumersMap();
+        Map<String, KnownRepositoryContentConsumer> knownConsumerMap = consumerutil.getSelectedKnownConsumersMap( );
         assertNotNull( "Known Consumer Map should not be null", knownConsumerMap );
-        assertEquals( "Known Consumer Map.size", expectedSelectedKnownIds.length, knownConsumerMap.size() );
+        assertEquals( "Known Consumer Map.size but " + knownConsumerMap, expectedSelectedKnownIds.length,
+                      knownConsumerMap.size( ) );
 
         for ( String expectedId : expectedSelectedKnownIds )
         {
             KnownRepositoryContentConsumer consumer = knownConsumerMap.get( expectedId );
             assertNotNull( "Known[" + expectedId + "] should not be null.", consumer );
-            assertEquals( "Known[" + expectedId + "].id", expectedId, consumer.getId() );
+            assertEquals( "Known[" + expectedId + "].id", expectedId, consumer.getId( ) );
         }
     }
 
     @Test
-    public void testGetSelectedInvalidConsumerMap()
+    public void testGetSelectedInvalidConsumerMap( )
         throws Exception
     {
-        RepositoryContentConsumers consumerutil = lookupRepositoryConsumers();
+        RepositoryContentConsumers consumerutil = lookupRepositoryConsumers( );
 
         String expectedSelectedInvalidIds[] = new String[]{ "update-db-bad-content" };
 
         Map<String, InvalidRepositoryContentConsumer> invalidConsumerMap =
-            consumerutil.getSelectedInvalidConsumersMap();
+            consumerutil.getSelectedInvalidConsumersMap( );
         assertNotNull( "Invalid Consumer Map should not be null", invalidConsumerMap );
-        assertEquals( "Invalid Consumer Map.size", expectedSelectedInvalidIds.length, invalidConsumerMap.size() );
+        assertEquals( "Invalid Consumer Map.size", expectedSelectedInvalidIds.length, invalidConsumerMap.size( ) );
 
         for ( String expectedId : expectedSelectedInvalidIds )
         {
             InvalidRepositoryContentConsumer consumer = invalidConsumerMap.get( expectedId );
             assertNotNull( "Known[" + expectedId + "] should not be null.", consumer );
-            assertEquals( "Known[" + expectedId + "].id", expectedId, consumer.getId() );
+            assertEquals( "Known[" + expectedId + "].id", expectedId, consumer.getId( ) );
         }
     }
 
     @Test
-    public void testGetAvailableKnownList()
+    public void testGetAvailableKnownList( )
         throws Exception
     {
-        RepositoryContentConsumers consumerutil = lookupRepositoryConsumers();
+        RepositoryContentConsumers consumerutil = lookupRepositoryConsumers( );
 
         String expectedKnownIds[] =
             new String[]{ "update-db-artifact", "create-missing-checksums", "update-db-repository-metadata",
                 "validate-checksum", "index-content", "auto-remove", "auto-rename", "available-but-unselected" };
 
-        List<KnownRepositoryContentConsumer> knownConsumers = consumerutil.getAvailableKnownConsumers();
+        List<KnownRepositoryContentConsumer> knownConsumers = consumerutil.getAvailableKnownConsumers( );
         assertNotNull( "known consumers should not be null.", knownConsumers );
-        assertEquals( "known consumers", expectedKnownIds.length, knownConsumers.size() );
+        assertEquals( "known consumers", expectedKnownIds.length, knownConsumers.size( ) );
 
         List<String> expectedIds = Arrays.asList( expectedKnownIds );
         for ( KnownRepositoryContentConsumer consumer : knownConsumers )
         {
-            assertTrue( "Consumer [" + consumer.getId() + "] returned by .getAvailableKnownConsumers() is unexpected.",
-                        expectedIds.contains( consumer.getId() ) );
+            assertTrue( "Consumer [" + consumer.getId( ) + "] returned by .getAvailableKnownConsumers() is unexpected.",
+                        expectedIds.contains( consumer.getId( ) ) );
         }
     }
 
     @Test
-    public void testGetAvailableInvalidList()
+    public void testGetAvailableInvalidList( )
         throws Exception
     {
-        RepositoryContentConsumers consumerutil = lookupRepositoryConsumers();
+        RepositoryContentConsumers consumerutil = lookupRepositoryConsumers( );
 
         String expectedInvalidIds[] = new String[]{ "update-db-bad-content", "move-to-trash-then-notify" };
 
-        List<InvalidRepositoryContentConsumer> invalidConsumers = consumerutil.getAvailableInvalidConsumers();
+        List<InvalidRepositoryContentConsumer> invalidConsumers = consumerutil.getAvailableInvalidConsumers( );
         assertNotNull( "invalid consumers should not be null.", invalidConsumers );
-        assertEquals( "invalid consumers", expectedInvalidIds.length, invalidConsumers.size() );
+        assertEquals( "invalid consumers", expectedInvalidIds.length, invalidConsumers.size( ) );
 
         List<String> expectedIds = Arrays.asList( expectedInvalidIds );
         for ( InvalidRepositoryContentConsumer consumer : invalidConsumers )
         {
             assertTrue(
-                "Consumer [" + consumer.getId() + "] returned by .getAvailableInvalidConsumers() is unexpected.",
-                expectedIds.contains( consumer.getId() ) );
+                "Consumer [" + consumer.getId( ) + "] returned by .getAvailableInvalidConsumers() is unexpected.",
+                expectedIds.contains( consumer.getId( ) ) );
         }
     }
 
     @Test
-    public void testExecution()
+    public void testExecution( )
         throws Exception
     {
         MockControl knownControl = MockControl.createNiceControl( KnownRepositoryContentConsumer.class );
-        RepositoryContentConsumers consumers = lookupRepositoryConsumers();
-        KnownRepositoryContentConsumer selectedKnownConsumer = (KnownRepositoryContentConsumer) knownControl.getMock();
+        RepositoryContentConsumers consumers = lookupRepositoryConsumers( );
+        KnownRepositoryContentConsumer selectedKnownConsumer = (KnownRepositoryContentConsumer) knownControl.getMock( );
         KnownRepositoryContentConsumer unselectedKnownConsumer =
             (KnownRepositoryContentConsumer) MockControl.createNiceControl(
-                KnownRepositoryContentConsumer.class ).getMock();
+                KnownRepositoryContentConsumer.class ).getMock( );
 
         consumers.setApplicationContext(
             new MockApplicationContext( Arrays.asList( selectedKnownConsumer, unselectedKnownConsumer ), null ) );
@@ -257,10 +256,10 @@ public class RepositoryContentConsumersTest
 
         MockControl invalidControl = MockControl.createControl( InvalidRepositoryContentConsumer.class );
         InvalidRepositoryContentConsumer selectedInvalidConsumer =
-            (InvalidRepositoryContentConsumer) invalidControl.getMock();
+            (InvalidRepositoryContentConsumer) invalidControl.getMock( );
         InvalidRepositoryContentConsumer unselectedInvalidConsumer =
             (InvalidRepositoryContentConsumer) MockControl.createControl(
-                InvalidRepositoryContentConsumer.class ).getMock();
+                InvalidRepositoryContentConsumer.class ).getMock( );
 
         consumers.setApplicationContext(
             new MockApplicationContext( null, Arrays.asList( selectedInvalidConsumer, unselectedInvalidConsumer ) ) );
@@ -270,74 +269,74 @@ public class RepositoryContentConsumersTest
         ManagedRepository repo = createRepository( "id", "name", new File( "target/test-repo" ) );
         File testFile = new File( "target/test-repo/path/to/test-file.txt" );
 
-        Date startTime = new Date( System.currentTimeMillis() );
+        Date startTime = new Date( System.currentTimeMillis( ) );
         startTime.setTime( 12345678 );
 
         selectedKnownConsumer.beginScan( repo, startTime, false );
-        selectedKnownConsumer.getExcludes();
+        selectedKnownConsumer.getExcludes( );
         knownControl.setReturnValue( Collections.EMPTY_LIST );
-        selectedKnownConsumer.getIncludes();
+        selectedKnownConsumer.getIncludes( );
         knownControl.setReturnValue( Collections.singletonList( "**/*.txt" ) );
         selectedKnownConsumer.processFile( _OS( "path/to/test-file.txt" ), false );
         //        knownConsumer.completeScan();
-        knownControl.replay();
+        knownControl.replay( );
 
         selectedInvalidConsumer.beginScan( repo, startTime, false );
         //        invalidConsumer.completeScan();
-        invalidControl.replay();
+        invalidControl.replay( );
 
         consumers.executeConsumers( repo, testFile, true );
 
-        knownControl.verify();
-        invalidControl.verify();
+        knownControl.verify( );
+        invalidControl.verify( );
 
-        knownControl.reset();
-        invalidControl.reset();
+        knownControl.reset( );
+        invalidControl.reset( );
 
         File notIncludedTestFile = new File( "target/test-repo/path/to/test-file.xml" );
 
         selectedKnownConsumer.beginScan( repo, startTime, false );
-        selectedKnownConsumer.getExcludes();
+        selectedKnownConsumer.getExcludes( );
         knownControl.setReturnValue( Collections.EMPTY_LIST );
-        selectedKnownConsumer.getIncludes();
+        selectedKnownConsumer.getIncludes( );
         knownControl.setReturnValue( Collections.singletonList( "**/*.txt" ) );
         //        knownConsumer.completeScan();
-        knownControl.replay();
+        knownControl.replay( );
 
         selectedInvalidConsumer.beginScan( repo, startTime, false );
         selectedInvalidConsumer.processFile( _OS( "path/to/test-file.xml" ), false );
-        selectedInvalidConsumer.getId();
+        selectedInvalidConsumer.getId( );
         invalidControl.setReturnValue( "invalid" );
         //        invalidConsumer.completeScan();
-        invalidControl.replay();
+        invalidControl.replay( );
 
         consumers.executeConsumers( repo, notIncludedTestFile, true );
 
-        knownControl.verify();
-        invalidControl.verify();
+        knownControl.verify( );
+        invalidControl.verify( );
 
-        knownControl.reset();
-        invalidControl.reset();
+        knownControl.reset( );
+        invalidControl.reset( );
 
         File excludedTestFile = new File( "target/test-repo/path/to/test-file.txt" );
 
         selectedKnownConsumer.beginScan( repo, startTime, false );
-        selectedKnownConsumer.getExcludes();
+        selectedKnownConsumer.getExcludes( );
         knownControl.setReturnValue( Collections.singletonList( "**/test-file.txt" ) );
         //        knownConsumer.completeScan();
-        knownControl.replay();
+        knownControl.replay( );
 
         selectedInvalidConsumer.beginScan( repo, startTime, false );
         selectedInvalidConsumer.processFile( _OS( "path/to/test-file.txt" ), false );
-        selectedInvalidConsumer.getId();
+        selectedInvalidConsumer.getId( );
         invalidControl.setReturnValue( "invalid" );
         //        invalidConsumer.completeScan();
-        invalidControl.replay();
+        invalidControl.replay( );
 
         consumers.executeConsumers( repo, excludedTestFile, true );
 
-        knownControl.verify();
-        invalidControl.verify();
+        knownControl.verify( );
+        invalidControl.verify( );
     }
 
     /**
@@ -355,7 +354,7 @@ public class RepositoryContentConsumersTest
 
     private static Map convertToMap( List objects )
     {
-        HashMap map = new HashMap();
+        HashMap map = new HashMap( );
         for ( Object o : objects )
         {
             map.put( o, o );
@@ -377,28 +376,28 @@ public class RepositoryContentConsumersTest
             this.invalidRepositoryContentConsumers = invalidRepositoryContentConsumers;
         }
 
-        public AutowireCapableBeanFactory getAutowireCapableBeanFactory()
+        public AutowireCapableBeanFactory getAutowireCapableBeanFactory( )
             throws IllegalStateException
         {
             throw new UnsupportedOperationException( "Not supported yet." );
         }
 
-        public String getDisplayName()
+        public String getDisplayName( )
         {
             throw new UnsupportedOperationException( "Not supported yet." );
         }
 
-        public String getId()
+        public String getId( )
         {
             throw new UnsupportedOperationException( "Not supported yet." );
         }
 
-        public ApplicationContext getParent()
+        public ApplicationContext getParent( )
         {
             throw new UnsupportedOperationException( "Not supported yet." );
         }
 
-        public long getStartupDate()
+        public long getStartupDate( )
         {
             throw new UnsupportedOperationException( "Not supported yet." );
         }
@@ -408,12 +407,12 @@ public class RepositoryContentConsumersTest
             throw new UnsupportedOperationException( "Not supported yet." );
         }
 
-        public int getBeanDefinitionCount()
+        public int getBeanDefinitionCount( )
         {
             throw new UnsupportedOperationException( "Not supported yet." );
         }
 
-        public String[] getBeanDefinitionNames()
+        public String[] getBeanDefinitionNames( )
         {
             throw new UnsupportedOperationException( "Not supported yet." );
         }
@@ -505,7 +504,7 @@ public class RepositoryContentConsumersTest
             throw new UnsupportedOperationException( "Not supported yet." );
         }
 
-        public BeanFactory getParentBeanFactory()
+        public BeanFactory getParentBeanFactory( )
         {
             throw new UnsupportedOperationException( "Not supported yet." );
         }
@@ -538,7 +537,7 @@ public class RepositoryContentConsumersTest
             throw new UnsupportedOperationException( "Not supported yet." );
         }
 
-        public ClassLoader getClassLoader()
+        public ClassLoader getClassLoader( )
         {
             throw new UnsupportedOperationException( "Not supported yet." );
         }