]> source.dussan.org Git - archiva.git/commitdiff
fix test mock compilation
authorOlivier Lamy <olamy@apache.org>
Tue, 5 Jun 2012 21:43:29 +0000 (21:43 +0000)
committerOlivier Lamy <olamy@apache.org>
Tue, 5 Jun 2012 21:43:29 +0000 (21:43 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1346610 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java
archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/mock/MockRepositorySessionFactory.java
archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/mock/MockRepositorySessionFactory.java
archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/mock/MockRepositorySessionFactory.java
archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessorTest.java
archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/webtest/memory/TestMetadataRepository.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java
archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java
archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java

index c78389e8966a11bcc5fe960b843fdc489178fe6a..9c2d2206145b9e76c1641182e8b9684c5db65e9e 100644 (file)
@@ -182,4 +182,11 @@ public class TestMetadataRepository
     {
         return null;
     }
+
+    public void removeArtifact( String repositoryId, String namespace, String project, String version,
+                                MetadataFacet metadataFacet )
+        throws MetadataRepositoryException
+    {
+        throw new UnsupportedOperationException();
+    }
 }
index 5a6c40042e1a6ba7eead2f58d1e7ea41f10edf56..bd000d82273a00f2cc7c919f1d00d081ff95b5ff 100644 (file)
@@ -42,30 +42,30 @@ import java.util.List;
 public class MockRepositorySessionFactory
     implements RepositorySessionFactory
 {
-    public RepositorySession createSession( )
+    public RepositorySession createSession()
     {
         return new RepositorySession( null, null )
         {
             @Override
-            public void close( )
+            public void close()
             {
                 return;
             }
 
             @Override
-            public void save( )
+            public void save()
             {
                 // no op
             }
 
             @Override
-            public MetadataRepository getRepository( )
+            public MetadataRepository getRepository()
             {
-                return new MetadataRepository( )
+                return new MetadataRepository()
                 {
 
                     public void removeArtifact( String repositoryId, String namespace, String project,
-                                                String projectVersion, String projectId, MetadataFacet metadataFacet )
+                                                String projectVersion, MetadataFacet metadataFacet )
                         throws MetadataRepositoryException
                     {
 
@@ -100,7 +100,7 @@ public class MockRepositorySessionFactory
                     public List<String> getMetadataFacets( String repositoryId, String facetId )
                         throws MetadataRepositoryException
                     {
-                        return Collections.emptyList( );
+                        return Collections.emptyList();
                     }
 
                     public MetadataFacet getMetadataFacet( String repositoryId, String facetId, String name )
@@ -134,7 +134,7 @@ public class MockRepositorySessionFactory
                         return null;  //To change body of implemented methods use File | Settings | File Templates.
                     }
 
-                    public Collection<String> getRepositories( )
+                    public Collection<String> getRepositories()
                         throws MetadataRepositoryException
                     {
                         return null;  //To change body of implemented methods use File | Settings | File Templates.
@@ -224,17 +224,17 @@ public class MockRepositorySessionFactory
                         return null;  //To change body of implemented methods use File | Settings | File Templates.
                     }
 
-                    public void save( )
+                    public void save()
                     {
                         //To change body of implemented methods use File | Settings | File Templates.
                     }
 
-                    public void close( )
+                    public void close()
                     {
                         //To change body of implemented methods use File | Settings | File Templates.
                     }
 
-                    public void revert( )
+                    public void revert()
                     {
                         //To change body of implemented methods use File | Settings | File Templates.
                     }
index 1c1e97e90d53d8c6f0ebe8fd592121a6a5e4373c..7754911db72f1f1a74b807b6721ea62afa56f072 100644 (file)
@@ -187,4 +187,11 @@ public class TestMetadataRepository
     {
         return Collections.emptyList();
     }
+
+    public void removeArtifact( String repositoryId, String namespace, String project, String version,
+                                MetadataFacet metadataFacet )
+        throws MetadataRepositoryException
+    {
+        throw new UnsupportedOperationException();
+    }
 }
index 649343209d60e81a45619717285c80b8b941d9c5..e411fc1c3691385d4be6ca0a48ca618ed018b244 100644 (file)
@@ -42,33 +42,33 @@ import java.util.List;
 public class MockRepositorySessionFactory
     implements RepositorySessionFactory
 {
-    public RepositorySession createSession( )
+    public RepositorySession createSession()
     {
         return new RepositorySession( null, null )
         {
             @Override
-            public void close( )
+            public void close()
             {
                 return;
             }
 
             @Override
-            public void save( )
+            public void save()
             {
                 // no op
             }
 
             @Override
-            public MetadataRepository getRepository( )
+            public MetadataRepository getRepository()
             {
-                return new MetadataRepository( )
+                return new MetadataRepository()
                 {
 
                     public void removeArtifact( String repositoryId, String namespace, String project,
-                                                String projectVersion, String projectId, MetadataFacet metadataFacet )
+                                                String projectVersion, MetadataFacet metadataFacet )
                         throws MetadataRepositoryException
                     {
-                        //To change body of implemented methods use File | Settings | File Templates.
+                        throw new UnsupportedOperationException();
                     }
 
                     public void updateProject( String repositoryId, ProjectMetadata project )
@@ -100,7 +100,7 @@ public class MockRepositorySessionFactory
                     public List<String> getMetadataFacets( String repositoryId, String facetId )
                         throws MetadataRepositoryException
                     {
-                        return Collections.emptyList( );
+                        return Collections.emptyList();
                     }
 
                     public MetadataFacet getMetadataFacet( String repositoryId, String facetId, String name )
@@ -134,7 +134,7 @@ public class MockRepositorySessionFactory
                         return null;  //To change body of implemented methods use File | Settings | File Templates.
                     }
 
-                    public Collection<String> getRepositories( )
+                    public Collection<String> getRepositories()
                         throws MetadataRepositoryException
                     {
                         return null;  //To change body of implemented methods use File | Settings | File Templates.
@@ -224,17 +224,17 @@ public class MockRepositorySessionFactory
                         return null;  //To change body of implemented methods use File | Settings | File Templates.
                     }
 
-                    public void save( )
+                    public void save()
                     {
                         //To change body of implemented methods use File | Settings | File Templates.
                     }
 
-                    public void close( )
+                    public void close()
                     {
                         //To change body of implemented methods use File | Settings | File Templates.
                     }
 
-                    public void revert( )
+                    public void revert()
                     {
                         //To change body of implemented methods use File | Settings | File Templates.
                     }
index 37290708abaf1ad8a01138f353290c913ae6191c..de7a9de659cbf6ebfc9e29133e2aef79652f8000 100644 (file)
@@ -65,10 +65,10 @@ public class MockRepositorySessionFactory
                 {
 
                     public void removeArtifact( String repositoryId, String namespace, String project,
-                                                String projectVersion, String projectId, MetadataFacet metadataFacet )
+                                                String projectVersion, MetadataFacet metadataFacet )
                         throws MetadataRepositoryException
                     {
-
+                        throw new UnsupportedOperationException();
                     }
 
                     public void updateProject( String repositoryId, ProjectMetadata project )
index 1636f27c79e5d985088c054a9d6a11e94ed4470e..4fabb5998fc72e9797309de85bf8612c70b0a85f 100644 (file)
@@ -28,6 +28,7 @@ import org.apache.archiva.metadata.model.ProjectMetadata;
 import org.apache.archiva.metadata.model.ProjectVersionMetadata;
 import org.apache.archiva.metadata.model.ProjectVersionReference;
 import org.apache.archiva.metadata.repository.MetadataRepository;
+import org.apache.archiva.metadata.repository.MetadataRepositoryException;
 import org.apache.archiva.metadata.repository.MetadataResolutionException;
 import org.apache.archiva.rss.RssFeedGenerator;
 import org.junit.Before;
@@ -141,6 +142,13 @@ public class NewArtifactsRssFeedProcessorTest
             return artifactsByDateRange;
         }
 
+        public void removeArtifact( String repositoryId, String namespace, String project, String version,
+                                    MetadataFacet metadataFacet )
+            throws MetadataRepositoryException
+        {
+            throw new UnsupportedOperationException();
+        }
+
         public void addMetadataFacet( String arg0, MetadataFacet arg1 )
         {
             throw new UnsupportedOperationException();
index 482637f9198730b398f9be5625e17f81975859a2..91d7955d3bec711a5d709374a7c74b7728cbeafe 100644 (file)
@@ -25,6 +25,7 @@ import org.apache.archiva.metadata.model.ProjectMetadata;
 import org.apache.archiva.metadata.model.ProjectVersionMetadata;
 import org.apache.archiva.metadata.model.ProjectVersionReference;
 import org.apache.archiva.metadata.repository.MetadataRepository;
+import org.apache.archiva.metadata.repository.MetadataRepositoryException;
 
 import java.util.ArrayList;
 import java.util.Collection;
@@ -175,17 +176,24 @@ public class TestMetadataRepository
 
     public List<ArtifactMetadata> getArtifactsByChecksum( String repoId, String checksum )
     {
-        return null;  //To change body of implemented methods use File | Settings | File Templates.
+        return null;
     }
 
     public void removeArtifact( String repositoryId, String namespace, String project, String version, String id )
     {
-        //To change body of implemented methods use File | Settings | File Templates.
+        throw new UnsupportedOperationException();
+    }
+
+    public void removeArtifact( String repositoryId, String namespace, String project, String version,
+                                MetadataFacet metadataFacet )
+        throws MetadataRepositoryException
+    {
+        throw new UnsupportedOperationException();
     }
 
     public void removeRepository( String repoId )
     {
-        //To change body of implemented methods use File | Settings | File Templates.
+        throw new UnsupportedOperationException();
     }
 
     public Collection<ArtifactMetadata> getArtifacts( String repoId, String namespace, String projectId,
@@ -209,12 +217,12 @@ public class TestMetadataRepository
 
     public boolean canObtainAccess( Class<?> aClass )
     {
-        return false;  //To change body of implemented methods use File | Settings | File Templates.
+        return false;
     }
 
     public Object obtainAccess( Class<?> aClass )
     {
-        return null;  //To change body of implemented methods use File | Settings | File Templates.
+        return null;
     }
 
     public List<ArtifactMetadata> getArtifacts( String repositoryId )
index 571b2015d0f88cbc087065fcf529ec83416782ae..1b6b8c65b50d8a4a0a7836e7f853b2344d976966 100644 (file)
@@ -183,4 +183,11 @@ public class TestMetadataRepository
     {
         return null;
     }
+
+    public void removeArtifact( String repositoryId, String namespace, String project, String version,
+                                MetadataFacet metadataFacet )
+        throws MetadataRepositoryException
+    {
+        throw new UnsupportedOperationException();
+    }
 }
index 24a0a5d44e7dbf58340d63a7c85939972e4897d2..93217bcd88d49e21793c3df3d719c9fa21627fd6 100644 (file)
@@ -199,11 +199,10 @@ public class TestMetadataRepository
         return null;  //To change body of implemented methods use File | Settings | File Templates.
     }
 
-
-    public void removeArtifact( String repositoryId, String namespace, String project, String projectVersion,
-                                String projectId, MetadataFacet metadataFacet )
+    public void removeArtifact( String repositoryId, String namespace, String project, String version,
+                                MetadataFacet metadataFacet )
         throws MetadataRepositoryException
     {
-        //To change body of implemented methods use File | Settings | File Templates.
+        throw new UnsupportedOperationException();
     }
 }
\ No newline at end of file
index e3de5fd400124d3e6d9379e9053d615b14cd5eef..fbf246ffded3fd27373acb52655330bb28aebb53 100644 (file)
@@ -38,7 +38,6 @@ import org.apache.archiva.metadata.repository.MetadataRepository;
 import org.apache.archiva.metadata.repository.MetadataRepositoryException;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.NotImplementedException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -648,10 +647,10 @@ public class FileMetadataRepository
      * @throws MetadataRepositoryException
      */
     public void removeArtifact( String repositoryId, String namespace, String project, String projectVersion,
-                                String projectId, MetadataFacet metadataFacet )
+                                 MetadataFacet metadataFacet )
         throws MetadataRepositoryException
     {
-        throw new NotImplementedException( "not implemented" );
+        throw new UnsupportedOperationException("not implemented");
     }
 
     public void removeRepository( String repoId )