public class UtilIOTest
extends java.lang.Object
UtilIO
unit testsModifier and Type | Class and Description |
---|---|
class |
UtilIOTest.TestBinarizable |
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
TEST_DIRECTORY
Name of test directory
|
private static java.lang.String |
TEST_DIRECTORY_CREATE_DIRECTORY
Name of created directory, during the test
|
private static java.lang.String |
TEST_DIRECTORY_CREATE_FILE
Name of the created file during the test
|
private static java.lang.String |
TEST_DIRECTORY_DELETE_DIRECTORY
Name of directory to delete during the test
|
private static java.lang.String |
TEST_DIRECTORY_DELETE_DIRECTORY_DIR1
Name of sub directory 1 to delete during the test
|
private static java.lang.String |
TEST_DIRECTORY_DELETE_DIRECTORY_DIR2
Name of sub directory 2 to delete during the test
|
private static java.lang.String |
TEST_DIRECTORY_DELETE_DIRECTORY_F1
Name of file 1 to delete during the test
|
private static java.lang.String |
TEST_DIRECTORY_DELETE_DIRECTORY_F2
Name of file 2 to delete during the test
|
private static java.lang.String |
TEST_DIRECTORY_DELETE_DIRECTORY_F3
Name of file 3 to delete during the test
|
private static java.lang.String |
TEST_DIRECTORY_DELETE_FILE
Name of file to delete during the test
|
private static java.lang.String |
TEST_DIRECTORY_FILE
Name of file to copy during the test
|
private static java.lang.String |
TEST_DIRECTORY_UNZIP
Name of directory where unzip during the test
|
private static java.lang.String |
TEST_DIRECTORY_UNZIP_FILE
Name of file to unzip during the test
|
private static java.lang.String |
TEST_DIRECTORY_VIRTUAL_LINK
Name of virtual link tested
|
private static java.lang.String |
TEST_DIRECTORY_ZIP
Name of directory to zip test
|
private static java.lang.String |
TEST_DIRECTORY_ZIP_FILE
Name of result zip file
|
Constructor and Description |
---|
UtilIOTest() |
Modifier and Type | Method and Description |
---|---|
static boolean |
compareDirectories(java.io.File directory1,
java.io.File directory2)
Compare 2 directories contents
|
static boolean |
compareFiles(java.io.File file1,
java.io.File file2)
Indicates if 2 files are the same
|
static void |
initialiazeForCodeCoverage()
Initialize directories for code coverage
|
void |
testBinarizableObjects()
|
void |
testCreateDirectory()
Test of
UtilIO.createDirectory(File) |
void |
testCreateFile()
Test of
UtilIO.createFile(File) |
void |
testDelete()
Test of
UtilIO.delete(File) |
void |
testIsVirtualLink()
Test of
UtilIO.isVirtualLink(File) |
void |
testObtainExternalFile()
|
void |
testObtainFileFileString()
Test of
UtilIO.obtainFile(File, String) |
void |
testObtainFileFileStringChar()
|
void |
testObtainOutsideDirectory()
Test of
UtilIO.obtainOutsideDirectory() |
void |
testUnzipFileFile()
Test of
UtilIO.unzip(File, File) |
void |
testWriteFileFile()
Test of
UtilIO.write(File, File) |
void |
testZipFileFile()
Test of
UtilIO.zip(File, File) |
private static final java.lang.String TEST_DIRECTORY
private static final java.lang.String TEST_DIRECTORY_CREATE_DIRECTORY
private static final java.lang.String TEST_DIRECTORY_CREATE_FILE
private static final java.lang.String TEST_DIRECTORY_DELETE_DIRECTORY
private static final java.lang.String TEST_DIRECTORY_DELETE_DIRECTORY_DIR1
private static final java.lang.String TEST_DIRECTORY_DELETE_DIRECTORY_DIR2
private static final java.lang.String TEST_DIRECTORY_DELETE_DIRECTORY_F1
private static final java.lang.String TEST_DIRECTORY_DELETE_DIRECTORY_F2
private static final java.lang.String TEST_DIRECTORY_DELETE_DIRECTORY_F3
private static final java.lang.String TEST_DIRECTORY_DELETE_FILE
private static final java.lang.String TEST_DIRECTORY_FILE
private static final java.lang.String TEST_DIRECTORY_UNZIP
private static final java.lang.String TEST_DIRECTORY_UNZIP_FILE
private static final java.lang.String TEST_DIRECTORY_VIRTUAL_LINK
private static final java.lang.String TEST_DIRECTORY_ZIP
private static final java.lang.String TEST_DIRECTORY_ZIP_FILE
public static boolean compareDirectories(java.io.File directory1, java.io.File directory2)
directory1
- First directorydirectory2
- Second directorytrue
if directories have same treepublic static boolean compareFiles(java.io.File file1, java.io.File file2)
file1
- First filefile2
- Second filetrue
if files have same contentpublic static void initialiazeForCodeCoverage() throws java.io.IOException
java.io.IOException
- On copying issuepublic void testBinarizableObjects() throws java.io.IOException
UtilIO.writeBinarizableNamed(Binarizable, java.io.OutputStream)
and
UtilIO.readBinarizableNamed(java.io.InputStream)
java.io.IOException
public void testCreateDirectory()
UtilIO.createDirectory(File)
public void testCreateFile()
UtilIO.createFile(File)
public void testDelete()
UtilIO.delete(File)
public void testIsVirtualLink()
UtilIO.isVirtualLink(File)
public void testObtainExternalFile()
public void testObtainFileFileString()
UtilIO.obtainFile(File, String)
public void testObtainFileFileStringChar()
public void testObtainOutsideDirectory()
UtilIO.obtainOutsideDirectory()
public void testUnzipFileFile() throws java.io.IOException
UtilIO.unzip(File, File)
java.io.IOException
- On unzipping issuepublic void testWriteFileFile() throws java.io.IOException
UtilIO.write(File, File)
java.io.IOException
- On copy issuepublic void testZipFileFile() throws java.io.IOException
UtilIO.zip(File, File)
java.io.IOException
- On zipping issue