org.apache.maven.shared.utils.io
Class FileUtilsTest

java.lang.Object
  extended by org.apache.maven.shared.utils.io.FileUtilsTest

public class FileUtilsTest
extends Object

This is used to test FileUtils for correctness.

Version:
$Id: FileUtilsTestCase.java 1081025 2011-03-13 00:45:10Z niallp $
Author:
Peter Donald, Matthew Hawthorne, Stephen Colebourne, Jim Harrington
See Also:
FileUtils

Field Summary
 org.junit.rules.TestName name
           
 org.junit.rules.TemporaryFolder tempFolder
           
 
Constructor Summary
FileUtilsTest()
           
 
Method Summary
 void blowUpOnFilenameNull()
           
 void blowUpOnNull()
           
 void blowUpOnNullExtension()
           
 void contentEquals()
           
 void copyDirectoryErrors()
           
 void copyDirectoryToChild()
          Test for IO-141
 void copyDirectoryToDirectory_NonExistingDest()
           
 void copyDirectoryToExistingDest()
           
 void copyDirectoryToGrandChild()
          Test for IO-141
 void copyDirectoryToItself()
          Test for IO-217 FileUtils.copyDirectoryToDirectory makes infinite loops
 void copyDirectoryToNonExistingDest()
           
 void copyFile1()
           
 void copyFile1ToDir()
           
 void copyFile2()
           
 void copyFile2ToDir()
           
 void copyToSelf()
           
 void copyURLToFile()
           
 void deleteQuietlyDir()
           
 void deleteQuietlyFile()
           
 void deleteQuietlyNonExistent()
           
 void dirnameEmpty()
           
 void dirnameFilename()
           
 void dirnameUnixNonRootPathOnUnix()
           
 void dirnameUnixNonRootPathOnWindows()
           
 void dirnameUnixRootPathOnUnix()
           
 void dirnameUnixRootPathOnWindows()
           
 void dirnameWindowsNonRootPathOnUnix()
           
 void dirnameWindowsNonRootPathOnWindows()
           
 void dirnameWindowsRootPathOnUnix()
           
 void dirnameWindowsRootPathOnWindows()
           
 void extensionEmpty()
           
 void extensionFileName()
           
 void extensionFileNameNoExtension()
           
 void extensionUnixNonRootPathOnUnix()
           
 void extensionUnixNonRootPathOnWindows()
           
 void extensionUnixRootPathOnUnix()
           
 void extensionUnixRootPathOnWindows()
           
 void extensionWindowsNonRootPathOnUnix()
           
 void extensionWindowsNonRootPathOnWindows()
           
 void extensionWindowsRootPathOnUnix()
           
 void extensionWindowsRootPathOnWindows()
           
 void filenameEmpty()
           
 void filenameFilename()
           
 void filenameUnixNonRootPathOnUnix()
           
 void filenameUnixNonRootPathOnWindows()
           
 void filenameUnixRootPathOnUnix()
           
 void filenameUnixRootPathOnWindows()
           
 void filenameWindowsNonRootPathOnUnix()
           
 void filenameWindowsNonRootPathOnWindows()
           
 void filenameWindowsRootPathOnUnix()
           
 void filenameWindowsRootPathOnWindows()
           
 void fileReadWithDefaultEncoding()
           
 void fileReadWithEncoding()
           
 void fileUtils()
          Test the FileUtils implementation.
 void forceDeleteAFile1()
           
 void forceDeleteAFile2()
           
 void forceDeleteAFile3()
           
 void forceDeleteDir()
           
 void forceMkdir()
           
 void getDefaultExcludes()
           
 void getDefaultExcludesAsList()
           
 void getDefaultExcludesAsString()
           
 void nlowUpOnDirnameNull()
           
 void readLines()
           
 void setUp()
           
 void sizeOfDirectory()
           
 void toFile1()
           
 void toFile2()
           
 void toFile3()
           
 void toFile4()
           
 void toFile5()
          IO-252
 void toFileUtf8()
           
 void toURLs1()
           
 void write_WithAppendOptionTrue_ShouldNotDeletePreviousFileLines()
           
 void writeCharSequence1()
           
 void writeCharSequence2()
           
 void writeStringArrayToFile()
           
 void writeStringArrayToFileWithEncoding()
           
 void writeStringToFile_WithAppendOptionTrue_ShouldNotDeletePreviousFileLines()
           
 void writeStringToFile1()
           
 void writeStringToFile2()
           
 void writeStringToFileWithEncoding_WithAppendOptionTrue_ShouldNotDeletePreviousFileLines()
           
 void writeWithEncoding_WithAppendOptionTrue_ShouldNotDeletePreviousFileLines()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tempFolder

public org.junit.rules.TemporaryFolder tempFolder

name

public org.junit.rules.TestName name
Constructor Detail

FileUtilsTest

public FileUtilsTest()
Method Detail

setUp

public void setUp()
           throws Exception
Throws:
Exception
See Also:
TestCase.setUp()

