]> source.dussan.org Git - archiva.git/commitdiff
fix compilation
authorOlivier Lamy <olamy@apache.org>
Wed, 14 Sep 2011 23:03:52 +0000 (23:03 +0000)
committerOlivier Lamy <olamy@apache.org>
Wed, 14 Sep 2011 23:03:52 +0000 (23:03 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1170889 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/NexusRepositorySearchTest.java
archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/java/org/apache/archiva/web/xmlrpc/services/SearchServiceImplTest.java

index fb6f4ae0d6c779bfd3f1e644e5ae845014cbc07a..236de651f06947dd78cb2111779051b42798a431 100644 (file)
@@ -290,7 +290,7 @@ public class NexusRepositorySearchTest
 
         archivaConfigControl.replay();
 
-        // wait lucene flush.....
+        // wait lucene flush.....SearchServiceImplTest
         Thread.sleep( 2000 );
 
         SearchResults results = search.search( "user", selectedRepos, "archiva-search", null, null );
index 123ce8309bbd0e229f39847edee1dba10ae3ca94..2cd8f66a6451abbc43efb7832b46a1805df56514 100644 (file)
@@ -142,7 +142,7 @@ public class SearchServiceImplTest
         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 );
 
@@ -155,11 +155,9 @@ public class SearchServiceImplTest
         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();
@@ -205,26 +203,23 @@ public class SearchServiceImplTest
         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();
@@ -269,7 +264,8 @@ public class SearchServiceImplTest
         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 );
 
@@ -282,11 +278,9 @@ public class SearchServiceImplTest
         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();
@@ -343,8 +337,8 @@ public class SearchServiceImplTest
     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();
 
@@ -379,16 +373,14 @@ public class SearchServiceImplTest
         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();
@@ -402,16 +394,19 @@ public class SearchServiceImplTest
         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
@@ -453,16 +448,15 @@ public class SearchServiceImplTest
         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();
@@ -481,10 +475,9 @@ public class SearchServiceImplTest
         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();
@@ -539,10 +532,9 @@ public class SearchServiceImplTest
         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();
@@ -554,10 +546,10 @@ public class SearchServiceImplTest
 
         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
@@ -571,18 +563,14 @@ public class SearchServiceImplTest
         // 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();