context.put( "basedir", getBasedir() ); customizeContext( context ); File f = getTestFile( "target/plexus-home" ); String config = getCustomConfigurationName(); String resource = getConfigurationName( null ); customizeContainerConfiguration( containerConfiguration ); fail( "Failed to create plexus container." );
@SuppressWarnings("unchecked") protected <T> T lookup( String componentKey ) throws Exception { return (T) getContainer().lookup( componentKey ); }
protected InputStream getConfiguration( String subname ) throws Exception { return getResourceAsStream( getConfigurationName( subname ) ); }
/** * {@inheritDoc} */ protected void setUp() throws Exception { super.setUp(); setMavenSettings(); }
protected void setUp() throws Exception { basedir = getBasedir(); }
public static String getTestPath( String basedir, String path ) { return getTestFile( basedir, path ).getAbsolutePath(); }
/** * Creates the <code>${plexus.home}/logs</code> directory. */ public final void setUp() throws Exception { super.setUp(); File f = getTestFile( "target/plexus-home/logs" ); if ( !f.isDirectory() ) { f.mkdir(); } }
public static File getTestFile( final String path ) { return getTestFile( getBasedir(), path ); }
private final Map<Object, Object> context() { final Context context = new DefaultContext(); context.put( "basedir", getBasedir() ); // Per-test context customization customizeContext( context ); // Provide 'plexus.home' fall-back if ( !context.contains( PLEXUS_HOME ) ) { context.put( PLEXUS_HOME, plexusHome() ); } return context.getContextData(); }
private final ContainerConfiguration config() { final ContainerConfiguration config = new DefaultContainerConfiguration(); // Apply current test context config.setName( "test" ).setContext( context() ); // Find per-test components XML String path = getCustomConfigurationName(); if ( null == path ) { path = getConfigurationName( null ); } config.setContainerConfiguration( path ); // Per-test config customization customizeContainerConfiguration( config ); return config; }
protected void setUp() throws Exception { checksumObserver = new ChecksumObserver(); mockTransferListener = createMock( TransferListener.class ); super.setUp(); }
/** {@inheritDoc} */ public File getBasedir() { return new File( PlexusTestCase.getBasedir() ); }
public static String getTestPath( String path ) { return getTestFile( path ).getAbsolutePath(); }
protected InputStream getConfiguration( String subname ) throws Exception { return getResourceAsStream( getConfigurationName( subname ) ); }
context.put( "basedir", getBasedir() ); customizeContext( new DefaultContext( context ) ); File f = getTestFile( "target/plexus-home" ); String config = getCustomConfigurationName(); String resource = getConfigurationName( null ); customizeContainerConfiguration( containerConfiguration ); fail( "Failed to create plexus container." );
protected void setUp() throws Exception { checksumObserver = new ChecksumObserver(); mockTransferListener = createMock( TransferListener.class ); super.setUp(); }
public static File getTestFile( String path ) { return new File( getBasedir(), path ); }
public static File getTestFile( String basedir, String path ) { File basedirFile = new File( basedir ); if ( !basedirFile.isAbsolute() ) { basedirFile = getTestFile( basedir ); } return new File( basedirFile, path ); }
protected <T> T lookup( Class<T> componentClass, String roleHint ) throws Exception { return getContainer().lookup( componentClass, roleHint ); }
public void setUp() throws Exception { super.setUp(); LoggerManager loggerManager = (LoggerManager) lookup( LoggerManager.ROLE ); logger = loggerManager.getLoggerForComponent( this.getClass().toString() ); ldapServer = (LdapServer) lookup( LdapServer.ROLE ); }