resultHit.setVersions( versions );
resultHit.setRepositoryId( null );
- results.addHit( SearchUtil.getHitId( ARCHIVA_TEST_GROUP_ID, "archiva-webapp" ), resultHit );
+ results.addHit( SearchUtil.getHitId( ARCHIVA_TEST_GROUP_ID, "archiva-webapp", null, "war" ), resultHit );
SearchResultLimits limits = new SearchResultLimits( SearchResultLimits.ALL_PAGES );
facet.setPackaging( "war" );
model.addFacet( facet );
- metadataResolverControl.expectAndReturn( metadataResolver.resolveProjectVersion( repositorySession,
- "repo1.mirror",
- ARCHIVA_TEST_GROUP_ID,
- "archiva-webapp", "1.0" ),
- model );
+ metadataResolverControl.expectAndReturn(
+ metadataResolver.resolveProjectVersion( repositorySession, "repo1.mirror", ARCHIVA_TEST_GROUP_ID,
+ "archiva-webapp", "1.0" ), model );
userReposControl.replay();
searchControl.replay();
resultHit.setArtifactId( ARCHIVA_TEST_ARTIFACT_ID );
resultHit.setVersions( versions );
- results.addHit( SearchUtil.getHitId( ARCHIVA_TEST_GROUP_ID, ARCHIVA_TEST_ARTIFACT_ID ), resultHit );
+ results.addHit( SearchUtil.getHitId( ARCHIVA_TEST_GROUP_ID, ARCHIVA_TEST_ARTIFACT_ID, null, "war" ),
+ resultHit );
SearchResultLimits limits = new SearchResultLimits( SearchResultLimits.ALL_PAGES );
searchControl.expectAndDefaultReturn( search.search( "", observableRepoIds, "archiva", limits, null ),
results );
- metadataResolverControl.expectAndReturn( metadataResolver.resolveProjectVersion( repositorySession,
- "repo1.mirror",
- ARCHIVA_TEST_GROUP_ID,
- ARCHIVA_TEST_ARTIFACT_ID,
- "1.0" ), null );
+ metadataResolverControl.expectAndReturn(
+ metadataResolver.resolveProjectVersion( repositorySession, "repo1.mirror", ARCHIVA_TEST_GROUP_ID,
+ ARCHIVA_TEST_ARTIFACT_ID, "1.0" ), null );
ProjectVersionMetadata model = new ProjectVersionMetadata();
model.setId( "1.0" );
- metadataResolverControl.expectAndReturn( metadataResolver.resolveProjectVersion( repositorySession,
- "public.releases",
- ARCHIVA_TEST_GROUP_ID,
- ARCHIVA_TEST_ARTIFACT_ID,
- "1.0" ), model );
+ metadataResolverControl.expectAndReturn(
+ metadataResolver.resolveProjectVersion( repositorySession, "public.releases", ARCHIVA_TEST_GROUP_ID,
+ ARCHIVA_TEST_ARTIFACT_ID, "1.0" ), model );
userReposControl.replay();
searchControl.replay();
resultHit.setVersions( versions );
resultHit.setRepositoryId( null );
- results.addHit( SearchUtil.getHitId( resultHit.getGroupId(), resultHit.getArtifactId() ), resultHit );
+ results.addHit( SearchUtil.getHitId( resultHit.getGroupId(), resultHit.getArtifactId(), null, "war" ),
+ resultHit );
SearchResultLimits limits = new SearchResultLimits( SearchResultLimits.ALL_PAGES );
facet.setPackaging( "jar" );
model.addFacet( facet );
- metadataResolverControl.expectAndReturn( metadataResolver.resolveProjectVersion( repositorySession,
- "repo1.mirror",
- ARCHIVA_TEST_GROUP_ID,
- ARCHIVA_TEST_ARTIFACT_ID,
- "1.0" ), model );
+ metadataResolverControl.expectAndReturn(
+ metadataResolver.resolveProjectVersion( repositorySession, "repo1.mirror", ARCHIVA_TEST_GROUP_ID,
+ ARCHIVA_TEST_ARTIFACT_ID, "1.0" ), model );
userReposControl.replay();
searchControl.replay();
public void testGetArtifactByChecksum()
throws Exception
{
- userReposControl.expectAndReturn( userRepos.getObservableRepositories(), Collections.singletonList(
- TEST_REPO ) );
+ userReposControl.expectAndReturn( userRepos.getObservableRepositories(),
+ Collections.singletonList( TEST_REPO ) );
Date whenGathered = new Date();
observableRepoIds.add( "public.releases" );
userReposControl.expectAndReturn( userRepos.getObservableRepositories(), observableRepoIds );
- metadataResolverControl.expectAndReturn( metadataResolver.resolveProjectVersions( repositorySession,
- "repo1.mirror",
- ARCHIVA_TEST_GROUP_ID,
- ARCHIVA_TEST_ARTIFACT_ID ),
- Arrays.asList( "1.0", "1.1-beta-2", "1.2" ) );
- metadataResolverControl.expectAndReturn( metadataResolver.resolveProjectVersions( repositorySession,
- "public.releases",
- ARCHIVA_TEST_GROUP_ID,
- ARCHIVA_TEST_ARTIFACT_ID ),
- Arrays.asList( "1.1-beta-1", "1.1", "1.2.1-SNAPSHOT" ) );
+ metadataResolverControl.expectAndReturn(
+ metadataResolver.resolveProjectVersions( repositorySession, "repo1.mirror", ARCHIVA_TEST_GROUP_ID,
+ ARCHIVA_TEST_ARTIFACT_ID ),
+ Arrays.asList( "1.0", "1.1-beta-2", "1.2" ) );
+ metadataResolverControl.expectAndReturn(
+ metadataResolver.resolveProjectVersions( repositorySession, "public.releases", ARCHIVA_TEST_GROUP_ID,
+ ARCHIVA_TEST_ARTIFACT_ID ),
+ Arrays.asList( "1.1-beta-1", "1.1", "1.2.1-SNAPSHOT" ) );
userReposControl.replay();
metadataResolverControl.replay();
assertEquals( 6, artifacts.size() );
assertEquals( new Artifact( "repo1.mirror", ARCHIVA_TEST_GROUP_ID, ARCHIVA_TEST_ARTIFACT_ID, "1.0", "pom" ),
artifacts.get( 0 ) );
- assertEquals( new Artifact( "public.releases", ARCHIVA_TEST_GROUP_ID, ARCHIVA_TEST_ARTIFACT_ID, "1.1-beta-1",
- "pom" ), artifacts.get( 3 ) );
- assertEquals( new Artifact( "repo1.mirror", ARCHIVA_TEST_GROUP_ID, ARCHIVA_TEST_ARTIFACT_ID, "1.1-beta-2",
- "pom" ), artifacts.get( 1 ) );
+ assertEquals(
+ new Artifact( "public.releases", ARCHIVA_TEST_GROUP_ID, ARCHIVA_TEST_ARTIFACT_ID, "1.1-beta-1", "pom" ),
+ artifacts.get( 3 ) );
+ assertEquals(
+ new Artifact( "repo1.mirror", ARCHIVA_TEST_GROUP_ID, ARCHIVA_TEST_ARTIFACT_ID, "1.1-beta-2", "pom" ),
+ artifacts.get( 1 ) );
assertEquals( new Artifact( "public.releases", ARCHIVA_TEST_GROUP_ID, ARCHIVA_TEST_ARTIFACT_ID, "1.1", "pom" ),
artifacts.get( 4 ) );
assertEquals( new Artifact( "repo1.mirror", ARCHIVA_TEST_GROUP_ID, ARCHIVA_TEST_ARTIFACT_ID, "1.2", "pom" ),
artifacts.get( 2 ) );
- assertEquals( new Artifact( "public.releases", ARCHIVA_TEST_GROUP_ID, ARCHIVA_TEST_ARTIFACT_ID,
- "1.2.1-SNAPSHOT", "pom" ), artifacts.get( 5 ) );
+ assertEquals(
+ new Artifact( "public.releases", ARCHIVA_TEST_GROUP_ID, ARCHIVA_TEST_ARTIFACT_ID, "1.2.1-SNAPSHOT", "pom" ),
+ artifacts.get( 5 ) );
}
@Test
model.addDependency( dependency );
userReposControl.expectAndReturn( userRepos.getObservableRepositories(), Collections.singletonList( repoId ) );
- metadataResolverControl.expectAndReturn( metadataResolver.resolveProjectVersion( repositorySession, repoId,
- ARCHIVA_TEST_GROUP_ID,
- ARCHIVA_TEST_ARTIFACT_ID,
- "1.0" ), model );
+ metadataResolverControl.expectAndReturn(
+ metadataResolver.resolveProjectVersion( repositorySession, repoId, ARCHIVA_TEST_GROUP_ID,
+ ARCHIVA_TEST_ARTIFACT_ID, "1.0" ), model );
metadataResolverControl.replay();
userReposControl.replay();
- List<Dependency> dependencies = searchService.getDependencies( ARCHIVA_TEST_GROUP_ID, ARCHIVA_TEST_ARTIFACT_ID,
- "1.0" );
+ List<Dependency> dependencies =
+ searchService.getDependencies( ARCHIVA_TEST_GROUP_ID, ARCHIVA_TEST_ARTIFACT_ID, "1.0" );
metadataResolverControl.verify();
userReposControl.verify();
String repoId = "repo1.mirror";
userReposControl.expectAndReturn( userRepos.getObservableRepositories(), Collections.singletonList( repoId ) );
- metadataResolverControl.expectAndReturn( metadataResolver.resolveProjectVersion( repositorySession, repoId,
- ARCHIVA_TEST_GROUP_ID,
- ARCHIVA_TEST_ARTIFACT_ID,
- "1.0" ), null );
+ metadataResolverControl.expectAndReturn(
+ metadataResolver.resolveProjectVersion( repositorySession, repoId, ARCHIVA_TEST_GROUP_ID,
+ ARCHIVA_TEST_ARTIFACT_ID, "1.0" ), null );
userReposControl.replay();
metadataResolverControl.replay();
dependeeModels.add( dependeeModel );
userReposControl.expectAndReturn( userRepos.getObservableRepositories(), observableRepoIds );
- metadataResolverControl.expectAndReturn( metadataResolver.resolveProjectReferences( repositorySession, repoId,
- ARCHIVA_TEST_GROUP_ID,
- ARCHIVA_TEST_ARTIFACT_ID,
- "1.0" ), dependeeModels );
+ metadataResolverControl.expectAndReturn(
+ metadataResolver.resolveProjectReferences( repositorySession, repoId, ARCHIVA_TEST_GROUP_ID,
+ ARCHIVA_TEST_ARTIFACT_ID, "1.0" ), dependeeModels );
metadataResolverControl.replay();
userReposControl.replay();
assertNotNull( dependees );
assertEquals( 2, dependees.size() );
- assertEquals( new Artifact( repoId, ARCHIVA_TEST_GROUP_ID, "archiva-dependee-one", "1.0", "" ), dependees.get(
- 0 ) );
- assertEquals( new Artifact( repoId, ARCHIVA_TEST_GROUP_ID, "archiva-dependee-two", "1.0", "" ), dependees.get(
- 1 ) );
+ assertEquals( new Artifact( repoId, ARCHIVA_TEST_GROUP_ID, "archiva-dependee-one", "1.0", "" ),
+ dependees.get( 0 ) );
+ assertEquals( new Artifact( repoId, ARCHIVA_TEST_GROUP_ID, "archiva-dependee-two", "1.0", "" ),
+ dependees.get( 1 ) );
}
@Test
// no longer differentiating between a project not being present and a project that is present but with
// no references. If it is later determined to be needed, we will need to modify the metadata content repository
userReposControl.expectAndReturn( userRepos.getObservableRepositories(), observableRepoIds );
- metadataResolverControl.expectAndReturn( metadataResolver.resolveProjectReferences( repositorySession,
- "repo1.mirror",
- ARCHIVA_TEST_GROUP_ID,
- ARCHIVA_TEST_ARTIFACT_ID,
- "1.0" ),
- Collections.<ProjectVersionReference>emptyList() );
- metadataResolverControl.expectAndReturn( metadataResolver.resolveProjectReferences( repositorySession,
- "public.releases",
- ARCHIVA_TEST_GROUP_ID,
- ARCHIVA_TEST_ARTIFACT_ID,
- "1.0" ),
- Collections.<ProjectVersionReference>emptyList() );
+ metadataResolverControl.expectAndReturn(
+ metadataResolver.resolveProjectReferences( repositorySession, "repo1.mirror", ARCHIVA_TEST_GROUP_ID,
+ ARCHIVA_TEST_ARTIFACT_ID, "1.0" ),
+ Collections.<ProjectVersionReference>emptyList() );
+ metadataResolverControl.expectAndReturn(
+ metadataResolver.resolveProjectReferences( repositorySession, "public.releases", ARCHIVA_TEST_GROUP_ID,
+ ARCHIVA_TEST_ARTIFACT_ID, "1.0" ),
+ Collections.<ProjectVersionReference>emptyList() );
userReposControl.replay();
metadataResolverControl.replay();