edu.rice.cs.util
Class FileOpsTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by edu.rice.cs.drjava.DrJavaTestCase
              extended by edu.rice.cs.util.FileOpsTest
All Implemented Interfaces:
Test

public class FileOpsTest
extends DrJavaTestCase

Test cases for FileOps.

Version:
$Id: FileOpsTest.java 4691 2008-12-02 23:33:27Z dlsmith $

Field Summary
static String PREFIX
           
static String SUFFIX
           
static String TEXT
           
 
Fields inherited from class edu.rice.cs.drjava.DrJavaTestCase
TEST_DRJAVA_CONFIG_PROPERTY
 
Constructor Summary
FileOpsTest()
           
 
Method Summary
static void main(String[] args)
          Main method called by testDeleteDirectoryOnExit.
 void testConvertToAbsolutePathEntries()
           
 void testCreateTempDirectory()
           
 void testDeleteDirectoryOnExit()
          Tests that non-empty directories can be deleted on exit.
 void testGetFiles()
          Tests getFilesInDir.
 void testMakeRelativeTo()
           
 void testPackageExplore()
          This tests that packageExplore correctly runs through and returns non-empty packages
 void testReadAndWriteTempFile()
           
 void testRecursiveDirectoryDelete()
           
 void testSaveFile()
          This method checks that backups are made correctly, that when a save fails, no data is lost, and that when a save is attempted on a write-protected file, the save fails (bug #782963).
 void testSplitFile()
           
 
Methods inherited from class edu.rice.cs.drjava.DrJavaTestCase
setConfigSetting, setDocText, setUp, tearDown
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TEXT

public static final String TEXT
See Also:
Constant Field Values

PREFIX

public static final String PREFIX
See Also:
Constant Field Values

SUFFIX

public static final String SUFFIX
See Also:
Constant Field Values
Constructor Detail

FileOpsTest

public FileOpsTest()
Method Detail

testCreateTempDirectory

public void testCreateTempDirectory()
                             throws IOException
Throws:
IOException

testReadAndWriteTempFile

public void testReadAndWriteTempFile()
                              throws IOException
Throws:
IOException

testRecursiveDirectoryDelete

public void testRecursiveDirectoryDelete()
                                  throws IOException
Throws:
IOException

testSaveFile

public void testSaveFile()
                  throws IOException
This method checks that backups are made correctly, that when a save fails, no data is lost, and that when a save is attempted on a write-protected file, the save fails (bug #782963).

Throws:
IOException

testPackageExplore

public void testPackageExplore()
                        throws IOException
This tests that packageExplore correctly runs through and returns non-empty packages

Throws:
IOException

testDeleteDirectoryOnExit

public void testDeleteDirectoryOnExit()
                               throws IOException,
                                      InterruptedException
Tests that non-empty directories can be deleted on exit.

Throws:
IOException
InterruptedException

testSplitFile

public void testSplitFile()

testMakeRelativeTo

public void testMakeRelativeTo()
                        throws IOException,
                               SecurityException
Throws:
IOException
SecurityException

main

public static void main(String[] args)
Main method called by testDeleteDirectoryOnExit. Runs in new JVM so the files can be deleted. Exits with status 1 if wrong number of arguments are passed. Exits with status 2 if file doesn't exist.

Parameters:
args - should contain the file name of the directory to delete on exit

testConvertToAbsolutePathEntries

public void testConvertToAbsolutePathEntries()

testGetFiles

public void testGetFiles()
                  throws IOException
Tests getFilesInDir.

Throws:
IOException