Default temporary directory java.io.tmpdir is now used for 'basedir' if no other basedir is specified in the testing options

git-svn-id: http://jclouds.googlecode.com/svn/trunk@1618 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
jamurty 2009-07-13 19:06:05 +00:00
parent fb85439380
commit 03631f84d1
1 changed files with 5 additions and 1 deletions

View File

@ -38,6 +38,7 @@ import java.util.concurrent.TimeoutException;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.jclouds.aws.s3.internal.BaseS3Map; import org.jclouds.aws.s3.internal.BaseS3Map;
import org.testng.annotations.BeforeMethod; import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Optional;
import org.testng.annotations.Parameters; import org.testng.annotations.Parameters;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -72,8 +73,11 @@ public abstract class BaseS3MapIntegrationTest<T> extends S3IntegrationTest {
@BeforeMethod(groups = { "integration", "live" }) @BeforeMethod(groups = { "integration", "live" })
@Parameters( { "basedir" }) @Parameters( { "basedir" })
protected void setUpTempDir(String basedir) throws InterruptedException, ExecutionException, protected void setUpTempDir(@Optional String basedir) throws InterruptedException, ExecutionException,
FileNotFoundException, IOException, TimeoutException { FileNotFoundException, IOException, TimeoutException {
if (basedir == null) {
basedir = System.getProperty("java.io.tmpdir");
}
tmpDirectory = basedir + File.separator + "target" + File.separator + "testFiles" tmpDirectory = basedir + File.separator + "target" + File.separator + "testFiles"
+ File.separator + getClass().getSimpleName(); + File.separator + getClass().getSimpleName();
new File(tmpDirectory).mkdirs(); new File(tmpDirectory).mkdirs();