Package com.eviware.soapui.model.settings

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


    dialog.setBooleanValue( SettingsForm.CANCEL_RUNNING, loadTest.getCancelOnReachedLimit() );
    dialog.setIntValue( SettingsForm.STRATEGY_INTERVAL, ( int )loadTest.getStrategyInterval() );
    dialog.setBooleanValue( SettingsForm.CANCEL_EXCESSIVE, loadTest.getCancelExcessiveThreads() );
    dialog.setBooleanValue( SettingsForm.TESTSTEP_STATISTICS, loadTest.getUpdateStatisticsPerTestStep() );

    Settings settings = loadTest.getSettings();

    dialog.setBooleanValue( SettingsForm.INCLUDE_REQUEST,
        settings.getBoolean( HttpSettings.INCLUDE_REQUEST_IN_TIME_TAKEN ) );
    dialog.setBooleanValue( SettingsForm.INCLUDE_RESPONSE,
        settings.getBoolean( HttpSettings.INCLUDE_RESPONSE_IN_TIME_TAKEN ) );
    dialog.setBooleanValue( SettingsForm.CLOSE_CONNECTIONS, settings.getBoolean( HttpSettings.CLOSE_CONNECTIONS ) );

    dialog.setValue( LogForm.LOG_FOLDER, loadTest.getStatisticsLogFolder() );
    dialog.setIntValue( LogForm.LOG_INTERVAL, ( int )loadTest.getStatisticsLogInterval() );
    dialog.setBooleanValue( LogForm.LOG_ON_THREADCOUNT_CHANGE, loadTest.getLogStatisticsOnThreadChange() );

    if( dialog.show() && !loadTest.isRunning() )
    {
      try
      {
        loadTest.setStartDelay( dialog.getIntValue( SettingsForm.THREAD_STARTUP_DELAY, loadTest.getStartDelay() ) );
        loadTest.setResetStatisticsOnThreadCountChange( dialog.getBooleanValue( SettingsForm.RESET_STATISTICS ) );
        loadTest.setCalculateTPSOnTimePassed( dialog.getBooleanValue( SettingsForm.CALC_TPS ) );
        loadTest.setSampleInterval( dialog.getIntValue( SettingsForm.SAMPLE_INTERVAL,
            ( int )loadTest.getSampleInterval() ) );
        loadTest.setHistoryLimit( dialog.getBooleanValue( SettingsForm.DISABLE_HISTORY ) ? 0 : -1 );
        loadTest.setMaxAssertionErrors( dialog.getIntValue( SettingsForm.MAX_ASSERTIONS, 1000 ) );
        loadTest.setCancelOnReachedLimit( dialog.getBooleanValue( SettingsForm.CANCEL_RUNNING ) );
        loadTest.setStrategyInterval( dialog.getIntValue( SettingsForm.STRATEGY_INTERVAL,
            WsdlLoadTest.DEFAULT_STRATEGY_INTERVAL ) );
        loadTest.setCancelExcessiveThreads( dialog.getBooleanValue( SettingsForm.CANCEL_EXCESSIVE ) );
        loadTest.setUpdateStatisticsPerTestStep( dialog.getBooleanValue( SettingsForm.TESTSTEP_STATISTICS ) );

        settings.setBoolean( HttpSettings.INCLUDE_REQUEST_IN_TIME_TAKEN,
            dialog.getBooleanValue( SettingsForm.INCLUDE_REQUEST ) );
        settings.setBoolean( HttpSettings.INCLUDE_RESPONSE_IN_TIME_TAKEN,
            dialog.getBooleanValue( SettingsForm.INCLUDE_RESPONSE ) );
        settings.setBoolean( HttpSettings.CLOSE_CONNECTIONS,
            dialog.getBooleanValue( SettingsForm.CLOSE_CONNECTIONS ) );

        loadTest.setLogStatisticsOnThreadChange( dialog.getBooleanValue( LogForm.LOG_ON_THREADCOUNT_CHANGE ) );
        loadTest.setStatisticsLogFolder( dialog.getValue( LogForm.LOG_FOLDER ) );
        loadTest.setStatisticsLogInterval( dialog.getIntValue( LogForm.LOG_INTERVAL,
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 Object construct()
    {
      HttpClient httpClient = HttpClientSupport.getHttpClient();
      try
      {
        Settings soapuiSettings = SoapUI.getSettings();

        HttpClientSupport.applyHttpSettings( getMethod, soapuiSettings );
        HostConfiguration hostConfiguration = ProxyUtils.initProxySettings( soapuiSettings, state,
            new HostConfiguration(), getMethod.getURI().toString(), contextModelItem == null ? null
                : new DefaultPropertyExpansionContext( contextModelItem ) );
View Full Code Here

    // check for authorization prerequisites
    if( username == null || username.length() == 0 )
      return;

    Settings settings = wsdlRequest.getSettings();
    String password = PropertyExpander.expandProperties( context, wsdlRequest.getPassword() );
    String domain = PropertyExpander.expandProperties( context, wsdlRequest.getDomain() );

    String wssPasswordType = null;
View Full Code Here

  private ArgumentBuilder buildArgs( File reportFile, WsdlMockResponse 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, WsdlMockResponse 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

      filter.filterRequest( submitContext, httpRequest );
    }

    try
    {
      Settings settings = httpRequest.getSettings();

      // custom http headers last so they can be overridden
      StringToStringsMap headers = httpRequest.getRequestHeaders();

      // first remove so we don't get any unwanted duplicates
      for( String header : headers.keySet() )
      {
        httpMethod.removeRequestHeader( header );
      }

      // now add
      for( String header : headers.keySet() )
      {
        for( String headerValue : headers.get( header ) )
        {
          headerValue = PropertyExpander.expandProperties( submitContext, headerValue );
          httpMethod.addRequestHeader( header, headerValue );
        }
      }

      // do request
      WsdlProject project = ( WsdlProject )ModelSupport.getModelItemProject( httpRequest );
      WssCrypto crypto = null;
      if( project != null && project.getWssContainer() != null )
      {
        crypto = project.getWssContainer().getCryptoByName(
            PropertyExpander.expandProperties( submitContext, httpRequest.getSslKeystore() ) );
      }

      if( crypto != null && WssCrypto.STATUS_OK.equals( crypto.getStatus() ) )
      {
        hostConfiguration.getParams().setParameter( SoapUIHostConfiguration.SOAPUI_SSL_CONFIG,
            crypto.getSource() + " " + crypto.getPassword() );
      }

      // dump file?
      httpMethod.setDumpFile( PathUtils.expandPath( httpRequest.getDumpFile(),
          ( AbstractWsdlModelItem<?> )httpRequest, submitContext ) );

      // fix absolute URIs due to peculiarity in httpclient
      URI uri = ( URI )submitContext.getProperty( BaseHttpRequestTransport.REQUEST_URI );
      if( uri != null && uri.isAbsoluteURI() )
      {
        hostConfiguration.setHost( uri.getHost(), uri.getPort() );
        String str = uri.toString();
        int ix = str.indexOf( '/', str.indexOf( "//" ) + 2 );
        if( ix != -1 )
        {
          uri = new URI( str.substring( ix ), true );
          String qs = httpMethod.getQueryString();
          httpMethod.setURI( uri );
          if( StringUtils.hasContent( qs ) )
            httpMethod.setQueryString( qs );

          submitContext.setProperty( BaseHttpRequestTransport.REQUEST_URI, uri );
        }
      }

      // include request time?
      if( settings.getBoolean( HttpSettings.INCLUDE_REQUEST_IN_TIME_TAKEN ) )
        httpMethod.initStartTime();

      // submit!
      httpClient.executeMethod( hostConfiguration, httpMethod, httpState );
      httpMethod.getTimeTaken();
View Full Code Here

      SoapUI.logError( e1 );
    }

    if( !httpMethod.isFailed() )
    {
      Settings settings = httpRequest.getSettings();
      if( settings.getBoolean( HttpSettings.INCLUDE_RESPONSE_IN_TIME_TAKEN ) )
      {
        try
        {
          httpMethod.getResponseBody();
        }
View Full Code Here

    // clone entire testCase
    WsdlTestCase tc = testCase.getTestSuite().buildTestCase( config, true );
    tc.afterLoad();
    tc.addTestRunListener( testRunListener );
    Settings settings = tc.getSettings();
    settings.setBoolean( HttpSettings.INCLUDE_REQUEST_IN_TIME_TAKEN,
        loadTest.getSettings().getBoolean( HttpSettings.INCLUDE_REQUEST_IN_TIME_TAKEN ) );
    settings.setBoolean( HttpSettings.INCLUDE_RESPONSE_IN_TIME_TAKEN,
        loadTest.getSettings().getBoolean( HttpSettings.INCLUDE_RESPONSE_IN_TIME_TAKEN ) );
    settings.setBoolean( HttpSettings.CLOSE_CONNECTIONS,
        loadTest.getSettings().getBoolean( HttpSettings.CLOSE_CONNECTIONS ) );

    // disable default pretty-printing since it takes time
    settings.setBoolean( WsdlSettings.PRETTY_PRINT_RESPONSE_MESSAGES, false );

    // don't discard.. the WsdlLoadTests internal listener will discard after
    // asserting..
    tc.setDiscardOkResults( false );
    tc.setMaxResults( 0 );
View Full Code Here

            }
        }
    }

    public static void initAutoSaveTimer() {
        Settings settings = SoapUI.getSettings();
        long interval = settings.getLong(UISettings.AUTO_SAVE_INTERVAL, 0);

        if (autoSaveTimerTask != null) {
            if (interval == 0) {
                SoapUI.log("Cancelling AutoSave Timer");
            }
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.