toFile1

public void toFile1()
             throws Exception
Throws:
Exception

toFile2

public void toFile2()
             throws Exception
Throws:
Exception

toFile3

public void toFile3()
             throws Exception
Throws:
Exception

toFile4

public void toFile4()
             throws Exception
Throws:
Exception

toFile5

public void toFile5()
             throws Exception
IO-252

Throws:
Exception

toFileUtf8

public void toFileUtf8()
                throws Exception
Throws:
Exception

toURLs1

public void toURLs1()
             throws Exception
Throws:
Exception

contentEquals

public void contentEquals()
                   throws Exception
Throws:
Exception

copyURLToFile

public void copyURLToFile()
                   throws Exception
Throws:
Exception

forceMkdir

public void forceMkdir()
                throws Exception
Throws:
Exception

sizeOfDirectory

public void sizeOfDirectory()
                     throws Exception
Throws:
Exception

copyFile1

public void copyFile1()
               throws Exception
Throws:
Exception

copyFile2

public void copyFile2()
               throws Exception
Throws:
Exception

copyToSelf

public void copyToSelf()
                throws Exception
Throws:
Exception

copyDirectoryToDirectory_NonExistingDest

public void copyDirectoryToDirectory_NonExistingDest()
                                              throws Exception
Throws:
Exception

copyDirectoryToNonExistingDest

public void copyDirectoryToNonExistingDest()
                                    throws Exception
Throws:
Exception

copyDirectoryToExistingDest

public void copyDirectoryToExistingDest()
                                 throws Exception
Throws:
Exception

copyDirectoryToChild

public void copyDirectoryToChild()
                          throws Exception
Test for IO-141

Throws:
Exception

copyDirectoryToGrandChild

public void copyDirectoryToGrandChild()
                               throws Exception
Test for IO-141

Throws:
Exception

copyDirectoryToItself

public void copyDirectoryToItself()
                           throws Exception
Test for IO-217 FileUtils.copyDirectoryToDirectory makes infinite loops

Throws:
Exception

copyDirectoryErrors

public void copyDirectoryErrors()
                         throws Exception
Throws:
Exception

forceDeleteAFile1

public void forceDeleteAFile1()
                       throws Exception
Throws:
Exception

forceDeleteAFile2

public void forceDeleteAFile2()
                       throws Exception
Throws:
Exception

forceDeleteAFile3

public void forceDeleteAFile3()
                       throws Exception
Throws:
Exception

copyFile1ToDir

public void copyFile1ToDir()
                    throws Exception
Throws:
Exception

copyFile2ToDir

public void copyFile2ToDir()
                    throws Exception
Throws:
Exception

forceDeleteDir

public void forceDeleteDir()
                    throws Exception
Throws:
Exception

fileUtils

public void fileUtils()
               throws Exception
Test the FileUtils implementation.

Throws:
Exception

fileReadWithDefaultEncoding

public void fileReadWithDefaultEncoding()
                                 throws Exception
Throws:
Exception

fileReadWithEncoding

public void fileReadWithEncoding()
                          throws Exception
Throws:
Exception

readLines

public void readLines()
               throws Exception
Throws:
Exception

writeStringToFile1

public void writeStringToFile1()
                        throws Exception
Throws:
Exception

writeStringToFile2

public void writeStringToFile2()
                        throws Exception
Throws:
Exception

writeCharSequence1

public void writeCharSequence1()
                        throws Exception
Throws:
Exception

writeCharSequence2

public void writeCharSequence2()
                        throws Exception
Throws:
Exception

writeStringToFileWithEncoding_WithAppendOptionTrue_ShouldNotDeletePreviousFileLines

public void writeStringToFileWithEncoding_WithAppendOptionTrue_ShouldNotDeletePreviousFileLines()
                                                                                         throws Exception
Throws:
Exception

writeStringToFile_WithAppendOptionTrue_ShouldNotDeletePreviousFileLines

public void writeStringToFile_WithAppendOptionTrue_ShouldNotDeletePreviousFileLines()
                                                                             throws Exception
Throws:
Exception

writeStringArrayToFile

public void writeStringArrayToFile()
                            throws Exception
Throws:
Exception

writeStringArrayToFileWithEncoding

public void writeStringArrayToFileWithEncoding()
                                        throws Exception
Throws:
Exception

writeWithEncoding_WithAppendOptionTrue_ShouldNotDeletePreviousFileLines

public void writeWithEncoding_WithAppendOptionTrue_ShouldNotDeletePreviousFileLines()
                                                                             throws Exception
Throws:
Exception

write_WithAppendOptionTrue_ShouldNotDeletePreviousFileLines

public void write_WithAppendOptionTrue_ShouldNotDeletePreviousFileLines()
                                                                 throws Exception
Throws:
Exception

blowUpOnNull

public void blowUpOnNull()
                  throws IOException
Throws:
IOException

deleteQuietlyDir

public void deleteQuietlyDir()
                      throws IOException
Throws:
IOException

