Uploaded image for project: 'Edgent'
  1. Edgent
  2. EDGENT-306

With edgent Tester, failed to read file content from the newly appeared files from a directory

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 0.4.0
    • None
    • Test
    • None

    Description

      I got a trouble when using edgent Tester. The scenario that I am trying to test is:
      1) There is a empty directory (e.g "testdata")
      2) Use FileStreams.directoryWatcher to watch the directory "testdata" and use FileStreams.textFileReader to read content of newly appeared files in the directory.

      I am trying to use edgent Tester to write a unit test of this scenario (I checked org.apache.edgent.test.connectors.file.FileStreamsTest and didn't find such scenario). But I found my unit test always failed at reading the content of newly appeared files. But if the files are pre-existing, it works.

      I attached two files. To reproduce this issue, you can run testDirectoryWatcherOrder in CopyOfFileStreamsTest.java. And you will see the following error. FileReaderApp.java is a standard alone version of the above test scenario - it works well (once you start it, generate some files with content in the directory, you can see the file content are printed in console).

      So could you please let me know if this is a defect of edgent Tester or my usage mistake?

      Attachments

        1. M2.png
          59 kB
          Rui Shen
        2. CopyOfFileStreamsTest.java
          11 kB
          Rui Shen
        3. FileReaderApp.java
          3 kB
          Rui Shen

        Activity

          People

            Unassigned Unassigned
            ilovepumpkin Rui Shen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: