com.mucommander.file.impl.sftp
Class SFTPFileTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by com.mucommander.file.AbstractFileTestCase
              extended by com.mucommander.file.impl.sftp.SFTPFileTestCase
All Implemented Interfaces:
junit.framework.Test

public class SFTPFileTestCase
extends AbstractFileTestCase

An AbstractFileTestCase implementation for SFTPFile. The SFTP temporary folder where test files are created is defined by the TEMP_FOLDER_PROPERTY system property.

Author:
Maxence Bernard

Field Summary
static java.lang.String TEMP_FOLDER_PROPERTY
          The system property that holds the URI to the temporary SFTP folder
 
Fields inherited from class com.mucommander.file.AbstractFileTestCase
filesToDelete, random, tempFile
 
Constructor Summary
SFTPFileTestCase()
           
 
Method Summary
 AbstractFile getTemporaryFile()
          Returns a temporary file that can be used for testing purposes.
 void testInputStream()
          Tests AbstractFile.getInputStream().
 void testRandomAccessInputStream()
          Tests AbstractFile.hasRandomAccessInputStream() and AbstractFile.getRandomAccessInputStream().
 
Methods inherited from class com.mucommander.file.AbstractFileTestCase
assertContentsEquals, assertEquals, byteArraysEqual, calculateMd5, calculateMd5, createFile, deleteWhenFinished, getMd5OutputStream, getPseudoUniqueFilename, setUp, sleep, tearDown, testAbsolutePath, testCanonicalPath, testCopyTo, testDate, testDelete, testDestinationResolution, testDigest, testExists, testFileURL, testFreeSpace, testIcon, testIsDirectory, testJavaNetURL, testLs, testMkdir, testMkdirs, testMkfile, testMoveTo, testNameAndExtension, testOutputStream, testParent, testPathResolution, testPermissions, testRandomAccessOutputStream, testRoot, testSeparator, testTotalSpace, testUnicodeFilenames, writeRandomData, writeRandomData
 
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

TEMP_FOLDER_PROPERTY

public static final java.lang.String TEMP_FOLDER_PROPERTY
The system property that holds the URI to the temporary SFTP folder

See Also:
Constant Field Values
Constructor Detail

SFTPFileTestCase

public SFTPFileTestCase()
Method Detail

testInputStream

public void testInputStream()
                     throws java.io.IOException,
                            java.security.NoSuchAlgorithmException
Description copied from class: AbstractFileTestCase
Tests AbstractFile.getInputStream().

Overrides:
testInputStream in class AbstractFileTestCase
Throws:
java.io.IOException - should not happen
java.security.NoSuchAlgorithmException - should not happen

testRandomAccessInputStream

public void testRandomAccessInputStream()
                                 throws java.io.IOException,
                                        java.security.NoSuchAlgorithmException
Description copied from class: AbstractFileTestCase
Tests AbstractFile.hasRandomAccessInputStream() and AbstractFile.getRandomAccessInputStream().

Overrides:
testRandomAccessInputStream in class AbstractFileTestCase
Throws:
java.io.IOException - should not happen
java.security.NoSuchAlgorithmException - should not happen

getTemporaryFile

public AbstractFile getTemporaryFile()
                              throws java.io.IOException
Description copied from class: AbstractFileTestCase
Returns a temporary file that can be used for testing purposes. The implementation should return a file that does not exist, i.e. for which AbstractFile.exists() returns false.

Specified by:
getTemporaryFile in class AbstractFileTestCase
Returns:
a temporary file that does not physically exist
Throws:
java.io.IOException - if an error occurred while creating a temporary file


This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard