Package com.eviware.soapui.impl.wsdl.loadtest

Examples of com.eviware.soapui.impl.wsdl.loadtest.WsdlLoadTest


  {
    HashMap<String, String> samplerSettings = new HashMap<String, String>();
    try
    {
      String loadTestName = loadTests[0];
      WsdlLoadTest loadTest = ( WsdlLoadTest )testCase.getLoadTestByName( loadTestName );
      HashMap<String, Object> firstSamplerSettings = exportLoadTestToLoadUI( loadTest, loadUIProject,
          CREATE_NEW_OPTION, CREATE_NEW_OPTION );
      // String loadUITestCaseAddedTo = ( String )firstSamplerSettings.get(
      // ContextMapping.LOADUI_TEST_CASE_NAME );
      String loadUIProjectAddedTo = ( String )firstSamplerSettings.get( ContextMapping.LOADUI_PROJECT_NAME );
View Full Code Here


      HashMap<String, Object> firstSamplerSettings = new HashMap<String, Object>();
      // String loadUITestCaseAddedTo = "";
      String loadUIProjectAddedTo = "";
      if( testCase != null )
      {
        WsdlLoadTest loadTest = ( WsdlLoadTest )testCase.getLoadTestByName( loadTestName );
        if( loadTest != null )
        {
          firstSamplerSettings = exportLoadTestToLoadUI( loadTest, loadUIProject, CREATE_NEW_OPTION,
              CREATE_NEW_OPTION );
          // loadUITestCaseAddedTo = ( String )firstSamplerSettings.get(
          // ContextMapping.LOADUI_TEST_CASE_NAME );
          loadUIProjectAddedTo = ( String )firstSamplerSettings.get( ContextMapping.LOADUI_PROJECT_NAME );
        }

      }

      for( int i = 1; i < loadTests.length; i++ )
      {
        compositeLoadTestName = loadTests[i];
        loadTestName = loadTests[i];
        WsdlLoadTest loadTest = ( WsdlLoadTest )testCase.getLoadTestByName( loadTestName );
        testCaseName = names[0];
        loadTestName = names[1];
        testCase = testSuite.getTestCaseByName( testCaseName );
        if( testCase != null )
        {
View Full Code Here

    return assertionsTable;
  }

  protected JComponent buildToolbar()
  {
    WsdlLoadTest loadTest = getModelItem();

    JXToolBar toolbar = UISupport.createToolbar();

    // ButtonBarBuilder builder = new ButtonBarBuilder();
    runButton = UISupport.createToolbarButton( new RunLoadTestAction() );
    cancelButton = UISupport.createToolbarButton( new CancelRunTestCaseAction(), false );
    resetButton = UISupport.createToolbarButton( new ResetAction() );
    exportButton = UISupport.createToolbarButton( new ExportStatisticsAction( loadTest.getStatisticsModel() ) );

    statisticsGraphButton = UISupport.createToolbarButton( new ShowStatisticsGraphAction() );
    testTimesGraphButton = UISupport.createToolbarButton( new ShowTestTimesGraphAction() );

    statisticsGraphButton.setEnabled( getModelItem().getHistoryLimit() != 0 );
    testTimesGraphButton.setEnabled( getModelItem().getHistoryLimit() != 0 );

    AbstractAction optionsDelegate = SwingActionDelegate.createDelegate( LoadTestOptionsAction.SOAPUI_ACTION_ID,
        loadTest );
    optionsDelegate.putValue( Action.SMALL_ICON, UISupport.createImageIcon( "/options.gif" ) );
    optionsButton = UISupport.createToolbarButton( optionsDelegate );
    convertToLoadUIButton = UISupport.createToolbarButton( SwingActionDelegate.createDelegate(
        ConvertToLoadUIAction.SOAPUI_ACTION_ID, getModelItem(), null, "/convertLoadTestToLoadUI.png" ) );

    strategyCombo = new JComboBox( LoadStrategyRegistry.getInstance().getStrategies() );
    strategyCombo.setToolTipText( "Selects which LoadTest Strategy to use" );
    UISupport.setPreferredHeight( strategyCombo, 18 );
    strategyCombo.setSelectedItem( loadTest.getLoadStrategy().getType() );
    strategyCombo.addItemListener( new ItemListener()
    {
      public void itemStateChanged( ItemEvent e )
      {
        Object item = e.getItem();
        if( item == null )
          return;

        setLoadStrategy( item.toString() );
      }
    } );

    toolbar.add( runButton );
    toolbar.add( cancelButton );
    toolbar.add( statisticsGraphButton );
    toolbar.add( testTimesGraphButton );
    toolbar.add( resetButton );
    toolbar.add( exportButton );

    toolbar.add( optionsButton );
    toolbar.add( convertToLoadUIButton );
    toolbar.add( UISupport.createToolbarButton( new ShowOnlineHelpAction( HelpUrls.LOADTESTEDITOR_HELP_URL ) ) );
    toolbar.add( Box.createHorizontalGlue() );
    buildLimitBar( toolbar );
    toolbar.addSeparator();

    progressBar = new JProgressBar( 0, 100 );
    progressBar.setPreferredSize( new Dimension( 70, 20 ) );

    toolbar.addFixed( progressBar );

    ButtonBarBuilder builder = new ButtonBarBuilder();

    builder.addFixed( new JLabel( "Threads:" ) );
    builder.addRelatedGap();

    threadsSpinner = new JSpinner( new SpinnerNumberModel( getModelItem().getThreadCount(), 1, 9999, 1 ) );
    threadsSpinner.setToolTipText( "Sets the number of threads (\"Virtual Users\") to run this TestCase" );
    UISupport.setPreferredHeight( threadsSpinner, 18 );
    threadsSpinner.getModel().addChangeListener( new ChangeListener()
    {

      public void stateChanged( ChangeEvent e )
      {
        getModelItem().setThreadCount( ( ( SpinnerNumberModel )threadsSpinner.getModel() ).getNumber().intValue() );
      }
    } );

    builder.addFixed( threadsSpinner );
    builder.addUnrelatedGap();

    LoadStrategy loadStrategy = loadTest.getLoadStrategy();

    builder.addFixed( new JLabel( "Strategy" ) );
    builder.addRelatedGap();
    builder.addFixed( strategyCombo );
    builder.addUnrelatedGap();
View Full Code Here

    }
  }

  public boolean dependsOn( ModelItem modelItem )
  {
    WsdlLoadTest loadTest = getModelItem();

    return modelItem == loadTest || modelItem == loadTest.getTestCase()
        || modelItem == loadTest.getTestCase().getTestSuite()
        || modelItem == loadTest.getTestCase().getTestSuite().getProject();
  }
View Full Code Here

      putValue( Action.SHORT_DESCRIPTION, "Runs this LoadTest" );
    }

    public void actionPerformed( ActionEvent e )
    {
      WsdlLoadTest loadtest = getModelItem();
      if( loadtest.getTestCase().getTestStepCount() == 0 )
      {
        UISupport.showErrorMessage( "Missing TestSteps for testing!" );
        return;
      }

      if( loadtest.getLimitType() == LoadTestLimitTypesConfig.COUNT
          && loadtest.getTestLimit() < loadtest.getThreadCount() )
      {
        if( !UISupport.confirm( "The run limit is set to a lower count than number of threads\nRun Anyway?",
            "Run LoadTest" ) )
        {
          return;
        }
      }

      runButton.setEnabled( false );
      runner = loadtest.run();
    }
View Full Code Here

    if( !forLoadTest )
    {
      List<LoadTestConfig> loadTestConfigs = config.getLoadTestList();
      for( LoadTestConfig tsc : loadTestConfigs )
      {
        WsdlLoadTest loadTest = buildLoadTest( tsc );
        loadTests.add( loadTest );
      }
    }

    // if( !forLoadTest )
View Full Code Here

    return forLoadTest;
  }

  public WsdlLoadTest buildLoadTest( LoadTestConfig tsc )
  {
    return new WsdlLoadTest( this, tsc );
  }
