com.mockobjects.io
Class MockFile

java.lang.Object
  extended bycom.mockobjects.MockObject
      extended bycom.mockobjects.io.MockFile
All Implemented Interfaces:
File, Verifiable

public class MockFile
extends MockObject
implements File


Constructor Summary
MockFile()
           
 
Method Summary
 boolean canRead()
           
 boolean canWrite()
           
 int compareTo(File pathname)
           
 int compareTo(java.lang.Object o)
           
 boolean createNewFile()
           
 File createTempFile(java.lang.String prefix, java.lang.String suffix)
           
 File createTempFile(java.lang.String prefix, java.lang.String suffix, File directory)
           
 boolean delete()
           
 void deleteOnExit()
           
 boolean exists()
           
 File getAbsoluteFile()
           
 java.lang.String getAbsolutePath()
           
 File getCanonicalFile()
           
 java.lang.String getCanonicalPath()
           
 java.lang.String getName()
           
 java.lang.String getParent()
           
 File getParentFile()
           
 java.lang.String getPath()
           
 java.io.File getRealFile()
           
 boolean isAbsolute()
           
 boolean isDirectory()
           
 boolean isFile()
           
 boolean isHidden()
           
 long lastModified()
           
 long length()
           
 java.lang.String[] list()
           
 java.lang.String[] list(java.io.FilenameFilter filter)
           
 File[] listFiles()
           
 File[] listFiles(java.io.FileFilter filter)
           
 File[] listFiles(java.io.FilenameFilter aFilenameFilter)
           
 File[] listRoots()
           
 boolean mkdir()
           
 boolean mkdirs()
           
 boolean renameTo(File dest)
           
 void setExpectedFilenameFilter(java.io.FilenameFilter aFilenameFilter)
           
 boolean setLastModified(long time)
           
 boolean setReadOnly()
           
 void setupExists(boolean exists)
           
 void setupGetAbsolutePath(java.lang.String absolutePath)
           
 void setupGetName(java.lang.String name)
           
 void setupGetParent(java.lang.String aParent)
           
 void setupGetParentFile(File parentFile)
           
 void setupGetPath(java.lang.String aPath)
           
 void setupGetRealFile(java.io.File file)
           
 void setupListFile(File[] aFilesToReturn)
           
 void setupMkdirs(boolean mkdirs, int count)
           
 java.net.URL toURL()
           
 
Methods inherited from class com.mockobjects.MockObject
notImplemented, notYetImplemented, verify
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockFile

public MockFile()
Method Detail

setupGetName

public void setupGetName(java.lang.String name)

getName

public java.lang.String getName()
Specified by:
getName in interface File

setupGetParent

public void setupGetParent(java.lang.String aParent)

getParent

public java.lang.String getParent()
Specified by:
getParent in interface File

setupGetParentFile

public void setupGetParentFile(File parentFile)

getParentFile

public File getParentFile()
Specified by:
getParentFile in interface File

createTempFile

public File createTempFile(java.lang.String prefix,
                           java.lang.String suffix,
                           File directory)
                    throws java.io.IOException
Specified by:
createTempFile in interface File
Throws:
java.io.IOException

createTempFile

public File createTempFile(java.lang.String prefix,
                           java.lang.String suffix)
                    throws java.io.IOException
Specified by:
createTempFile in interface File
Throws:
java.io.IOException

listRoots

public File[] listRoots()
Specified by:
listRoots in interface File

setupGetPath

public void setupGetPath(java.lang.String aPath)

getPath

public java.lang.String getPath()
Specified by:
getPath in interface File

isAbsolute

public boolean isAbsolute()
Specified by:
isAbsolute in interface File

setupGetAbsolutePath

public void setupGetAbsolutePath(java.lang.String absolutePath)

getAbsolutePath

public java.lang.String getAbsolutePath()
Specified by:
getAbsolutePath in interface File

getAbsoluteFile

public File getAbsoluteFile()
Specified by:
getAbsoluteFile in interface File

getCanonicalPath

public java.lang.String getCanonicalPath()
                                  throws java.io.IOException
Specified by:
getCanonicalPath in interface File
Throws:
java.io.IOException

getCanonicalFile

public File getCanonicalFile()
                      throws java.io.IOException
Specified by:
getCanonicalFile in interface File
Throws:
java.io.IOException

toURL

public java.net.URL toURL()
                   throws java.net.MalformedURLException
Specified by:
toURL in interface File
Throws:
java.net.MalformedURLException

canRead

public boolean canRead()
Specified by:
canRead in interface File

canWrite

public boolean canWrite()
Specified by:
canWrite in interface File

setupExists

public void setupExists(boolean exists)

exists

public boolean exists()
Specified by:
exists in interface File

isDirectory

public boolean isDirectory()
Specified by:
isDirectory in interface File

isFile

public boolean isFile()
Specified by:
isFile in interface File

isHidden

public boolean isHidden()
Specified by:
isHidden in interface File

lastModified

public long lastModified()
Specified by:
lastModified in interface File

length

public long length()
Specified by:
length in interface File

createNewFile

public boolean createNewFile()
                      throws java.io.IOException
Specified by:
createNewFile in interface File
Throws:
java.io.IOException

delete

public boolean delete()
Specified by:
delete in interface File

deleteOnExit

public void deleteOnExit()
Specified by:
deleteOnExit in interface File

list

public java.lang.String[] list()
Specified by:
list in interface File

list

public java.lang.String[] list(java.io.FilenameFilter filter)
Specified by:
list in interface File

listFiles

public File[] listFiles()
Specified by:
listFiles in interface File

setExpectedFilenameFilter

public void setExpectedFilenameFilter(java.io.FilenameFilter aFilenameFilter)

setupListFile

public void setupListFile(File[] aFilesToReturn)

listFiles

public File[] listFiles(java.io.FilenameFilter aFilenameFilter)
Specified by:
listFiles in interface File

listFiles

public File[] listFiles(java.io.FileFilter filter)
Specified by:
listFiles in interface File

mkdir

public boolean mkdir()
Specified by:
mkdir in interface File

setupMkdirs

public void setupMkdirs(boolean mkdirs,
                        int count)

mkdirs

public boolean mkdirs()
Specified by:
mkdirs in interface File

renameTo

public boolean renameTo(File dest)
Specified by:
renameTo in interface File

setLastModified

public boolean setLastModified(long time)
Specified by:
setLastModified in interface File

setReadOnly

public boolean setReadOnly()
Specified by:
setReadOnly in interface File

compareTo

public int compareTo(File pathname)
Specified by:
compareTo in interface File

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface File

setupGetRealFile

public void setupGetRealFile(java.io.File file)

getRealFile

public java.io.File getRealFile()
Specified by:
getRealFile in interface File


Copyright © 2002 Mock Objects. All Rights Reserved.