Class JCoRecManagedConnectionFactory
- java.lang.Object
-
- de.hybris.platform.sap.core.jco.rec.impl.JCoRecManagedConnectionFactory
-
- All Implemented Interfaces:
JCoManagedConnectionFactory
public class JCoRecManagedConnectionFactory extends java.lang.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 Summary
Fields Modifier and Type Field Description static java.lang.StringENVIRONMENT_VARIABLE_DISABLE_RECORDINGEnvironment variable for disabling recorder.static java.lang.StringENVIRONMENT_VARIABLE_FORCE_RECORDINGEnvironment variable for forcing recording.
-
Constructor Summary
Constructors Constructor Description JCoRecManagedConnectionFactory(JCoManagedConnectionFactory factory)Constructor for the spring definition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JCoConnectiongetManagedConnection(java.lang.String connectionName, java.lang.String callerId)Returns a managed connection by a given connection name.JCoConnectiongetManagedConnection(java.lang.String connectionName, java.lang.String callerId, java.lang.String destinationName)Returns a managed connection by a given connection name.protected JCoRecModegetRecordingMode()Getter for the local attributerecordingMode.booleanisDisableRecorder()Returns if recorder is disabled.booleanisForceRecording()Returns if force recording is set.voidsetDisableRecorder(boolean disableRecorder)Setter for disable recorder.voidsetForceRecording(boolean forceRecording)Setter for force recording.voidstartRecorder(JCoRecMode recordingMode, java.lang.String directoryPath, java.lang.String key)Starts recorder.voidstopRecorder()Stops recorder.voidtestFailed()Notify recorder that the test has failed.
-
-
-
Field Detail
-
ENVIRONMENT_VARIABLE_FORCE_RECORDING
public static final java.lang.String ENVIRONMENT_VARIABLE_FORCE_RECORDING
Environment variable for forcing recording.- See Also:
- Constant Field Values
-
ENVIRONMENT_VARIABLE_DISABLE_RECORDING
public static final java.lang.String ENVIRONMENT_VARIABLE_DISABLE_RECORDING
Environment variable for disabling recorder.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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 Detail
-
getManagedConnection
public JCoConnection getManagedConnection(java.lang.String connectionName, java.lang.String callerId)
Description copied from interface:JCoManagedConnectionFactoryReturns a managed connection by a given connection name.- Specified by:
getManagedConnectionin interfaceJCoManagedConnectionFactory- Parameters:
connectionName- name of the connectioncallerId- id for identifying the caller used for debugging- Returns:
- managed connection instance
-
getManagedConnection
public JCoConnection getManagedConnection(java.lang.String connectionName, java.lang.String callerId, java.lang.String destinationName)
Description copied from interface:JCoManagedConnectionFactoryReturns a managed connection by a given connection name.- Specified by:
getManagedConnectionin interfaceJCoManagedConnectionFactory- Parameters:
connectionName- name of the connectioncallerId- id for identifying the caller used for debuggingdestinationName- name of the destination to be used- Returns:
- managed connection instance
-
getRecordingMode
protected JCoRecMode getRecordingMode()
Getter for the local attributerecordingMode.- Returns:
- the current value of
mode.
-
startRecorder
public void startRecorder(JCoRecMode recordingMode, java.lang.String directoryPath, java.lang.String key)
Starts recorder.- Parameters:
recordingMode- recording modedirectoryPath- directory pathkey- 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
-
-