mcconnell 2003/11/17 23:40:49
Modified: repository/test/src/test/org/apache/avalon/repository
InitialRepositoryFactoryTest.java
Log:
Cleaning up of the inital repository factory testcase.
Revision Changes Path
1.2 +31 -20
avalon-sandbox/repository/test/src/test/org/apache/avalon/repository/InitialRepositoryFactoryTest.java
Index: InitialRepositoryFactoryTest.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/repository/test/src/test/org/apache/avalon/repository/InitialRepositoryFactoryTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- InitialRepositoryFactoryTest.java 17 Nov 2003 08:20:35 -0000 1.1
+++ InitialRepositoryFactoryTest.java 18 Nov 2003 07:40:49 -0000 1.2
@@ -97,35 +97,46 @@
public void testGetDefaultContext() throws Exception
{
- RepositoryFactory l_factory = new InitialRepositoryFactory() ;
- assertNotNull( l_factory ) ;
- RepositoryContext l_context = l_factory.getDefaultContext() ;
- assertNotNull( l_context ) ;
+ String[] urls = getBootstrapRepositorySet();
+ RepositoryFactory factory = new InitialRepositoryFactory( urls ) ;
+ assertNotNull( factory ) ;
+ RepositoryContext context = factory.getDefaultContext() ;
+ assertNotNull( context ) ;
}
public void testRepositoryBootstrap() throws Exception
{
- String [] l_urls = getRepositorySet();
- RepositoryFactory l_factory = new InitialRepositoryFactory( l_urls ) ;
- assertNotNull( l_factory ) ;
- RepositoryContext l_config = l_factory.getDefaultContext() ;
- assertNotNull( l_config ) ;
+ String[] bootstrap = getBootstrapRepositorySet();
+ RepositoryFactory factory = new InitialRepositoryFactory( bootstrap );
+ assertNotNull( factory );
+ RepositoryContext context = factory.getDefaultContext();
+ assertNotNull( context );
- l_config.setCacheDir( System.getProperty( "user.home" )
- + File.separator + ".merlin" ) ;
+ context.setCacheDir(
+ System.getProperty( "user.home" )
+ + File.separator + ".merlin" ) ;
- l_config.setRemoteRepositoryUrls( l_urls ) ;
- Repository l_repo = l_factory.create( l_config ) ;
- assertNotNull( l_repo ) ;
+ String[] repositories = getWorkingRepositorySet();
+ context.setRemoteRepositoryUrls( repositories ) ;
+ Repository repository = factory.create( context ) ;
+ assertNotNull( repository ) ;
- l_repo.getArtifact("avalon-framework", "avalon-framework-api", "4.1.5",
- "jar" ) ;
+ repository.getArtifact(
+ "avalon-framework", "avalon-framework-api", "4.1.5", "jar" ) ;
}
- private static String[] getRepositorySet()
+ private static String[] getBootstrapRepositorySet()
{
return new String[]{
"file:///" + System.getProperty( "basedir" ) + "/target/repository",
};
}
+
+ private static String[] getWorkingRepositorySet()
+ {
+ return new String[]{
+ "http://dpml.net/","http://www.ibiblio.org/maven"
+ };
+ }
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]