TestRecorderFilter.instance().getWebapp() + " )";
forward( request, response, msg, Constants.RECORD_PAGE, true );
return;
}
// may throw IOException or SecurityException
RecordSession session = null;
try {
session = getRecordSession( test, overwrite, testUser, description );
if ( description != null ) {
test.setDescription( description );
}
TestRecorderFilter.instance().getTestDefinitions().add( test );
}
catch ( Exception ex ) {
String msg = "ERROR: unable to start recording, unable to obtain session, exception( " +
ex.getMessage() + " )";
forward( request, response, msg, Constants.RECORD_PAGE, true, ex );
return;
}
if ( log.isDebugEnabled() ) {
log.debug( "attempting to start recording session( " + session + " )" );
}
TestRecorderFilter filter = TestRecorderFilter.instance();
boolean start = false;
try {
// may throw IOException
start = filter.getState().recordStart( session );
}
catch ( Exception ex ) {
String msg = "ERROR: failed to start recording, exception( " + ex.getMessage() + " )";
forward( request, response, msg, Constants.RECORD_PAGE, true, ex );
return;
}
if ( log.isInfoEnabled() ) {
log.info( "start( " + start + " )" );
}
if ( start ) {
String msg = "recording session( " + session.getSessionName() + " ) started.";
request.setAttribute( Constants.RECORD_SESSION_ATTRIBUTE, session );
if ( log.isInfoEnabled() ) {
log.info( msg );
}
forward( request, response, msg, Constants.RECORD_PAGE, false );
}
else {
String msg = "ERROR: recording session( " +
session.getSessionName() + " ) already started.";
request.setAttribute( Constants.RECORD_SESSION_ATTRIBUTE, filter.getState().getRecordingSession() );
forward( request, response, msg, Constants.RECORD_PAGE, true );
}
}