Package com.eviware.soapui.support.types

Examples of com.eviware.soapui.support.types.StringToObjectMap


      return PropertyExpander.expandProperties( this, content );
    }

    public StringToObjectMap getProperties()
    {
      StringToObjectMap result = new StringToObjectMap();
      Map<String, TestProperty> props = getGlobalProperties().getProperties();
      for( String key : props.keySet() )
      {
        result.put( key, props.get( key ) );
      }

      return result;
    }
View Full Code Here


    if( name.length() == 0 || name.charAt( 0 ) != '=' )
      return null;

    name = name.substring( 1 );

    StringToObjectMap objects = new StringToObjectMap( context.getProperties() );
    objects.put( "context", context );
    objects.put( "log", SoapUI.ensureGroovyLog() );

    if( context instanceof TestCaseRunContext )
    {
      TestCaseRunContext testCaseRunContext = ( TestCaseRunContext )context;
      objects.put( "testRunner", testCaseRunContext.getTestRunner() );

      objects.put( "testStep", testCaseRunContext.getCurrentStep() );

      if( testCaseRunContext.getCurrentStep() instanceof SamplerTestStep )
      {
        objects.put( "request", ( ( SamplerTestStep )testCaseRunContext.getCurrentStep() ).getTestRequest() );
      }
    }

    if( context instanceof LoadTestRunContext )
    {
      objects.put( "loadTestRunner", ( ( LoadTestRunContext )context ).getLoadTestRunner() );
    }

    if( context instanceof MockRunContext )
    {
      objects.put( "mockRunner", ( ( MockRunContext )context ).getMockRunner() );
    }

    ModelItem modelItem = context.getModelItem();
    if( modelItem instanceof TestCase )
    {
      objects.put( "testCase", modelItem );

      objects.put( "testSuite", ( ( TestCase )modelItem ).getTestSuite() );
      objects.put( "project", ( ( TestCase )modelItem ).getTestSuite().getProject() );
    }
    else if( modelItem instanceof TestStep )
    {
      objects.put( "testStep", modelItem );

      if( modelItem instanceof SamplerTestStep )
      {
        objects.put( "request", ( ( SamplerTestStep )modelItem ).getTestRequest() );
      }

      objects.put( "testCase", ( ( TestStep )modelItem ).getTestCase() );
      objects.put( "testSuite", ( ( TestStep )modelItem ).getTestCase().getTestSuite() );
      objects.put( "project", ( ( TestStep )modelItem ).getTestCase().getTestSuite().getProject() );
    }
    else if( modelItem instanceof TestSuite )
    {
      objects.put( "testSuite", modelItem );
      objects.put( "project", ( ( TestSuite )modelItem ).getProject() );
    }
    if( modelItem instanceof LoadTest )
    {
      objects.put( "loadTest", modelItem );
      objects.put( "testCase", ( ( LoadTest )modelItem ).getTestCase() );
      objects.put( "testSuite", ( ( LoadTest )modelItem ).getTestCase().getTestSuite() );
      objects.put( "project", ( ( LoadTest )modelItem ).getTestCase().getTestSuite().getProject() );
    }
    else if( modelItem instanceof Project )
    {
      objects.put( "project", modelItem );
    }
    else if( modelItem instanceof MockService )
    {
      objects.put( "mockService", modelItem );
      objects.put( "project", ( ( MockService )modelItem ).getProject() );
    }
    else if( modelItem instanceof MockOperation )
    {
      objects.put( "mockOperation", modelItem );
      objects.put( "mockService", ( ( MockOperation )modelItem ).getMockService() );
      objects.put( "project", ( ( MockOperation )modelItem ).getMockService().getProject() );
    }
    else if( modelItem instanceof MockResponse )
    {
      objects.put( "mockResponse", modelItem );
      objects.put( "mockOperation", ( ( MockResponse )modelItem ).getMockOperation() );
      objects.put( "mockService", ( ( MockResponse )modelItem ).getMockOperation().getMockService() );
      objects.put( "project", ( ( MockResponse )modelItem ).getMockOperation().getMockService().getProject() );
    }
    else if( modelItem instanceof Request )
    {
      objects.put( "request", modelItem );

      if( modelItem instanceof TestRequest )
      {
        objects.put( "testStep", ( ( TestRequest )modelItem ).getTestStep() );
        objects.put( "testCase", ( ( TestRequest )modelItem ).getTestStep().getTestCase() );
        objects.put( "testSuite", ( ( TestRequest )modelItem ).getTestStep().getTestCase().getTestSuite() );
        objects.put( "project", ( ( TestRequest )modelItem ).getTestStep().getTestCase().getTestSuite()
            .getProject() );
      }
    }
    else if( modelItem instanceof Operation )
    {
      objects.put( "operation", modelItem );
    }
    else if( modelItem instanceof Interface )
    {
      objects.put( "interface", modelItem );
    }
    else if( modelItem instanceof SecurityTest )
    {
      objects.put( "securityTest", modelItem );
    }

    if( modelItem != null )
    {
      objects.put( "modelItem", modelItem );
    }

    return doEval( name, modelItem, objects );
  }
