Author: mcconnell Date: Thu Jun 10 08:04:45 2004 New Revision: 21014 Removed: avalon/trunk/runtime/activation/impl/src/test/org/apache/avalon/activation/impl/test/components/ Modified: avalon/trunk/runtime/activation/impl/src/test/org/apache/avalon/activation/impl/test/AbstractTestCase.java Log: remove redundant test components
Modified: avalon/trunk/runtime/activation/impl/src/test/org/apache/avalon/activation/impl/test/AbstractTestCase.java ============================================================================== --- avalon/trunk/runtime/activation/impl/src/test/org/apache/avalon/activation/impl/test/AbstractTestCase.java (original) +++ avalon/trunk/runtime/activation/impl/src/test/org/apache/avalon/activation/impl/test/AbstractTestCase.java Thu Jun 10 08:04:45 2004 @@ -60,13 +60,27 @@ { //------------------------------------------------------- // static - //------------------------------------------------------- + //------------------------------------------------------- + + private static File getWorkDir() + { + String path = System.getProperty( "project.dir" ); + if( null != path ) + { + return new File( path ); + } + else + { + path = System.getProperty( "basedir" ); + File root = new File( path ); + return new File( root, "target/test-classes" ); + } + } - public static final File BASEDIR = - new File( System.getProperty( "basedir" ) ); + public static final File BASEDIR = getWorkDir(); public static final File SYS_CONF = - new File( BASEDIR, "target/test-classes/conf/system/kernel.xml" ); + new File( BASEDIR, "system/kernel.xml" ); private static final XMLSecurityProfileBuilder SECURITY_BUILDER = new XMLSecurityProfileBuilder(); @@ -118,10 +132,8 @@ */ public void setUp( String filename ) throws Exception { - File base = new File( getTargetDirectory(), "test-classes" ); - File conf = new File( getBaseDirectory(), "src/test/conf" ); - File block = new File( conf, filename ); - setUp( base, block ); + File block = new File( BASEDIR, filename ); + setUp( BASEDIR, block ); } /** @@ -178,9 +190,9 @@ factory.setSecurityEnabled( true ); } - Repository repository = - createTestRepository( context, new File( base, "repository" ) ); - factory.setRepository( repository ); + //Repository repository = + // createTestRepository( context, new File( base, "repository" ) ); + //factory.setRepository( repository ); factory.setRuntime( DefaultRuntime.class ); m_system = factory.createSystemContext(); @@ -201,9 +213,22 @@ { InitialContextFactory initial = new DefaultInitialContextFactory( "test", base ); - initial.setCacheDirectory( getMavenRepositoryDirectory() ); + initial.setCacheDirectory( getCacheDirectory() ); registerSystemArtifacts( initial, config ); return initial.createInitialContext(); + } + + private File getCacheDirectory() + { + String cache = System.getProperty( "project.repository.cache.path" ); + if( null != cache ) + { + return new File( cache ); + } + else + { + return getMavenRepositoryDirectory(); + } } private Repository createTestRepository( @@ -252,14 +277,9 @@ protected static File getBaseDirectory() { - return new File( System.getProperty( "basedir" ) ); - } - - protected static File getTargetDirectory() - { - return new File( getBaseDirectory(), "target" ); + return BASEDIR; } - + protected Logger getLogger() { return m_logger; --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]