Class AWorkflowEngineTest

    • Constructor Detail

      • AWorkflowEngineTest

        public AWorkflowEngineTest()
    • Method Detail

      • assertAttachmentAccessibleByEndUsers

        protected void assertAttachmentAccessibleByEndUsers​(EAttachmentSource source,
                                                            boolean value)
      • assertAttachmentContentString

        protected void assertAttachmentContentString​(EAttachmentSource source,
                                                     String value)
      • assertAttachmentCount

        protected void assertAttachmentCount​(EAttachmentSource source,
                                             int expectedCount)
      • assertAttachmentsAccessibleByEndUsers

        protected void assertAttachmentsAccessibleByEndUsers​(EAttachmentSource source,
                                                             boolean... values)
      • assertAttachmentsAccessibleByEndUsers

        protected void assertAttachmentsAccessibleByEndUsers​(List<Attachment> attachments,
                                                             boolean... values)
      • assertAttachmentsContentJsonObject

        protected void assertAttachmentsContentJsonObject​(List<Attachment> attachments,
                                                          Object... values)
      • assertAttachmentsContentString

        protected void assertAttachmentsContentString​(EAttachmentSource source,
                                                      String... values)
      • assertAttachmentsContentString

        protected void assertAttachmentsContentString​(List<Attachment> attachments,
                                                      String... values)
      • assertAttachmentsFileName

        protected void assertAttachmentsFileName​(EAttachmentSource source,
                                                 String... values)
      • assertAttachmentsFileName

        protected void assertAttachmentsFileName​(List<Attachment> attachments,
                                                 String... values)
      • assertEntriesAreEqual

        protected void assertEntriesAreEqual​(Map<?,​?> expectedSubset,
                                             Map<?,​?> actual)
      • assertHasNoAttachments

        protected void assertHasNoAttachments​(EAttachmentSource source)
      • assertNoFormRecordChats

        protected void assertNoFormRecordChats()
      • binaryResource

        protected byte[] binaryResource​(String resourcePath)
      • cleanupAfterEach

        protected void cleanupAfterEach​(AutoCloseable cleanupAction)
      • createClientResource

        protected MandantRessource createClientResource​(@NotNull
                                                        @NotNull String name,
                                                        @NotNull
                                                        @javax.validation.constraints.NotNull byte[] resourceData,
                                                        @NotNull
                                                        @NotNull String resourceDescription)
                                                 throws Exception
        Creates a client resource where the resource- and the file-name are the same.
        Parameters:
        name - Name of the file.
        resourceData - Contents of the file.
        resourceDescription - Description of the file.
        Returns:
        The newly created client resource.
        Throws:
        Exception - When the resource could not be created, such as due to a database error.
      • createClientResource

        protected MandantRessource createClientResource​(@NotNull
                                                        @NotNull String resourceName,
                                                        @NotNull
                                                        @NotNull String fileName,
                                                        @NotNull
                                                        @javax.validation.constraints.NotNull byte[] resourceData,
                                                        @NotNull
                                                        @NotNull String resourceDescription)
                                                 throws Exception
        Throws:
        Exception
      • createClientResource

        protected MandantRessource createClientResource​(@NotNull
                                                        @NotNull String name,
                                                        @NotNull
                                                        @NotNull String resourceData,
                                                        @NotNull
                                                        @NotNull String resourceDescription)
                                                 throws Exception
        Creates a client resource where the resource- and the file-name are the same.
        Parameters:
        name - Name of the file.
        resourceData - Contents of the file.
        resourceDescription - Description of the file.
        Returns:
        The newly created client resource.
        Throws:
        Exception - When the resource could not be created, such as due to a database error.
      • createFormData

        @Deprecated
        protected void createFormData​(String fileName,
                                      String... formElements)
        Creates form data for the current form record.
        Parameters:
        fileName - XML and JSON file with the form data. If it starts with a slash: a full path to a classpath resource, without the extension. Otherwise it should be a file name without an extension, which is looked up as a classpath resource in the /forms/ folder.
        formElements - Names of the form elements to make available.
      • createFormDataAdapter

        protected IFormDataAdapter createFormDataAdapter()
        Creates the form data adapter for accessing the values of the current form submission.
        Returns:
        The form data adapter.
      • createFormDataAdapter

        protected IFormDataAdapter createFormDataAdapter​(FormEingang formData)
        Creates the form data adapter for accessing the values of the given form submission.
        Parameters:
        formData - The form submission to create the adapter for.
        Returns:
        The form data adapter.
      • createFormRecordResource

        protected Attachment createFormRecordResource​(@NotNull
                                                      @NotNull String attachmentFilename,
                                                      EAttachmentSource attachmentSource,
                                                      @NotNull
                                                      @javax.validation.constraints.NotNull byte[] resourceData,
                                                      @Nullable
                                                      Date editDate,
                                                      @Nullable
                                                      String uploadElementName)
                                               throws Exception
        Throws:
        Exception
      • createProjectResource

        protected ProjektRessource createProjectResource​(@NotNull
                                                         @NotNull String name,
                                                         @NotNull
                                                         @javax.validation.constraints.NotNull byte[] resourceData,
                                                         @NotNull
                                                         @NotNull String resourceDescription)
                                                  throws Exception
        Creates a project resource where the resource- and the file-name are the same.
        Parameters:
        name - Name of the file.
        resourceData - Content of the file.
        resourceDescription - Description of the file.
        Returns:
        The newly create form file.
        Throws:
        Exception - When the file could not be created, such as due to a database error.
      • createProjectResource

        protected ProjektRessource createProjectResource​(@NotNull
                                                         @NotNull String resourceName,
                                                         @NotNull
                                                         @NotNull String fileName,
                                                         @NotNull
                                                         @javax.validation.constraints.NotNull byte[] resourceData,
                                                         @NotNull
                                                         @NotNull String resourceDescription)
                                                  throws Exception
        Throws:
        Exception
      • createProjectResource

        protected ProjektRessource createProjectResource​(String name,
                                                         @NotNull
                                                         @NotNull String resourceData,
                                                         @NotNull
                                                         @NotNull String resourceDescription)
                                                  throws Exception
        Creates a project resource where the resource- and the file-name are the same.
        Parameters:
        name - Name of the file.
        resourceData - Content of the file.
        resourceDescription - Description of the file.
        Returns:
        The newly create form file.
        Throws:
        Exception - When the file could not be created, such as due to a database error.
      • deleteTempDir

        @AfterEach
        protected void deleteTempDir()
      • getAttachmentContentData

        protected byte[] getAttachmentContentData​(Attachment attachment)
      • getAttachmentContentJsonObject

        protected com.alibaba.fastjson.JSONObject getAttachmentContentJsonObject​(Attachment attachment)
      • getAttachmentContentString

        protected String getAttachmentContentString​(Attachment attachment)
      • getFormRecordAttachmentContentString

        protected String getFormRecordAttachmentContentString​(EAttachmentSource source)
      • plainTextResource

        protected String plainTextResource​(String resourcePath)
      • plainTextResource

        protected String plainTextResource​(String resourcePath,
                                           Charset charset)
      • readFormRecord

        protected Vorgang readFormRecord​(Long id)
      • registerQueryListener

        protected <T extends de.xima.cmn.dao.interfaces.IEntity<?>,​E extends de.xima.cmn.dao.interfaces.IBaseEntityContext> void registerQueryListener​(de.xima.cmn.dao.interfaces.IAbstractDao<T,​?,​E> dao,
                                                                                                                                                             de.xima.cmn.dao.enums.EDaoAction action,
                                                                                                                                                             de.xima.cmn.dao.enums.EDaoActionState state,
                                                                                                                                                             de.xima.cmn.dao.interfaces.IDaoActionListener<T,​E> listener)
      • reloadFormRecord

        protected void reloadFormRecord()
      • reloadProcess

        protected void reloadProcess()
      • reloadProject

        protected void reloadProject()
      • runGenericAfterEachCleanupActions

        @AfterEach
        protected void runGenericAfterEachCleanupActions()
                                                  throws Exception
        Throws:
        Exception
      • saveAndReloadFormRecord

        protected void saveAndReloadFormRecord()
      • saveAndReloadProcess

        protected void saveAndReloadProcess()
      • saveAndReloadProject

        protected void saveAndReloadProject()
      • setFormData

        protected void setFormData​(Map<String,​Object> dataToSet)
        Sets the submitted form data for the current form record to the given values. The map key is the name of the form element, and the value is the value to set. The value may be either a single string or a list of strings.
        Parameters:
        dataToSet - The form data to set.
      • setupEntities

        @BeforeEach
        protected void setupEntities()
                              throws Exception
        Throws:
        Exception
      • setupProcess

        protected abstract void setupProcess()
      • toJsonObject

        protected com.alibaba.fastjson.JSONObject toJsonObject​(Object data)
      • updateFormDataWithPersistenceXml

        protected void updateFormDataWithPersistenceXml​(String fileName)
        Updates the current form record with the form field values from the given persistence XML.
        Parameters:
        fileName - XML file with the persistence JSON. If it starts with a slash: a full path to a classpath resource, without the extension. Otherwise, it should be a file name without an extension, which is looked up as a classpath resource in the /forms/ folder.
      • updateFormVersionWithPersistJson

        protected void updateFormVersionWithPersistJson​(String fileName,
                                                        String... formElements)
        Updates the current form version with the persist JSON from the given file.
        Parameters:
        fileName - JSON file with the persist JSON. If it starts with a slash: a full path to a classpath resource, without the extension. Otherwise, it should be a file name without an extension, which is looked up as a classpath resource in the /forms/ folder.
        formElements - Names of the form elements to make available. When empty, all elements in the given persist JSON are added.
      • waitUntilFormRecordLocked

        protected AutoCloseable waitUntilFormRecordLocked()
      • waitUntilFormRecordLocked

        protected AutoCloseable waitUntilFormRecordLocked​(int timeoutSeconds)
      • waitUntilFormRecordLocked

        protected AutoCloseable waitUntilFormRecordLocked​(long formRecordId)
      • waitUntilFormRecordLocked

        protected AutoCloseable waitUntilFormRecordLocked​(long formRecordId,
                                                          int timeoutSeconds)
      • waitUntilFormRecordUnlocked

        protected void waitUntilFormRecordUnlocked()
      • waitUntilFormRecordUnlocked

        protected void waitUntilFormRecordUnlocked​(int timeoutSeconds)
      • waitUntilFormRecordUnlocked

        protected void waitUntilFormRecordUnlocked​(long formRecordId)
      • waitUntilFormRecordUnlocked

        protected void waitUntilFormRecordUnlocked​(long formRecordId,
                                                   int timeoutSeconds)
      • cleanupAfterAll

        protected static void cleanupAfterAll​(AutoCloseable cleanupAction)
      • runGenericAfterAllCleanupActions

        @AfterAll
        protected static void runGenericAfterAllCleanupActions()
                                                        throws Exception
        Throws:
        Exception