diff options
author | Martin Stockhammer <martin_s@apache.org> | 2019-08-04 22:40:04 +0200 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2019-08-04 22:40:04 +0200 |
commit | eca0097d857aa4739a6387c67d22a9a355a46fa1 (patch) | |
tree | 48752d7b63424b3e8b2bf47d11a692bfa69a6ff5 /archiva-modules/archiva-web/archiva-rss | |
parent | ee2c1a7b2b623cf76c8a5deff5e8ddb836de2eaa (diff) | |
download | archiva-eca0097d857aa4739a6387c67d22a9a355a46fa1.tar.gz archiva-eca0097d857aa4739a6387c67d22a9a355a46fa1.zip |
Changing session handling for metadata API
Diffstat (limited to 'archiva-modules/archiva-web/archiva-rss')
4 files changed, 10 insertions, 9 deletions
diff --git a/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessor.java b/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessor.java index 019c9e16a..789d0845d 100644 --- a/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessor.java +++ b/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessor.java @@ -93,7 +93,7 @@ public class NewArtifactsRssFeedProcessor List<ArtifactMetadata> artifacts; try { - artifacts = metadataRepository.getArtifactsByDateRange( repoId, greaterThanThisDate.getTime(), null ); + artifacts = metadataRepository.getArtifactsByDateRange( , repoId, greaterThanThisDate.getTime(), null ); } catch ( MetadataRepositoryException e ) { diff --git a/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessor.java b/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessor.java index f9c24bd5c..68ddc45e1 100644 --- a/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessor.java +++ b/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessor.java @@ -84,10 +84,10 @@ public class NewVersionsOfArtifactRssFeedProcessor { for ( String repoId : metadataRepository.getRepositories() ) { - Collection<String> versions = metadataRepository.getProjectVersions( repoId, groupId, artifactId ); + Collection<String> versions = metadataRepository.getProjectVersions( , repoId, groupId, artifactId ); for ( String version : versions ) { - artifacts.addAll( metadataRepository.getArtifacts( repoId, groupId, artifactId, version ) ); + artifacts.addAll( metadataRepository.getArtifacts( , repoId, groupId, artifactId, version ) ); } } } 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 328ef91ea..0706d6491 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 @@ -24,6 +24,7 @@ import com.sun.syndication.feed.synd.SyndFeed; import junit.framework.TestCase; import org.apache.archiva.metadata.model.ArtifactMetadata; import org.apache.archiva.metadata.repository.AbstractMetadataRepository; +import org.apache.archiva.metadata.repository.RepositorySession; import org.apache.archiva.rss.RssFeedGenerator; import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner; import org.junit.Before; @@ -129,7 +130,7 @@ public class NewArtifactsRssFeedProcessorTest private List<ArtifactMetadata> artifactsByDateRange; @Override - public List<ArtifactMetadata> getArtifactsByDateRange( String repoId, Date from, Date to ) + public List<ArtifactMetadata> getArtifactsByDateRange( RepositorySession session, String repoId, Date from, Date to ) { setRepoId( repoId ); setFrom( from ); @@ -174,7 +175,7 @@ public class NewArtifactsRssFeedProcessorTest } @Override - public List<ArtifactMetadata> getArtifacts( String repositoryId ) + public List<ArtifactMetadata> getArtifacts( RepositorySession session, String repositoryId ) { return artifactsByDateRange; } diff --git a/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessorTest.java b/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessorTest.java index 2b71c0f5c..2a60ae2bc 100644 --- a/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessorTest.java +++ b/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessorTest.java @@ -90,13 +90,13 @@ public class NewVersionsOfArtifactRssFeedProcessorTest reqParams.put( RssFeedProcessor.KEY_ARTIFACT_ID, ARTIFACT_ID ); expect( metadataRepository.getRepositories() ).andReturn( Collections.singletonList( TEST_REPO ) ); - expect( metadataRepository.getProjectVersions( TEST_REPO, GROUP_ID, ARTIFACT_ID ) ).andReturn( + expect( metadataRepository.getProjectVersions( , TEST_REPO, GROUP_ID, ARTIFACT_ID ) ).andReturn( Arrays.asList( "1.0.1", "1.0.2", "1.0.3-SNAPSHOT" ) ); - expect( metadataRepository.getArtifacts( TEST_REPO, GROUP_ID, ARTIFACT_ID, "1.0.1" ) ).andReturn( + expect( metadataRepository.getArtifacts( , TEST_REPO, GROUP_ID, ARTIFACT_ID, "1.0.1" ) ).andReturn( Collections.singletonList( artifact1 ) ); - expect( metadataRepository.getArtifacts( TEST_REPO, GROUP_ID, ARTIFACT_ID, "1.0.2" ) ).andReturn( + expect( metadataRepository.getArtifacts( , TEST_REPO, GROUP_ID, ARTIFACT_ID, "1.0.2" ) ).andReturn( Collections.singletonList( artifact2 ) ); - expect( metadataRepository.getArtifacts( TEST_REPO, GROUP_ID, ARTIFACT_ID, "1.0.3-SNAPSHOT" ) ).andReturn( + expect( metadataRepository.getArtifacts( , TEST_REPO, GROUP_ID, ARTIFACT_ID, "1.0.3-SNAPSHOT" ) ).andReturn( Collections.singletonList( artifact3 ) ); metadataRepositoryControl.replay(); |