protected void setUp() throws Exception { basedir = getBasedir(); }
/** {@inheritDoc} */ public File getBasedir() { return new File( PlexusTestCase.getBasedir() ); }
public static File getTestFile( String path ) { return new File( getBasedir(), path ); }
/** {@inheritDoc} */ public File alignToBaseDirectory( File file ) { if ( file.getAbsolutePath().startsWith( PlexusTestCase.getBasedir() ) ) { return file; } else if ( file.isAbsolute() ) { return file; } else { return new File( PlexusTestCase.getBasedir(), file.getPath() ); } } }
return PlexusTestCase.getBasedir(); value = PlexusTestCase.getBasedir() + expression.substring( pathSeparator ); File localRepo = new File( PlexusTestCase.getBasedir(), "target/local-repo" ); return new DefaultArtifactRepository( "localRepository", "file://" + localRepo.getAbsolutePath(), new DefaultRepositoryLayout() );
protected void setUp() throws Exception { basedir = getBasedir(); }
/** {@inheritDoc} */ public File getBasedir() { return new File( PlexusTestCase.getBasedir() ); }
context.put( "basedir", getBasedir() );
public static File getTestFile( String path ) { return new File( getBasedir(), path ); }
public static File getTestFile( final String basedir, final String path ) { File root = new File( basedir ); if ( !root.isAbsolute() ) { root = new File( getBasedir(), basedir ); } return new File( root, path ); }
/** {@inheritDoc} */ public File alignToBaseDirectory( File file ) { if ( file.getAbsolutePath().startsWith( PlexusTestCase.getBasedir() ) ) { return file; } else if ( file.isAbsolute() ) { return file; } else { return new File( PlexusTestCase.getBasedir(), file.getPath() ); } } }
public static File getBasedir(String name) throws IOException { File src = new File(PlexusTestCase.getBasedir(), "src/test/resources/" + name); File dst = new File(PlexusTestCase.getBasedir(), "target/" + name); if (dst.isDirectory()) { FileUtils.deleteDirectory(dst); } else if (dst.isFile()) { if (!dst.delete()) { throw new IOException("Can't delete file " + dst.toString()); } } FileUtils.copyDirectoryStructure(src, dst); return dst; } }
public static File getTestFile( final String path ) { return getTestFile( getBasedir(), path ); }
public static File getBasedir( String name ) throws IOException { File src = new File( PlexusTestCase.getBasedir(), "src/test/resources/" + name ); File dst = new File( PlexusTestCase.getBasedir(), "target/" + name ); if ( dst.isDirectory() ) { FileUtils.deleteDirectory( dst ); } else if ( dst.isFile() ) { if ( !dst.delete() ) { throw new IOException( "Can't delete file " + dst.toString() ); } } FileUtils.copyDirectoryStructure( src, dst ); return dst; } }
public static File getTestResourceLocation(String name) throws IOException { File src = new File(PlexusTestCase.getBasedir(), "src/test/resources/" + name); assertThat(src, exists()); return src; }
public File getBasedir() { if ( baseDir == null ) { baseDir = new File( PlexusTestCase.getBasedir() ); } return baseDir; }
/** * @return the basedir for all tests * @see PlexusTestCase#getBasedir() */ public static File getBasedir() { if (basedir == null) { String path = PlexusTestCase.getBasedir(); basedir = new File(path); if (verbose) { System.out.println("basedir = " + basedir.getAbsolutePath()); } } return basedir; }
return PlexusTestCase.getBasedir(); value = PlexusTestCase.getBasedir() + expression.substring( pathSeparator ); File localRepo = new File( PlexusTestCase.getBasedir(), "target/local-repo" ); return new DefaultArtifactRepository( "localRepository", "file://" + localRepo.getAbsolutePath(), new DefaultRepositoryLayout() );
context.put( "basedir", getBasedir() );
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(); }