Package com.eviware.soapui.impl.wsdl

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


    return scriptEngineId;
  }

  public static SoapUIScriptGenerator createScriptGenerator( ModelItem modelItem )
  {
    WsdlProject project = ( WsdlProject )ModelSupport.getModelItemProject( modelItem );

    String scriptEngineId = project.getDefaultScriptLanguage();
    if( StringUtils.isNullOrEmpty( scriptEngineId ) )
      scriptEngineId = DEFAULT_SCRIPT_ENGINE_ID;

    return factories.get( scriptEngineId ).createCodeGenerator( modelItem );
  }
View Full Code Here


      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;
View Full Code Here

public class WsdlRequestStepTestCase extends TestCase
{
  public void testAssert() throws Exception
  {
    WsdlProject project = new WsdlProject( "src" + File.separatorChar + "test-resources" + File.separatorChar
        + "sample-soapui-project.xml" );
    TestSuite testSuite = project.getTestSuiteByName( "Test Suite" );
    com.eviware.soapui.model.testsuite.TestCase testCase = testSuite.getTestCaseByName( "Test Conversions" );

    WsdlTestRequestStep testStep = ( WsdlTestRequestStep )testCase.getTestStepByName( "SEK to USD Test" );

    MockTestRunner testRunner = new MockTestRunner( ( WsdlTestCase )testStep.getTestCase() );
View Full Code Here

public class WsdlImporterTestCase extends TestCaseWithJetty
{
  public void testOneWayOperationImport() throws Exception
  {
    WsdlProject project = new WsdlProject();
    WsdlInterface[] wsdls = WsdlImporter.importWsdl( project, "http://localhost:8082/testonewayop/TestService.wsdl" );

    assertEquals( 1, wsdls.length );

    WsdlInterface iface = wsdls[0];
View Full Code Here

    if( dialog.show() )
    {
      String targetProjectName = dialog.getValue( Form.PROJECT );
      String name = dialog.getValue( Form.NAME );

      WsdlProject project = ( WsdlProject )testSuite.getProject();

      // within same project?
      boolean move = dialog.getBooleanValue( Form.MOVE );
      boolean cloneDescription = dialog.getBooleanValue( Form.CLONE_DESCRIPTION );
      String description = testSuite.getDescription();
View Full Code Here

  public static WsdlTestSuite cloneToAnotherProject( WsdlTestSuite testSuite, String targetProjectName, String name,
      boolean move, String description )
  {
    WorkspaceImpl workspace = testSuite.getProject().getWorkspace();
    WsdlProject targetProject = ( WsdlProject )workspace.getProjectByName( targetProjectName );
    if( targetProject == null )
    {
      targetProjectName = UISupport.prompt( "Enter name for new Project", "Clone TestSuite", "" );
      if( targetProjectName == null )
        return null;

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

      if( targetProject == null )
        return null;
    }

    Set<Interface> requiredInterfaces = getRequiredInterfaces( testSuite, targetProject );

    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 be cloned to the targetProject as well?";

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

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

    testSuite = targetProject.importTestSuite( testSuite, name, -1, !move, description );
    UISupport.select( testSuite );

    return testSuite;
  }
View Full Code Here

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

  public void perform( WsdlTestSuite testSuite, Object param )
  {
    WsdlProject project = testSuite.getProject();
    int ix = project.getIndexOfTestSuite( testSuite );
    if( ix == -1 || ix == 0 )
      return;

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

    super( "Create TestRequest", "Creates a TestRequest for this MockResponse in a TestCase" );
  }

  public void perform( WsdlMockResponse mockResponse, Object param )
  {
    WsdlProject project = ( WsdlProject )ModelSupport.getModelItemProject( mockResponse );

    WsdlTestCase testCase = getTargetTestCase( project );
    if( testCase != null )
      addRequest( testCase, mockResponse, -1 );
  }
View Full Code Here

      String targetProjectName = dialog.getValue( Form.PROJECT );
      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 )
      {
View Full Code Here

  public void perform( WsdlOperation operation, Object param )
  {
    String title = getName();

    WsdlMockService mockService = null;
    WsdlProject project = operation.getInterface().getProject();

    while( mockService == null )
    {
      if( project.getMockServiceCount() > 0 )
      {
        String[] mockServices = ModelSupport.getNames( project.getMockServiceList(),
            new String[] { CREATE_MOCKSUITE_OPTION } );

        // prompt
        String option = UISupport.prompt( "Select MockService for MockOperation", title, mockServices );
        if( option == null )
          return;

        mockService = project.getMockServiceByName( option );
      }

      // create new mocksuite?
      if( mockService == null )
      {
        String mockServiceName = UISupport.prompt( "Enter name of new MockService", title, "MockService "
            + ( project.getMockServiceCount() + 1 ) );
        if( mockServiceName == null || mockServiceName.trim().length() == 0 )
          return;

        mockService = project.addNewMockService( mockServiceName );
      }

      if( mockService.hasMockOperation( operation ) )
      {
        UISupport.showErrorMessage( "MockService [" + mockService.getName() + "] already has a MockOperation for ["
View Full Code Here

TOP

Related Classes of com.eviware.soapui.impl.wsdl.WsdlProject

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.