Class JCoRecManagedConnectionFactory
java.lang.Object
de.hybris.platform.sap.core.jco.rec.impl.JCoRecManagedConnectionFactory
- All Implemented Interfaces:
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 -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for the spring definition. -
Method Summary
Modifier and TypeMethodDescriptiongetManagedConnection(String connectionName, String callerId) Returns a managed connection by a given connection name.getManagedConnection(String connectionName, String callerId, String destinationName) Returns a managed connection by a given connection name.protected JCoRecModeGetter for the local attributerecordingMode.booleanReturns if recorder is disabled.booleanReturns if force recording is set.voidsetDisableRecorder(boolean disableRecorder) Setter for disable recorder.voidsetForceRecording(boolean forceRecording) Setter for force recording.voidstartRecorder(JCoRecMode recordingMode, String directoryPath, String key) Starts recorder.voidStops recorder.voidNotify recorder that the test has failed.
-
Field Details
-
ENVIRONMENT_VARIABLE_FORCE_RECORDING
Environment variable for forcing recording.- See Also:
-
ENVIRONMENT_VARIABLE_DISABLE_RECORDING
Environment variable for disabling recorder.- See Also:
-
-
Constructor Details
-
JCoRecManagedConnectionFactory
Constructor for the spring definition. Called as soon as the test class SapcoreJCoRecJUnitTest is initialized.- Parameters:
factory- the JCoManagedConnectionFactory to wrap.
-
-
Method Details
-
getManagedConnection
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(String connectionName, String callerId, 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
Getter for the local attributerecordingMode.- Returns:
- the current value of
mode.
-
startRecorder
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
-