Class TextFileUnitTest

java.lang.Object
com.hybris.datahub.core.io.TextFileUnitTest

@UnitTest public class TextFileUnitTest extends Object
  • Constructor Details

    • TextFileUnitTest

      public TextFileUnitTest()
  • Method Details

    • tearDown

      public void tearDown()
    • testCreatesTextFileWithASpecificPath

      public void testCreatesTextFileWithASpecificPath()
    • testCreatesTextFileWithASpecifiedDirectoryAndFileName

      public void testCreatesTextFileWithASpecifiedDirectoryAndFileName()
    • testCreatesTextFileWithASpecificFile

      public void testCreatesTextFileWithASpecificFile()
    • testDoesNotSaveFileFileBeforeContentWasWritten

      public void testDoesNotSaveFileFileBeforeContentWasWritten()
    • testSaveCreatesFileIfItDoesNotExist

      public void testSaveCreatesFileIfItDoesNotExist() throws IOException
      Throws:
      IOException
    • testSavePersistsTheContent

      public void testSavePersistsTheContent() throws IOException
      Throws:
      IOException
    • testSaveReplacesPreviousContent

      public void testSaveReplacesPreviousContent() throws IOException
      Throws:
      IOException
    • testDeleteDoesNothingIfTheFileWasNeverSaved

      public void testDeleteDoesNothingIfTheFileWasNeverSaved() throws IOException
      Throws:
      IOException
    • testDeleteRemovesAPreviouslySavedFile

      public void testDeleteRemovesAPreviouslySavedFile() throws IOException
      Throws:
      IOException
    • testReadReturnsEmptyTextBeforeTheFileWasEverSaved

      public void testReadReturnsEmptyTextBeforeTheFileWasEverSaved() throws IOException
      Throws:
      IOException
    • testAppendAddsToPreviousContentAndDoesNotReplaceIt

      public void testAppendAddsToPreviousContentAndDoesNotReplaceIt() throws IOException
      Throws:
      IOException
    • testAppendLineAddsLineOfTextToThePreviousContent

      public void testAppendLineAddsLineOfTextToThePreviousContent() throws IOException
      Throws:
      IOException
    • testReadLineReturnsTextOnTheLineSpecifiedByItsNumber

      public void testReadLineReturnsTextOnTheLineSpecifiedByItsNumber() throws IOException
      Throws:
      IOException
    • testReadLineReturnsNullForLineNumber0

      public void testReadLineReturnsNullForLineNumber0() throws IOException
      Throws:
      IOException
    • testReadLineReturnsNullWhenLineNumberExceedsNumberOfLinesInTheFile

      public void testReadLineReturnsNullWhenLineNumberExceedsNumberOfLinesInTheFile() throws IOException
      Throws:
      IOException
    • testReadLineReturnsNullWhenNothingHasBeenSavedIntoTheFileYet

      public void testReadLineReturnsNullWhenNothingHasBeenSavedIntoTheFileYet() throws IOException
      Throws:
      IOException
    • testReadLineTreatsTextWithoutLineBreaksAsSingleLine

      public void testReadLineTreatsTextWithoutLineBreaksAsSingleLine() throws IOException
      Throws:
      IOException
    • testReadLineReturnsEmptyStringForLinesWithNoTextPresent

      public void testReadLineReturnsEmptyStringForLinesWithNoTextPresent() throws IOException
      Throws:
      IOException
    • testToStringContainsTheFilePath

      public void testToStringContainsTheFilePath()
    • testFilesAreEqualWhenTheyAreBasedOnTheSamePath

      public void testFilesAreEqualWhenTheyAreBasedOnTheSamePath()
    • testFilesAreNotEqualWhenTheyAreNotOfTheSameClass

      public void testFilesAreNotEqualWhenTheyAreNotOfTheSameClass()
    • testFilesAreNotEqualWhenTheirPathesAreDifferent

      public void testFilesAreNotEqualWhenTheirPathesAreDifferent()
    • testHashCodeIsTheSameWhenFilesAreEqual

      public void testHashCodeIsTheSameWhenFilesAreEqual()
    • testHashCodeIsDifferentWhenFilesAreNotEqual

      public void testHashCodeIsDifferentWhenFilesAreNotEqual()
    • testCreatesNonExistingPathForTheFileName

      public void testCreatesNonExistingPathForTheFileName() throws IOException
      Throws:
      IOException