diff options
author | Carlos Sanchez <csanchez@maestrodev.com> | 2014-11-06 09:58:02 +0100 |
---|---|---|
committer | Carlos Sanchez <csanchez@maestrodev.com> | 2014-11-06 13:39:28 +0100 |
commit | 63479200cef1e242cdbdf19eb9474133959aac32 (patch) | |
tree | 5ecfb21a00562d8ad0a6086bb695dcd5e8c0ace1 /archiva-modules/archiva-web/archiva-rss | |
parent | ae9b10930639f230ebbc017d0a78d7e95b5a42ae (diff) | |
download | archiva-63479200cef1e242cdbdf19eb9474133959aac32.tar.gz archiva-63479200cef1e242cdbdf19eb9474133959aac32.zip |
Add a AbstractMetadataRepository to remove duplicated code
Diffstat (limited to 'archiva-modules/archiva-web/archiva-rss')
-rw-r--r-- | archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessorTest.java | 237 |
1 files changed, 13 insertions, 224 deletions
diff --git a/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessorTest.java b/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessorTest.java index dee82c93e..4c34c66e6 100644 --- a/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessorTest.java +++ b/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessorTest.java @@ -19,31 +19,26 @@ package org.apache.archiva.rss.processor; * under the License. */ -import com.sun.syndication.feed.synd.SyndEntry; -import com.sun.syndication.feed.synd.SyndFeed; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.TimeZone; + import junit.framework.TestCase; + import org.apache.archiva.metadata.model.ArtifactMetadata; -import org.apache.archiva.metadata.model.MetadataFacet; -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.metadata.repository.AbstractMetadataRepository; import org.apache.archiva.rss.RssFeedGenerator; import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Collection; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.TimeZone; +import com.sun.syndication.feed.synd.SyndEntry; +import com.sun.syndication.feed.synd.SyndFeed; @RunWith (ArchivaBlockJUnit4ClassRunner.class) public class NewArtifactsRssFeedProcessorTest @@ -127,7 +122,7 @@ public class NewArtifactsRssFeedProcessorTest // TODO: replace with mockito private class MetadataRepositoryMock - implements MetadataRepository + extends AbstractMetadataRepository { private Date from, to; @@ -144,191 +139,6 @@ public class NewArtifactsRssFeedProcessorTest return artifactsByDateRange; } - @Override - public void removeArtifact( String repositoryId, String namespace, String project, String version, - MetadataFacet metadataFacet ) - throws MetadataRepositoryException - { - throw new UnsupportedOperationException(); - } - - @Override - public void addMetadataFacet( String arg0, MetadataFacet arg1 ) - { - throw new UnsupportedOperationException(); - } - - @Override - public void removeArtifact( String arg0, String arg1, String arg2, String arg3, String arg4 ) - { - throw new UnsupportedOperationException(); - } - - @Override - public void removeRepository( String arg0 ) - { - throw new UnsupportedOperationException(); - } - - @Override - public List<ArtifactMetadata> getArtifactsByChecksum( String arg0, String arg1 ) - { - throw new UnsupportedOperationException(); - } - - @Override - public MetadataFacet getMetadataFacet( String arg0, String arg1, String arg2 ) - { - throw new UnsupportedOperationException(); - } - - @Override - public List<String> getMetadataFacets( String arg0, String arg1 ) - { - throw new UnsupportedOperationException(); - } - - @Override - public Collection<String> getRepositories() - { - throw new UnsupportedOperationException(); - } - - @Override - public void removeMetadataFacet( String arg0, String arg1, String arg2 ) - { - throw new UnsupportedOperationException(); - } - - @Override - public void removeMetadataFacets( String arg0, String arg1 ) - { - throw new UnsupportedOperationException(); - } - - @Override - public void updateArtifact( String arg0, String arg1, String arg2, String arg3, ArtifactMetadata arg4 ) - { - throw new UnsupportedOperationException(); - } - - @Override - public void updateNamespace( String arg0, String arg1 ) - { - throw new UnsupportedOperationException(); - } - - @Override - public void updateProject( String arg0, ProjectMetadata arg1 ) - { - throw new UnsupportedOperationException(); - } - - @Override - public void updateProjectVersion( String arg0, String arg1, String arg2, ProjectVersionMetadata arg3 ) - { - throw new UnsupportedOperationException(); - } - - @Override - public Collection<String> getArtifactVersions( String arg0, String arg1, String arg2, String arg3 ) - { - throw new UnsupportedOperationException(); - } - - @Override - public Collection<ArtifactMetadata> getArtifacts( String arg0, String arg1, String arg2, String arg3 ) - { - throw new UnsupportedOperationException(); - } - - @Override - public void save() - { - throw new UnsupportedOperationException(); - } - - @Override - public void close() - { - throw new UnsupportedOperationException(); - } - - @Override - public boolean hasMetadataFacet( String repositoryId, String facetId ) - throws MetadataRepositoryException - { - return false; - } - - @Override - public void revert() - { - throw new UnsupportedOperationException(); - } - - @Override - public boolean canObtainAccess( Class<?> aClass ) - { - return false; - } - - @Override - public <T>T obtainAccess( Class<T> aClass ) - { - throw new UnsupportedOperationException(); - } - - @Override - public Collection<String> getNamespaces( String arg0, String arg1 ) - { - throw new UnsupportedOperationException(); - } - - @Override - public ProjectMetadata getProject( String arg0, String arg1, String arg2 ) - { - throw new UnsupportedOperationException(); - } - - @Override - public Collection<ProjectVersionReference> getProjectReferences( String arg0, String arg1, String arg2, - String arg3 ) - { - throw new UnsupportedOperationException(); - } - - @Override - public ProjectVersionMetadata getProjectVersion( String arg0, String arg1, String arg2, String arg3 ) - throws MetadataResolutionException - { - throw new UnsupportedOperationException(); - } - - @Override - public Collection<String> getProjectVersions( String arg0, String arg1, String arg2 ) - { - throw new UnsupportedOperationException(); - } - - @Override - public Collection<String> getProjects( String arg0, String arg1 ) - { - throw new UnsupportedOperationException(); - } - - @Override - public Collection<String> getRootNamespaces( String arg0 ) - { - throw new UnsupportedOperationException(); - } - - @Override - public void removeProject( String repositoryId, String namespace, String projectId ) - throws MetadataRepositoryException - { - throw new UnsupportedOperationException(); - } public void setFrom( Date from ) { @@ -370,26 +180,5 @@ public class NewArtifactsRssFeedProcessorTest { return artifactsByDateRange; } - - @Override - public void removeArtifact( ArtifactMetadata artifactMetadata, String baseVersion ) - throws MetadataRepositoryException - { - - } - - @Override - public void removeNamespace( String repositoryId, String namespace ) - throws MetadataRepositoryException - { - - } - - @Override - public void removeProjectVersion( String repoId, String namespace, String projectId, String projectVersion ) - throws MetadataRepositoryException - { - - } } } |