Package com.eviware.soapui.model.settings

Examples of com.eviware.soapui.model.settings.Settings


      catch( Throwable e )
      {
        SoapUI.log( e );
      }

      Settings settings = SoapUI.getSettings();

      connectionManager = new SoapUIMultiThreadedHttpConnectionManager();
      connectionManager.getParams().setDefaultMaxConnectionsPerHost(
          ( int )settings.getLong( HttpSettings.MAX_CONNECTIONS_PER_HOST, 500 ) );
      connectionManager.getParams().setMaxTotalConnections(
          ( int )settings.getLong( HttpSettings.MAX_TOTAL_CONNECTIONS, 2000 ) );
      httpClient = new HttpClient( connectionManager );

      settings.addSettingsListener( new SSLSettingsListener() );
    }
View Full Code Here


    }

    private void initKeyMaterial( EasySSLProtocolSocketFactory easySSL ) throws IOException,
        NoSuchAlgorithmException, KeyStoreException, KeyManagementException, CertificateException
    {
      Settings settings = SoapUI.getSettings();

      String keyStore = settings.getString( SSLSettings.KEYSTORE, null );
      keyStore = keyStore != null ? keyStore.trim() : "";
      String pass = settings.getString( SSLSettings.KEYSTORE_PASSWORD, "" );
      char[] pwd = pass.toCharArray();
      if( !"".equals( keyStore ) )
      {
        log.info( "Initializing KeyStore" );
View Full Code Here

    return server.isRunning();
  }

  public void start( SoapMonitor soapMonitor, int localPort )
  {
    Settings settings = soapMonitor.getProject().getSettings();
    server.setThreadPool( new SoapUIJettyThreadPool() );
    Context context = new Context( server, ROOT, 0 );

    if( sslEndpoint != null )
    {
      if( sslEndpoint.startsWith( HTTPS ) )
      {
        sslConnector = new SslSocketConnector();
        sslConnector
            .setKeystore( settings.getString( SoapMonitorAction.SecurityTabForm.SSLTUNNEL_KEYSTORE, "JKS" ) );
        sslConnector.setPassword( settings.getString( SoapMonitorAction.SecurityTabForm.SSLTUNNEL_PASSWORD, "" ) );
        sslConnector.setKeyPassword( settings.getString( SoapMonitorAction.SecurityTabForm.SSLTUNNEL_KEYPASSWORD,
            "" ) );
        sslConnector.setTruststore( settings.getString( SoapMonitorAction.SecurityTabForm.SSLTUNNEL_TRUSTSTORE,
            "JKS" ) );
        sslConnector.setTrustPassword( settings.getString(
            SoapMonitorAction.SecurityTabForm.SSLTUNNEL_TRUSTSTORE_PASSWORD, "" ) );
        sslConnector.setNeedClientAuth( false );
        sslConnector.setMaxIdleTime( 30000 );
        sslConnector.setPort( localPort );
View Full Code Here

    toolHost.run( new WSIProcessToolRunner( builder, reportFile, modelItem ) );
  }

  private ArgumentBuilder buildArgs( File wsiToolDir, File reportFile, Interface modelItem ) throws IOException
  {
    Settings settings = modelItem.getSettings();

    ConfigurationDocument configDoc = createConfigFile( reportFile, settings, ( WsdlInterface )modelItem );
    configFile = configDoc.toString();

    File file = File.createTempFile( "wsi-analyzer-config", ".xml" );

    configDoc.save( file );

    ArgumentBuilder builder = new ArgumentBuilder( new StringToStringMap() );
    builder.startScript( wsiToolDir.getAbsolutePath() + File.separator + "Analyzer", ".bat", ".sh" );

    builder.addArgs( "-config", file.getAbsolutePath() );

    // add this to command-line due to bug in wsi-tools (?)
    if( settings.getBoolean( WSISettings.ASSERTION_DESCRIPTION ) )
      builder.addArgs( "-assertionDescription", "true" );

    return builder;
  }
View Full Code Here

  private ArgumentBuilder buildArgs( File reportFile, WsdlRequest modelItem ) throws Exception
  {
    File logFile = buildLog( modelItem );
    File file = buildConfig( reportFile, logFile, modelItem );
    Settings settings = modelItem.getSettings();

    ArgumentBuilder builder = new ArgumentBuilder( new StringToStringMap() );
    builder.startScript( "Analyzer", ".bat", ".sh" );

    builder.addArgs( "-config", file.getAbsolutePath() );

    // add this to command-line due to bug in wsi-tools (?)
    if( settings.getBoolean( WSISettings.ASSERTION_DESCRIPTION ) )
      builder.addArgs( "-assertionDescription", "true" );

    return builder;
  }
View Full Code Here

    return logFile;
  }

  private File buildConfig( File reportFile, File logFile, WsdlRequest modelItem ) throws IOException
  {
    Settings settings = modelItem.getSettings();

    ConfigurationDocument configDoc = ConfigurationDocument.Factory.newInstance();
    Configuration config = configDoc.addNewConfiguration();

    config.setVerbose( settings.getBoolean( WSISettings.VERBOSE ) );
    AssertionResults results = config.addNewAssertionResults();
    results.setType( AssertionResults.Type.Enum.forString( settings.getString( WSISettings.RESULTS_TYPE,
        AssertionResults.Type.ONLY_FAILED.toString() ) ) );

    results.setMessageEntry( settings.getBoolean( WSISettings.MESSAGE_ENTRY ) );
    results.setFailureMessage( settings.getBoolean( WSISettings.FAILURE_MESSAGE ) );
    results.setAssertionDescription( settings.getBoolean( WSISettings.ASSERTION_DESCRIPTION ) );

    ReportFile report = config.addNewReportFile();
    report.setLocation( reportFile.getAbsolutePath() );
    report.setReplace( true );
View Full Code Here

    {
      dialog = ADialogBuilder.buildTabbedDialog( WizardForm.class, null );
      dialog.setSize( 650, 500 );
    }

    Settings settings = project.getSettings();

    StringList endpoints = new StringList();
    endpoints.add( null );

    for( Interface iface : ModelSupport.getChildren( project, WsdlInterface.class ) )
    {
      endpoints.addAll( iface.getEndpoints() );
    }

    XFormDialogBuilder builder = XFormFactory.createDialogBuilder( "Launch LoadTestRunner" );
    generalForm = builder.createForm( "General" );

    dialog.setIntValue( LaunchForm.PORT, ( int )settings.getLong( LaunchForm.PORT, 8081 ) );
    dialog.setOptions( LaunchForm.REQUEST_WSS,
        StringUtils.merge( project.getWssContainer().getIncomingWssNames(), "<none>" ) );
    dialog.setOptions( LaunchForm.RESPONSE_WSS,
        StringUtils.merge( project.getWssContainer().getIncomingWssNames(), "<none>" ) );
    dialog.setValue( LaunchForm.SETSSLMON,
        settings.getString( LaunchForm.SETSSLMON, "" ).length() > 0 ? settings.getString( LaunchForm.SETSSLMON, "" )
            : HTTPS_PROTOCOL );
    dialog.setOptions( LaunchForm.SSLORHTTP, new String[] { HTTP_TUNNEL, HTTP_PROXY } );

    dialog.setValue( SecurityTabForm.SSLTUNNEL_KEYSTORE, settings.getString( SecurityTabForm.SSLTUNNEL_KEYSTORE, "" ) );
    dialog.setValue( SecurityTabForm.SSLTUNNEL_PASSWORD, settings.getString( SecurityTabForm.SSLTUNNEL_PASSWORD, "" ) );
    dialog.setValue( SecurityTabForm.SSLTUNNEL_KEYPASSWORD,
        settings.getString( SecurityTabForm.SSLTUNNEL_KEYPASSWORD, "" ) );
    dialog.setValue( SecurityTabForm.SSLTUNNEL_TRUSTSTORE,
        settings.getString( SecurityTabForm.SSLTUNNEL_TRUSTSTORE, "" ) );
    dialog.setValue( SecurityTabForm.SSLTUNNEL_TRUSTSTORE_PASSWORD,
        settings.getString( SecurityTabForm.SSLTUNNEL_TRUSTSTORE_PASSWORD, "" ) );
    dialog.setBooleanValue( LaunchForm.SSLTUNNEL_REUSESTATE, settings.getBoolean( LaunchForm.SSLTUNNEL_REUSESTATE ) );
    dialog.setValue( LaunchForm.SET_CONTENT_TYPES,
        settings.getString( LaunchForm.SET_CONTENT_TYPES, defaultContentTypes() ) );
    dialog.setValue( SecurityTabForm.SSLTUNNEL_KEYSTOREPATH,
        settings.getString( SecurityTabForm.SSLTUNNEL_KEYSTOREPATH, "" ) );
    dialog.setValue( SecurityTabForm.SSLTUNNEL_KEYSTOREPASSWORD,
        settings.getString( SecurityTabForm.SSLTUNNEL_KEYSTOREPASSWORD, "" ) );

    XFormField sslOrHttp = dialog.getFormField( LaunchForm.SSLORHTTP );
    sslOrHttp.setValue( HTTP_PROXY );
    setDialogState( HTTP_PROXY );
    sslOrHttp.addFormFieldListener( new XFormFieldListener()
    {

      public void valueChanged( XFormField sourceField, String newValue, String oldValue )
      {
        setDialogState( newValue );
      }

    } );

    if( dialog.show() )
    {
      try
      {
        UISupport.setHourglassCursor();

        int listenPort = dialog.getIntValue( LaunchForm.PORT, 8080 );
        settings.setLong( LaunchForm.PORT, listenPort );

        settings.setString( LaunchForm.SETSSLMON, dialog.getValue( LaunchForm.SETSSLMON ) );

        settings.setString( SecurityTabForm.SSLTUNNEL_KEYSTORE,
            dialog.getValue( SecurityTabForm.SSLTUNNEL_KEYSTORE ) );
        settings.setString( SecurityTabForm.SSLTUNNEL_PASSWORD,
            dialog.getValue( SecurityTabForm.SSLTUNNEL_PASSWORD ) );
        settings.setString( SecurityTabForm.SSLTUNNEL_KEYPASSWORD,
            dialog.getValue( SecurityTabForm.SSLTUNNEL_KEYPASSWORD ) );
        settings.setString( SecurityTabForm.SSLTUNNEL_TRUSTSTORE,
            dialog.getValue( SecurityTabForm.SSLTUNNEL_TRUSTSTORE ) );
        settings.setString( SecurityTabForm.SSLTUNNEL_TRUSTSTORE_PASSWORD,
            dialog.getValue( SecurityTabForm.SSLTUNNEL_TRUSTSTORE_PASSWORD ) );
        settings.setString( LaunchForm.SSLTUNNEL_REUSESTATE, dialog.getValue( LaunchForm.SSLTUNNEL_REUSESTATE ) );
        settings.setString( SecurityTabForm.SSLTUNNEL_KEYSTOREPATH,
            dialog.getValue( SecurityTabForm.SSLTUNNEL_KEYSTOREPATH ) );
        if( dialog.getValue( LaunchForm.SET_CONTENT_TYPES ) != null
            && dialog.getValue( LaunchForm.SET_CONTENT_TYPES ).trim().equals( "" ) )
        {
          settings.setString( LaunchForm.SET_CONTENT_TYPES, defaultContentTypes() );
        }
        else
        {
          settings.setString( LaunchForm.SET_CONTENT_TYPES, dialog.getValue( LaunchForm.SET_CONTENT_TYPES ) );
        }

        settings.setString( SecurityTabForm.SSLTUNNEL_KEYSTOREPASSWORD,
            dialog.getValue( SecurityTabForm.SSLTUNNEL_KEYSTOREPASSWORD ) );

        // load all interfaces in project
        for( Interface iface : project.getInterfaceList() )
        {
View Full Code Here

      if( dialog == null )
      {
        dialog = ADialogBuilder.buildDialog( Form.class );
      }

      Settings settings = target.getSettings();
      dialog.setValue( Form.OUTPUT_FOLDER, settings.getString( REPORT_DIRECTORY_SETTING, "" ) );

      if( !dialog.show() )
      {
        return;
      }

      settings.setString( REPORT_DIRECTORY_SETTING, dialog.getValue( Form.OUTPUT_FOLDER ) );

      final File reportDirectory = new File( settings.getString( REPORT_DIRECTORY_SETTING, "" ) );
      String reportDirAbsolutePath = reportDirectory.getAbsolutePath();
      String filename = reportDirAbsolutePath + File.separatorChar + "report.xml";
      String reportUrl = transform( target, reportDirAbsolutePath, filename );
      Tools.openURL( reportUrl );
    }
View Full Code Here

  public boolean show( String initialTab )
  {
    if( dialog == null )
      buildDialog();

    Settings settings = SoapUI.getSettings();
    for( Prefs pref : prefs )
      pref.setFormValues( settings );

    if( initialTab != null )
    {
View Full Code Here

        proxyConf.setAuthenticationHandler( ServerType.HTTP, new AuthenticationHandler()
        {
          @Override
          public ProxyServerLogin authenticationRequired( ServerType arg0 )
          {
            Settings settings = SoapUI.getSettings();
            PropertyExpansionContext context = null;

            String proxyUsername = PropertyExpander.expandProperties( context,
                settings.getString( ProxySettings.USERNAME, null ) );
            String proxyPassword = PropertyExpander.expandProperties( context,
                settings.getString( ProxySettings.PASSWORD, null ) );

            return new ProxyServerLogin( proxyUsername, proxyPassword );
          }
        } );

        proxyAuthenticationInitialized = true;
      }

      if( ProxyUtils.isProxyEnabled() )
      {
        Settings settings = SoapUI.getSettings();
        PropertyExpansionContext context = null;

        // check system properties first
        String proxyHost = System.getProperty( "http.proxyHost" );
        String proxyPort = System.getProperty( "http.proxyPort" );

        if( proxyHost == null )
          proxyHost = PropertyExpander.expandProperties( context, settings.getString( ProxySettings.HOST, "" ) );

        if( proxyPort == null )
          proxyPort = PropertyExpander.expandProperties( context, settings.getString( ProxySettings.PORT, "" ) );

        proxyConf.setProxy( ServerType.HTTP, new ProxyServer( proxyHost, Integer.parseInt( proxyPort ) ) );
        // check excludes
        proxyConf.setExceptions( PropertyExpander.expandProperties( context,
            settings.getString( ProxySettings.EXCLUDES, "" ) ) );
      }
      else
      {
        proxyConf.setDirectConnection();
      }
View Full Code Here

TOP

Related Classes of com.eviware.soapui.model.settings.Settings

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.