Permalink
Browse files

remoteIndexUrl configurable as a property

git-svn-id: https://svn.apache.org/repos/asf/maven/sandbox/trunk@1297037 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
olamy committed Mar 5, 2012
1 parent f9b087e commit de3efb06f46b9d18c0d8d9aea5d108916db804b2
@@ -18,6 +18,7 @@
<properties>
<userAgent></userAgent>
+ <remoteIndexUrl>http://repo.maven.apache.org/maven2/.index</remoteIndexUrl>
</properties>
<dependencies>
@@ -48,6 +49,7 @@
<configuration>
<systemPropertyVariables>
<userAgent>${userAgent}</userAgent>
+ <remoteIndexUrl>${remoteIndexUrl}</remoteIndexUrl>
</systemPropertyVariables>
</configuration>
</plugin>
@@ -83,7 +83,11 @@ public void setUp()
httpWagon.setTimeout( 10000 );
- httpWagon.connect( new Repository( "central", "http://repo.maven.apache.org/maven2/.index" ) );
+ String remoteIndexUrl = System.getProperty( "remoteIndexUrl" );
+
+ System.out.println( "remoteIndexUrl:" + remoteIndexUrl );
+
+ httpWagon.connect( new Repository( "central", remoteIndexUrl ) );
ResourceFetcher resourceFetcher = new ResourceFetcher()
{
@@ -204,15 +208,14 @@ public void testSearchWithClassName()
NexusIndexer indexer = lookup( NexusIndexer.class );
BooleanQuery q = new BooleanQuery();
- q.add( indexer.constructQuery( MAVEN.CLASSNAMES, new StringSearchExpression(
- "NexusIndexer" ) ), BooleanClause.Occur.MUST );
+ q.add( indexer.constructQuery( MAVEN.CLASSNAMES, new StringSearchExpression( "NexusIndexer" ) ),
+ BooleanClause.Occur.MUST );
FlatSearchRequest searchRequest = new FlatSearchRequest( q );
searchRequest.setContexts( Arrays.asList( context ) );
FlatSearchResponse response = indexer.searchFlat( searchRequest );
System.out.println(
- "search with className NexusIndexer response getReturnedHitsCount : "
- + response.getReturnedHitsCount() );
+ "search with className NexusIndexer response getReturnedHitsCount : " + response.getReturnedHitsCount() );
assertTrue( response.getReturnedHitsCount() > 0 );
}
}

0 comments on commit de3efb0

Please sign in to comment.