Changeset 7020


Ignore:
Timestamp:
10/03/10 10:39:00 (9 years ago)
Author:
melissa
Message:

Hide temporary files in a subdirectory of /tmp, so that the tests are shielded from any changes to /tmp. Closes #572.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.2/components/common/test/loci/common/utests/LocationTest.java

    r7007 r7020  
    6060  @BeforeMethod 
    6161  public void setup() throws IOException { 
    62     File hiddenFile = File.createTempFile(".hiddenTest", null); 
     62    File tmpDirectory = new File(System.getProperty("java.io.tmpdir"), 
     63      System.currentTimeMillis() + "-location-test"); 
     64    boolean success = tmpDirectory.mkdirs(); 
     65    tmpDirectory.deleteOnExit(); 
     66 
     67    File hiddenFile = File.createTempFile(".hiddenTest", null, tmpDirectory); 
    6368    hiddenFile.deleteOnExit(); 
    6469 
    65     File invalidFile = File.createTempFile("invalidTest", null); 
     70    File invalidFile = File.createTempFile("invalidTest", null, tmpDirectory); 
    6671    String invalidPath = invalidFile.getAbsolutePath(); 
    6772    invalidFile.delete(); 
    6873 
    69     File validFile = File.createTempFile("validTest", null); 
     74    File validFile = File.createTempFile("validTest", null, tmpDirectory); 
    7075    validFile.deleteOnExit(); 
    7176 
     
    7378      new Location(validFile.getAbsolutePath()), 
    7479      new Location(invalidPath), 
    75       new Location(System.getProperty("java.io.tmpdir")), 
     80      new Location(tmpDirectory), 
    7681      new Location("http://loci.wisc.edu/software/bio-formats"), 
    7782      new Location("http://openmicroscopy.org/software/bio-formats"), 
  • trunk/components/common/test/loci/common/utests/LocationTest.java

    r6881 r7020  
    6060  @BeforeMethod 
    6161  public void setup() throws IOException { 
    62     File hiddenFile = File.createTempFile(".hiddenTest", null); 
     62    File tmpDirectory = new File(System.getProperty("java.io.tmpdir"), 
     63      System.currentTimeMillis() + "-location-test"); 
     64    boolean success = tmpDirectory.mkdirs(); 
     65    tmpDirectory.deleteOnExit(); 
     66 
     67    File hiddenFile = File.createTempFile(".hiddenTest", null, tmpDirectory); 
    6368    hiddenFile.deleteOnExit(); 
    6469 
    65     File invalidFile = File.createTempFile("invalidTest", null); 
     70    File invalidFile = File.createTempFile("invalidTest", null, tmpDirectory); 
    6671    String invalidPath = invalidFile.getAbsolutePath(); 
    6772    invalidFile.delete(); 
    6873 
    69     File validFile = File.createTempFile("validTest", null); 
     74    File validFile = File.createTempFile("validTest", null, tmpDirectory); 
    7075    validFile.deleteOnExit(); 
    7176 
     
    7378      new Location(validFile.getAbsolutePath()), 
    7479      new Location(invalidPath), 
    75       new Location(System.getProperty("java.io.tmpdir")), 
     80      new Location(tmpDirectory), 
    7681      new Location("http://loci.wisc.edu/software/bio-formats"), 
    7782      new Location("http://openmicroscopy.org/software/bio-formats"), 
Note: See TracChangeset for help on using the changeset viewer.