View Full Code Here

    super( "Run from here", "Runs the TestCase starting at this step" );
  }

  public void perform( WsdlTestStep testStep, Object param )
  {
    StringToObjectMap properties = recoverContextProperties( testStep );
    properties.put( TestCaseRunContext.INTERACTIVE, Boolean.TRUE );

    WsdlTestCaseRunner testCaseRunner = new WsdlTestCaseRunner( testStep.getTestCase(), properties );
    testCaseRunner.setStartStep( testStep.getTestCase().getIndexOfTestStep( testStep ) );
    testCaseRunner.start( true );
  }
View Full Code Here

    testCaseRunner.start( true );
  }

  private StringToObjectMap recoverContextProperties( WsdlTestStep testStep )
  {
    StringToObjectMap properties = null;
    try
    {
      if( testStep.getParent() instanceof WsdlTestCase )
      {
        properties = ( ( WsdlTestCase )testStep.getParent() ).getRunFromHereContext();
      }
      else
      {
        properties = new StringToObjectMap();
      }
    }
    catch( Exception e )
    {
      properties = new StringToObjectMap();
    }
    return properties;
  }
View Full Code Here

          // StringToObjectMap properties = new StringToObjectMap();
          // for( String name : testRunContext.getPropertyNames() )
          // properties.put( name, testRunContext.getProperty( name ));

          result.startTimer();
          StringToObjectMap properties = new StringToObjectMap();

          if( isCopyLoadTestProperties() && properties.containsKey( TestRunContext.LOAD_TEST_CONTEXT ) )
          {
            properties
                .put( TestRunContext.THREAD_INDEX, testRunContext.getProperty( TestRunContext.THREAD_INDEX ) );
            properties.put( TestRunContext.TOTAL_RUN_COUNT,
                testRunContext.getProperty( TestRunContext.TOTAL_RUN_COUNT ) );
            properties.put( TestRunContext.LOAD_TEST_CONTEXT,
                testRunContext.getProperty( TestRunContext.LOAD_TEST_CONTEXT ) );
            properties.put( TestRunContext.LOAD_TEST_RUNNER,
                testRunContext.getProperty( TestRunContext.LOAD_TEST_RUNNER ) );
            properties.put( TestRunContext.RUN_COUNT, testRunContext.getProperty( TestRunContext.RUN_COUNT ) );
          }

          if( isCopyHttpSession() && properties.containsKey( TestRunContext.HTTP_STATE_PROPERTY ) )
          {
            properties.put( TestRunContext.HTTP_STATE_PROPERTY,
                testRunContext.getProperty( TestRunContext.HTTP_STATE_PROPERTY ) );
          }

          properties.put( TestRunContext.INTERACTIVE, testRunContext.getProperty( TestRunContext.INTERACTIVE ) );

          properties.put( "#CallingRunTestCaseStep#", this );
          properties.put( "#CallingTestCaseRunner#", testRunner );
          properties.put( "#CallingTestRunContext#", testRunContext );

          testCaseRunner = runningTestCase.run( properties, true );
          testCaseRunner.waitUntilFinished();
          result.stopTimer();
View Full Code Here

    return runFromHereContext;
  }

  public void setRunFromHereContext( StringToObjectMap runFromHereContext )
  {
    this.runFromHereContext = new StringToObjectMap( runFromHereContext );
  }
View Full Code Here

      return;
    }

    runButton.setEnabled( false );
    cancelButton.setEnabled( true );
    StringToObjectMap properties = new StringToObjectMap();
    // properties.put( "loopButton", loopButton );
    properties.put( TestCaseRunContext.INTERACTIVE, Boolean.TRUE );
    lastRunner = null;

    runner = getModelItem().run( properties, true );
  }
View Full Code Here

      {
        if( System.getProperty( "soapui.enablenamedthreads" ) != null )
          Thread.currentThread().setName(
              testCase.getName() + " " + loadTest.getName() + " ThreadIndex = " + threadIndex );

        runner = new WsdlTestCaseRunner( testCase, new StringToObjectMap() );

        while( !canceled )
        {
          try
          {
View Full Code Here

        project.removeProjectRunListener(testSuiteRunListener);
        project.removeProjectListener(testSuiteListener);
    }

    protected void runProject() {
        projectRunner = project.run(new StringToObjectMap(), true);
    }
View Full Code Here

            cancelButton.setEnabled(false);
            testStepList.setEnabled(true);
            return;
        }

        StringToObjectMap properties = new StringToObjectMap();
        properties.put("loopButton", loopButton);
        properties.put(TestCaseRunContext.INTERACTIVE, Boolean.TRUE);
        lastRunner = null;
        runner = getModelItem().run(properties, true);
    }
View Full Code Here

TOP

Related Classes of com.eviware.soapui.support.types.StringToObjectMap

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.