dialog = builder.buildDialog( builder.buildOkCancelHelpActions( HelpUrls.TESTCASEOPTIONS_HELP_URL ),
"Specify general options for this TestCase", UISupport.OPTIONS_ICON );
}
StringToStringMap values = new StringToStringMap();
values.put( SEARCH_PROPERTIES, String.valueOf( testCase.getSearchProperties() ) );
values.put( KEEP_SESSION, String.valueOf( testCase.getKeepSession() ) );
values.put( FAIL_ON_ERROR, String.valueOf( testCase.getFailOnError() ) );
values.put( FAIL_TESTCASE_ON_ERROR, String.valueOf( testCase.getFailTestCaseOnErrors() ) );
values.put( DISCARD_OK_RESULTS, String.valueOf( testCase.getDiscardOkResults() ) );
values.put( SOCKET_TIMEOUT, String.valueOf( testCase.getSettings().getString( HttpSettings.SOCKET_TIMEOUT, "" ) ) );
values.put( TESTCASE_TIMEOUT, String.valueOf( testCase.getTimeout() ) );
values.put( MAXRESULTS, String.valueOf( testCase.getMaxResults() ) );
values.put( WS_RM_ENABLED, String.valueOf( testCase.getWsrmEnabled() ) );
values.put( WS_RM_VERSION, String.valueOf( testCase.getWsrmVersion() ) );
if( testCase.getWsrmAckTo() != null )
values.put( WS_RM_ACK_TO, String.valueOf( testCase.getWsrmAckTo() ) );
if( testCase.getWsrmExpires() != 0 )
values.put( WS_RM_EXPIRES, String.valueOf( testCase.getWsrmExpires() ) );
values.put( AMF_AUTHORISATION_ENABLE, String.valueOf( testCase.getAmfAuthorisation() ) );
values.put( AMF_ENDPOINT, String.valueOf( testCase.getAmfEndpoint() ) );
values.put( AMF_LOGIN, String.valueOf( testCase.getAmfLogin() ) );
values.put( AMF_PASSWORD, String.valueOf( testCase.getAmfPassword() ) );
dialog.getFormField( FAIL_TESTCASE_ON_ERROR ).setEnabled(
!Boolean.parseBoolean( String.valueOf( testCase.getFailOnError() ) ) );
values = dialog.show( values );
if( dialog.getReturnValue() == XFormDialog.OK_OPTION )
{
try
{
testCase.setSearchProperties( Boolean.parseBoolean( values.get( SEARCH_PROPERTIES ) ) );
testCase.setKeepSession( Boolean.parseBoolean( values.get( KEEP_SESSION ) ) );
testCase.setDiscardOkResults( Boolean.parseBoolean( values.get( DISCARD_OK_RESULTS ) ) );
testCase.setFailOnError( Boolean.parseBoolean( values.get( FAIL_ON_ERROR ) ) );
testCase.setFailTestCaseOnErrors( Boolean.parseBoolean( values.get( FAIL_TESTCASE_ON_ERROR ) ) );
testCase.setTimeout( Long.parseLong( values.get( TESTCASE_TIMEOUT ) ) );
testCase.setMaxResults( Integer.parseInt( values.get( MAXRESULTS ) ) );
testCase.setWsrmEnabled( Boolean.parseBoolean( values.get( WS_RM_ENABLED ) ) );
testCase.setWsrmVersion( values.get( WS_RM_VERSION ) );
testCase.setWsrmAckTo( values.get( WS_RM_ACK_TO ) );
if( values.get( WS_RM_EXPIRES ) != null && values.get( WS_RM_EXPIRES ).length() > 0 )
testCase.setWsrmExpires( Long.parseLong( values.get( WS_RM_EXPIRES ) ) );
String timeout = values.get( SOCKET_TIMEOUT );
if( timeout.trim().length() == 0 )
testCase.getSettings().clearSetting( HttpSettings.SOCKET_TIMEOUT );
else
testCase.getSettings().setString( HttpSettings.SOCKET_TIMEOUT, timeout );
testCase.setAmfAuthorisation( Boolean.parseBoolean( values.get( AMF_AUTHORISATION_ENABLE ) ) );
testCase.setAmfEndpoint( values.get( AMF_ENDPOINT ) );
testCase.setAmfLogin( values.get( AMF_LOGIN ) );
testCase.setAmfPassword( values.get( AMF_PASSWORD ) );
}
catch( Exception e1 )
{
UISupport.showErrorMessage( e1.getMessage() );
}