Examples of WsdlTestSuite


Examples of com.eviware.soapui.impl.wsdl.WsdlTestSuite

    super( "Move TestCase Down", "Moves this TestCase down" );
  }

  public void perform( WsdlTestCase testCase, Object param )
  {
    WsdlTestSuite testSuite = testCase.getTestSuite();
    int ix = testSuite.getIndexOfTestCase( testCase );
    if( ix == -1 || ix >= testSuite.getTestCaseCount() - 1 )
      return;

    testSuite.moveTestCase( ix, 1 );
    UISupport.select( testCase );
  }
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.WsdlTestSuite

      String targetTestSuiteName = dialog.getValue( Form.TESTSUITE );
      String targetTestCaseName = dialog.getValue( Form.TESTCASE );
      String name = dialog.getValue( Form.NAME );

      WsdlProject project = testStep.getTestCase().getTestSuite().getProject();
      WsdlTestSuite targetTestSuite = null;
      WsdlTestCase targetTestCase = null;
      Set<Interface> requiredInterfaces = new HashSet<Interface>();

      // to another project project?
      if( !targetProjectName.equals( project.getName() ) )
      {
        // get required interfaces
        requiredInterfaces.addAll( testStep.getRequiredInterfaces() );

        project = ( WsdlProject )workspace.getProjectByName( targetProjectName );
        if( project == null )
        {
          targetProjectName = UISupport.prompt( "Enter name for new Project", "Clone TestStep", "" );
          if( targetProjectName == null )
            return;

          try
          {
            project = workspace.createProject( targetProjectName, null );
          }
          catch( SoapUIException e )
          {
            UISupport.showErrorMessage( e );
          }

          if( project == null )
            return;
        }

        if( requiredInterfaces.size() > 0 && project.getInterfaceCount() > 0 )
        {
          Map<String, Interface> bindings = new HashMap<String, Interface>();
          for( Interface iface : requiredInterfaces )
          {
            bindings.put( iface.getTechnicalId(), iface );
          }

          for( Interface iface : project.getInterfaceList() )
          {
            bindings.remove( iface.getTechnicalId() );
          }

          requiredInterfaces.retainAll( bindings.values() );
        }

        if( requiredInterfaces.size() > 0 )
        {
          String msg = "Target project [" + targetProjectName + "] is missing required Interfaces;\r\n\r\n";
          for( Interface iface : requiredInterfaces )
          {
            msg += iface.getName() + " [" + iface.getTechnicalId() + "]\r\n";
          }
          msg += "\r\nThese will be cloned to the targetProject as well";

          if( !UISupport.confirm( msg, "Clone TestStep" ) )
            return;

          for( Interface iface : requiredInterfaces )
          {
            project.importInterface( ( AbstractInterface<?> )iface, true, true );
          }
        }
      }

      targetTestSuite = project.getTestSuiteByName( targetTestSuiteName );
      if( targetTestSuite == null )
      {
        targetTestSuiteName = UISupport.prompt( "Specify name for new TestSuite", "Clone TestStep", "Copy of "
            + testStep.getTestCase().getTestSuite().getName() );
        if( targetTestSuiteName == null )
          return;

        targetTestSuite = project.addNewTestSuite( targetTestSuiteName );
      }

      targetTestCase = targetTestSuite.getTestCaseByName( targetTestCaseName );
      if( targetTestCase == null )
      {
        targetTestCaseName = UISupport.prompt( "Specify name for new TestCase", "Clone TestStep", "Copy of "
            + testStep.getTestCase().getName() );
        if( targetTestCaseName == null )
          return;

        targetTestCase = targetTestSuite.addNewTestCase( targetTestCaseName );
      }

      boolean move = dialog.getBooleanValue( Form.MOVE );

      WsdlTestStep newTestStep = targetTestCase.importTestStep( testStep, name, -1, !move );
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.WsdlTestSuite

      String targetProjectName = dialog.getValue( Form.PROJECT );
      String targetTestSuiteName = dialog.getValue( Form.TESTSUITE );
      String name = dialog.getValue( Form.NAME );

      WsdlProject project = testCase.getTestSuite().getProject();
      WsdlTestSuite targetTestSuite = null;
      Set<Interface> requiredInterfaces = new HashSet<Interface>();

      // to another project project?
      if( !targetProjectName.equals( project.getName() ) )
      {
        // get required interfaces
        for( int y = 0; y < testCase.getTestStepCount(); y++ )
        {
          WsdlTestStep testStep = testCase.getTestStepAt( y );
          requiredInterfaces.addAll( testStep.getRequiredInterfaces() );
        }

        project = ( WsdlProject )workspace.getProjectByName( targetProjectName );
        if( project == null )
        {
          targetProjectName = UISupport.prompt( "Enter name for new Project", "Clone TestCase", "" );
          if( targetProjectName == null )
            return;

          try
          {
            project = workspace.createProject( targetProjectName, null );
          }
          catch( SoapUIException e )
          {
            UISupport.showErrorMessage( e );
          }

          if( project == null )
            return;
        }

        if( requiredInterfaces.size() > 0 && project.getInterfaceCount() > 0 )
        {
          Map<String, Interface> bindings = new HashMap<String, Interface>();
          for( Interface iface : requiredInterfaces )
          {
            bindings.put( iface.getTechnicalId(), iface );
          }

          for( Interface iface : project.getInterfaceList() )
          {
            bindings.remove( iface.getTechnicalId() );
          }

          requiredInterfaces.retainAll( bindings.values() );
        }

        if( requiredInterfaces.size() > 0 )
        {
          String msg = "Target project [" + targetProjectName + "] is missing required Interfaces;\r\n\r\n";
          for( Interface iface : requiredInterfaces )
          {
            msg += iface.getName() + " [" + iface.getTechnicalId() + "]\r\n";
          }
          msg += "\r\nShould these will be cloned to the targetProject as well?";

          Boolean result = UISupport.confirmOrCancel( msg, "Clone TestCase" );
          if( result == null )
            return;

          if( result )
          {
            for( Interface iface : requiredInterfaces )
            {
              project.importInterface( ( AbstractInterface<?> )iface, true, true );
            }
          }
        }
      }

      targetTestSuite = project.getTestSuiteByName( targetTestSuiteName );
      if( targetTestSuite == null )
      {
        targetTestSuiteName = UISupport.prompt( "Specify name for new TestSuite", "Clone TestCase", "Copy of "
            + testCase.getTestSuite().getName() );
        if( targetTestSuiteName == null )
          return;

        targetTestSuite = project.addNewTestSuite( targetTestSuiteName );
      }

      boolean move = dialog.getBooleanValue( Form.MOVE );
      WsdlTestCase newTestCase = targetTestSuite.importTestCase( testCase, name, -1,
          dialog.getBooleanValue( Form.CLONE_LOADTESTS ), dialog.getBooleanValue( Form.CLONE_SECURITYTESTS ),
          !move );
      UISupport.select( newTestCase );

      if( move )
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.WsdlTestSuite

    super( "Move TestCase Up", "Moves this TestCase up" );
  }

  public void perform( WsdlTestCase testCase, Object param )
  {
    WsdlTestSuite testSuite = testCase.getTestSuite();
    int ix = testSuite.getIndexOfTestCase( testCase );
    if( ix == -1 || ix == 0 )
      return;

    testSuite.moveTestCase( ix, -1 );
    UISupport.select( testCase );
  }
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.WsdlTestSuite

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

      targetTestSuite = project.getTestSuiteByName( targetTestSuiteName );
      if( targetTestSuite == null )
      {
        targetTestSuiteName = "Web TestSuite";
        while( project.getTestSuiteByName( targetTestSuiteName ) != null )
        {
          targetTestSuiteName = UISupport.prompt(
              "TestSuite name must be unique, please specify new name for TestSuite\n" + "[" + project.getName()
                  + "->" + targetTestSuiteName + "]", "Change TestSuite name", targetTestSuiteName );

          if( targetTestSuiteName == null )
            return;
        }

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

      }
      while( testStepName == null || targetTestCase.getTestStepByName( testStepName ) != null )
      {
        testStepName = UISupport.prompt( "TestStep name must be unique, please specify new name for step\n" + "["
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.WsdlTestSuite

    while( project.getTestSuiteByName( name.trim() ) != null )
    {
      name = UISupport.prompt( "Specify unique name of TestSuite", "Rename TestSuite", name );
    }

    WsdlTestSuite testSuite = project.addNewTestSuite( name );
    UISupport.showDesktopPanel( testSuite );
    return testSuite;
  }
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.WsdlTestSuite

        testSuiteName = UISupport.prompt( "Enter name of TestSuite to create", "Generate TestSuite",
            service.getName() + " TestSuite" );

      if( testSuiteName != null && testSuiteName.trim().length() > 0 )
      {
        WsdlTestSuite testSuite = project.getTestSuiteByName( testSuiteName );

        if( testSuite == null )
        {
          testSuite = project.addNewTestSuite( testSuiteName );
          testSuite.setDescription( "TestSuite generated for REST Service [" + service.getName() + "]" );
        }

        int style = dialog.getValueIndex( GenerateForm.STYLE );
        boolean generateLoadTest = dialog.getBooleanValue( GenerateForm.GENERATE_LOADTEST );
        if( style == 0 )
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.WsdlTestSuite

      return addNewTestSuiteAndTestCase( project );
    }

    for( int c = 0; c < project.getTestSuiteCount(); c++ )
    {
      WsdlTestSuite testSuite = ( WsdlTestSuite )project.getTestSuiteAt( c );
      for( int i = 0; i < testSuite.getTestCaseCount(); i++ )
      {
        testCase = ( WsdlTestCase )testSuite.getTestCaseAt( i );

        testCases.add( testCase );
        testCaseNames.add( ( testCaseNames.size() + 1 ) + ": " + testSuite.getName() + " - " + testCase.getName() );
        testSuites.add( testSuite );
      }

      testCases.add( null );
      testSuites.add( testSuite );
      testCaseNames.add( ( testCaseNames.size() + 1 ) + ": " + testSuite.getName() + " -> Create new TestCase" );
    }

    if( testCases.size() == 0 )
    {
      List<String> testSuiteNames = new ArrayList<String>();

      for( int c = 0; c < project.getTestSuiteCount(); c++ )
      {
        TestSuite testSuite = project.getTestSuiteAt( c );
        testSuiteNames.add( ( testSuiteNames.size() + 1 ) + ": " + testSuite.getName() );
      }

      String selection = ( String )UISupport.prompt( "Select TestSuite to create TestCase in", "Select TestSuite",
          testSuiteNames.toArray() );
      if( selection == null )
        return null;

      WsdlTestSuite testSuite = ( WsdlTestSuite )project.getTestSuiteAt( testSuiteNames.indexOf( selection ) );

      String name = UISupport.prompt( "Enter name for TestCase create", "Create TestCase",
          "TestCase " + ( testSuite.getTestCaseCount() + 1 ) );
      if( name == null )
        return null;

      return testSuite.addNewTestCase( name );
    }
    else
    {
      testCases.add( null );
      testSuites.add( null );
      testCaseNames.add( ( testCaseNames.size() + 1 ) + ": -> Create new TestSuite" );

      String selection = ( String )UISupport.prompt( "Select TestCase", "Select TestCase", testCaseNames.toArray() );
      if( selection == null )
        return null;

      testCase = testCases.get( testCaseNames.indexOf( selection ) );
      while( testCase != null
          && ( SoapUI.getTestMonitor().hasRunningLoadTest( testCase ) || SoapUI.getTestMonitor()
              .hasRunningSecurityTest( testCase ) ) )
      {
        UISupport.showErrorMessage( "Can not add to TestCase that is currently LoadTesting or SecurityTesting" );

        selection = ( String )UISupport.prompt( "Select TestCase", "Select TestCase", testCaseNames.toArray() );
        if( selection == null )
          return null;

        testCase = testCases.get( testCaseNames.indexOf( selection ) );
      }

      // selected create new?
      if( testCase == null )
      {
        WsdlTestSuite testSuite = testSuites.get( testCaseNames.indexOf( selection ) );

        // selected create new testsuite?
        if( testSuite == null )
        {
          return addNewTestSuiteAndTestCase( project );
        }
        else
        {
          String name = UISupport.prompt( "Enter name for TestCase create", "Create TestCase", "TestCase "
              + ( testSuite.getTestCaseCount() + 1 ) );
          if( name == null )
            return null;

          return testSuite.addNewTestCase( name );
        }
      }
    }

    return testCase;
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.WsdlTestSuite

    String testCaseName = UISupport.prompt( "Enter name for TestCase create", "Create TestCase", "TestCase 1" );
    if( testCaseName == null )
      return null;

    WsdlTestSuite testSuite = ( WsdlTestSuite )project.addNewTestSuite( testSuiteName );
    return testSuite.addNewTestCase( testCaseName );
  }
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.WsdlTestSuite

    @Before
    public void setUp() throws Exception {
        WsdlProject project = new WsdlProject(TestOnDemandCallerTest.class.getResource(
                "/soapui-projects/sample-soapui-project.xml").getPath());
        WsdlTestSuite testSuite = project.getTestSuiteByName("Test Suite");
        testCase = testSuite.getTestCaseByName("Test Conversions");
        caller = new TestOnDemandCaller();
    }
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.