Examples of WsdlTestCase


Examples of com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase

      testCaseConfig.setLoadTestArray( new LoadTestConfig[0] );

    if( createCopy )
      testCaseConfig.setSecurityTestArray( new SecurityTestConfig[0] );

    WsdlTestCase oldTestCase = testCase;
    testCase = buildTestCase( testCaseConfig, false );

    if( createCopy )
    {
      ModelSupport.unsetIds( testCase );
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase

   * @param offset
   */

  public WsdlTestCase moveTestCase( int ix, int offset )
  {
    WsdlTestCase testCase = testCases.get( ix );

    if( offset == 0 )
      return testCase;

    testCases.remove( ix );
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase

    if( importTestCaseConfig != null )
    {
      TestCaseConfig newConfig = ( TestCaseConfig )getConfig().addNewTestCase().set( importTestCaseConfig )
          .changeType( TestCaseConfig.type );
      WsdlTestCase newTestCase = buildTestCase( newConfig, false );
      ModelSupport.unsetIds( newTestCase );

      /*
       * security test keeps reference to test step by id, which gets changed
       * during importing, so old values needs to be rewritten to new ones.
       *
       * Create tarnsition table ( old id , new id ) and use it to replace
       * all old ids in new imported test case.
       */
      LinkedHashMap<String, String> oldNewIds = new LinkedHashMap<String, String>();
      for( int cnt = 0; cnt < importTestCaseConfig.getTestStepList().size(); cnt++ )
        oldNewIds.put( importTestCaseConfig.getTestStepList().get( cnt ).getId(), newTestCase.getTestStepList()
            .get( cnt ).getId() );

      for( SecurityTest scan : newTestCase.getSecurityTests().values() )
        for( TestStepSecurityTestConfig secStepConfig : scan.getConfig().getTestStepSecurityTestList() )
          if( oldNewIds.containsKey( secStepConfig.getTestStepId() ) )
            secStepConfig.setTestStepId( oldNewIds.get( secStepConfig.getTestStepId() ) );

      newTestCase.afterLoad();

      testCases.add( newTestCase );
      fireTestCaseAdded( newTestCase );

      resolveImportedTestCase( newTestCase );
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase

  public void afterCopy( WsdlTestSuite oldTestSuite )
  {

    for( int i = 0; i < testCases.size(); i++ )
    {
      WsdlTestCase testCase = getTestCaseAt( i );
      WsdlTestCase oldTestCase = oldTestSuite.getTestCaseAt( i );

      testCase.afterCopy( oldTestSuite, null );
      testCase.importSecurityTests( oldTestSuite, oldTestCase );
    }
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase

      modelItem = ( ( SecurityTest )modelItem ).getTestCase();

    if( modelItem instanceof WsdlTestStep || modelItem instanceof WsdlTestCase )
    {
      WsdlTestStep testStep = ( WsdlTestStep )( modelItem instanceof WsdlTestStep ? modelItem : null );
      WsdlTestCase testCase = ( WsdlTestCase )( testStep == null ? modelItem : testStep.getTestCase() );

      int sepIx = pe.indexOf( PropertyExpansion.PROPERTY_SEPARATOR );
      Object property = null;

      if( sepIx > 0 )
      {
        String step = pe.substring( 0, sepIx );
        String name = pe.substring( sepIx + 1 );
        String xpath = null;

        sepIx = name.indexOf( PropertyExpansion.PROPERTY_SEPARATOR );
        WsdlTestStep ts = testCase.getTestStepByName( step );

        if( sepIx != -1 )
        {
          xpath = name.substring( sepIx + 1 );
          name = name.substring( 0, sepIx );
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase

  {
    WsdlProject project = new WsdlProject();
    project.addProperty( "projectId" ).setValue( "123" );
    WsdlTestSuite testSuite = project.addNewTestSuite( "TestSuite" );
    testSuite.addProperty( "testSuiteId" ).setValue( "234" );
    WsdlTestCase testCase = testSuite.addNewTestCase( "TestCase" );
    testCase.addProperty( "testCaseId" ).setValue( "345" );

    WsdlTestStep testStep = testCase.addTestStep( GroovyScriptStepFactory.GROOVY_TYPE, "GroovyScript" );

    MockTestRunner mockTestRunner = new MockTestRunner( testCase, Logger.getLogger( "testing" ) );
    MockTestRunContext context = new MockTestRunContext( mockTestRunner, testStep );

    PropertyExpansionUtils.getGlobalProperties().setPropertyValue( "testSuiteId", "testing" );
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase

  public static MutablePropertyExpansionImpl createMutablePropertyExpansion( String pe, ModelItem modelItem,
      Object target, String propertyName )
  {
    WsdlTestStep testStep = null;
    WsdlTestCase testCase = null;
    WsdlTestSuite testSuite = null;
    WsdlProject project = null;
    WsdlMockService mockService = null;
    WsdlMockResponse mockResponse = null;
    TestPropertyHolder holder = null;
    SecurityTest securityTest = null;

    if( modelItem instanceof WsdlTestStep )
    {
      testStep = ( WsdlTestStep )modelItem;
      testCase = testStep.getTestCase();
      testSuite = testCase.getTestSuite();
      project = testSuite.getProject();
    }
    else if( modelItem instanceof WsdlTestCase )
    {
      testCase = ( WsdlTestCase )modelItem;
      testSuite = testCase.getTestSuite();
      project = testSuite.getProject();
    }
    else if( modelItem instanceof WsdlTestSuite )
    {
      testSuite = ( WsdlTestSuite )modelItem;
      project = testSuite.getProject();
    }
    else if( modelItem instanceof WsdlInterface )
    {
      project = ( ( WsdlInterface )modelItem ).getProject();
    }
    else if( modelItem instanceof WsdlProject )
    {
      project = ( WsdlProject )modelItem;
    }
    else if( modelItem instanceof WsdlMockService )
    {
      mockService = ( WsdlMockService )modelItem;
      project = mockService.getProject();
    }
    else if( modelItem instanceof AbstractHttpRequestInterface<?> )
    {
      project = ( ( AbstractHttpRequest<?> )modelItem ).getOperation().getInterface().getProject();
    }
    else if( modelItem instanceof WsdlMockOperation )
    {
      mockService = ( ( WsdlMockOperation )modelItem ).getMockService();
      project = mockService.getProject();
    }
    else if( modelItem instanceof WsdlMockResponse )
    {
      mockResponse = ( WsdlMockResponse )modelItem;
      mockService = mockResponse.getMockOperation().getMockService();
      project = mockService.getProject();
    }
    else if( modelItem instanceof SecurityTest )
    {
      securityTest = ( SecurityTest )modelItem;
      testCase = securityTest.getTestCase();
      testSuite = testCase.getTestSuite();
      project = testSuite.getProject();
    }

    // explicit item reference?
    if( pe.startsWith( PropertyExpansion.PROJECT_REFERENCE ) )
    {
      holder = project;
      pe = pe.substring( PropertyExpansion.PROJECT_REFERENCE.length() );
    }
    else if( pe.startsWith( PropertyExpansion.TESTSUITE_REFERENCE ) )
    {
      holder = testSuite;
      pe = pe.substring( PropertyExpansion.TESTSUITE_REFERENCE.length() );
    }
    else if( pe.startsWith( PropertyExpansion.TESTCASE_REFERENCE ) )
    {
      holder = testCase;
      pe = pe.substring( PropertyExpansion.TESTCASE_REFERENCE.length() );
    }
    else if( pe.startsWith( PropertyExpansion.SECURITYTEST_REFERENCE ) )
    {
      holder = testCase;
      pe = pe.substring( PropertyExpansion.SECURITYTEST_REFERENCE.length() );
    }
    else if( pe.startsWith( PropertyExpansion.MOCKSERVICE_REFERENCE ) )
    {
      holder = mockService;
      pe = pe.substring( PropertyExpansion.MOCKSERVICE_REFERENCE.length() );
    }
    else if( pe.startsWith( PropertyExpansion.MOCKRESPONSE_REFERENCE ) )
    {
      holder = mockResponse;
      pe = pe.substring( PropertyExpansion.MOCKRESPONSE_REFERENCE.length() );
    }
    else if( testCase != null )
    {
      int sepIx = pe.indexOf( PropertyExpansion.PROPERTY_SEPARATOR );
      if( sepIx > 0 )
      {
        holder = testCase.getTestStepByName( pe.substring( 0, sepIx ) );
        if( holder != null )
        {
          pe = pe.substring( sepIx + 1 );
        }
      }
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase

    return resolved;
  }

  public boolean resolve()
  {
    WsdlTestCase tCase = testStep.getTestCase().getTestSuite().addNewTestCase( "New Test Case" );
    testStep.setTargetTestCase( tCase );
    resolved = true;
    return resolved;
  }
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase

        UISupport.showErrorMessage( "You must specify the web address to start at" );
        dialog.show();
      }
      String testStepName = dialog.getValue( Form.URL );
      String url = HttpUtils.ensureEndpointStartsWithProtocol( testStepName );
      WsdlTestCase targetTestCase = null;

      targetTestCase = testSuite.getTestCaseByName( targetTestCaseName );
      if( targetTestCase == null )
      {
        while( testSuite.getTestCaseByName( targetTestCaseName ) != null )
        {
          targetTestCaseName = UISupport.prompt(
              "TestCase name must be unique, please specify new name for TestCase\n" + "[" + targetTestCaseName
                  + "] in TestSuite [" + testSuite.getName() + "->" + testSuite.getName() + "]",
              "Change TestCase name", targetTestCaseName );
          if( targetTestCaseName == null )
            return;
        }
        targetTestCase = testSuite.addNewTestCase( targetTestCaseName );

      }
      while( testStepName == null || targetTestCase.getTestStepByName( testStepName ) != null )
      {
        testStepName = UISupport.prompt( "TestStep name must be unique, please specify new name for step\n" + "["
            + testStepName + "] in TestCase [" + testSuite.getName() + "->" + testSuite.getName() + "->"
            + targetTestCaseName + "]", "Change TestStep name", testStepName );
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase

  {
    Set<Interface> requiredInterfaces = new HashSet<Interface>();

    for( int i = 0; i < testSuite.getTestCaseCount(); i++ )
    {
      WsdlTestCase testCase = testSuite.getTestCaseAt( i );

      for( int y = 0; y < testCase.getTestStepCount(); y++ )
      {
        WsdlTestStep testStep = testCase.getTestStepAt( y );
        requiredInterfaces.addAll( testStep.getRequiredInterfaces() );
      }
    }

    if( requiredInterfaces.size() > 0 && targetProject.getInterfaceCount() > 0 )
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.