Class JCoRecManagedConnectionFactory

java.lang.Object
de.hybris.platform.sap.core.jco.rec.impl.JCoRecManagedConnectionFactory
All Implemented Interfaces:
JCoManagedConnectionFactory

public class JCoRecManagedConnectionFactory extends Object implements JCoManagedConnectionFactory
If this Class is registered as ManagedConnectionFactory in the -spring.xml then JCoRec is enabled.

Make sure to provide parameters record (OFF, RECORDING or PLAYBACK) and path (the path where to save/load) in the correspondent Test Files.

  • Field Details

    • ENVIRONMENT_VARIABLE_FORCE_RECORDING

      public static final String ENVIRONMENT_VARIABLE_FORCE_RECORDING
      Environment variable for forcing recording.
      See Also:
    • ENVIRONMENT_VARIABLE_DISABLE_RECORDING

      public static final String ENVIRONMENT_VARIABLE_DISABLE_RECORDING
      Environment variable for disabling recorder.
      See Also:
  • Constructor Details

    • JCoRecManagedConnectionFactory

      public JCoRecManagedConnectionFactory(JCoManagedConnectionFactory factory)
      Constructor for the spring definition. Called as soon as the test class SapcoreJCoRecJUnitTest is initialized.
      Parameters:
      factory - the JCoManagedConnectionFactory to wrap.
  • Method Details

    • getManagedConnection

      public JCoConnection getManagedConnection(String connectionName, String callerId)
      Description copied from interface: JCoManagedConnectionFactory
      Returns a managed connection by a given connection name.
      Specified by:
      getManagedConnection in interface JCoManagedConnectionFactory
      Parameters:
      connectionName - name of the connection
      callerId - id for identifying the caller used for debugging
      Returns:
      managed connection instance
    • getManagedConnection

      public JCoConnection getManagedConnection(String connectionName, String callerId, String destinationName)
      Description copied from interface: JCoManagedConnectionFactory
      Returns a managed connection by a given connection name.
      Specified by:
      getManagedConnection in interface JCoManagedConnectionFactory
      Parameters:
      connectionName - name of the connection
      callerId - id for identifying the caller used for debugging
      destinationName - name of the destination to be used
      Returns:
      managed connection instance
    • getRecordingMode

      protected JCoRecMode getRecordingMode()
      Getter for the local attribute recordingMode.
      Returns:
      the current value of mode.
    • startRecorder

      public void startRecorder(JCoRecMode recordingMode, String directoryPath, String key)
      Starts recorder.
      Parameters:
      recordingMode - recording mode
      directoryPath - directory path
      key - unique key for creating the repository file name
    • stopRecorder

      public void stopRecorder()
      Stops recorder. In case of recorder mode recording the repository is saved.
    • testFailed

      public void testFailed()
      Notify recorder that the test has failed.
    • isForceRecording

      public boolean isForceRecording()
      Returns if force recording is set.
      Considers environment variable which overrules settings in coding.
      Returns:
      the forceRecording
    • setForceRecording

      public void setForceRecording(boolean forceRecording)
      Setter for force recording.
      Parameters:
      forceRecording - the forceRecording to set
    • isDisableRecorder

      public boolean isDisableRecorder()
      Returns if recorder is disabled.
      Considers environment variable which overrules settings in coding.
      Returns:
      the disableRecorder
    • setDisableRecorder

      public void setDisableRecorder(boolean disableRecorder)
      Setter for disable recorder.
      Parameters:
      disableRecorder - the disableRecorder to set