Class PortalSessionTestFacade

java.lang.Object
com.aquima.interactions.test.templates.session.PortalSessionTestFacade

public class PortalSessionTestFacade extends Object
PortalSessionTestFacade to create a portal session based on an ApplicationTemplate.
Since:
5.2
Author:
Jon van Leuven
  • Constructor Summary

    Constructors
    Constructor
    Description
    PortalSessionTestFacade(com.aquima.interactions.portal.IPortalSession session)
    Construct a portal session test facade with a portal session.
    Construct a PortalSession template for an application template.
    PortalSessionTestFacade(IApplicationTemplate template, com.aquima.interactions.metamodel.Channel channel, com.aquima.interactions.project.IUserData user)
    Construct a PortalSession template for an application template for a specific channel/roles.
    PortalSessionTestFacade(IApplicationTemplate template, com.aquima.interactions.metamodel.Channel channel, com.aquima.interactions.project.IUserData user, com.aquima.interactions.portal.IPortalMessageBus messageBus, com.aquima.interactions.portal.IPortalEventBus eventBus)
    Construct a PortalSession template for an application template for a specific channel/roles.
    PortalSessionTestFacade(IApplicationTemplate template, com.aquima.interactions.portal.IPortalMessageBus messageBus, com.aquima.interactions.portal.IPortalEventBus eventBus)
    Construct a PortalSession template for an application template.
    Use this constructor to create a PortalSessionTestFacade based on an application template and a session dump xml.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Close the current portal session.
    com.aquima.interactions.foundation.IValue
    getAttributeValue(String entityName, String attributeName)
    Returns the value of the given attribute of the given singleton entity.
    com.aquima.interactions.composer.IPage
    Retrieve the current page.
    com.aquima.interactions.composer.IPage
    getCurrentPage(boolean ignoreErrors)
    Retrieve the current page.
    com.aquima.interactions.foundation.report.IInitializationReport
    This method returns the initialization report that will be filled with the errors and warnings that were detected during initialization.
    com.aquima.interactions.portal.IPortalSession
    This method returns the portal session of this facade.
    com.aquima.interactions.process.IProcessEngine
     
    com.aquima.interactions.profile.IProfile
    This method returns a read only profile to be used in assertions in your test case.
    void
    handleButtonEvent(String buttonName, int buttonOccurrenceIndex, RequestTemplate values)
    Handle a button event.
    void
    Handle a button event.
    void
    handleFieldRefresh(String fieldName, int fieldOccurrenceIndex, RequestTemplate values)
    Handle a field refresh.
    void
    Handle a field refresh.
    void
    Recompose the current page.
    com.aquima.interactions.portal.PortalResponse
    startFlow(String flowName)
    Start a flow.
    void
    stopFlow(boolean commitChanges)
    This method will stop the current flow and commit or rollback any pending changes.

    Methods inherited from class java.lang.Object

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

    • PortalSessionTestFacade

      public PortalSessionTestFacade(IApplicationTemplate template)
      Construct a PortalSession template for an application template.
      Parameters:
      template - Application template.
      Throws:
      com.aquima.interactions.foundation.exception.AppException - Is thrown when an error occurs.
    • PortalSessionTestFacade

      public PortalSessionTestFacade(IApplicationTemplate template, com.aquima.interactions.portal.IPortalMessageBus messageBus, com.aquima.interactions.portal.IPortalEventBus eventBus)
      Construct a PortalSession template for an application template.
      Parameters:
      template - Application template.
      Throws:
      com.aquima.interactions.foundation.exception.AppException - Is thrown when an error occurs.
    • PortalSessionTestFacade

      public PortalSessionTestFacade(IApplicationTemplate template, com.aquima.interactions.metamodel.Channel channel, com.aquima.interactions.project.IUserData user)
      Construct a PortalSession template for an application template for a specific channel/roles.
      Parameters:
      template - Application template.
      channel - The current channel.
      user - The user of the client.
      Throws:
      com.aquima.interactions.foundation.exception.AppException - Is thrown when an error occurs.
    • PortalSessionTestFacade

      public PortalSessionTestFacade(IApplicationTemplate template, com.aquima.interactions.metamodel.Channel channel, com.aquima.interactions.project.IUserData user, com.aquima.interactions.portal.IPortalMessageBus messageBus, com.aquima.interactions.portal.IPortalEventBus eventBus)
      Construct a PortalSession template for an application template for a specific channel/roles.
      Parameters:
      template - Application template.
      channel - The current channel.
      user - The user of the client.
      Throws:
      com.aquima.interactions.foundation.exception.AppException - Is thrown when an error occurs.
    • PortalSessionTestFacade

      public PortalSessionTestFacade(IApplicationTemplate template, String sessionDumpXml)
      Use this constructor to create a PortalSessionTestFacade based on an application template and a session dump xml.
      Parameters:
      template - The applicationTemplate
      sessionDumpXml - the session dump.
      Throws:
      com.aquima.interactions.foundation.exception.AppException - Is thrown when an error occurs.
    • PortalSessionTestFacade

      public PortalSessionTestFacade(com.aquima.interactions.portal.IPortalSession session)
      Construct a portal session test facade with a portal session.
      Parameters:
      session - The portal session to use internally.
  • Method Details

    • getPortalSession

      public com.aquima.interactions.portal.IPortalSession getPortalSession()
      This method returns the portal session of this facade.
      Returns:
      the portal session of this facade.
    • startFlow

      public com.aquima.interactions.portal.PortalResponse startFlow(String flowName)
      Start a flow.
      Parameters:
      flowName - The name of flow to start.
      Throws:
      com.aquima.interactions.foundation.exception.AppException - Is thrown when an error occurs.
    • stopFlow

      public void stopFlow(boolean commitChanges)
      This method will stop the current flow and commit or rollback any pending changes.
      Parameters:
      commitChanges - Boolean indicating if pending changes should be committed.
      Throws:
      com.aquima.interactions.foundation.exception.AppException - This exception is thrown when there is no active flow.
    • handleFieldRefresh

      public void handleFieldRefresh(String fieldName, RequestTemplate values)
      Handle a field refresh. A build in input format is used and the application's default language. If the current page contains more fields with the name fieldName use handleFieldRefresh(String, int, RequestTemplate)
      Parameters:
      fieldName - Name of the field that triggers the refresh.
      values - Values that are submitted.
      Throws:
      com.aquima.interactions.foundation.exception.AppException - Is thrown when an error occurs.
    • handleFieldRefresh

      public void handleFieldRefresh(String fieldName, int fieldOccurrenceIndex, RequestTemplate values)
      Handle a field refresh. A build in input format is used and the application's default language.
      Parameters:
      fieldName - Name of the field that triggers the refresh.
      fieldOccurrenceIndex - Use the i-th field with name fieldName of the current page (zero based).
      values - Values that are submitted.
      Throws:
      com.aquima.interactions.foundation.exception.AppException - Is thrown when an error occurs.
    • handleButtonEvent

      public void handleButtonEvent(String buttonName, RequestTemplate values)
      Handle a button event. A build in input format is used and the application's default language. If the current page contains more buttons with the name buttonName use handleButtonEvent(String, int, RequestTemplate)
      Parameters:
      buttonName - Name of the button that triggers the event.
      values - Values that are submitted.
      Throws:
      com.aquima.interactions.foundation.exception.AppException - Is thrown when an error occurs.
    • handleButtonEvent

      public void handleButtonEvent(String buttonName, int buttonOccurrenceIndex, RequestTemplate values)
      Handle a button event. A build in inputformat is used and the application's default language.
      Parameters:
      buttonName - Name of the button that triggers the event.
      buttonOccurrenceIndex - Use the i-th button with name buttonName of the current page (zero based).
      values - Values that are submitted.
      Throws:
      com.aquima.interactions.foundation.exception.AppException - Is thrown when an error occurs.
    • recomposePage

      public void recomposePage()
      Recompose the current page.
      Throws:
      com.aquima.interactions.foundation.exception.AppException - Is thrown when an error occurs.
    • getCurrentPage

      public com.aquima.interactions.composer.IPage getCurrentPage()
      Retrieve the current page.
      Returns:
      The current page.
      Throws:
      com.aquima.interactions.foundation.exception.AppException - Is thrown when an error occurs or when the page contains failed elements or generic errors.
    • getCurrentPage

      public com.aquima.interactions.composer.IPage getCurrentPage(boolean ignoreErrors)
      Retrieve the current page.
      Parameters:
      ignoreErrors - If set to true, don't fail on failed elements or generic errors
      Returns:
      The current page.
      Throws:
      com.aquima.interactions.foundation.exception.AppException - Is thrown when an error occurs or when the page contains failed elements or generic errors (if ignoreErrors is false).
    • close

      public boolean close()
      Close the current portal session.
      Returns:
      boolean indicating if close was successful.
    • getProfile

      public com.aquima.interactions.profile.IProfile getProfile()
      This method returns a read only profile to be used in assertions in your test case.
      Returns:
      A read only profile
    • getAttributeValue

      public com.aquima.interactions.foundation.IValue getAttributeValue(String entityName, String attributeName)
      Returns the value of the given attribute of the given singleton entity.
      Parameters:
      entityName - the entity name
      attributeName - the attribute name
      Returns:
      the attribute value
    • getInitializationReport

      public com.aquima.interactions.foundation.report.IInitializationReport getInitializationReport()
      This method returns the initialization report that will be filled with the errors and warnings that were detected during initialization.
      Returns:
      the initialization report that will be filled with the errors and warnings that were detected during initialization.
    • getProcessEngine

      public com.aquima.interactions.process.IProcessEngine getProcessEngine()