org.opennms.test
Class FileAnticipator
java.lang.Object
junit.framework.Assert
org.opennms.test.FileAnticipator
public class FileAnticipator
- extends junit.framework.Assert
File anticipator.
Example usage with late initialization:
private FileAnticipator m_fileAnticipator;
- Author:
- DJ Gregor
|
Method Summary |
void |
deleteExpected()
Delete expected files, throwing an AssertionFailedError if any of
the expected files don't exist. |
void |
deleteExpected(boolean ignoreNonExistantFiles)
Delete expected files, throwing an AssertionFailedError if any of
the expected files don't exist. |
java.io.File |
expecting(java.io.File parent,
java.lang.String name)
|
java.io.File |
expecting(java.lang.String name)
|
protected void |
finalize()
|
protected static java.lang.String |
generateRandomHexString(int length)
|
java.io.File |
getTempDir()
|
void |
initialize()
|
boolean |
isInitialized()
|
void |
tearDown()
|
java.io.File |
tempDir(java.io.File parent,
java.lang.String name)
|
java.io.File |
tempDir(java.lang.String name)
|
java.io.File |
tempFile(java.io.File parent,
java.lang.String name)
|
java.io.File |
tempFile(java.io.File parent,
java.lang.String name,
java.lang.String contents)
|
java.io.File |
tempFile(java.lang.String name)
|
java.io.File |
tempFile(java.lang.String name,
java.lang.String contents)
|
| 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 |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileAnticipator
public FileAnticipator()
throws java.io.IOException
- Throws:
java.io.IOException
FileAnticipator
public FileAnticipator(boolean initialize)
throws java.io.IOException
- Throws:
java.io.IOException
finalize
protected void finalize()
- Overrides:
finalize in class java.lang.Object
tearDown
public void tearDown()
initialize
public void initialize()
throws java.io.IOException
- Throws:
java.io.IOException
generateRandomHexString
protected static java.lang.String generateRandomHexString(int length)
getTempDir
public java.io.File getTempDir()
tempFile
public java.io.File tempFile(java.lang.String name)
throws java.io.IOException
- Throws:
java.io.IOException
tempFile
public java.io.File tempFile(java.io.File parent,
java.lang.String name)
throws java.io.IOException
- Throws:
java.io.IOException
tempFile
public java.io.File tempFile(java.lang.String name,
java.lang.String contents)
throws java.io.IOException
- Throws:
java.io.IOException
tempFile
public java.io.File tempFile(java.io.File parent,
java.lang.String name,
java.lang.String contents)
throws java.io.IOException
- Throws:
java.io.IOException
tempDir
public java.io.File tempDir(java.lang.String name)
throws java.io.IOException
- Throws:
java.io.IOException
tempDir
public java.io.File tempDir(java.io.File parent,
java.lang.String name)
throws java.io.IOException
- Throws:
java.io.IOException
expecting
public java.io.File expecting(java.lang.String name)
expecting
public java.io.File expecting(java.io.File parent,
java.lang.String name)
deleteExpected
public void deleteExpected()
- Delete expected files, throwing an AssertionFailedError if any of
the expected files don't exist.
deleteExpected
public void deleteExpected(boolean ignoreNonExistantFiles)
- Delete expected files, throwing an AssertionFailedError if any of
the expected files don't exist.
- Parameters:
ignoreNonExistantFiles - if true, non-existant files will be
ignored and will not throw an AssertionFailedError
- Throws:
junit.framework.AssertionFailedError - if ignoreNonExistantFiles is false
and an expected file does not exist, or if a file cannot be deleted
isInitialized
public boolean isInitialized()
Copyright © 2007. All Rights Reserved.