Class UploadTester

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final T component
    • Constructor Summary

      Constructors 
      Constructor Description
      UploadTester(T component) Wrap given component for testing.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      void upload(String fileName, String contentType, InputStream contents) Send the file data to the Upload component as if it is uploaded in the browser.
      void upload(String fileName, String contentType, Array<byte> contents) Send the file data to the Upload component as if it is uploaded in the browser.
      void upload(File file) Send the file data to the Upload component as if it is uploaded in the browser.
      void uploadAll(Array<File> files) Simulates uploading multiple files at once.
      void uploadAll(Collection<File> files) Simulates uploading multiple files at once.
      void uploadAborted(String fileName, String contentType) Simulates upload interruption by user on browser.
      void uploadAborted(File file) Simulates upload interruption by user on browser.
      void uploadFailed(File file) Simulates a failure during file upload.
      void uploadFailed(String fileName, String contentType) Simulates a failure during file upload.
      • Methods inherited from class com.vaadin.testbench.unit.ComponentTester

        find, getComponent, isUsable, setModal
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UploadTester

        UploadTester(T component)
        Wrap given component for testing.
        Parameters:
        component - target component
    • Method Detail

      • upload

         void upload(String fileName, String contentType, InputStream contents)

        Send the file data to the Upload component as if it is uploaded in the browser.

        Parameters:
        fileName - name of the file to upload
        contentType - content type of the file to upload
        contents - file contents as an array of bytes
      • upload

         void upload(String fileName, String contentType, Array<byte> contents)

        Send the file data to the Upload component as if it is uploaded in the browser.

        Parameters:
        fileName - name of the file to upload
        contentType - content type of the file to upload
        contents - file contents as an array of bytes
      • upload

         void upload(File file)

        Send the file data to the Upload component as if it is uploaded in the browser. The content type is detected from file name.

        Parameters:
        file - the file to upload
      • uploadAll

         void uploadAll(Array<File> files)

        Simulates uploading multiple files at once.

        Parameters:
        files - files to upload
      • uploadAll

         void uploadAll(Collection<File> files)

        Simulates uploading multiple files at once.

        Parameters:
        files - files to upload
      • uploadAborted

         void uploadAborted(String fileName, String contentType)

        Simulates upload interruption by user on browser.

        Parameters:
        fileName - name of uploading file
        contentType - content type of the uploading file
      • uploadAborted

         void uploadAborted(File file)

        Simulates upload interruption by user on browser.

        Parameters:
        file - uploading file
      • uploadFailed

         void uploadFailed(File file)

        Simulates a failure during file upload.

        Parameters:
        file - uploading file
      • uploadFailed

         void uploadFailed(String fileName, String contentType)

        Simulates a failure during file upload.

        Parameters:
        fileName - name of uploading file
        contentType - content type of the uploading file