1 17 package org.alfresco.util; 18 19 import java.io.File ; 20 21 import junit.framework.TestCase; 22 23 28 public class TempFileProviderTest extends TestCase 29 { 30 public void testTempDir() throws Exception 31 { 32 File tempDir = TempFileProvider.getTempDir(); 33 assertTrue("Not a directory", tempDir.isDirectory()); 34 File tempDirParent = tempDir.getParentFile(); 35 36 File tempFile = File.createTempFile("AAAA", ".tmp"); 38 File tempFileParent = tempFile.getParentFile(); 39 40 assertEquals("Our temp dir not subdirectory system temp directory", 42 tempFileParent, tempDirParent); 43 } 44 45 public void testTempFile() throws Exception 46 { 47 File tempFile = TempFileProvider.createTempFile("AAAA", ".tmp"); 48 File tempFileParent = tempFile.getParentFile(); 49 File tempDir = TempFileProvider.getTempDir(); 50 assertEquals("Temp file not located in our temp directory", 51 tempDir, tempFileParent); 52 } 53 } 54 | Popular Tags |