deleteQuietlyFile

public void deleteQuietlyFile()
                       throws IOException
Throws:
IOException

deleteQuietlyNonExistent

public void deleteQuietlyNonExistent()
                              throws IOException
Throws:
IOException

getDefaultExcludes

public void getDefaultExcludes()
                        throws Exception
Throws:
Exception

getDefaultExcludesAsList

public void getDefaultExcludesAsList()
                              throws Exception
Throws:
Exception

getDefaultExcludesAsString

public void getDefaultExcludesAsString()
                                throws Exception
Throws:
Exception

nlowUpOnDirnameNull

public void nlowUpOnDirnameNull()
                         throws Exception
Throws:
Exception

dirnameEmpty

public void dirnameEmpty()
                  throws Exception
Throws:
Exception

dirnameFilename

public void dirnameFilename()
                     throws Exception
Throws:
Exception

dirnameWindowsRootPathOnUnix

public void dirnameWindowsRootPathOnUnix()
                                  throws Exception
Throws:
Exception

dirnameWindowsNonRootPathOnUnix

public void dirnameWindowsNonRootPathOnUnix()
                                     throws Exception
Throws:
Exception

dirnameUnixRootPathOnWindows

public void dirnameUnixRootPathOnWindows()
                                  throws Exception
Throws:
Exception

dirnameUnixNonRootPathOnWindows

public void dirnameUnixNonRootPathOnWindows()
                                     throws Exception
Throws:
Exception

dirnameWindowsRootPathOnWindows

public void dirnameWindowsRootPathOnWindows()
                                     throws Exception
Throws:
Exception

dirnameWindowsNonRootPathOnWindows

public void dirnameWindowsNonRootPathOnWindows()
                                        throws Exception
Throws:
Exception

dirnameUnixRootPathOnUnix

public void dirnameUnixRootPathOnUnix()
                               throws Exception
Throws:
Exception

dirnameUnixNonRootPathOnUnix

public void dirnameUnixNonRootPathOnUnix()
                                  throws Exception
Throws:
Exception

blowUpOnFilenameNull

public void blowUpOnFilenameNull()
                          throws Exception
Throws:
Exception

filenameEmpty

public void filenameEmpty()
                   throws Exception
Throws:
Exception

filenameFilename

public void filenameFilename()
                      throws Exception
Throws:
Exception

filenameWindowsRootPathOnUnix

public void filenameWindowsRootPathOnUnix()
                                   throws Exception
Throws:
Exception

filenameWindowsNonRootPathOnUnix

public void filenameWindowsNonRootPathOnUnix()
                                      throws Exception
Throws:
Exception

filenameUnixRootPathOnWindows

public void filenameUnixRootPathOnWindows()
                                   throws Exception
Throws:
Exception

filenameUnixNonRootPathOnWindows

public void filenameUnixNonRootPathOnWindows()
                                      throws Exception
Throws:
Exception

filenameWindowsRootPathOnWindows

public void filenameWindowsRootPathOnWindows()
                                      throws Exception
Throws:
Exception

filenameWindowsNonRootPathOnWindows

public void filenameWindowsNonRootPathOnWindows()
                                         throws Exception
Throws:
Exception

filenameUnixRootPathOnUnix

public void filenameUnixRootPathOnUnix()
                                throws Exception
Throws:
Exception

filenameUnixNonRootPathOnUnix

public void filenameUnixNonRootPathOnUnix()
                                   throws Exception
Throws:
Exception

blowUpOnNullExtension

public void blowUpOnNullExtension()
                           throws Exception
Throws:
Exception

extensionEmpty

public void extensionEmpty()
                    throws Exception
Throws:
Exception

extensionFileName

public void extensionFileName()
                       throws Exception
Throws:
Exception

extensionFileNameNoExtension

public void extensionFileNameNoExtension()
                                  throws Exception
Throws:
Exception

extensionWindowsRootPathOnUnix

public void extensionWindowsRootPathOnUnix()
                                    throws Exception
Throws:
Exception

extensionWindowsNonRootPathOnUnix

public void extensionWindowsNonRootPathOnUnix()
                                       throws Exception
Throws:
Exception

extensionUnixRootPathOnWindows

public void extensionUnixRootPathOnWindows()
                                    throws Exception
Throws:
Exception

extensionUnixNonRootPathOnWindows

public void extensionUnixNonRootPathOnWindows()
                                       throws Exception
Throws:
Exception

extensionWindowsRootPathOnWindows

public void extensionWindowsRootPathOnWindows()
                                       throws Exception
Throws:
Exception

extensionWindowsNonRootPathOnWindows

public void extensionWindowsNonRootPathOnWindows()
                                          throws Exception
Throws:
Exception

extensionUnixRootPathOnUnix

public void extensionUnixRootPathOnUnix()
                                 throws Exception
Throws:
Exception

extensionUnixNonRootPathOnUnix

public void extensionUnixNonRootPathOnUnix()
                                    throws Exception
Throws:
Exception


Copyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.