View Full Code Here

    return true;
  }

  public WsdlLoadTest addNewLoadTest( String name )
  {
    WsdlLoadTest loadTest = buildLoadTest( getConfig().addNewLoadTest() );
    loadTest.setStartDelay( 0 );
    loadTest.setName( name );
    loadTests.add( loadTest );

    loadTest.addAssertion( TestStepStatusAssertion.STEP_STATUS_TYPE, LoadTestAssertion.ANY_TEST_STEP, false );

    ( getTestSuite() ).fireLoadTestAdded( loadTest );

    return loadTest;
  }
View Full Code Here

    loadTest.beforeSave();

    LoadTestConfig loadTestConfig = getConfig().addNewLoadTest();
    loadTestConfig.set( loadTest.getConfig().copy() );

    WsdlLoadTest newLoadTest = buildLoadTest( loadTestConfig );
    newLoadTest.setName( name );
    ModelSupport.unsetIds( newLoadTest );
    newLoadTest.afterLoad();
    loadTests.add( newLoadTest );

    ( getTestSuite() ).fireLoadTestAdded( newLoadTest );

    return newLoadTest;
View Full Code Here

    String name = UISupport.prompt( "Specify name of cloned LoadTest", "Clone LoadTest",
        "Copy of " + loadTest.getName() );
    if( name == null )
      return;

    WsdlLoadTest newLoadTest = loadTest.getTestCase().cloneLoadTest( loadTest, name );
    UISupport.selectAndShow( newLoadTest );
  }
View Full Code Here

TOP

Related Classes of com.eviware.soapui.impl.wsdl.loadtest.WsdlLoadTest

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.